diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 299af7d..e2df053 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -46,11 +46,12 @@ jobs: tracker-helper: image: gitea.futureporn.net/futureporn/tracker-helper:latest ports: - - 3000:3000 + - 5063:5063 env: WL_FIFO_PATH: /etc/opentracker/adder.fifo WL_FILE_PATH: /etc/opentracker/whitelist WL_CREDENTIALS: ${{ secrets.WL_CREDENTIALS }} + WL_PORT: 5063 volumes: - /tmp/futureporn/opentracker:/etc/opentracker @@ -74,10 +75,10 @@ jobs: # run: apt-get update && apt-get install -y iputils-ping postgresql - name: tracker-helper service check (localhost) - run: curl http://localhost:3000/health + run: curl http://localhost:5063/health - name: tracker-helper service check - run: curl http://tracker-helper:3000/health + run: curl http://tracker-helper:5063/health # - name: Check opentracker pingability # run: ping -c 3 opentracker diff --git a/devbox.json b/devbox.json index 8bd1a46..297a4ae 100644 --- a/devbox.json +++ b/devbox.json @@ -28,9 +28,6 @@ "pip install -r requirements.txt" ], "scripts": { - "test": [ - "echo \"Error: no test specified\" && exit 1" - ], "tunnel": "dotenvx run -f ./.kamal/secrets.development -- chisel client bright.fp.sbtp.xyz:9090 R:4000", "backup": "docker exec -t postgres_db pg_dumpall -c -U postgres > ./backups/dev_`date +%Y-%m-%d_%H_%M_%S`.sql", "act": "act -W ./.gitea/workflows --secret-file .kamal/secrets.development", @@ -38,7 +35,8 @@ "bright:compile:watch2": "cd ./apps/bright && pnpx chokidar-cli \"**/*\" -i \"deps/**\" -i \"_build/**\" -c \"mix compile --warnings-as-errors\"", "bright:dev": "cd ./apps/bright && dotenvx run -f ../../.kamal/secrets.development -e MIX_ENV=dev -- mix phx.server", "bright:test:unit:watch": "cd ./apps/bright && pnpx chokidar-cli '**/*' -i \"deps/**\" -i '_build/**' -c 'mix test --only=unit'", - "bright:act": "cd ./apps/bright && act --env MIX_ENV=test -W ./.gitea/workflows/tests.yaml --secret-file .kamal/secrets.development" + "bright:act": "cd ./apps/bright && act --env MIX_ENV=test -W ./.gitea/workflows/tests.yaml --secret-file .kamal/secrets.development", + "test": "act -W ./.gitea/workflows/tests.yaml --secret-file .kamal/secrets.development && beep || boop" } } } \ No newline at end of file diff --git a/services/tracker-helper/Dockerfile b/services/tracker-helper/Dockerfile index 5aaac52..fc8861e 100644 --- a/services/tracker-helper/Dockerfile +++ b/services/tracker-helper/Dockerfile @@ -35,5 +35,5 @@ COPY --from=prerelease /usr/src/app/package.json . # run the app USER bun -EXPOSE 3000/tcp +EXPOSE 5063/tcp ENTRYPOINT [ "bun", "run", "index.ts" ] \ No newline at end of file diff --git a/services/tracker-helper/README.md b/services/tracker-helper/README.md index cc130f8..4033887 100644 --- a/services/tracker-helper/README.md +++ b/services/tracker-helper/README.md @@ -27,4 +27,4 @@ tracker-helper unit & integration tests are run during the docker build. That st When validating the container before pushing to production, it can be run as follows - dotenvx run -f ../../.kamal/secrets.production -- docker run -it --init --rm -p 3000:3000 -e WL_CREDENTIALS -e WL_FILE_PATH -e WL_FIFO_PATH fp/tracker-helper \ No newline at end of file + dotenvx run -f ../../.kamal/secrets.production -- docker run -it --init --rm -p 5063:5063 -e WL_CREDENTIALS -e WL_FILE_PATH -e WL_FIFO_PATH fp/tracker-helper \ No newline at end of file diff --git a/services/tracker-helper/index.ts b/services/tracker-helper/index.ts index 14a53b1..0c26750 100644 --- a/services/tracker-helper/index.ts +++ b/services/tracker-helper/index.ts @@ -1,4 +1,4 @@ import app from './app.ts' -const port = process.env.PORT || 3000 +const port = process.env.WL_PORT || 5063 app.listen(port) \ No newline at end of file diff --git a/services/tracker-helper/package.json b/services/tracker-helper/package.json index f51a2df..9d1aa01 100644 --- a/services/tracker-helper/package.json +++ b/services/tracker-helper/package.json @@ -17,7 +17,7 @@ }, "scripts": { "docker.build": "dotenvx run -f ../../.kamal/secrets.testing -- docker build --secret id=WL_CREDENTIALS -t gitea.futureporn.net/futureporn/tracker-helper:latest .", - "docker.run": "dotenvx run -f ../../.kamal/secrets.development -- docker run -e WL_CREDENTIALS -p 3000:3000 -t gitea.futureporn.net/futureporn/tracker-helper:latest", + "docker.run": "dotenvx run -f ../../.kamal/secrets.development -- docker run -e WL_CREDENTIALS -p 5063:5063 -t gitea.futureporn.net/futureporn/tracker-helper:latest", "docker.push": "docker push gitea.futureporn.net/futureporn/tracker-helper:latest" } } \ No newline at end of file