mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 12:28:26 +00:00
fix: env vars
This commit is contained in:
parent
92bec65862
commit
c94ec95599
@ -39,7 +39,7 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"reset": "npm install && npm run containers:restart",
|
||||
"reset:hard": "npm clean-install && npm run containers:rebuild",
|
||||
"cli": "DEBUG=ts-node* ts-node --files --log-error --compiler-options '{\"diagnostics\": true}' src/cli.ts"
|
||||
"cli": "HEXABOT_CLI=1 ts-node --files --log-error --compiler-options '{\"diagnostics\": true}' src/cli.ts"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,ts}": "eslint --fix -c \".eslintrc-staged.js\""
|
||||
|
@ -149,9 +149,11 @@ export const config: Config = {
|
||||
process.env.MONGO_URI || 'mongodb://dev_only:dev_only@localhost:27017/',
|
||||
dbName: process.env.MONGO_DB || 'hexabot',
|
||||
autoMigrate:
|
||||
process.env.MONGO_AUTO_MIGRATE === 'true'
|
||||
? Boolean(process.env.MONGO_AUTO_MIGRATE)
|
||||
: false,
|
||||
// Either auto-migration is explicitly enabled and the node is primary (cluster case)
|
||||
(process.env.MONGO_AUTO_MIGRATE === 'true' &&
|
||||
(process.env.API_IS_PRIMARY_NODE || 'true') === 'true') ||
|
||||
// Otherwise, run only in dev mode
|
||||
!(process.env.NODE_ENV || 'development').toLowerCase().includes('prod'),
|
||||
},
|
||||
env: process.env.NODE_ENV || 'development',
|
||||
authentication: {
|
||||
|
@ -52,8 +52,8 @@ export class MigrationService implements OnApplicationBootstrap {
|
||||
}
|
||||
this.logger.log('Mongoose connection established');
|
||||
|
||||
const isProduction = config.env.toLowerCase().includes('prod');
|
||||
if (!isProduction && config.mongo.autoMigrate) {
|
||||
const isCLI = Boolean(process.env.HEXABOT_CLI);
|
||||
if (!isCLI && config.mongo.autoMigrate) {
|
||||
this.logger.log('Executing migrations ...');
|
||||
const { value: version = '2.1.9' } =
|
||||
await this.metadataService.getMetadata('db-version');
|
||||
|
@ -1,10 +0,0 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
module.exports = {
|
||||
async up() {
|
||||
// Migration logic
|
||||
},
|
||||
async down() {
|
||||
// Rollback logic
|
||||
},
|
||||
};
|
@ -1,11 +1,12 @@
|
||||
# API & Common
|
||||
NODE_ENV=dev
|
||||
NODE_ENV=development
|
||||
APP_DOMAIN=localhost
|
||||
SSL_EMAIL=hello@hexabot.ai
|
||||
API_PORT=4000
|
||||
APP_FRONTEND_PORT=8080
|
||||
APP_SCRIPT_COMPODOC_PORT=9003
|
||||
API_ORIGIN=http://${APP_DOMAIN}:${API_PORT}
|
||||
API_IS_PRIMARY_NODE=true
|
||||
FRONTEND_BASE_URL=http://${APP_DOMAIN}:${APP_FRONTEND_PORT}
|
||||
FRONTEND_ORIGIN=${FRONTEND_BASE_URL},http://${APP_DOMAIN}:8081,http://${APP_DOMAIN}:5173,http://${APP_DOMAIN},https://${APP_DOMAIN}
|
||||
JWT_SECRET=dev_only
|
||||
|
Loading…
Reference in New Issue
Block a user