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 <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
parent
6a17e25871
commit
663c6570f4
6
ct/headers/tracktor
Normal file
6
ct/headers/tracktor
Normal file
@ -0,0 +1,6 @@
|
||||
__ __ __
|
||||
/ /__________ ______/ /__/ /_____ _____
|
||||
/ __/ ___/ __ `/ ___/ //_/ __/ __ \/ ___/
|
||||
/ /_/ / / /_/ / /__/ ,< / /_/ /_/ / /
|
||||
\__/_/ \__,_/\___/_/|_|\__/\____/_/
|
||||
|
72
ct/tracktor.sh
Normal file
72
ct/tracktor.sh
Normal file
@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
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
|
||||
# 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 -r '.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/backend/.env /opt/tracktor.env
|
||||
msg_ok "Created Backup"
|
||||
|
||||
setup_nodejs
|
||||
fetch_and_deploy_gh_release "tracktor" "javedh-dev/tracktor" "tarball" "latest" "/opt/tracktor"
|
||||
|
||||
msg_info "Updating ${APP}"
|
||||
cd /opt/tracktor
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
msg_ok "Updated $APP"
|
||||
|
||||
msg_info "Restoring Backup"
|
||||
cp /opt/tracktor.env /opt/tracktor/app/backend/.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}"
|
40
frontend/public/json/tracktor.json
Normal file
40
frontend/public/json/tracktor.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"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/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": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/tracktor.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 1024,
|
||||
"hdd": 6,
|
||||
"os": "Debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Please check and update the '/opt/tracktor/app/backend/.env' file if using behind reverse proxy.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
61
install/tracktor-install.sh
Normal file
61
install/tracktor-install.sh
Normal file
@ -0,0 +1,61 @@
|
||||
#!/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" "tarball" "latest" "/opt/tracktor"
|
||||
|
||||
msg_info "Configuring Tracktor"
|
||||
cd /opt/tracktor
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
mkdir /opt/tracktor-data
|
||||
HOST_IP=$(hostname -I | awk '{print $1}')
|
||||
cat <<EOF >/opt/tracktor/app/backend/.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
|
||||
PORT=3000
|
||||
EOF
|
||||
msg_ok "Configured Tracktor"
|
||||
|
||||
msg_info "Creating service"
|
||||
cat <<EOF >/etc/systemd/system/tracktor.service
|
||||
[Unit]
|
||||
Description=Tracktor Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/tracktor
|
||||
EnvironmentFile=/opt/tracktor/app/backend/.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"
|
Loading…
x
Reference in New Issue
Block a user