This commit is contained in:
Troplo 2022-07-29 21:26:18 +10:00
parent b95676624a
commit e22c40ddd5
24 changed files with 102 additions and 104 deletions

View file

@ -8,10 +8,11 @@ Colubrina is a simple chatting platform written in Vue, and Vuetify for the fron
- [x] Messaging
- [x] Authentication
- [x] Admin panel
- [x] CLI (cli)
- [x] CLI
- [ ] Message history
- [x] User profile cards
- [x] Group creation and modification
- [x] Direct message groups
- [x] Friending
- [x] Searching
@ -46,11 +47,10 @@ Failed to check for updates, ensure you are connected to the internet, and servi
Build frontend for production
Exit
```
Select setup, and go through the steps. After completing the initial setup, you may run `yarn build` in the frontend folder, or select "Build frontend for production" in the CLI.<br>
The CLI will populate the database with some default data which are essential for operation.<br>
Select setup, and go through the steps.<br>After completing the initial setup, you may run `yarn build` in the frontend folder, or select "Build frontend for production" in the CLI.<br>
The backend service can now be started with `node .` in the `backend` folder which will run on port `23998`.
A systemd service example config file can be found at `colubrina.service`
A systemd service example config file can be found at `colubrina.service`, and an `nginx.conf` example.
## Frontend setup
Rename .env.example to .env and fill it out with your own information.

View file

@ -762,7 +762,10 @@ router.get("/users", auth, async (req, res, next) => {
"updatedAt",
"status",
"admin"
]
],
where: {
banned: false
}
})
res.json(users)
} catch (err) {

View file

@ -27,12 +27,7 @@ module.exports = {
sheet: "#181818",
text: "#000000",
dark: "#151515",
bg: "#151515",
calendarNormalActivity: "#3f51b5",
calendarActivityType7: "#f44336",
calendarActivityType8: "#4caf50",
calendarActivityType10: "#ff9800",
calendarExternalActivity: "#2196f3"
bg: "#151515"
},
light: {
primary: "#0190ea",
@ -47,12 +42,7 @@ module.exports = {
sheet: "#f8f8f8",
text: "#000000",
dark: "#f8f8f8",
bg: "#f8f8f8",
calendarNormalActivity: "#3f51b5",
calendarActivityType7: "#f44336",
calendarActivityType8: "#4caf50",
calendarActivityType10: "#ff9800",
calendarExternalActivity: "#2196f3"
bg: "#f8f8f8"
}
},
createdAt: "2022-03-26 23:23:29",
@ -83,12 +73,7 @@ module.exports = {
sheet: "#262626",
text: "#000000",
dark: "#262626",
bg: "#191919",
calendarNormalActivity: "#3f51b5",
calendarActivityType7: "#f44336",
calendarActivityType8: "#4caf50",
calendarActivityType10: "#ff9800",
calendarExternalActivity: "#2196f3"
bg: "#191919"
},
light: {
primary: "#0190ea",
@ -103,12 +88,7 @@ module.exports = {
sheet: "#dedede",
text: "#000000",
dark: "#dedede",
bg: "#e7e7e7",
calendarNormalActivity: "#3f51b5",
calendarActivityType7: "#f44336",
calendarActivityType8: "#4caf50",
calendarActivityType10: "#ff9800",
calendarExternalActivity: "#2196f3"
bg: "#e7e7e7"
}
},
createdAt: "2022-03-26 23:25:12",
@ -136,12 +116,7 @@ module.exports = {
sheet: "#000000",
text: "#000000",
dark: "#000000",
bg: "#000000",
calendarNormalActivity: "#3f51b5",
calendarActivityType7: "#f44336",
calendarActivityType8: "#4caf50",
calendarActivityType10: "#ff9800",
calendarExternalActivity: "#2196f3"
bg: "#000000"
},
light: {
primary: "#0190ea",
@ -155,12 +130,7 @@ module.exports = {
toolbar: "#f8f8f8",
sheet: "#f8f8f8",
text: "#000000",
dark: "#f8f8f8",
calendarNormalActivity: "#3f51b5",
calendarActivityType7: "#f44336",
calendarActivityType8: "#4caf50",
calendarActivityType10: "#ff9800",
calendarExternalActivity: "#2196f3"
dark: "#f8f8f8"
}
},
createdAt: "2022-03-26 23:25:12",
@ -188,12 +158,7 @@ module.exports = {
sheet: "#181818",
text: "#000000",
dark: "#151515",
bg: "#151515",
calendarNormalActivity: "#565656",
calendarActivityType7: "#767676",
calendarActivityType8: "#868686",
calendarActivityType10: "#A6A6A6",
calendarExternalActivity: "#7D7D7D"
bg: "#151515"
},
light: {
primary: "#6E6E6E",
@ -208,12 +173,7 @@ module.exports = {
sheet: "#f8f8f8",
text: "#000000",
dark: "#f8f8f8",
bg: "#f8f8f8",
calendarNormalActivity: "#565656",
calendarActivityType7: "#767676",
calendarActivityType8: "#868686",
calendarActivityType10: "#A6A6A6",
calendarExternalActivity: "#7D7D7D"
bg: "#f8f8f8"
}
},
createdAt: "2022-03-26 23:25:12",
@ -241,12 +201,7 @@ module.exports = {
sheet: "#181818",
text: "#000000",
dark: "#151515",
bg: "#151515",
calendarNormalActivity: "#0057E9",
calendarActivityType7: "#E11845",
calendarActivityType8: "#87E911",
calendarActivityType10: "#F2CA19",
calendarExternalActivity: "#0057E9"
bg: "#151515"
},
light: {
primary: "#0057E9",
@ -261,12 +216,7 @@ module.exports = {
sheet: "#f8f8f8",
text: "#000000",
dark: "#f8f8f8",
bg: "#f8f8f8",
calendarNormalActivity: "#0057E9",
calendarActivityType7: "#E11845",
calendarActivityType8: "#87E911",
calendarActivityType10: "#F2CA19",
calendarExternalActivity: "#0057E9"
bg: "#f8f8f8"
}
},
createdAt: "2022-03-26 23:25:12",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1210" viewBox="0 0 1024 1210" version="1.1">
<path d="M 493.235 14.497 C 464.342 19.735, 439.862 34.705, 422.618 57.682 C 411.030 73.122, 404.162 90.199, 401.231 110.864 C 396.915 141.290, 406.950 173.469, 428.437 198.107 C 431.458 201.570, 433.832 204.501, 433.714 204.620 C 433.595 204.738, 425.399 206.460, 415.499 208.446 C 330.893 225.421, 258.467 260.158, 190.594 316.316 C 176.124 328.289, 142.713 361.542, 131.129 375.500 C 64.543 455.737, 26.508 545.245, 15.335 648 C 12.807 671.250, 12.807 724.750, 15.335 748 C 26.435 850.077, 64.513 940.174, 129.869 1019 C 142.140 1033.800, 176.200 1067.860, 191 1080.131 C 269.809 1145.473, 359.945 1183.568, 462 1194.665 C 485.250 1197.193, 538.750 1197.193, 562 1194.665 C 664.055 1183.568, 754.191 1145.473, 833 1080.131 C 847.800 1067.860, 881.860 1033.800, 894.131 1019 C 959.473 940.191, 997.568 850.055, 1008.665 748 C 1011.193 724.750, 1011.193 671.250, 1008.665 648 C 997.491 545.243, 959.525 455.889, 892.879 375.500 C 882.190 362.607, 847.393 327.810, 834.500 317.121 C 753.918 250.315, 665.493 212.767, 562 201.409 C 542.565 199.276, 501.701 198.504, 482.624 199.910 C 473.891 200.554, 466.563 200.896, 466.337 200.671 C 466.112 200.445, 472.131 199.295, 479.714 198.114 C 510.935 193.253, 518.993 192.686, 560.353 192.441 L 600.206 192.204 603.483 187.595 C 611.983 175.640, 619.858 155.514, 622.070 140.097 C 623.832 127.812, 622.765 108.836, 619.631 96.723 C 616.606 85.032, 610.051 70.794, 602.992 60.583 C 597.035 51.966, 583.177 38.231, 574.498 32.342 C 551.275 16.584, 519.825 9.678, 493.235 14.497 M 501.402 77.486 C 493.091 79.294, 485.691 83.233, 479.361 89.220 C 468.759 99.247, 464 110.148, 464 124.408 C 464 137.798, 467.832 147.630, 476.778 157.194 C 504.011 186.308, 552.645 171.168, 559.213 131.532 C 562.543 111.440, 551.389 90.310, 532.792 81.478 C 521.620 76.173, 512.669 75.034, 501.402 77.486 M 489.500 338.587 C 487.300 338.804, 480.550 339.453, 474.500 340.030 C 443.256 343.005, 408.828 351.492, 377 364.063 C 372.325 365.910, 360.625 371.362, 351 376.180 C 280.471 411.480, 225.500 466.451, 190.177 537 C 170.291 576.716, 159.668 612.641, 153.806 660 C 151.808 676.136, 152.130 723.084, 154.358 740.500 C 167.815 845.717, 223.199 936.928, 309.039 995.240 C 358.126 1028.586, 409.976 1048.112, 469.500 1055.667 C 489.165 1058.163, 534.835 1058.163, 554.500 1055.667 C 614.024 1048.112, 665.874 1028.586, 714.961 995.240 C 765.874 960.655, 805.893 914.784, 833.823 859 C 853.756 819.189, 864.433 783.084, 870.198 736 C 871.900 722.102, 871.894 673.828, 870.189 660 C 864.364 612.753, 853.711 576.720, 833.823 537 C 798.500 466.451, 743.529 411.480, 673 376.180 C 634.151 356.735, 598.148 345.906, 554 340.388 C 543.023 339.016, 497.913 337.756, 489.500 338.587 M 473 601 L 473 658 415.500 658 L 358 658 358 697 L 358 736 415.500 736 L 473 736 473 793 L 473 850 511.500 850 L 550 850 550 793 L 550 736 608 736 L 666 736 666 697 L 666 658 608 658 L 550 658 550 601 L 550 544 511.500 544 L 473 544 473 601" stroke="none" fill="black" fill-rule="evenodd"/>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00251 14.9297L0 1.07422H6.14651L8.00251 4.27503L9.84583 1.07422H16L8.00251 14.9297Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 215 B

View file

@ -8,7 +8,7 @@
<v-text-field
v-model="nickname.nickname"
label="Nickname"
required
autofocus
@keyup.enter="setFriendNickname"
></v-text-field>
<small>Friend nicknames only show to you.</small>

View file

@ -156,6 +156,7 @@ export default {
}
},
mounted() {
if(this.user?.item?.id) {
this.mutualGroups = []
this.mutualFriends = []
this.loading = {
@ -191,6 +192,7 @@ export default {
AjaxErrorHandler(this.$store)(e)
})
}
}
}
</script>

View file

@ -74,7 +74,8 @@ Vue.use(VueNativeNotification, {
Vue.use({
install(Vue) {
Vue.prototype.$socket = SocketIO(process.env.VUE_APP_SOCKET_URL, {
Vue.prototype.$socket = SocketIO("", {
transports: ["websocket", "polling"],
headers: {
Authorization: localStorage.getItem("session")
}

View file

@ -37,7 +37,7 @@
:user="context.userPopout"
:key="context.userPopout.item?.id || 0"
></UserDialog>
<NicknameDialog :nickname="context.nickname" />
<NicknameDialog :nickname="nickname" />
<v-dialog
v-model="preview.dialog"
elevation="0"

42
nginx.conf Normal file
View file

@ -0,0 +1,42 @@
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/nginx/ssl/colubrina.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/colubrina.mydomain.com/privkey.pem;
server_name colubrina.mydomain.com;
root /home/colubrina/colubrina/frontend/dist;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_set_header Host $http_host;
location ~ \.(css|js|fonts)$ {
expires 16d;
access_log off;
add_header Cache-Control "public";
}
location /api {
proxy_pass http://localhost:23998;
}
location /socket.io {
proxy_pass http://localhost:23998;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location /usercontent {
proxy_pass http://localhost:23998;
}
location / {
try_files $uri $uri/ /index.html;
}
client_max_body_size 200M;
error_log /var/log/nginx/colubrina.error.log warn;
}
server {
listen 80;
listen [::]:80;
server_name colubrina.mydomain.com;
return 301 https://$host$request_uri;
}