Skip to content

Commit

Permalink
Fully tested the remote database
Browse files Browse the repository at this point in the history
Added default host for the admin account
  • Loading branch information
Ratstail91 committed May 2, 2024
1 parent ab9e745 commit cd34f0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The primary technology involved is:
* React
* Nodejs
* MariaDB (with Sequelize)
* Docker (with docker-compose)
* Docker (with docker compose)

This template is designed to support the development of persistent browser based games (PBBGs), but it, and it's component microservices, can be used elsewhere.

Expand All @@ -31,7 +31,7 @@ A clean install is this easy:
git clone https://github.com/krgamestudios/MERN-template.git
cd MERN-template
node configure-script.js
docker-compose up --build
docker compose up --build
```

# Setup Development
Expand Down
4 changes: 4 additions & 0 deletions configure-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,14 @@ See https://github.com/krgamestudios/MERN-template/wiki for help.

//MUST be at least 8 chars
let tmpPass = '';
let tmpHost = '';
while (defaultUser && tmpPass.length < 8) {
console.log('--All passwords must be at least 8 characters long--');
tmpPass = await question('Default Admin Pass', '');
tmpHost = await question('Default Admin Host', '');
}
const defaultPass = tmpPass;
const defaultHost = tmpHost;

if (defaultUser) {
console.log(`Default user email will be: ${defaultUser}@${authWebAddress}`);
Expand Down Expand Up @@ -281,6 +284,7 @@ services:
- MAIL_PASSWORD=${emailPass}
- MAIL_PHYSICAL=${emailPhysical}
- ADMIN_DEFAULT_USERNAME=${defaultUser}
- ADMIN_DEFAULT_HOSTNAME=${defaultHost}
- ADMIN_DEFAULT_PASSWORD=${defaultPass}
- SECRET_ACCESS=${accessToken}
- SECRET_REFRESH=${refreshToken}
Expand Down
13 changes: 4 additions & 9 deletions tools/create_database.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#This file only needs to be run once, during initial development setup
#This file isnt needed for actual deployment
#use this while debugging
CREATE DATABASE template;
CREATE USER 'template'@'%' IDENTIFIED BY 'pikachu';
GRANT ALL PRIVILEGES ON template.* TO 'template'@'%';

#Create the development database
CREATE DATABASE IF NOT EXISTS template;
USE template;

#Create the database user
CREATE USER IF NOT EXISTS 'template'@'%' IDENTIFIED BY 'pikachu';
GRANT ALL PRIVILEGES ON template.* TO 'template'@'%';

0 comments on commit cd34f0d

Please sign in to comment.