New Script: AirTrail - #2030
Closed
Majiiin wants to merge 7 commits into
Closed
Conversation
MickLesk
requested changes
Jul 16, 2026
Comment on lines
+18
to
+20
| curl \ | ||
| skopeo \ | ||
| unzip |
Comment on lines
+37
to
+42
| msg_info "Configuring AirTrail" | ||
| useradd \ | ||
| --system \ | ||
| --home-dir /opt/airtrail \ | ||
| --shell /usr/sbin/nologin \ | ||
| airtrail |
Comment on lines
+72
to
+121
| msg_info "Installing Airport Overlay" | ||
| overlay_tmp=$(mktemp -d) | ||
|
|
||
| overlay_image=$( | ||
| awk ' | ||
| $1 == "FROM" && | ||
| $2 ~ /^johly\/airtrail-airport-overlay(:|@)/ { | ||
| print $2 | ||
| exit | ||
| } | ||
| ' /opt/airtrail/docker/Dockerfile | ||
| ) | ||
|
|
||
| if [[ -z "$overlay_image" ]]; then | ||
| msg_error "Airport overlay image not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ "$overlay_image" == *@sha256:* ]]; then | ||
| image_without_digest="${overlay_image%@*}" | ||
| image_digest="${overlay_image#*@}" | ||
| image_repository="${image_without_digest%:*}" | ||
| skopeo_image="${image_repository}@${image_digest}" | ||
| else | ||
| skopeo_image="$overlay_image" | ||
| fi | ||
|
|
||
| mkdir -p \ | ||
| "$overlay_tmp/archive" \ | ||
| "$overlay_tmp/rootfs" | ||
|
|
||
| $STD skopeo copy \ | ||
| "docker://docker.io/${skopeo_image}" \ | ||
| "docker-archive:${overlay_tmp}/overlay.tar:airtrail-overlay:latest" | ||
|
|
||
| tar -xf "$overlay_tmp/overlay.tar" \ | ||
| -C "$overlay_tmp/archive" | ||
|
|
||
| overlay_layer=$( | ||
| jq -r '.[0].Layers[-1]' \ | ||
| "$overlay_tmp/archive/manifest.json" | ||
| ) | ||
|
|
||
| tar -xf "$overlay_tmp/archive/$overlay_layer" \ | ||
| -C "$overlay_tmp/rootfs" | ||
|
|
||
| if [[ ! -s "$overlay_tmp/rootfs/airport-overlay.pmtiles" ]]; then | ||
| msg_error "Airport overlay file not found" | ||
| exit 1 | ||
| fi |
Member
There was a problem hiding this comment.
for what? if this the state of the art of AirTrail? Then sorry, nope
| msg_ok "Applied Database Migrations" | ||
|
|
||
| msg_info "Creating Service" | ||
| cat <<'EOF_SERVICE' >/etc/systemd/system/airtrail.service |
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF_SERVICE |
Comment on lines
+83
to
+145
| msg_info "Installing Airport Overlay" | ||
| if ! command -v skopeo >/dev/null 2>&1; then | ||
| $STD apt install -y skopeo | ||
| fi | ||
|
|
||
| overlay_tmp=$(mktemp -d) | ||
|
|
||
| overlay_image=$( | ||
| awk ' | ||
| $1 == "FROM" && | ||
| $2 ~ /^johly\/airtrail-airport-overlay(:|@)/ { | ||
| print $2 | ||
| exit | ||
| } | ||
| ' /opt/airtrail/docker/Dockerfile | ||
| ) | ||
|
|
||
| if [[ -z "$overlay_image" ]]; then | ||
| msg_error "Airport overlay image not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ "$overlay_image" == *@sha256:* ]]; then | ||
| image_without_digest="${overlay_image%@*}" | ||
| image_digest="${overlay_image#*@}" | ||
| image_repository="${image_without_digest%:*}" | ||
| skopeo_image="${image_repository}@${image_digest}" | ||
| else | ||
| skopeo_image="$overlay_image" | ||
| fi | ||
|
|
||
| mkdir -p \ | ||
| "$overlay_tmp/archive" \ | ||
| "$overlay_tmp/rootfs" | ||
|
|
||
| $STD skopeo copy \ | ||
| "docker://docker.io/${skopeo_image}" \ | ||
| "docker-archive:${overlay_tmp}/overlay.tar:airtrail-overlay:latest" | ||
|
|
||
| tar -xf "$overlay_tmp/overlay.tar" \ | ||
| -C "$overlay_tmp/archive" | ||
|
|
||
| overlay_layer=$( | ||
| jq -r '.[0].Layers[-1]' \ | ||
| "$overlay_tmp/archive/manifest.json" | ||
| ) | ||
|
|
||
| tar -xf "$overlay_tmp/archive/$overlay_layer" \ | ||
| -C "$overlay_tmp/rootfs" | ||
|
|
||
| if [[ ! -s "$overlay_tmp/rootfs/airport-overlay.pmtiles" ]]; then | ||
| msg_error "Airport overlay file not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| install \ | ||
| -o root \ | ||
| -g root \ | ||
| -m 0644 \ | ||
| "$overlay_tmp/rootfs/airport-overlay.pmtiles" \ | ||
| /opt/airtrail/build/client/airport-overlay.pmtiles | ||
|
|
||
| rm -rf "$overlay_tmp" |
Comment on lines
+70
to
+73
| CLEAN_INSTALL=1 fetch_and_deploy_gh_release \ | ||
| "airtrail" \ | ||
| "johanohly/AirTrail" \ | ||
| "tarball" |
Comment on lines
+44
to
+68
| msg_info "Backing Up Database" | ||
| install -d \ | ||
| -o root \ | ||
| -g root \ | ||
| -m 0700 \ | ||
| /var/lib/airtrail/backups | ||
|
|
||
| backup_file="/var/lib/airtrail/backups/airtrail-$(date +%Y%m%d-%H%M%S).sql" | ||
|
|
||
| sudo -u postgres pg_dump airtrail | | ||
| install \ | ||
| -o root \ | ||
| -g root \ | ||
| -m 0600 \ | ||
| /dev/stdin \ | ||
| "$backup_file" | ||
|
|
||
| find /var/lib/airtrail/backups \ | ||
| -type f \ | ||
| -name 'airtrail-*.sql' \ | ||
| -mtime +14 \ | ||
| -delete | ||
| msg_ok "Backed Up Database" | ||
|
|
||
| systemctl stop airtrail |
Member
There was a problem hiding this comment.
this is not how we handle updates, backups and msgs for service shutdown
This comment was marked as resolved.
This comment was marked as resolved.
asylumexp
requested changes
Jul 23, 2026
| "interface_port": 3000, | ||
| "documentation": "https://airtrail.johan.ohly.dk/docs/overview/introduction", | ||
| "website": "https://airtrail.johan.ohly.dk", | ||
| "logo": "https://cdn.jsdelivr.net/gh/johanohly/AirTrail@main/static/favicon.png", |
Member
There was a problem hiding this comment.
request a icon in https://github.com/selfhst/icons/discussions
| msg_ok "Updated AirTrail" | ||
|
|
||
| msg_info "Updating Service" | ||
| cat <<EOF >/etc/systemd/system/airtrail.service |
Member
There was a problem hiding this comment.
is there a need to update the service in the update func?
Comment on lines
+39
to
+43
| }, | ||
| { | ||
| "text": "The AirTrail configuration is stored in /opt/airtrail/.env.", | ||
| "type": "info" | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| }, | |
| { | |
| "text": "The AirTrail configuration is stored in /opt/airtrail/.env.", | |
| "type": "info" | |
| } | |
| } |
it shows the config location on the website
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
✍️ Description
Adds a fully functional and tested native AirTrail LXC script.
AirTrail is a self-hosted application for tracking flights, viewing flight history on an interactive map, importing flight data, and displaying travel statistics.
Implementation details:
airtrailsystem userTested on Proxmox VE 9.2.4:
0.0.0root:rootownership and0600permissions🔗 Related PR / Issue
This PR addresses the existing AirTrail script request:
The request was opened in September 2025 and received follow-up interest from two additional community members.
✅ Prerequisites
🏗️ arm64 Support
ARM64 is currently disabled in the script metadata until it can be properly tested.
🛠️ Type of Change
README,AppName.md,CONTRIBUTING.md, or other docs.🔍 Code & Security Review
CODE-AUDIT.md&CONTRIBUTING.mdguidelinesAppName.sh,AppName-install.sh,AppName.json)fetch_and_deploy_gh_release.🤖 AI Assistance
AGENTS.mdand.github/agents/pve-script-creator.agent.mdas guidance, and the output has been reviewed and corrected to match those guidelines.📋 Additional Information
The upstream AirTrail source release does not include
airport-overlay.pmtiles.AirTrail's official Dockerfile obtains this required static data file from a separately published and digest-pinned OCI image. The LXC installer reproduces only that asset extraction using Skopeo while running the application itself directly with Node.js and systemd.
📦 Application Requirements (for new scripts)
🌐 Source