Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

docker-build-db:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: lowercase github.repository
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: trackdirect-db.dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}-db:latest
ghcr.io/${{ env.IMAGE_NAME }}-db:${{ github.RUN_ID }}

docker-build-apache:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: lowercase github.repository
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: trackdirect-apache.dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}-apache:latest
ghcr.io/${{ env.IMAGE_NAME }}-apache:${{ github.RUN_ID }}

docker-build-python:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: lowercase github.repository
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: trackdirect-python.dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}-python:latest
ghcr.io/${{ env.IMAGE_NAME }}-python:${{ github.RUN_ID }}

docker-build-aprsc:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: lowercase github.repository
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: trackdirect-aprsc.dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}-aprsc:latest
ghcr.io/${{ env.IMAGE_NAME }}-aprsc:${{ github.RUN_ID }}

docker-build-cron:
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: lowercase github.repository
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- name: Build and push
uses: docker/build-push-action@v6
with:
file: trackdirect-cron.dockerfile
push: true
tags: |
ghcr.io/${{ env.IMAGE_NAME }}-cron:latest
ghcr.io/${{ env.IMAGE_NAME }}-cron:${{ github.RUN_ID }}
2 changes: 1 addition & 1 deletion htdocs/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/mapbox-gl-leaflet/0.0.15/leaflet-mapbox-gl.min.js"></script>
<?php endif; ?>

<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-providers/1.11.0/leaflet-providers.min.js" integrity="sha512-TO+Wd5hbpDsACTmvzSqAZL83jMQCXGRFNoS4WZxcxrlJBTdgMYaT7g5uX49C5+Kbuxzlg2A+TFJ6UqdsXuOKLw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-providers/1.13.0/leaflet-providers.min.js" integrity="sha512-5EYsvqNbFZ8HX60keFbe56Wr0Mq5J1RrA0KdVcfGDhnjnzIRsDrT/S3cxdzpVN2NGxAB9omgqnlh4/06TvWCMw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.heat/0.2.0/leaflet-heat.js" integrity="sha512-KhIBJeCI4oTEeqOmRi2gDJ7m+JARImhUYgXWiOTIp9qqySpFUAJs09erGKem4E5IPuxxSTjavuurvBitBmwE0w==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OverlappingMarkerSpiderfier-Leaflet/0.2.6/oms.min.js" integrity="sha512-V8RRDnS4BZXrat3GIpnWx+XNYBHQGdK6nKOzMpX4R0hz9SPWt7fltGmmyGzUkVFZUQODO1rE+SWYJJkw3SYMhg==" crossorigin="anonymous"></script>
<?php endif; ?>
Expand Down
17 changes: 9 additions & 8 deletions server/bin/remover.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def validate_config_file(config_file):
print("\nUsage: script.py [config.ini]")
sys.exit()

def drop_table_if_exists(cursor, table_name, logger):
if DatabaseObjectFinder.check_table_exists(table_name):
def drop_table_if_exists(cursor, dbobjfinder, table_name, logger):
if dbobjfinder.check_table_exists(table_name):
cursor.execute(f"DROP TABLE {table_name}")
logger.info(f"Dropped table {table_name}")

Expand Down Expand Up @@ -99,24 +99,24 @@ def main():
prev_day = datetime.date.today() - datetime.timedelta(x)
prev_day_format = prev_day.strftime('%Y%m%d')
packet_table = f"packet{prev_day_format}_weather"
drop_table_if_exists(cursor, packet_table, logger)
drop_table_if_exists(cursor,track_direct_db_object_finder, packet_table, logger)

# Drop packet_telemetry
for x in range(max_days_to_save_telemetry_data, max_days_to_save_telemetry_data + 100):
prev_day = datetime.date.today() - datetime.timedelta(x)
prev_day_format = prev_day.strftime('%Y%m%d')
packet_table = f"packet{prev_day_format}_telemetry"
drop_table_if_exists(cursor, packet_table, logger)
drop_table_if_exists(cursor,track_direct_db_object_finder, packet_table, logger)

# Drop packets
for x in range(max_days_to_save_position_data, max_days_to_save_position_data + 100):
prev_day = datetime.date.today() - datetime.timedelta(x)
prev_day_format = prev_day.strftime('%Y%m%d')
packet_table = f"packet{prev_day_format}"

drop_table_if_exists(cursor, f"{packet_table}_ogn", logger)
drop_table_if_exists(cursor, f"{packet_table}_path", logger)
drop_table_if_exists(cursor, packet_table, logger)
drop_table_if_exists(cursor, track_direct_db_object_finder, f"{packet_table}_ogn", logger)
drop_table_if_exists(cursor, track_direct_db_object_finder, f"{packet_table}_path", logger)
drop_table_if_exists(cursor, track_direct_db_object_finder, packet_table, logger)

# Delete old stations
timestamp_limit = int(time.time()) - (60 * 60 * 24 * max_days_to_save_station_data)
Expand Down Expand Up @@ -181,4 +181,5 @@ def main():
logger.error(e, exc_info=1)

if __name__ == '__main__':
main()
main()

2 changes: 1 addition & 1 deletion trackdirect-apache.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-apache
FROM php:8.4.8-apache

RUN apt-get update && apt-get install -y \
git \
Expand Down
2 changes: 1 addition & 1 deletion trackdirect-aprsc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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 noble main" >> /etc/apt/sources.list
RUN printf "deb [trusted=yes] http://aprsc-dist.he.fi/aprsc/apt noble main" >> /etc/apt/sources.list
RUN gpg --keyserver keyserver.ubuntu.com --recv C51AA22389B5B74C3896EF3CA72A581E657A2B8D
RUN gpg --export C51AA22389B5B74C3896EF3CA72A581E657A2B8D | apt-key add -

Expand Down
4 changes: 2 additions & 2 deletions trackdirect-db.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM postgres
FROM postgres:17
COPY misc/database/tables/* /docker-entrypoint-initdb.d/
COPY config/postgresql.conf /etc/postgresql.conf
RUN chown :999 /etc/postgresql.conf
RUN chmod 770 /etc/postgresql.conf
RUN chmod g+s /etc/postgresql.conf
VOLUME /var/lib/postgresql/data
VOLUME /var/lib/postgresql/data