Skip to content

Commit 663c657

Browse files
tracktor (#7190)
* 'Add new script' * Update tracktor.sh * Update tracktor.json --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Slaviša Arežina <[email protected]>
1 parent 6a17e25 commit 663c657

File tree

4 files changed

+179
-0
lines changed

4 files changed

+179
-0
lines changed

ct/headers/tracktor

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__ __ __
2+
/ /__________ ______/ /__/ /_____ _____
3+
/ __/ ___/ __ `/ ___/ //_/ __/ __ \/ ___/
4+
/ /_/ / / /_/ / /__/ ,< / /_/ /_/ / /
5+
\__/_/ \__,_/\___/_/|_|\__/\____/_/
6+

ct/tracktor.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: CrazyWolf13
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://tracktor.bytedge.in/
7+
8+
APP="tracktor"
9+
var_tags="${var_tags:-car;monitoring}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-4096}"
12+
var_disk="${var_disk:-6}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/tracktor ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
31+
RELEASE=$(curl -fsSL https://api.github.com/repos/javedh-dev/tracktor/releases/latest | jq -r '.tag_name' | sed 's/^v//')
32+
if [[ "${RELEASE}" != "$(cat ~/.tracktor 2>/dev/null)" ]] || [[ ! -f ~/.tracktor ]]; then
33+
msg_info "Stopping Service"
34+
systemctl stop tracktor
35+
msg_ok "Stopped Service"
36+
37+
msg_info "Creating Backup"
38+
cp /opt/tracktor/app/backend/.env /opt/tracktor.env
39+
msg_ok "Created Backup"
40+
41+
setup_nodejs
42+
fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor"
43+
44+
msg_info "Updating ${APP}"
45+
cd /opt/tracktor
46+
$STD npm install
47+
$STD npm run build
48+
msg_ok "Updated $APP"
49+
50+
msg_info "Restoring Backup"
51+
cp /opt/tracktor.env /opt/tracktor/app/backend/.env
52+
msg_ok "Restored Backup"
53+
54+
msg_info "Starting Service"
55+
systemctl start tracktor
56+
msg_ok "Started Service"
57+
58+
msg_ok "Updated Successfully"
59+
else
60+
msg_ok "Already up to date"
61+
fi
62+
exit
63+
}
64+
65+
start
66+
build_container
67+
description
68+
69+
msg_ok "Completed Successfully!\n"
70+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
71+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
72+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

frontend/public/json/tracktor.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Tracktor",
3+
"slug": "tracktor",
4+
"categories": [
5+
9
6+
],
7+
"date_created": "2025-08-06",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://tracktor.bytedge.in/introduction.html",
13+
"config_path": "/opt/tracktor/app/server/.env",
14+
"website": "https://tracktor.bytedge.in/",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/tracktor.webp",
16+
"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.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/tracktor.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 1024,
24+
"hdd": 6,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Please check and update the '/opt/tracktor/app/backend/.env' file if using behind reverse proxy.",
37+
"type": "info"
38+
}
39+
]
40+
}

install/tracktor-install.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2025 Community Scripts ORG
4+
# Author: CrazyWolf13
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://tracktor.bytedge.in
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
setup_nodejs
17+
fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor"
18+
19+
msg_info "Configuring Tracktor"
20+
cd /opt/tracktor
21+
$STD npm install
22+
$STD npm run build
23+
mkdir /opt/tracktor-data
24+
HOST_IP=$(hostname -I | awk '{print $1}')
25+
cat <<EOF >/opt/tracktor/app/backend/.env
26+
NODE_ENV=production
27+
PUBLIC_DEMO_MODE=false
28+
DB_PATH=/opt/tracktor-data/tracktor.db
29+
# Replace this URL if using behind reverse proxy for https traffic. Though it is optional and should work without changing
30+
PUBLIC_API_BASE_URL=http://$HOST_IP:3000
31+
# Here add the reverse proxy url as well to avoid cross errors from the app.
32+
CORS_ORIGINS=http://$HOST_IP:3000
33+
PORT=3000
34+
EOF
35+
msg_ok "Configured Tracktor"
36+
37+
msg_info "Creating service"
38+
cat <<EOF >/etc/systemd/system/tracktor.service
39+
[Unit]
40+
Description=Tracktor Service
41+
After=network.target
42+
43+
[Service]
44+
Type=simple
45+
WorkingDirectory=/opt/tracktor
46+
EnvironmentFile=/opt/tracktor/app/backend/.env
47+
ExecStart=/usr/bin/npm start
48+
49+
[Install]
50+
WantedBy=multi-user.target
51+
EOF
52+
systemctl enable -q --now tracktor
53+
msg_ok "Created service"
54+
55+
motd_ssh
56+
customize
57+
58+
msg_info "Cleaning up"
59+
$STD apt-get -y autoremove
60+
$STD apt-get -y autoclean
61+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)