Skip to content

Commit 7cd3e40

Browse files
authored
tracktor: bump to debian 13 | feature bump (#7818)
1 parent 42191bd commit 7cd3e40

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

ct/tracktor.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
1111
var_ram="${var_ram:-4096}"
1212
var_disk="${var_disk:-6}"
1313
var_os="${var_os:-debian}"
14-
var_version="${var_version:-12}"
14+
var_version="${var_version:-13}"
1515
var_unprivileged="${var_unprivileged:-1}"
1616

1717
header_info "$APP"
@@ -33,22 +33,23 @@ function update_script() {
3333
systemctl stop tracktor
3434
msg_ok "Stopped Service"
3535

36-
msg_info "Creating Backup"
37-
cp /opt/tracktor/app/backend/.env /opt/tracktor.env
38-
msg_ok "Created Backup"
36+
msg_info "Correcting Services"
37+
if [ -f /opt/tracktor/app/backend/.env ]; then
38+
mv /opt/tracktor/app/backend/.env /opt/tracktor.env
39+
echo 'AUTH_PIN=123456' >> /opt/tracktor.env
40+
sed -i 's|^EnvironmentFile=.*|EnvironmentFile=/opt/tracktor.env|' /etc/systemd/system/tracktor.service
41+
systemctl daemon-reload
42+
fi
43+
msg_ok "Corrected Services"
3944

4045
setup_nodejs
4146
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor"
4247

43-
msg_info "Updating ${APP}"
48+
msg_info "Updating tracktor"
4449
cd /opt/tracktor
4550
$STD npm install
4651
$STD npm run build
47-
msg_ok "Updated $APP"
48-
49-
msg_info "Restoring Backup"
50-
cp /opt/tracktor.env /opt/tracktor/app/backend/.env
51-
msg_ok "Restored Backup"
52+
msg_ok "Updated tracktor"
5253

5354
msg_info "Starting Service"
5455
systemctl start tracktor

frontend/public/json/tracktor.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"privileged": false,
1111
"interface_port": 3000,
1212
"documentation": "https://tracktor.bytedge.in/introduction.html",
13-
"config_path": "/opt/tracktor/app/server/.env",
13+
"config_path": "/opt/tracktor.env",
1414
"website": "https://tracktor.bytedge.in/",
1515
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/tracktor.webp",
1616
"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.",
@@ -23,17 +23,17 @@
2323
"ram": 1024,
2424
"hdd": 6,
2525
"os": "Debian",
26-
"version": "12"
26+
"version": "13"
2727
}
2828
}
2929
],
3030
"default_credentials": {
3131
"username": null,
32-
"password": null
32+
"password": "123456"
3333
},
3434
"notes": [
3535
{
36-
"text": "Please check and update the '/opt/tracktor/app/backend/.env' file if using behind reverse proxy.",
36+
"text": "Please check and update the '/opt/tracktor.env' file if using behind reverse proxy.",
3737
"type": "info"
3838
}
3939
]

install/tracktor-install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $STD npm install
2222
$STD npm run build
2323
mkdir /opt/tracktor-data
2424
HOST_IP=$(hostname -I | awk '{print $1}')
25-
cat <<EOF >/opt/tracktor/app/backend/.env
25+
cat <<EOF >/opt/tracktor.env
2626
NODE_ENV=production
2727
PUBLIC_DEMO_MODE=false
2828
DB_PATH=/opt/tracktor-data/tracktor.db
@@ -31,6 +31,7 @@ PUBLIC_API_BASE_URL=http://$HOST_IP:3000
3131
# Here add the reverse proxy url as well to avoid cross errors from the app.
3232
CORS_ORIGINS=http://$HOST_IP:3000
3333
PORT=3000
34+
AUTH_PIN=123456
3435
EOF
3536
msg_ok "Configured Tracktor"
3637

@@ -43,7 +44,7 @@ After=network.target
4344
[Service]
4445
Type=simple
4546
WorkingDirectory=/opt/tracktor
46-
EnvironmentFile=/opt/tracktor/app/backend/.env
47+
EnvironmentFile=/opt/tracktor.env
4748
ExecStart=/usr/bin/npm start
4849
4950
[Install]
@@ -56,6 +57,7 @@ motd_ssh
5657
customize
5758

5859
msg_info "Cleaning up"
59-
$STD apt-get -y autoremove
60-
$STD apt-get -y autoclean
60+
$STD apt -y autoremove
61+
$STD apt -y autoclean
62+
$STD apt -y clean
6163
msg_ok "Cleaned"

0 commit comments

Comments
 (0)