Skip to content
Snippets Groups Projects
Verified Commit 0a83574c authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

moved all the non frontend stuff to a different repo

parent 3d9d8e1f
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 348 deletions
...@@ -21,3 +21,7 @@ RUN chmod a+rx / && chmod a+rx -R /root ...@@ -21,3 +21,7 @@ RUN chmod a+rx / && chmod a+rx -R /root
RUN chmod 777 /root/trackdirect/htdocs/public/symbols RUN chmod 777 /root/trackdirect/htdocs/public/symbols
RUN chmod 777 /root/trackdirect/htdocs/public/heatmaps RUN chmod 777 /root/trackdirect/htdocs/public/heatmaps
VOLUME /root/trackdirect/config
VOLUME /root/trackdirect/htdocs/public/heatmaps
EXPOSE 80
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN printf "deb http://aprsc-dist.he.fi/aprsc/apt focal main" >> /etc/apt/sources.list
RUN gpg --keyserver keyserver.ubuntu.com --recv C51AA22389B5B74C3896EF3CA72A581E657A2B8D
RUN gpg --export C51AA22389B5B74C3896EF3CA72A581E657A2B8D | apt-key add -
RUN apt-get update && apt-get install -y \
aprsc \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 10152
EXPOSE 14580
EXPOSE 10155
EXPOSE 14501
WORKDIR /opt/aprsc
USER aprsc
CMD /opt/aprsc/sbin/aprsc -c /opt/aprsc/etc/aprsc.conf
# Note that server id and passcode needs to be changed
ServerId MY-SERVER-ID
PassCode 11111
MyAdmin "My Name, MySignal"
MyEmail me@domain.com
disallow_unverified false
RunDir data
LogRotate 10 5
UpstreamTimeout 15s
ClientTimeout 48h
Listen "Full feed" fullfeed tcp :: 10152
Listen "Client-Defined Filters" igate tcp :: 14580
Listen "Duplicate packets" dupefeed tcp :: 10155
### Select aprs source (only one)
Uplink "Core rotate" ro tcp rotate.aprs.net 10152
#Uplink "Core rotate" ro tcp cwop.aprs.net 10152
#Uplink "Core rotate" ro tcp aprs.glidernet.org 10152
HTTPStatus 0.0.0.0 14501
HTTPStatusOptions ShowEmail=1
### Operator attention span qualification run ###########
# After configuring the rest of the settings, remove this bad command
# from the configuration file. It's here only to avoid starting the
# server up accidentally with an invalid configuration.
MagicBadness 42.7
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
[website] [website]
title="APRS Track Direct" title="Digipex Hub"
owner_name="Unknown" owner_name="Jeffrey Phillips Freeman (WI2ARD)"
owner_email="no@name.com" owner_email="the@JeffreyFreeman.me"
;maptiler_key="<insert map key here if you want to activate maptiler for vector tiles>" ;maptiler_key="<insert map key here if you want to activate maptiler for vector tiles>"
;google_key="<insert google key here if you want to activate google maps>" ;google_key="<insert google key here if you want to activate google maps>"
...@@ -32,18 +32,18 @@ coverage_percentile="95" ...@@ -32,18 +32,18 @@ coverage_percentile="95"
;; Basic database settings ;; Basic database settings
;; If using docker, set host to "db" ;; If using docker, set host to "db"
host="127.0.0.1" host="swarm-db-default-postgres.cjvkhc5ajvev.us-east-1.rds.amazonaws.com"
database="trackdirect" database="digipex_hub"
;; If using docker, activate username and set to "root" ;; If using docker, activate username and set to "root"
;username="username" username="digipex_hub_user"
password="foobar" password=""
port="5432" port="5432"
;; Settings for the remover script ;; Settings for the remover script
days_to_save_position_data="10" days_to_save_position_data="10000"
days_to_save_station_data="30" days_to_save_station_data="30000"
days_to_save_weather_data="10" days_to_save_weather_data="10000"
days_to_save_telemetry_data="10" days_to_save_telemetry_data="10000"
;; If this setting is enabled, OGN stations that we are not allowed to reveal the identity of will be given a random name similar to "UNKNOWN123" ;; If this setting is enabled, OGN stations that we are not allowed to reveal the identity of will be given a random name similar to "UNKNOWN123"
;; If disabled we will drop all packets regarding stations that we should not reveal the identity of. ;; If disabled we will drop all packets regarding stations that we should not reveal the identity of.
...@@ -73,7 +73,7 @@ frequency_limit="0" ...@@ -73,7 +73,7 @@ frequency_limit="0"
;; First APRS IS server for the websocket server to connect to. ;; First APRS IS server for the websocket server to connect to.
;; Important: Please set up your own APRS IS server, do not use a public server. ;; Important: Please set up your own APRS IS server, do not use a public server.
;; If using docker, set aprs_host1 to "aprsc" ;; If using docker, set aprs_host1 to "aprsc"
aprs_host1="127.0.0.1" aprs_host1="igate.digipex.io"
aprs_port1="14580" aprs_port1="14580"
;; Important that you set the correct source, otherwise it might be handled incorrect ;; Important that you set the correct source, otherwise it might be handled incorrect
...@@ -92,7 +92,7 @@ aprs_source_id1="1" ...@@ -92,7 +92,7 @@ aprs_source_id1="1"
;; Allow time travel ;; Allow time travel
;; Use this settings to disable/enable data requests with a time interval (this must be disabled for the OGN network) ;; Use this settings to disable/enable data requests with a time interval (this must be disabled for the OGN network)
allow_time_travel="0" allow_time_travel="1"
;; Max default time in minutes (how old packets that will be included in the response) ;; Max default time in minutes (how old packets that will be included in the response)
;; This setting should be no more than 1440 for for the OGN network. ;; This setting should be no more than 1440 for for the OGN network.
...@@ -103,7 +103,7 @@ max_default_time="1440" ...@@ -103,7 +103,7 @@ max_default_time="1440"
max_filter_time="1440" max_filter_time="1440"
;; Time in minutes until idle client is disconnected ;; Time in minutes until idle client is disconnected
max_client_idle_time="60" max_client_idle_time="20160"
;; Max age in seconds for real time packets waiting to be sent to client (dropping packets if limit is excceded) ;; Max age in seconds for real time packets waiting to be sent to client (dropping packets if limit is excceded)
max_queued_realtime_packets="30" max_queued_realtime_packets="30"
...@@ -112,7 +112,7 @@ max_queued_realtime_packets="30" ...@@ -112,7 +112,7 @@ max_queued_realtime_packets="30"
[collector0] [collector0]
;; If using docker, set host to "aprsc" ;; If using docker, set host to "aprsc"
host="127.0.0.1" host="igate.digipex.io"
port_full="10152" port_full="10152"
port_filtered="14580" port_filtered="14580"
...@@ -125,21 +125,21 @@ port_filtered="14580" ...@@ -125,21 +125,21 @@ port_filtered="14580"
source_id="1" source_id="1"
;; Your callsign and passcode ;; Your callsign and passcode
callsign="NOCALL" callsign="DIGIHUB"
passcode="-1" passcode="31415"
;; Database inserts is done in batches ;; Database inserts is done in batches
numbers_in_batch="50" numbers_in_batch="50"
;; Packets received more frequently than the configured frequency limit will not be shown on map (limit is specified in seconds) ;; Packets received more frequently than the configured frequency limit will not be shown on map (limit is specified in seconds)
;; Set to "0" to disable the frequency limit (note that the limit must be 20s or more when receiving data from OGN network)). ;; Set to "0" to disable the frequency limit (note that the limit must be 20s or more when receiving data from OGN network)).
frequency_limit="5" frequency_limit="0"
;; If save_fast_packets is set to "0", packets that is received to frequently will not be saved (useful for OGN, but not recommended for APRS-IS). ;; If save_fast_packets is set to "0", packets that is received to frequently will not be saved (useful for OGN, but not recommended for APRS-IS).
save_fast_packets="1" save_fast_packets="1"
;; If detect_duplicates is set to "1" we will try to detect duplicates and ignore them. ;; If detect_duplicates is set to "1" we will try to detect duplicates and ignore them.
detect_duplicates="1" detect_duplicates="0"
;; Collector error log ;; Collector error log
error_log="~/trackdirect/server/log/collector.log" error_log="~/trackdirect/server/log/collector.log"
......
FROM postgres
COPY misc/database/tables/* /docker-entrypoint-initdb.d/
VOLUME /var/lib/postgresql/data
version: "3.9" version: "3.9"
services: services:
aprsc:
build:
context: .
dockerfile: aprsc.dockerfile
ports:
- "10152:10152"
- "14580:14580"
- "10155:10155"
- "14501:14501"
volumes:
- $PWD/config/aprsc.conf:/opt/aprsc/etc/aprsc.conf
collector: collector:
image: 'registry.qoto.org/digipex/hub:latest'
build: build:
context: . context: .
dockerfile: trackdirect-python.dockerfile dockerfile: collector.dockerfile
volumes: volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini - $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
command: /root/trackdirect/server/scripts/collector.sh trackdirect.ini 0
depends_on:
- "db"
- "aprsc"
websocket: websocket:
build: build:
context: . context: .
dockerfile: trackdirect-python.dockerfile dockerfile: websocket.dockerfile
volumes: volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini - $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
command: /root/trackdirect/server/scripts/wsserver.sh trackdirect.ini
ports: ports:
- "9000:9000" - "9000:9000"
depends_on:
- "db"
- "aprsc"
web: web:
build: build:
context: . context: .
dockerfile: trackdirect-apache.dockerfile dockerfile: web.dockerfile
volumes: volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini - $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
- $PWD/heatmaps:/root/trackdirect/htdocs/public/heatmaps - $PWD/heatmaps:/root/trackdirect/htdocs/public/heatmaps
ports: ports:
- "80:80" - "80:80"
depends_on:
- "db"
db:
build:
context: .
dockerfile: db.dockerfile
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: foobar
POSTGRES_DB: trackdirect
volumes:
- $PWD/db:/var/lib/postgresql/data
create table map (
"id" smallint not null,
"name" text not null,
primary key (id)
);
insert into map(id, name) values(1, 'Show on map');
insert into map(id, name) values(2, 'Hide, same position as newer packet');
insert into map(id, name) values(3, 'Hide, duplicate packet');
insert into map(id, name) values(4, 'Hide, failed to find marker id');
insert into map(id, name) values(5, 'Hide, faulty gps position');
insert into map(id, name) values(6, 'Hide, packet received to late');
insert into map(id, name) values(7, 'Hide, moves to fast');
insert into map(id, name) values(8, 'Hide, packet is less than 5 seconds after previous');
insert into map(id, name) values(9, 'Hide, abnormal position');
insert into map(id, name) values(10, 'Hide, has no position');
insert into map(id, name) values(11, 'Hide, unsupported format');
insert into map(id, name) values (12, 'Hide, same position as newer packet (but later date)');
insert into map(id, name) values (13, 'Hide, same position as newer packet (and faulty gps position)');
insert into map(id, name) values (14, 'Hide, killed object/item');
insert into map(id, name) values (15, 'Stealth/No tracking');
insert into map(id, name) values (16, 'Faulty network, APRS packet digipeated by a CWOP-station');
CREATE SEQUENCE marker_seq INCREMENT BY 1 MINVALUE 2;
create table ogn_address_type (
"id" smallint not null,
"name" text not null,
primary key (id)
);
insert into ogn_address_type(id, name) values(1, 'ICAO');
insert into ogn_address_type(id, name) values(2, 'FLARM');
insert into ogn_address_type(id, name) values(3, 'OGN');
create table ogn_aircraft_type (
"id" smallint not null,
"name" text not null,
primary key (id)
);
insert into ogn_aircraft_type(id, name) values(1, 'Glider');
insert into ogn_aircraft_type(id, name) values(2, 'Tow Plane');
insert into ogn_aircraft_type(id, name) values(3, 'Helicopter');
insert into ogn_aircraft_type(id, name) values(4, 'Parachute');
insert into ogn_aircraft_type(id, name) values(5, 'Drop Plane');
insert into ogn_aircraft_type(id, name) values(6, 'Hang Glider');
insert into ogn_aircraft_type(id, name) values(7, 'Para Glider');
insert into ogn_aircraft_type(id, name) values(8, 'Powered Aircraft');
insert into ogn_aircraft_type(id, name) values(9, 'Jet Aircraft');
insert into ogn_aircraft_type(id, name) values(10, 'UFO');
insert into ogn_aircraft_type(id, name) values(11, 'Balloon');
insert into ogn_aircraft_type(id, name) values(12, 'Airship');
insert into ogn_aircraft_type(id, name) values(13, 'UAV');
insert into ogn_aircraft_type(id, name) values(14, '');
insert into ogn_aircraft_type(id, name) values(15, 'Static Object');
create table if not exists ogn_device (
"device_type" text not null,
"device_id" text not null,
"aircraft_model" text not null,
"registration" text not null,
"cn" text not null,
"tracked" text not null,
"identified" text not null,
"ddb_aircraft_type" text not null
);
create table ogn_hidden_station (
"id" bigserial not null,
"hashed_name" text not null,
primary key (id)
);
create index ogn_hidden_station_hashed_name_idx on ogn_hidden_station(hashed_name);
create table packet_type (
"id" smallint not null,
"name" text not null,
primary key (id)
);
insert into packet_type(id, name) values(1, 'position');
insert into packet_type(id, name) values(2, 'direction');
insert into packet_type(id, name) values(3, 'weather');
insert into packet_type(id, name) values(4, 'object');
insert into packet_type(id, name) values(5, 'item');
insert into packet_type(id, name) values(6, 'telemetry');
insert into packet_type(id, name) values(7, 'message');
insert into packet_type(id, name) values(8, 'query');
insert into packet_type(id, name) values(9, 'response');
insert into packet_type(id, name) values(10, 'status');
insert into packet_type(id, name) values(11, 'other');
create table sender (
"id" bigserial not null,
"name" text not null,
primary key (id)
);
create index sender_name_idx on sender(name);
create table source (
"id" smallint not null,
"name" text not null,
primary key (id)
);
insert into source(id, name) values(1, 'APRS');
insert into source(id, name) values(2, 'CWOP');
insert into source(id, name) values(3, 'CBAPRS');
insert into source(id, name) values(4, 'HUBHAB');
insert into source(id, name) values(5, 'OGN');
create table station_type (
"id" smallint not null,
"name" text not null,
primary key (id)
);
insert into station_type(id, name) values(1, 'Station');
insert into station_type(id, name) values(2, 'Object');
create table station (
"id" bigserial not null,
"name" text null,
"latest_sender_id" bigint null,
"station_type_id" smallint not null,
"source_id" smallint not null,
"latest_location_packet_id" bigint null,
"latest_location_packet_timestamp" bigint null,
"latest_location_marker_id" bigint null,
"latest_location_symbol" text null,
"latest_location_symbol_table" text null,
"latest_location_latitude" double precision null,
"latest_location_longitude" double precision null,
"latest_confirmed_packet_id" bigint null,
"latest_confirmed_packet_timestamp" bigint null,
"latest_confirmed_marker_id" bigint null,
"latest_confirmed_symbol" text null,
"latest_confirmed_symbol_table" text null,
"latest_confirmed_latitude" double precision null,
"latest_confirmed_longitude" double precision null,
"latest_packet_id" bigint null,
"latest_packet_timestamp" bigint null,
"latest_weather_packet_id" bigint null,
"latest_weather_packet_timestamp" bigint null,
"latest_weather_packet_comment" text null,
"latest_telemetry_packet_id" bigint null,
"latest_telemetry_packet_timestamp" bigint null,
"latest_ogn_packet_id" bigint null,
"latest_ogn_packet_timestamp" bigint null,
"latest_ogn_sender_address" text null,
"latest_ogn_aircraft_type_id" smallint null,
"latest_ogn_address_type_id" smallint null,
primary key (id),
foreign key(latest_sender_id) references sender(id),
foreign key(station_type_id) references station_type(id),
foreign key(source_id) references source(id),
foreign key(latest_ogn_aircraft_type_id) references ogn_aircraft_type(id),
foreign key(latest_ogn_address_type_id) references ogn_address_type(id)
);
create index station_name_idx on station(name);
create index station_latest_sender_id_idx on station(latest_sender_id);
create index station_pos_timestamp_idx on station(latest_confirmed_latitude, latest_confirmed_longitude, latest_confirmed_packet_timestamp);
create index station_ogn_sender_address_idx on station(latest_ogn_sender_address);
create table station_telemetry_bits (
"id" bigserial not null,
"station_id" bigint null,
"created_ts" bigint default extract(epoch from now()),
"latest_ts" bigint default extract(epoch from now()),
"valid_to_ts" bigint null,
"bits" text null,
"title" text null,
primary key (id),
foreign key(station_id) references station(id)
);
create index station_telemetry_bits_station_id_idx on station_telemetry_bits(station_id, valid_to_ts, latest_ts);
create table station_telemetry_eqns (
"id" bigserial not null,
"station_id" bigint null,
"created_ts" bigint default extract(epoch from now()),
"latest_ts" bigint default extract(epoch from now()),
"valid_to_ts" bigint null,
"a1" real null,
"b1" real null,
"c1" real null,
"a2" real null,
"b2" real null,
"c2" real null,
"a3" real null,
"b3" real null,
"c3" real null,
"a4" real null,
"b4" real null,
"c4" real null,
"a5" real null,
"b5" real null,
"c5" real null,
primary key (id),
foreign key(station_id) references station(id)
);
create index station_telemetry_eqns_station_id_idx on station_telemetry_eqns(station_id, valid_to_ts, latest_ts);
create table station_telemetry_param (
"id" bigserial not null,
"station_id" bigint null,
"created_ts" bigint default extract(epoch from now()),
"latest_ts" bigint default extract(epoch from now()),
"valid_to_ts" bigint null,
"p1" text null,
"p2" text null,
"p3" text null,
"p4" text null,
"p5" text null,
"b1" text null,
"b2" text null,
"b3" text null,
"b4" text null,
"b5" text null,
"b6" text null,
"b7" text null,
"b8" text null,
primary key (id),
foreign key(station_id) references station(id)
);
create index station_telemetry_param_station_id_idx on station_telemetry_param(station_id, valid_to_ts, latest_ts);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment