-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
tracktor #7190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+179
−0
Merged
tracktor #7190
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
__ __ __ | ||
/ /__________ ______/ /__/ /_____ _____ | ||
/ __/ ___/ __ `/ ___/ //_/ __/ __ \/ ___/ | ||
/ /_/ / / /_/ / /__/ ,< / /_/ /_/ / / | ||
\__/_/ \__,_/\___/_/|_|\__/\____/_/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
tremor021 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.