From f5f44ae9f7e36676d09556a37fb8625ce27a9bef Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Thu, 18 Mar 2021 05:15:32 +1100 Subject: [PATCH] Updated configure-script.js with chat info --- README.md | 3 +-- client/styles/popup-chat.css | 1 + configure-script.js | 41 +++++++++++++++++++++++++++++++----- webpack.config.js | 2 +- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index eed29a2..bdb6437 100644 --- a/README.md +++ b/README.md @@ -62,14 +62,13 @@ To set up this template in development mode: - Full documentation - Modding tutorial - Fully Featured Chat System - - Optional microservice - Chat logs - Custom emoji - Global and room-based chat - Private messaging? - Broadcasting to all channels - Badges next to usernames? -- Moderation tools for banning, suspending, or chat-banning users +- Moderation tools for banning, suspending, chat-banning and reporting users # Coming Eventually - Better compression for client files diff --git a/client/styles/popup-chat.css b/client/styles/popup-chat.css index 0e1fdf6..555dd42 100644 --- a/client/styles/popup-chat.css +++ b/client/styles/popup-chat.css @@ -54,6 +54,7 @@ padding: 10px; min-height: 280px; max-height: calc(50vh - 23px - 20px - 6em); + overflow-x: wrap; overflow-y: scroll; } diff --git a/configure-script.js b/configure-script.js index b6b696f..c5312c5 100644 --- a/configure-script.js +++ b/configure-script.js @@ -70,6 +70,10 @@ See https://github.com/krgamestudios/MERN-template/wiki for help. const emailPhysical = await question('Physical Mailing Address', ''); //chat goes here + const chatName = await question('Chat Name', 'chat'); + const chatWebAddress = await question('Chat Web Address', `${chatName}.${projectWebAddress}`); + const chatDBUser = await question('Chat DB Username', chatName); + const chatDBPass = await question('Chat DB Password', 'blastoise'); //database configuration const dbRootPassword = await question('Database Root Password', 'password'); @@ -101,7 +105,7 @@ See https://github.com/krgamestudios/MERN-template/wiki for help. const projectPort = 3000; const newsPort = 3100; const authPort = 3200; - //const chatPort = 3300; + const chatPort = 3300; const ymlfile = ` version: "3.6" @@ -126,6 +130,7 @@ services: - DB_TIMEZONE=${dbTimeZone} - NEWS_URI=https://${newsWebAddress} - AUTH_URI=https://${authWebAddress} + - CHAT_URI=https://${chatWebAddress} - SECRET_ACCESS=${accessToken} networks: - app-network @@ -143,9 +148,9 @@ services: - traefik.http.routers.${newsName}router.entrypoints=websecure - traefik.http.routers.${newsName}router.tls.certresolver=myresolver - traefik.http.routers.${newsName}router.service=${newsName}service@docker - - traefik.http.services.${newsName}service.loadbalancer.server.port=3100 + - traefik.http.services.${newsName}service.loadbalancer.server.port=${newsPort} environment: - - WEB_PORT=3100 + - WEB_PORT=${newsPort} - DB_HOSTNAME=database - DB_DATABASE=${newsName} - DB_USERNAME=${newsDBUser} @@ -193,8 +198,30 @@ services: - database - traefik - #chat: - # image: krgamestudios/chat-server + ${chatName}: + image: krgamestudios/chat-server:latest + ports: + - ${chatPort} + labels: + - traefik.enable=true + - traefik.http.routers.${chatName}router.rule=Host(\`${chatWebAddress}\`) + - traefik.http.routers.${chatName}router.entrypoints=websecure + - traefik.http.routers.${chatName}router.tls.certresolver=myresolver + - traefik.http.routers.${chatName}router.service=${chatName}service@docker + - traefik.http.services.${chatName}service.loadbalancer.server.port=${chatPort} + environment: + - WEB_PORT=${chatPort} + - DB_HOSTNAME=database + - DB_DATABASE=${chatName} + - DB_USERNAME=${chatDBUser} + - DB_PASSWORD=${chatDBPass} + - DB_TIMEZONE=${dbTimeZone} + - SECRET_ACCESS=${accessToken} + networks: + - app-network + depends_on: + - database + - traefik database: image: mariadb @@ -258,6 +285,10 @@ CREATE DATABASE IF NOT EXISTS ${authName}; CREATE USER IF NOT EXISTS '${authDBUser}'@'%' IDENTIFIED BY '${authDBPass}'; GRANT ALL PRIVILEGES ON ${authName}.* TO '${authDBUser}'@'%'; +CREATE DATABASE IF NOT EXISTS ${chatName}; +CREATE USER IF NOT EXISTS '${chatDBUser}'@'%' IDENTIFIED BY '${chatDBPass}'; +GRANT ALL PRIVILEGES ON ${chatName}.* TO '${chatDBUser}'@'%'; + FLUSH PRIVILEGES; `; diff --git a/webpack.config.js b/webpack.config.js index 1247fb1..10b1192 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -57,7 +57,7 @@ module.exports = ({ production, analyzer }) => { 'PRODUCTION': production, 'NEWS_URI': production ? `"${process.env.NEWS_URI}"` : '"https://dev-news.eggtrainer.com"', 'AUTH_URI': production ? `"${process.env.AUTH_URI}"` : '"https://dev-auth.eggtrainer.com"', - 'CHAT_URI': production ? `"${process.env.CHAT_URI}"` : '"http://localhost:3300"', + 'CHAT_URI': production ? `"${process.env.CHAT_URI}"` : '"https://dev-chat.eggtrainer.com"', } }), new CleanWebpackPlugin({