From 6d4c16708e18d9f4fdb0f18cb4a0fcd8c0bc2895 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 18:50:12 +0000 Subject: [PATCH 1/4] 'Add new script' --- ct/headers/tracktor | 6 +++ ct/tracktor.sh | 72 ++++++++++++++++++++++++++++++ frontend/public/json/tracktor.json | 35 +++++++++++++++ install/tracktor-install.sh | 59 ++++++++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 ct/headers/tracktor create mode 100644 ct/tracktor.sh create mode 100644 frontend/public/json/tracktor.json create mode 100644 install/tracktor-install.sh diff --git a/ct/headers/tracktor b/ct/headers/tracktor new file mode 100644 index 00000000000..d4802c5aa23 --- /dev/null +++ b/ct/headers/tracktor @@ -0,0 +1,6 @@ + __ __ __ + / /__________ ______/ /__/ /_____ _____ + / __/ ___/ __ `/ ___/ //_/ __/ __ \/ ___/ +/ /_/ / / /_/ / /__/ ,< / /_/ /_/ / / +\__/_/ \__,_/\___/_/|_|\__/\____/_/ + diff --git a/ct/tracktor.sh b/ct/tracktor.sh new file mode 100644 index 00000000000..d18a5996ed0 --- /dev/null +++ b/ct/tracktor.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: CrazyWolf13 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://tracktor.bytedge.in/ + +APP="tracktor" +var_tags="${var_tags:-car;monitoring}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-6}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/tracktor ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/javedh-dev/tracktor/releases/latest | jq '.tag_name' | sed 's/^v//') + if [[ "${RELEASE}" != "$(cat ~/.tracktor 2>/dev/null)" ]] || [[ ! -f ~/.tracktor ]]; then + msg_info "Stopping Service" + systemctl stop tracktor + msg_ok "Stopped Service" + + msg_info "Creating Backup" + cp /opt/tracktor/app/server/.env /opt/tracktor.env + msg_ok "Created Backup" + + msg_info "Updating ${APP}" + rm -rf /opt/tracktor + setup_nodejs + fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" + cd /opt/tracktor + rm package-lock.json + $STD npm install + $STD npm run build + msg_ok "Updated $APP" + + msg_info "Restoring Backup" + cp /opt/tracktor.env /opt/tracktor/app/server/.env + msg_ok "Restored Backup" + + msg_info "Starting Service" + systemctl start tracktor + msg_ok "Started Service" + msg_ok "Updated Successfully" + else + msg_ok "Already up to date" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/tracktor.json b/frontend/public/json/tracktor.json new file mode 100644 index 00000000000..2d7d0a07bb8 --- /dev/null +++ b/frontend/public/json/tracktor.json @@ -0,0 +1,35 @@ +{ + "name": "Tracktor", + "slug": "tracktor", + "categories": [ + 9 + ], + "date_created": "2025-08-06", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://tracktor.bytedge.in/introduction.html", + "config_path": "/opt/tracktor/app/server/.env", + "website": "https://tracktor.bytedge.in/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/tracktor.svg", + "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": [ + { + "type": "default", + "script": "ct/tracktor.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 6, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/tracktor-install.sh b/install/tracktor-install.sh new file mode 100644 index 00000000000..5b709e64ee4 --- /dev/null +++ b/install/tracktor-install.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Copyright (c) 2025 Community Scripts ORG +# Author: CrazyWolf13 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://tracktor.bytedge.in + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +setup_nodejs +fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" + +msg_info "Configuring Tracktor" +cd /opt/tracktor +rm package-lock.json +$STD npm install +$STD npm run build +mkdir /opt/tracktor-data +HOST_IP=$(hostname -I | awk '{print $1}') +cat </opt/tracktor/app/server/.env +NODE_ENV=production +PUBLIC_DEMO_MODE=false +DB_PATH=/opt/tracktor-data/vehicles.db +PUBLIC_API_BASE_URL=http://$HOST_IP:3000 +PORT=3000 +EOF +msg_ok "Configured Tracktor" + +msg_info "Creating service" +cat </etc/systemd/system/tracktor.service +[Unit] +Description=Tracktor Service +After=network.target + +[Service] +Type=simple +WorkingDirectory=/opt/tracktor +EnvironmentFile=/opt/tracktor/app/server/.env +ExecStart=/usr/bin/npm start + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now tracktor +msg_ok "Created service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 7914ab6dc1723780aea2a7a1db030bf98d3c8484 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:52:20 +0200 Subject: [PATCH 2/4] curl and other minor fixed --- ct/tracktor.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ct/tracktor.sh b/ct/tracktor.sh index d18a5996ed0..8c88117d214 100644 --- a/ct/tracktor.sh +++ b/ct/tracktor.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: CrazyWolf13 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -38,10 +38,11 @@ function update_script() { cp /opt/tracktor/app/server/.env /opt/tracktor.env msg_ok "Created Backup" - msg_info "Updating ${APP}" - rm -rf /opt/tracktor + setup_nodejs fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" + + msg_info "Updating ${APP}" cd /opt/tracktor rm package-lock.json $STD npm install From d6214f96886af5c15708f86367a3c7a1d7d4d53c Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Tue, 12 Aug 2025 11:27:10 +0200 Subject: [PATCH 3/4] fix: update --- ct/tracktor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/tracktor.sh b/ct/tracktor.sh index 8c88117d214..9e419bfdc90 100644 --- a/ct/tracktor.sh +++ b/ct/tracktor.sh @@ -28,7 +28,7 @@ function update_script() { exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/javedh-dev/tracktor/releases/latest | jq '.tag_name' | sed 's/^v//') + RELEASE=$(curl -fsSL https://api.github.com/repos/javedh-dev/tracktor/releases/latest | jq -r '.tag_name' | sed 's/^v//') if [[ "${RELEASE}" != "$(cat ~/.tracktor 2>/dev/null)" ]] || [[ ! -f ~/.tracktor ]]; then msg_info "Stopping Service" systemctl stop tracktor @@ -40,7 +40,7 @@ function update_script() { setup_nodejs - fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" + fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor" msg_info "Updating ${APP}" cd /opt/tracktor From 5d48f804b36540dfd30faa765d7ad5c194545643 Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Tue, 12 Aug 2025 11:27:31 +0200 Subject: [PATCH 4/4] fix: update mechanic --- install/tracktor-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/tracktor-install.sh b/install/tracktor-install.sh index 5b709e64ee4..d2c5fde5f62 100644 --- a/install/tracktor-install.sh +++ b/install/tracktor-install.sh @@ -14,7 +14,7 @@ network_check update_os setup_nodejs -fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" +fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor" msg_info "Configuring Tracktor" cd /opt/tracktor