Skip to content
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

feat: add tar1090 and graphs1090 displays #190

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

shawaj
Copy link
Collaborator

@shawaj shawaj commented Jan 1, 2025

  • add tar1090 and graphs1090 using sdr-enthusiasts prebuilt container (thanks @mikenye @sdr-enthusiasts !!!)
  • add dockerfile modifications for running on balena
  • add start script for checks and setup
  • add readme item about tar1090/graphs1090

Closes: #24
Closes: #41

@shawaj shawaj changed the title Create init feat: add tar1090 and graphs1090 displays Jan 1, 2025
@shawaj shawaj force-pushed the shawaj/tar1090 branch 3 times, most recently from a92197a to 95b2bc0 Compare January 5, 2025 22:18
@shawaj
Copy link
Collaborator Author

shawaj commented Jan 5, 2025

Just putting these here as notes to myself...

Errors in container:

 tar1090  s6-rc: info: service autogain successfully started
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  s6-rc: info: service graphs1090 successfully started
 tar1090  [2025-01-05 22:19:02.038][cleanup_globe_history] MAX_GLOBE_HISTORY not set - we will not expire any globe_history files
 tar1090  s6-rc: info: service legacy-services: starting
 tar1090  s6-svc: fatal: unable to control /run/service/: supervisor not listening
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  fatal library error, lookup self
 tar1090  s6-svc: fatal: unable to control /run/service/: supervisor not listening
 tar1090  s6-svc: fatal: unable to control /run/service/: supervisor not listening
 tar1090  s6-svc: fatal: unable to control /run/service/: supervisor not listening

nginx conf

# nginx configuration for tar1090
location /tar1090/data/ {
  alias /run/readsb/;
  gzip_static off;
  location ~ aircraft.json$ {
    add_header Access-Control-Allow-Origin "*";
    add_header Cache-Control "no-cache";
    gzip on;
    gzip_static on;
  }
  location /tar1090/data/traces/ {
    location ~ trace_recent {
      gzip off;
    add_header Cache-Control "no-cache";
      add_header Content-Encoding "gzip";
    }
    location ~ trace_full {
      gzip off;
    add_header Cache-Control "no-cache";
      add_header Content-Encoding "gzip";
    }
  }
  location ~ globe_.*\.json$ {
    gzip off;
    add_header Cache-Control "no-cache";
    add_header Content-Encoding "gzip";
  }
  location ~ .*\.binCraft$ {
    gzip off;
    add_header Cache-Control "no-cache";
    add_header Content-Encoding "gzip";
  }
  location ~ .*\.zst$ {
    gzip off;
    add_header Cache-Control "no-cache";
  }
}

location /tar1090/osm_tiles_offline/ {
  alias /usr/local/share/osm_tiles_offline/;
}

location /tar1090/globe_history/ {
  alias /var/globe_history/;
  gzip on;
  gzip_static off;

  location ~ /acas/ {
    default_type text/plain;
    add_header Cache-Control "no-cache";

    gzip_static on;
  }

  location ~ ....-..-.. {
    absolute_redirect off;
    rewrite "^(.*)/globe_history/(....)-(..)-(..)/(.*)$" "$1/globe_history/$2/$3/$4/$5" last;
  }

  location ~ traces/ {
    gzip off;
    add_header Cache-Control "public, max-age=1209600";
    add_header Content-Encoding "gzip";
  }
  location ~ heatmap/ {
    gzip off;
    add_header Cache-Control "public, max-age=1209600";
    add_header Content-Encoding "gzip";
  }
}

location /tar1090/chunks/ {
  alias /run/tar1090/;
  gzip_static off;
  location ~ chunk_.*\.gz$ {
    gzip off;
    add_header Cache-Control "public, max-age=86400";
    add_header Content-Type "application/json";
    add_header Content-Encoding "gzip";
  }
  location ~ current_.*\.gz$ {
    gzip off;
    add_header Cache-Control "no-cache";
    add_header Content-Type "application/json";
    add_header Content-Encoding "gzip";
  }
  location ~ .*\.json$ {
    gzip on;
    add_header Cache-Control "no-cache";
  }
}

location /tar1090/aircraft_sil/ {
    alias /usr/local/share/tar1090/aircraft_sil/;
    add_header Cache-Control "public, max-age=1209600";
    try_files $uri /aircraft_sil/ZZZZ.png;
    absolute_redirect off;
}

location /tar1090 {
  alias /usr/local/share/tar1090/html/;
  try_files $uri $uri/ =404;
  absolute_redirect off;
  gzip off;
  gzip_static off;

  # location block priority:
  # = / exact location matches > regex matches > prefix matchs

  # exact matches
  location = /tar1090/config.js {
    add_header Cache-Control "no-cache";
    gzip on;
    gzip_static on;
  }
  location = /tar1090/index.html {
    add_header Cache-Control "no-cache";
    gzip on;
    gzip_static on;
  }

  # regex matches
  location ~ ^/tar1090/style.*\.css$ {
    add_header Cache-Control "public, max-age=7776000";
    gzip on;
    gzip_static on;
  }

  location ~ ^/tar1090/db-.*\.js$ {
    gzip off;
    gzip_static off;
    add_header Cache-Control "public, max-age=7776000";
    add_header Content-Encoding "gzip";
  }

  location ~ ^/tar1090/libs/.*$ {
    add_header Cache-Control "public, max-age=7776000";
    gzip on;
    gzip_static on;
  }
  location ~ ^/tar1090/[^/]*\.js$ {
    add_header Cache-Control "public, max-age=7776000";
    gzip on;
    gzip_static on;
  }

  # prefix matches
  location /tar1090/images {
    add_header Cache-Control "public, max-age=7776000";
  }
  location /tar1090/flags {
    add_header Cache-Control "public, max-age=7776000";
  }
}

@shawaj shawaj force-pushed the shawaj/tar1090 branch 7 times, most recently from 0475cd2 to 4d6b613 Compare January 6, 2025 01:51
- add tar1090 and graphs1090 using sdr-enthusiasts prebuilt container
- add dockerfile modifications for running on balena
- add start script for checks and setup

Closes: #24
Closes: #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add wiedehopf / tar1090 [Feature Request] Add wiedehopf / graphs1090
1 participant