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 diff --git a/frontend/public/json/tracktor.json b/frontend/public/json/tracktor.json index ca08d6dbf..12bd1d3b0 100644 --- a/frontend/public/json/tracktor.json +++ b/frontend/public/json/tracktor.json @@ -9,9 +9,9 @@ "updateable": true, "privileged": false, "interface_port": 3000, - "documentation": "https://tracktor.bytedge.in/introduction.html", + "documentation": "https://github.com/javedh-dev/tracktor/tree/main/docs", "config_path": "/opt/tracktor.env", - "website": "https://tracktor.bytedge.in/", + "website": "https://github.com/javedh-dev/tracktor", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/tracktor.webp", "description": "Tracktor is an open-source web application for comprehensive vehicle management.\nEasily track fuel consumption, maintenance, insurance, and regulatory documents for all your vehicles in one place.", "install_methods": [ diff --git a/install/tracktor-install.sh b/install/tracktor-install.sh index 8db049bac..8e82d76d6 100644 --- a/install/tracktor-install.sh +++ b/install/tracktor-install.sh @@ -20,18 +20,26 @@ msg_info "Configuring Tracktor" cd /opt/tracktor $STD npm install $STD npm run build -mkdir /opt/tracktor-data +mkdir -p /opt/tracktor-data/{uploads,logs} HOST_IP=$(hostname -I | awk '{print $1}') cat </opt/tracktor.env NODE_ENV=production -PUBLIC_DEMO_MODE=false DB_PATH=/opt/tracktor-data/tracktor.db -# Replace this URL if using behind reverse proxy for https traffic. Though it is optional and should work without changing -PUBLIC_API_BASE_URL=http://$HOST_IP:3000 -# Here add the reverse proxy url as well to avoid cross errors from the app. -CORS_ORIGINS=http://$HOST_IP:3000 +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 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. For lxc installation this is not needed +# PUBLIC_API_BASE_URL="" +LOG_REQUESTS=true +LOG_LEVEL="info" AUTH_PIN=123456 +# PUBLIC_DEMO_MODE=false +# FORCE_DATA_SEED=false EOF msg_ok "Configured Tracktor"