diff --git a/package.json b/package.json index 8cfea3831..10f1d9b78 100644 --- a/package.json +++ b/package.json @@ -92,9 +92,9 @@ "yargs": "^3.15.0" }, "scripts": { - "migrate_local": "NODE_ENV=local DATABASE_URL=mysql://root:@localhost/box node_modules/.bin/db-migrate up", - "migrate_test": "NODE_ENV=test DATABASE_URL=mysql://root:@localhost/boxtest node_modules/.bin/db-migrate up", - "test": "npm run migrate_test && src/test/setupTest && NODE_ENV=test ./node_modules/istanbul/lib/cli.js test $1 ./node_modules/mocha/bin/_mocha -- -R spec ./src/test ./src/routes/test", + "migrate_local": "DATABASE_URL=mysql://root:@localhost/box node_modules/.bin/db-migrate up", + "migrate_test": "BOX_ENV=test DATABASE_URL=mysql://root:@localhost/boxtest node_modules/.bin/db-migrate up", + "test": "npm run migrate_test && src/test/setupTest && BOX_ENV=test ./node_modules/istanbul/lib/cli.js test $1 ./node_modules/mocha/bin/_mocha -- -R spec ./src/test ./src/routes/test", "postmerge": "/bin/true", "precommit": "/bin/true", "prepush": "npm test", diff --git a/setup/container/sudoers b/setup/container/sudoers index b8e7a3656..e2ce8f7b3 100644 --- a/setup/container/sudoers +++ b/setup/container/sudoers @@ -1,26 +1,26 @@ -Defaults!/home/yellowtent/box/src/scripts/createappdir.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/createappdir.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/createappdir.sh -Defaults!/home/yellowtent/box/src/scripts/rmappdir.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/rmappdir.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/rmappdir.sh -Defaults!/home/yellowtent/box/src/scripts/reloadnginx.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/reloadnginx.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/reloadnginx.sh -Defaults!/home/yellowtent/box/src/scripts/backupbox.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/backupbox.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/backupbox.sh -Defaults!/home/yellowtent/box/src/scripts/backupapp.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/backupapp.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/backupapp.sh -Defaults!/home/yellowtent/box/src/scripts/restoreapp.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/restoreapp.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/restoreapp.sh -Defaults!/home/yellowtent/box/src/scripts/reboot.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/reboot.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/reboot.sh -Defaults!/home/yellowtent/box/src/scripts/reloadcollectd.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/reloadcollectd.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/reloadcollectd.sh -Defaults!/home/yellowtent/box/src/scripts/backupswap.sh env_keep="HOME NODE_ENV" +Defaults!/home/yellowtent/box/src/scripts/backupswap.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/backupswap.sh diff --git a/setup/container/supervisor/conf.d/apphealthtask.conf b/setup/container/supervisor/conf.d/apphealthtask.conf index 0c806536f..b0ef423fc 100644 --- a/setup/container/supervisor/conf.d/apphealthtask.conf +++ b/setup/container/supervisor/conf.d/apphealthtask.conf @@ -7,4 +7,4 @@ stdout_logfile=/var/log/supervisor/apphealthtask.log stdout_logfile_maxbytes=50MB stdout_logfile_backups=2 user=yellowtent -environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*",NODE_ENV="cloudron" +environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*",BOX_ENV="cloudron",NODE_ENV="production" diff --git a/setup/container/supervisor/conf.d/box.conf b/setup/container/supervisor/conf.d/box.conf index 2354bdd0a..8be98dcb2 100644 --- a/setup/container/supervisor/conf.d/box.conf +++ b/setup/container/supervisor/conf.d/box.conf @@ -7,4 +7,4 @@ stdout_logfile=/var/log/supervisor/box.log stdout_logfile_maxbytes=50MB stdout_logfile_backups=2 user=yellowtent -environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*,connect-lastmile",NODE_ENV="cloudron" +environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*,connect-lastmile",BOX_ENV="cloudron",NODE_ENV="production" diff --git a/setup/container/supervisor/conf.d/crashnotifier.conf b/setup/container/supervisor/conf.d/crashnotifier.conf index c6d56d4df..a732836b3 100644 --- a/setup/container/supervisor/conf.d/crashnotifier.conf +++ b/setup/container/supervisor/conf.d/crashnotifier.conf @@ -8,4 +8,4 @@ stderr_logfile=/var/log/supervisor/crashnotifier.log stderr_logfile_maxbytes=50MB stderr_logfile_backups=2 user=yellowtent -environment=HOME="/home/yellowtent",USER="yellowtent",NODE_ENV="cloudron" +environment=HOME="/home/yellowtent",USER="yellowtent",BOX_ENV="cloudron",NODE_ENV="production" diff --git a/setup/container/supervisor/conf.d/janitor.conf b/setup/container/supervisor/conf.d/janitor.conf index 48681c609..c087c2765 100644 --- a/setup/container/supervisor/conf.d/janitor.conf +++ b/setup/container/supervisor/conf.d/janitor.conf @@ -7,4 +7,4 @@ stdout_logfile=/var/log/supervisor/janitor.log stdout_logfile_maxbytes=50MB stdout_logfile_backups=2 user=yellowtent -environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*",NODE_ENV="cloudron" +environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*",BOX_ENV="cloudron",NODE_ENV="production" diff --git a/setup/container/supervisor/conf.d/oauthproxy.conf b/setup/container/supervisor/conf.d/oauthproxy.conf index 26782d2ba..99de95fb4 100644 --- a/setup/container/supervisor/conf.d/oauthproxy.conf +++ b/setup/container/supervisor/conf.d/oauthproxy.conf @@ -7,4 +7,4 @@ stdout_logfile=/var/log/supervisor/oauthproxy.log stdout_logfile_maxbytes=50MB stdout_logfile_backups=2 user=yellowtent -environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*",NODE_ENV="cloudron" +environment=HOME="/home/yellowtent",USER="yellowtent",DEBUG="box*",BOX_ENV="cloudron",NODE_ENV="production" diff --git a/setup/start.sh b/setup/start.sh index 9407bba20..175381bcc 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -77,7 +77,7 @@ set_progress "25" "Migrating data" sudo -u "${USER}" -H bash <