Config Setup

Early setup
This commit is contained in:
Jackary
2024-10-26 21:32:26 -04:00
parent e72f3e5aec
commit 5e9b07d62f
2 changed files with 61 additions and 95 deletions
-46
View File
@@ -1,46 +0,0 @@
module.exports = {
//mongodb connection string
dbURL: 'mongodb://jschan:CHANGE-ME-YOUR-SECURE-MONGODB-PASSWORD@127.0.0.1:27017/jschan',
//database name
dbName: 'jschan',
//redis connection info
redis: {
host: '127.0.0.1',
port: '6379',
password: 'CHANGE-ME-YOUR-SECURE-REDIS-PASSWORD'
},
//backend webserver port
port: 7000,
//secrets/salts for various things
cookieSecret: 'changeme',
tripcodeSecret: 'changeme',
ipHashSecret: 'changeme',
postPasswordSecret: 'changeme',
//keys for google recaptcha
google: {
siteKey: 'changeme',
secretKey: 'changeme'
},
//keys for hcaptcha
hcaptcha: {
siteKey: '10000000-ffff-ffff-ffff-000000000001',
secretKey: '0x0000000000000000000000000000000000000000'
},
//keys for yandex smartcaptcha
yandex: {
siteKey: 'changeme',
secretKey: 'changeme'
},
//enable debug logging
debugLogs: true,
};
+61 -49
View File
@@ -1,55 +1,67 @@
const numCpus = require('os').cpus().length;
module.exports = {
// Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/
apps : [{
name: 'build-worker',
script: 'worker.js',
instances: Math.ceil(numCpus*0.75),
autorestart: true,
watch: false,
max_memory_restart: '1G',
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
env: {
NODE_ENV: 'development'
apps : [
{
name: 'build-worker',
script: 'worker.js',
instances: Math.ceil(numCpus * 0.75),
autorestart: true,
watch: false,
max_memory_restart: '1G',
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
env: {
NODE_ENV: 'development',
PORT: 3000 // Ensure PORT is specified if needed by build-worker
},
env_development: {
NODE_ENV: 'development',
PORT: 3000
},
env_production: {
NODE_ENV: 'production'
}
},
env_development: {
NODE_ENV: 'development'
{
name: 'chan',
script: 'server.js',
instances: Math.ceil(numCpus * 0.75),
autorestart: true,
watch: false,
max_memory_restart: '1G',
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
wait_ready: true,
kill_timeout: 5000,
env: {
NODE_ENV: 'development',
PORT: 3000 // Added PORT for chan to bind to localhost:3000
},
env_development: {
NODE_ENV: 'development',
PORT: 3000
},
env_production: {
NODE_ENV: 'production',
PORT: 3000 // Ensure PORT is defined in production if needed
}
},
env_production: {
NODE_ENV: 'production'
{
name: 'schedules',
script: 'schedules/index.js',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
env: {
NODE_ENV: 'development'
},
env_development: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
}
}, {
name: 'chan',
script: 'server.js',
instances: Math.ceil(numCpus*0.75),
autorestart: true,
watch: false,
max_memory_restart: '1G',
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
wait_ready: true,
kill_timeout: 5000,
env: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
}, {
name: 'schedules',
script: 'schedules/index.js',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
env: {
NODE_ENV: 'development'
},
env_development: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
}]
]
};