Compare commits

...

17 Commits

Author SHA1 Message Date
Kayne Ruse 0f2b8d3f52 Updated dependencies, bumped patch version 2023-06-26 23:06:15 +10:00
Kayne Ruse 88c2239fdb Updated dependencies 2023-05-29 07:56:13 +10:00
Kayne Ruse b5f9d0a7fc Updated dependencies 2023-05-03 21:32:31 +10:00
Kayne Ruse 1ec29e4519 Updated depencencies, bumped version 2023-03-25 01:50:32 +11:00
Kayne Ruse a15c43b3d0 Updated dependencies 2023-03-19 02:53:17 +11:00
Kayne Ruse 9bc96bdb5f Updated dependencies 2023-02-21 09:30:15 +11:00
Kayne Ruse 4bdcee11ea Updated dependencies, License 2023-01-12 08:08:34 +11:00
Kayne Ruse e1cd1ec001 Bumped version number 2023-01-04 12:57:13 +00:00
Kayne Ruse e8a9a79687 Switched to a slim docker distro 2023-01-04 23:51:49 +11:00
Kayne Ruse 7d628be826 Updated libraries 2022-12-31 19:03:50 +00:00
Kayne Ruse 7a42ab3108 Updated dependencies 2022-11-29 05:06:21 +00:00
Kayne Ruse ec573e1074 Updated dependencies 2022-11-13 02:17:33 +00:00
Kayne Ruse 9c5033daea Updated dependencies 2022-08-01 10:40:43 +01:00
Kayne Ruse fb4d857224 Tweaked cors handing 2022-07-26 13:40:18 +01:00
Kayne Ruse e0d6260d1a Updated dependencies 2022-07-23 11:49:18 +01:00
Kayne Ruse 53ea726c89 Bumped patch version 2022-06-10 17:26:27 +01:00
Kayne Ruse c44ed79e6d Updated dependencies 2022-06-10 17:09:31 +01:00
7 changed files with 236 additions and 2983 deletions
+2
View File
@@ -1,5 +1,7 @@
WEB_PORT=3300 WEB_PORT=3300
WEB_ORIGIN=http://localhost:3001
DB_HOSTNAME=database DB_HOSTNAME=database
DB_DATABASE=chat DB_DATABASE=chat
DB_USERNAME=chat DB_USERNAME=chat
+1 -1
View File
@@ -1,5 +1,5 @@
FROM node:16 FROM node:18-bullseye-slim
WORKDIR "/app" WORKDIR "/app"
COPY package*.json ./ COPY package*.json ./
RUN npm install --production RUN npm install --production
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2021 Kayne Ruse, KR Game Studios Copyright (c) 2021-2023 Kayne Ruse, KR Game Studios
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+3 -1
View File
@@ -30,6 +30,7 @@ const question = (prompt, def = null) => {
//project configuration //project configuration
const appName = await question('App Name', 'chat'); const appName = await question('App Name', 'chat');
const appWebAddress = await question('Web Addr', `${appName}.example.com`); const appWebAddress = await question('Web Addr', `${appName}.example.com`);
const appWebOrigin = await question('Web Origin', `https://example.com`); //TODO: clean these up properly
const appPort = await question('App Port', '3300'); const appPort = await question('App Port', '3300');
const appDBUser = await question('DB User', appName); const appDBUser = await question('DB User', appName);
@@ -59,6 +60,7 @@ services:
- "traefik.http.services.${appName}service.loadbalancer.server.port=${appPort}" - "traefik.http.services.${appName}service.loadbalancer.server.port=${appPort}"
environment: environment:
- WEB_PORT=${appPort} - WEB_PORT=${appPort}
- WEB_ORIGIN=${appWebOrigin}
- DB_HOSTNAME=database - DB_HOSTNAME=database
- DB_DATABASE=${appName} - DB_DATABASE=${appName}
- DB_USERNAME=${appDBUser} - DB_USERNAME=${appDBUser}
@@ -108,7 +110,7 @@ networks:
`; `;
const dockerfile = ` const dockerfile = `
FROM node:16 FROM node:18-bullseye-slim
WORKDIR "/app" WORKDIR "/app"
COPY package*.json ./ COPY package*.json ./
RUN npm install --production RUN npm install --production
+211 -2970
View File
File diff suppressed because it is too large Load Diff
+11 -8
View File
@@ -1,6 +1,6 @@
{ {
"name": "chat-server", "name": "chat-server",
"version": "1.2.6", "version": "1.4.5",
"description": "An API centric chat server. Uses Sequelize and mariaDB by default.", "description": "An API centric chat server. Uses Sequelize and mariaDB by default.",
"main": "server/server.js", "main": "server/server.js",
"scripts": { "scripts": {
@@ -20,14 +20,17 @@
"homepage": "https://github.com/krgamestudios/chat-server#readme", "homepage": "https://github.com/krgamestudios/chat-server#readme",
"dependencies": { "dependencies": {
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^8.6.0", "dotenv": "^16.3.1",
"express": "^4.17.1", "express": "^4.18.2",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^9.0.0",
"mariadb": "^2.5.4", "mariadb": "^3.2.0",
"sequelize": "^6.6.5", "sequelize": "^6.32.1",
"socket.io": "^4.1.3" "socket.io": "^4.7.0"
}, },
"devDependencies": { "devDependencies": {
"nodemon": "^2.0.12" "nodemon": "^2.0.22"
},
"overrides": {
"semver": "^7.5.2"
} }
} }
+7 -2
View File
@@ -7,14 +7,19 @@ const app = express();
const server = require('http').Server(app); const server = require('http').Server(app);
const io = require('socket.io')(server, { const io = require('socket.io')(server, {
cors: { cors: {
origin: '*' origin: process.env.WEB_ORIGIN
} }
}); });
const cors = require('cors'); const cors = require('cors');
//config //config
app.use(express.json()); app.use(express.json());
app.use(cors()); app.use(cors({
credentials: true,
origin: [`${process.env.WEB_ORIGIN}`], //because auth-server
allowedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization', 'Set-Cookie'],
exposedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization', 'Set-Cookie'],
}));
//database connection //database connection
const database = require('./database'); const database = require('./database');