diff --git a/ct/tracktor.sh b/ct/tracktor.sh index 3f43ae454..234a5febc 100644 --- a/ct/tracktor.sh +++ b/ct/tracktor.sh @@ -40,6 +40,29 @@ function update_script() { sed -i 's|^EnvironmentFile=.*|EnvironmentFile=/opt/tracktor.env|' /etc/systemd/system/tracktor.service systemctl daemon-reload fi + if [ ! -d "/opt/tracktor-data/uploads" ]; then + mkdir -p /opt/tracktor-data/{uploads,logs} + EXISTING_AUTH_PIN=$(grep '^AUTH_PIN=' /opt/tracktor.env 2>/dev/null | cut -d'=' -f2) + AUTH_PIN=${EXISTING_AUTH_PIN:-123456} + cat </opt/tracktor.env +NODE_ENV=production +DB_PATH=/opt/tracktor-data/tracktor.db +UPLOADS_DIR="/opt/tracktor-data/uploads" +LOG_DIR="/opt/tracktor-data/logs" +# If server host is not set by default it will run on all interfaces - 0.0.0.0 +# SERVER_HOST="" +SERVER_PORT=3000 +# Set this if you want to secure your endpoints otherwise default will be "*" +CORS_ORIGINS="*" +# Set this if you are using backend and frontend separately. +# PUBLIC_API_BASE_URL="" +LOG_REQUESTS=true +LOG_LEVEL="info" +AUTH_PIN=${AUTH_PIN} +# PUBLIC_DEMO_MODE=false +# FORCE_DATA_SEED=false +EOF + fi msg_ok "Corrected Services" setup_nodejs