From b527779919160d3d98c8420b166859b7aec60c74 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 14 Jun 2025 18:44:05 +0200 Subject: [PATCH 01/26] Prod modifications --- .env | 4 ++-- .github/workflows/releases.yml | 3 +-- aperisolve/app.py | 5 +++++ docker-compose.yml | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.env b/.env index bdea06b..68b1939 100644 --- a/.env +++ b/.env @@ -3,8 +3,8 @@ MAX_PENDING_TIME=600 MAX_STORE_TIME=259200 FLASK_DEBUG=0 FLASK_ENV=production -DB_URI=postgresql://aperiuser:aperipass@postgres:5432/aperisolve +DB_URI=postgresql://aperiuser:iacyANdLeUREonIuMPorpHySTaIsHEAn@postgres:5432/aperisolve RQ_DASHBOARD_REDIS_URL=redis://redis:6379/0 POSTGRES_DB=aperisolve POSTGRES_USER=aperiuser -POSTGRES_PASSWORD=aperipass \ No newline at end of file +POSTGRES_PASSWORD=iacyANdLeUREonIuMPorpHySTaIsHEAn \ No newline at end of file diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 6d780f8..42b1404 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -39,6 +39,5 @@ jobs: context: ./ push: true tags: | - ghcr.io/${{ env.lower_actor }}/aperisolve:latest - ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} + ghcr.io/${{ env.lower_actor }}/aperisolve:prod \ No newline at end of file diff --git a/aperisolve/app.py b/aperisolve/app.py index c409c11..2d4e924 100644 --- a/aperisolve/app.py +++ b/aperisolve/app.py @@ -246,6 +246,11 @@ def get_image( return send_file(output_file, as_attachment=True) +@app.route("/ads.txt") +def google_ads() -> str: + return "google.com, pub-2324718887045017, DIRECT, f08c47fec0942fa0" + + if __name__ == "__main__": debug_mode = os.environ.get("FLASK_DEBUG", "false").lower() == "true" app.run(host="0.0.0.0", port=5000, debug=debug_mode) diff --git a/docker-compose.yml b/docker-compose.yml index 777fef2..f1349a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ services: web: - image: ghcr.io/zeecka/aperisolve:latest + image: ghcr.io/zeecka/aperisolve:prod #build: . container_name: aperisolve-web restart: always ports: - - "5000:5000" + - "80:5000" volumes: - apresults:/aperisolve/results depends_on: @@ -19,7 +19,7 @@ services: - .env worker: - image: ghcr.io/zeecka/aperisolve:latest + image: ghcr.io/zeecka/aperisolve:prod #build: . container_name: aperisolve-worker restart: always From b1dfa305d3926505ea76305964b7a61c0717c9bc Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 14 Jun 2025 18:48:32 +0200 Subject: [PATCH 02/26] Fix linters --- aperisolve/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aperisolve/app.py b/aperisolve/app.py index 2d4e924..9b4993b 100644 --- a/aperisolve/app.py +++ b/aperisolve/app.py @@ -31,7 +31,8 @@ queue = Queue(connection=redis_conn) @app.errorhandler(413) -def too_large(e): +def too_large(_) -> tuple[Response, int]: + """Error Handler for Max File Size.""" return jsonify({"error": "Image size exceeded"}), 413 @@ -248,6 +249,7 @@ def get_image( @app.route("/ads.txt") def google_ads() -> str: + """Google Ads required file""" return "google.com, pub-2324718887045017, DIRECT, f08c47fec0942fa0" From 277fbe7deaf74bfabe85e1a865c20fd687f01f08 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 14 Jun 2025 18:52:38 +0200 Subject: [PATCH 03/26] Fix MyPy --- aperisolve/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aperisolve/app.py b/aperisolve/app.py index 9b4993b..6e71f74 100644 --- a/aperisolve/app.py +++ b/aperisolve/app.py @@ -6,7 +6,7 @@ import os import time from datetime import datetime, timezone from pathlib import Path -from typing import Optional +from typing import Any, Optional from flask import Flask, Response, abort, jsonify, render_template, request, send_file from redis import Redis @@ -31,7 +31,7 @@ queue = Queue(connection=redis_conn) @app.errorhandler(413) -def too_large(_) -> tuple[Response, int]: +def too_large(_: Any) -> tuple[Response, int]: """Error Handler for Max File Size.""" return jsonify({"error": "Image size exceeded"}), 413 From b610ff6e4c13d5df8e51f6620f13e5f5c680df99 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 14 Jun 2025 20:11:38 +0200 Subject: [PATCH 04/26] Add Google script.js --- aperisolve/templates/base.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aperisolve/templates/base.html b/aperisolve/templates/base.html index 5ec42eb..5ebc34b 100644 --- a/aperisolve/templates/base.html +++ b/aperisolve/templates/base.html @@ -9,6 +9,8 @@ + From d8b680ee2f9c1208fb80e357f644749c135d2e7a Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sat, 14 Jun 2025 20:24:11 +0200 Subject: [PATCH 05/26] Fix max size bug --- aperisolve/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aperisolve/app.py b/aperisolve/app.py index 6e71f74..a66cf9e 100644 --- a/aperisolve/app.py +++ b/aperisolve/app.py @@ -20,7 +20,9 @@ app: Flask = Flask(__name__) app.json.sort_keys = False # type: ignore app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("DB_URI") app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False -app.config["MAX_CONTENT_LENGTH"] = os.environ.get("MAX_CONTENT_LENGTH") +app.config["MAX_CONTENT_LENGTH"] = int( + os.environ.get("MAX_CONTENT_LENGTH", 1024 * 1024) +) RESULT_FOLDER.mkdir(parents=True, exist_ok=True) From 0b86966b648728ab938922e58cb9d588c4bb7458 Mon Sep 17 00:00:00 2001 From: Zeecka <24873615+Zeecka@users.noreply.github.com> Date: Fri, 26 Dec 2025 12:39:58 +0100 Subject: [PATCH 06/26] Fix error handling in exiftool.py output --- aperisolve/analyzers/exiftool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aperisolve/analyzers/exiftool.py b/aperisolve/analyzers/exiftool.py index 136931d..23ec7bd 100644 --- a/aperisolve/analyzers/exiftool.py +++ b/aperisolve/analyzers/exiftool.py @@ -20,7 +20,7 @@ def analyze_exiftool(input_img: Path, output_dir: Path) -> None: if data.stderr: update_data( - output_dir, {"strings": {"status": "error", "error": data.stderr}} + output_dir, {"exiftool": {"status": "error", "error": data.stderr}} ) return From caa5289ffd1f06d88f3b4804ee98296cc6d2ccff Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 18:26:39 +0100 Subject: [PATCH 07/26] fix conflicts --- .env | 10 ---------- .github/workflows/releases.yml | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 68b1939..0000000 --- a/.env +++ /dev/null @@ -1,10 +0,0 @@ -MAX_CONTENT_LENGTH=1048576 -MAX_PENDING_TIME=600 -MAX_STORE_TIME=259200 -FLASK_DEBUG=0 -FLASK_ENV=production -DB_URI=postgresql://aperiuser:iacyANdLeUREonIuMPorpHySTaIsHEAn@postgres:5432/aperisolve -RQ_DASHBOARD_REDIS_URL=redis://redis:6379/0 -POSTGRES_DB=aperisolve -POSTGRES_USER=aperiuser -POSTGRES_PASSWORD=iacyANdLeUREonIuMPorpHySTaIsHEAn \ No newline at end of file diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 42b1404..561cabc 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -10,22 +10,24 @@ jobs: docker-releases: runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') && (github.ref_name == 'main' || github.ref_name == 'prod') + steps: - name: Get release version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - + - name: downcase username run: echo "lower_actor=${GITHUB_ACTOR,,}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -33,11 +35,21 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Determine latest tag + run: | + if [[ "${GITHUB_REF_NAME}" == "main" ]]; then + echo "LATEST_TAG=latest" >> $GITHUB_ENV + elif [[ "${GITHUB_REF_NAME}" == "prod" ]]; then + echo "LATEST_TAG=latest-prod" >> $GITHUB_ENV + else + echo "LATEST_TAG=" >> $GITHUB_ENV + fi + - name: Build and push Docker images uses: docker/build-push-action@v6.9.0 with: context: ./ push: true tags: | - ghcr.io/${{ env.lower_actor }}/aperisolve:prod - \ No newline at end of file + ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} + ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.LATEST_TAG }} From 00f63fd3413d11d43c97bf4f848292a52e8bf452 Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 18:31:19 +0100 Subject: [PATCH 08/26] Fix release job --- .github/workflows/releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 561cabc..bada2f7 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -10,7 +10,7 @@ jobs: docker-releases: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') && (github.ref_name == 'main' || github.ref_name == 'prod') + if: startsWith(github.ref, 'refs/tags/') && (github.ref_name == 'main' || github.ref_name == 'prod') steps: - name: Get release version From 2bdc99c8d9c1fc670dd6ff640777f06e020ce69d Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 18:42:51 +0100 Subject: [PATCH 09/26] Fix release job --- .github/workflows/releases.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index bada2f7..139bfec 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -10,7 +10,6 @@ jobs: docker-releases: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') && (github.ref_name == 'main' || github.ref_name == 'prod') steps: - name: Get release version From 0756a91c2ead7050f827cf5b21c57f95cb80093d Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 19:03:44 +0100 Subject: [PATCH 10/26] Fix release job --- .github/workflows/deployement.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deployement.yml b/.github/workflows/deployement.yml index cb0efdc..3915f8d 100644 --- a/.github/workflows/deployement.yml +++ b/.github/workflows/deployement.yml @@ -6,19 +6,40 @@ on: - Docker Image CI types: - completed - branches: - - prod # Only triggers for tags in the production branch jobs: - deploy: - # Deploys only if the build was successfuli + check-and-deploy: if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest environment: production steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_sha }} + fetch-depth: 0 + + - name: Check if tag is from prod branch + id: check + run: | + TAG_REF="${{ github.event.workflow_run.head_branch }}" + echo "Tag/Branch: $TAG_REF" + + # Récupère les branches contenant ce commit + BRANCHES=$(git branch -r --contains ${{ github.event.workflow_run.head_sha }}) + echo "Branches containing this commit: $BRANCHES" + + if echo "$BRANCHES" | grep -q "origin/prod"; then + echo "is_prod=true" >> $GITHUB_OUTPUT + echo "✅ Tag is from prod branch - will deploy" + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "❌ Tag is not from prod branch - skipping deployment" + fi + - name: Deploy to production server + if: steps.check.outputs.is_prod == 'true' uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.PROD_SSH_HOST }} From 26022acb605f8c40b950bd12a1564ad8115c00f4 Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 19:14:58 +0100 Subject: [PATCH 11/26] Fix release job --- .github/workflows/deployement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployement.yml b/.github/workflows/deployement.yml index 3915f8d..9bc4342 100644 --- a/.github/workflows/deployement.yml +++ b/.github/workflows/deployement.yml @@ -11,7 +11,7 @@ jobs: check-and-deploy: if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest - environment: production + environment: prod steps: - name: Checkout From 8cb3639d370af218ae8f080536dd306f9e93eb17 Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 23:41:58 +0100 Subject: [PATCH 12/26] Github CD --- .github/workflows/deployement.yml | 36 +++---------------- .../workflows/{releases.yml => release.yml} | 21 +---------- 2 files changed, 5 insertions(+), 52 deletions(-) rename .github/workflows/{releases.yml => release.yml} (54%) diff --git a/.github/workflows/deployement.yml b/.github/workflows/deployement.yml index 9bc4342..53a4f1c 100644 --- a/.github/workflows/deployement.yml +++ b/.github/workflows/deployement.yml @@ -1,45 +1,17 @@ name: Deploy to production on: - workflow_run: - workflows: - - Docker Image CI - types: - - completed + push: + tags: + - '*' jobs: - check-and-deploy: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + deploy: runs-on: ubuntu-latest environment: prod steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_sha }} - fetch-depth: 0 - - - name: Check if tag is from prod branch - id: check - run: | - TAG_REF="${{ github.event.workflow_run.head_branch }}" - echo "Tag/Branch: $TAG_REF" - - # Récupère les branches contenant ce commit - BRANCHES=$(git branch -r --contains ${{ github.event.workflow_run.head_sha }}) - echo "Branches containing this commit: $BRANCHES" - - if echo "$BRANCHES" | grep -q "origin/prod"; then - echo "is_prod=true" >> $GITHUB_OUTPUT - echo "✅ Tag is from prod branch - will deploy" - else - echo "is_prod=false" >> $GITHUB_OUTPUT - echo "❌ Tag is not from prod branch - skipping deployment" - fi - - name: Deploy to production server - if: steps.check.outputs.is_prod == 'true' uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.PROD_SSH_HOST }} diff --git a/.github/workflows/releases.yml b/.github/workflows/release.yml similarity index 54% rename from .github/workflows/releases.yml rename to .github/workflows/release.yml index cd82718..a1b2803 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/release.yml @@ -18,25 +18,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 # required to verify branch - - - name: Check which branch the tag belongs to - id: check_branch - run: | - # Trouve les branches qui contiennent ce tag - BRANCHES=$(git branch -r --contains ${{ github.ref }}) - - if echo "$BRANCHES" | grep -q "origin/main"; then - echo "branch=main" >> $GITHUB_OUTPUT - echo "LATEST_TAG=latest" >> $GITHUB_ENV - elif echo "$BRANCHES" | grep -q "origin/prod"; then - echo "branch=prod" >> $GITHUB_OUTPUT - echo "LATEST_TAG=latest-prod" >> $GITHUB_ENV - else - echo "branch=other" >> $GITHUB_OUTPUT - echo "LATEST_TAG=" >> $GITHUB_ENV - fi - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -58,4 +39,4 @@ jobs: push: true tags: | ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} - ${{ env.LATEST_TAG && format('ghcr.io/{0}/aperisolve:{1}', env.lower_actor, env.LATEST_TAG) || '' }} + ghcr.io/${{ env.lower_actor }}/aperisolve:latest-prod From 80622f218fff4133ceff1c41a7b9cc30b84ffe3e Mon Sep 17 00:00:00 2001 From: Zeecka Date: Sun, 4 Jan 2026 23:52:17 +0100 Subject: [PATCH 13/26] Check prod --- .github/workflows/deployement.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/deployement.yml b/.github/workflows/deployement.yml index 53a4f1c..53dbae1 100644 --- a/.github/workflows/deployement.yml +++ b/.github/workflows/deployement.yml @@ -6,7 +6,31 @@ on: - '*' jobs: + check-branch: + runs-on: ubuntu-latest + outputs: + is_prod: ${{ steps.check.outputs.is_prod }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if tag is from prod branch + id: check + run: | + BRANCHES=$(git branch -r --contains ${{ github.ref }}) + if echo "$BRANCHES" | grep -q "origin/prod"; then + echo "is_prod=true" >> $GITHUB_OUTPUT + echo "✅ Tag is from prod branch" + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "❌ Tag is NOT from prod branch - skipping deployment" + fi + deploy: + needs: check-branch + if: needs.check-branch.outputs.is_prod == 'true' runs-on: ubuntu-latest environment: prod From 08c85ccf0b12d7cc98d61bbed50810dbe84c0f8e Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:13:48 +0530 Subject: [PATCH 14/26] Add deployment steps to release workflow with prod branch check --- .github/workflows/release.yml | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b866453..1fb15c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,3 +40,84 @@ jobs: tags: | ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} ghcr.io/${{ env.lower_actor }}/aperisolve:latest + + deploy: + runs-on: ubuntu-latest + needs: docker-releases + environment: prod + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if tag is from prod branch + id: check + run: | + TAG_REF="${GITHUB_REF#refs/tags/}" + echo "Tag: $TAG_REF" + + # Get branches containing this commit + BRANCHES=$(git branch -r --contains HEAD) + echo "Branches containing this commit: $BRANCHES" + + if echo "$BRANCHES" | grep -q "origin/prod"; then + echo "is_prod=true" >> $GITHUB_OUTPUT + echo "✅ Tag is from prod branch - will deploy" + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "❌ Tag is not from prod branch - skipping deployment" + fi + + # wait for 30 seconds + - name: Wait for image propagation + if: steps.check.outputs.is_prod == 'true' + run: | + echo "Waiting 30 seconds for image to propagate in registry..." + sleep 30 + + - name: Deploy to production server + if: steps.check.outputs.is_prod == 'true' + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.PROD_SSH_HOST }} + username: ${{ secrets.PROD_SSH_USER }} + key: ${{ secrets.PROD_SSH_KEY }} + script: | + set -e + cd /root/AperiSolve + + # update code + git pull + + # create .env + cat < .env + MAX_CONTENT_LENGTH=${{ vars.MAX_CONTENT_LENGTH }} + MAX_PENDING_TIME=${{ vars.MAX_PENDING_TIME }} + MAX_STORE_TIME=${{ vars.MAX_STORE_TIME }} + CLEAR_AT_RESTART=${{ vars.CLEAR_AT_RESTART }} + SKIP_IHDR_FILL=${{ vars.SKIP_IHDR_FILL }} + + FLASK_DEBUG=${{ vars.FLASK_DEBUG }} + FLASK_ENV=${{ vars.FLASK_ENV }} + + RQ_DASHBOARD_REDIS_URL=${{ secrets.REDIS_URL }} + + POSTGRES_USER=${{ secrets.POSTGRES_USER }} + POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_DB=${{ secrets.POSTGRES_DB }} + DB_URI=${{ secrets.DATABASE_URL }} + + SENTRY_DSN=${{ secrets.SENTRY_DSN }} + SENTRY_TRACES_SAMPLE_RATE=${{ secrets.SENTRY_TRACES_SAMPLE_RATE }} + SENTRY_PROFILES_SAMPLE_RATE=${{ secrets.SENTRY_PROFILES_SAMPLE_RATE }} + SENTRY_RELEASE=${{ secrets.SENTRY_RELEASE }} + SENTRY_ENVIRONMENT=${{ secrets.SENTRY_ENVIRONMENT }} + EOF + + # Pull images and deploy + docker compose pull + docker compose down + docker compose up -d + docker image prune -f From 68b8707e3a3ed0d8b257b850a817996a72b8927a Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:23:12 +0530 Subject: [PATCH 15/26] Remove Docker CI workflow and add test deploy logic workflow to test --- .github/workflows/release.yml | 123 ------------------------------ .github/workflows/releasetest.yml | 43 +++++++++++ 2 files changed, 43 insertions(+), 123 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/releasetest.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1fb15c4..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Docker Image CI - -on: - push: - tags: - - '*' - -jobs: - docker-releases: - runs-on: ubuntu-latest - - steps: - - name: Get release version - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - - name: Downcase username - run: echo "lower_actor=${GITHUB_ACTOR,,}" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push Docker images - uses: docker/build-push-action@v6.9.0 - with: - context: ./ - push: true - tags: | - ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} - ghcr.io/${{ env.lower_actor }}/aperisolve:latest - - deploy: - runs-on: ubuntu-latest - needs: docker-releases - environment: prod - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check if tag is from prod branch - id: check - run: | - TAG_REF="${GITHUB_REF#refs/tags/}" - echo "Tag: $TAG_REF" - - # Get branches containing this commit - BRANCHES=$(git branch -r --contains HEAD) - echo "Branches containing this commit: $BRANCHES" - - if echo "$BRANCHES" | grep -q "origin/prod"; then - echo "is_prod=true" >> $GITHUB_OUTPUT - echo "✅ Tag is from prod branch - will deploy" - else - echo "is_prod=false" >> $GITHUB_OUTPUT - echo "❌ Tag is not from prod branch - skipping deployment" - fi - - # wait for 30 seconds - - name: Wait for image propagation - if: steps.check.outputs.is_prod == 'true' - run: | - echo "Waiting 30 seconds for image to propagate in registry..." - sleep 30 - - - name: Deploy to production server - if: steps.check.outputs.is_prod == 'true' - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.PROD_SSH_HOST }} - username: ${{ secrets.PROD_SSH_USER }} - key: ${{ secrets.PROD_SSH_KEY }} - script: | - set -e - cd /root/AperiSolve - - # update code - git pull - - # create .env - cat < .env - MAX_CONTENT_LENGTH=${{ vars.MAX_CONTENT_LENGTH }} - MAX_PENDING_TIME=${{ vars.MAX_PENDING_TIME }} - MAX_STORE_TIME=${{ vars.MAX_STORE_TIME }} - CLEAR_AT_RESTART=${{ vars.CLEAR_AT_RESTART }} - SKIP_IHDR_FILL=${{ vars.SKIP_IHDR_FILL }} - - FLASK_DEBUG=${{ vars.FLASK_DEBUG }} - FLASK_ENV=${{ vars.FLASK_ENV }} - - RQ_DASHBOARD_REDIS_URL=${{ secrets.REDIS_URL }} - - POSTGRES_USER=${{ secrets.POSTGRES_USER }} - POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} - POSTGRES_DB=${{ secrets.POSTGRES_DB }} - DB_URI=${{ secrets.DATABASE_URL }} - - SENTRY_DSN=${{ secrets.SENTRY_DSN }} - SENTRY_TRACES_SAMPLE_RATE=${{ secrets.SENTRY_TRACES_SAMPLE_RATE }} - SENTRY_PROFILES_SAMPLE_RATE=${{ secrets.SENTRY_PROFILES_SAMPLE_RATE }} - SENTRY_RELEASE=${{ secrets.SENTRY_RELEASE }} - SENTRY_ENVIRONMENT=${{ secrets.SENTRY_ENVIRONMENT }} - EOF - - # Pull images and deploy - docker compose pull - docker compose down - docker compose up -d - docker image prune -f diff --git a/.github/workflows/releasetest.yml b/.github/workflows/releasetest.yml new file mode 100644 index 0000000..71a3fa2 --- /dev/null +++ b/.github/workflows/releasetest.yml @@ -0,0 +1,43 @@ +name: Test Deploy Logic + +on: + push: + tags: + - '*' + +jobs: + test-deploy-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if tag is from prod branch + id: check + run: | + TAG_REF="${GITHUB_REF#refs/tags/}" + echo "Tag: $TAG_REF" + echo "GITHUB_SHA: $GITHUB_SHA" + + # Get branches containing this commit + BRANCHES=$(git branch -r --contains HEAD) + echo "Branches containing this commit: $BRANCHES" + + if echo "$BRANCHES" | grep -q "origin/prod"; then + echo "is_prod=true" >> $GITHUB_OUTPUT + echo "✅ Tag is from prod branch - will deploy" + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "❌ Tag is not from prod branch - skipping deployment" + fi + + - name: Would Deploy + if: steps.check.outputs.is_prod == 'true' + run: echo "🚀 DEPLOYMENT WOULD HAPPEN HERE" + + - name: Would Skip + if: steps.check.outputs.is_prod != 'true' + run: echo "⏭️ DEPLOYMENT SKIPPED" \ No newline at end of file From 86f9f6edd0b5d1f168251f8d67fdd7ec27f312ab Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:27:13 +0530 Subject: [PATCH 16/26] Update tag check to use prod-test branch for deployment logic --- .github/workflows/releasetest.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/releasetest.yml b/.github/workflows/releasetest.yml index 71a3fa2..4423d2f 100644 --- a/.github/workflows/releasetest.yml +++ b/.github/workflows/releasetest.yml @@ -26,12 +26,13 @@ jobs: BRANCHES=$(git branch -r --contains HEAD) echo "Branches containing this commit: $BRANCHES" - if echo "$BRANCHES" | grep -q "origin/prod"; then + # Using prod-test for testing (change to origin/prod in production) + if echo "$BRANCHES" | grep -q "origin/prod-test"; then echo "is_prod=true" >> $GITHUB_OUTPUT - echo "✅ Tag is from prod branch - will deploy" + echo "✅ Tag is from prod-test branch - will deploy" else echo "is_prod=false" >> $GITHUB_OUTPUT - echo "❌ Tag is not from prod branch - skipping deployment" + echo "❌ Tag is not from prod-test branch - skipping deployment" fi - name: Would Deploy From 41b365f364629d5794b7dafd542d1e1dab01446d Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:35:34 +0530 Subject: [PATCH 17/26] Add test message for CI/CD pipeline validation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5138792..140588e 100644 --- a/README.md +++ b/README.md @@ -90,3 +90,5 @@ Thanks to contributors: Thanks to the open-source community: [binwalk](https://github.com/ReFirmLabs/binwalk), [exiftool](https://exiftool.org/), [foremost](https://foremost.sourceforge.net/), [openstego](https://www.openstego.com/), [outguess](https://www.rbcafe.com/software/outguess/), [pngcheck](https://www.libpng.org/pub/png/apps/pngcheck.html), [steghide](https://steghide.sourceforge.net/), [strings](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/strings.html), [zsteg](https://github.com/zed-0xff/zsteg), ... + +acpx1337 cicd test from non prod branch ( this should fail hopefully ) From 1f9494c3acf1604bda5ceaf991ea44ca23ed71c4 Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:45:10 +0530 Subject: [PATCH 18/26] Add HEAD check to prevent deployment on shared commits --- .github/workflows/release.yml | 138 ++++++++++++++++++++++++++++++ .github/workflows/releasetest.yml | 19 +++- 2 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ee22ce0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,138 @@ +name: Docker Image CI + +on: + push: + tags: + - '*' + +jobs: + docker-releases: + runs-on: ubuntu-latest + + steps: + - name: Get release version + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Downcase username + run: echo "lower_actor=${GITHUB_ACTOR,,}" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker images + uses: docker/build-push-action@v6.9.0 + with: + context: ./ + push: true + tags: | + ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} + ghcr.io/${{ env.lower_actor }}/aperisolve:latest + + deploy: + runs-on: ubuntu-latest + needs: docker-releases + environment: prod + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if tag is from prod branch + id: check + run: | + TAG_REF="${GITHUB_REF#refs/tags/}" + echo "Tag: $TAG_REF" + echo "Commit SHA: $GITHUB_SHA" + + # Get branches containing this commit + BRANCHES=$(git branch -r --contains HEAD) + echo "Branches containing this commit: $BRANCHES" + + # Check if commit is on prod branch + if echo "$BRANCHES" | grep -q "origin/prod"; then + # Additional check: ensure this commit is at the HEAD of prod + # This prevents deployment if the same commit exists on multiple branches + PROD_HEAD=$(git rev-parse origin/prod) + TAG_COMMIT=$(git rev-parse HEAD) + + echo "Prod HEAD: $PROD_HEAD" + echo "Tag commit: $TAG_COMMIT" + + if [ "$PROD_HEAD" = "$TAG_COMMIT" ]; then + echo "is_prod=true" >> $GITHUB_OUTPUT + echo "✅ Tag is at prod branch HEAD - will deploy" + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "⚠️ Commit is on prod but not at HEAD - skipping deployment" + fi + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "❌ Tag is not from prod branch - skipping deployment" + fi + + # wait for 30 seconds + - name: Wait for image propagation + if: steps.check.outputs.is_prod == 'true' + run: | + echo "Waiting 30 seconds for image to propagate in registry..." + sleep 30 + + - name: Deploy to production server + if: steps.check.outputs.is_prod == 'true' + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.PROD_SSH_HOST }} + username: ${{ secrets.PROD_SSH_USER }} + key: ${{ secrets.PROD_SSH_KEY }} + script: | + set -e + cd /root/AperiSolve + + # update code + git pull + + # create .env + cat < .env + MAX_CONTENT_LENGTH=${{ vars.MAX_CONTENT_LENGTH }} + MAX_PENDING_TIME=${{ vars.MAX_PENDING_TIME }} + MAX_STORE_TIME=${{ vars.MAX_STORE_TIME }} + CLEAR_AT_RESTART=${{ vars.CLEAR_AT_RESTART }} + SKIP_IHDR_FILL=${{ vars.SKIP_IHDR_FILL }} + + FLASK_DEBUG=${{ vars.FLASK_DEBUG }} + FLASK_ENV=${{ vars.FLASK_ENV }} + + RQ_DASHBOARD_REDIS_URL=${{ secrets.REDIS_URL }} + + POSTGRES_USER=${{ secrets.POSTGRES_USER }} + POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_DB=${{ secrets.POSTGRES_DB }} + DB_URI=${{ secrets.DATABASE_URL }} + + SENTRY_DSN=${{ secrets.SENTRY_DSN }} + SENTRY_TRACES_SAMPLE_RATE=${{ secrets.SENTRY_TRACES_SAMPLE_RATE }} + SENTRY_PROFILES_SAMPLE_RATE=${{ secrets.SENTRY_PROFILES_SAMPLE_RATE }} + SENTRY_RELEASE=${{ secrets.SENTRY_RELEASE }} + SENTRY_ENVIRONMENT=${{ secrets.SENTRY_ENVIRONMENT }} + EOF + + # Pull images and deploy + docker compose pull + docker compose down + docker compose up -d + docker image prune -f diff --git a/.github/workflows/releasetest.yml b/.github/workflows/releasetest.yml index 4423d2f..c1c0977 100644 --- a/.github/workflows/releasetest.yml +++ b/.github/workflows/releasetest.yml @@ -20,7 +20,7 @@ jobs: run: | TAG_REF="${GITHUB_REF#refs/tags/}" echo "Tag: $TAG_REF" - echo "GITHUB_SHA: $GITHUB_SHA" + echo "Commit SHA: $GITHUB_SHA" # Get branches containing this commit BRANCHES=$(git branch -r --contains HEAD) @@ -28,8 +28,21 @@ jobs: # Using prod-test for testing (change to origin/prod in production) if echo "$BRANCHES" | grep -q "origin/prod-test"; then - echo "is_prod=true" >> $GITHUB_OUTPUT - echo "✅ Tag is from prod-test branch - will deploy" + # Additional check: ensure this commit is at the HEAD of prod-test + # This prevents deployment if the same commit exists on multiple branches + PROD_HEAD=$(git rev-parse origin/prod-test) + TAG_COMMIT=$(git rev-parse HEAD) + + echo "Prod-test HEAD: $PROD_HEAD" + echo "Tag commit: $TAG_COMMIT" + + if [ "$PROD_HEAD" = "$TAG_COMMIT" ]; then + echo "is_prod=true" >> $GITHUB_OUTPUT + echo "✅ Tag is at prod-test branch HEAD - will deploy" + else + echo "is_prod=false" >> $GITHUB_OUTPUT + echo "⚠️ Commit is on prod-test but not at HEAD - skipping deployment" + fi else echo "is_prod=false" >> $GITHUB_OUTPUT echo "❌ Tag is not from prod-test branch - skipping deployment" From a1aef656d3d667504446f745b0c476f898670d90 Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:46:55 +0530 Subject: [PATCH 19/26] Unique commit on cicd --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 140588e..87d7624 100644 --- a/README.md +++ b/README.md @@ -92,3 +92,4 @@ Thanks to the open-source community: [binwalk](https://github.com/ReFirmLabs/binwalk), [exiftool](https://exiftool.org/), [foremost](https://foremost.sourceforge.net/), [openstego](https://www.openstego.com/), [outguess](https://www.rbcafe.com/software/outguess/), [pngcheck](https://www.libpng.org/pub/png/apps/pngcheck.html), [steghide](https://steghide.sourceforge.net/), [strings](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/strings.html), [zsteg](https://github.com/zed-0xff/zsteg), ... acpx1337 cicd test from non prod branch ( this should fail hopefully ) +# test Fri Jan 9 20:46:55 IST 2026 From 2788bf174bbb7c4760eb0794c1cc95b4c7de9259 Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:55:23 +0530 Subject: [PATCH 20/26] Remove test workflow after successful testing --- .github/workflows/releasetest.yml | 57 ------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/releasetest.yml diff --git a/.github/workflows/releasetest.yml b/.github/workflows/releasetest.yml deleted file mode 100644 index c1c0977..0000000 --- a/.github/workflows/releasetest.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Test Deploy Logic - -on: - push: - tags: - - '*' - -jobs: - test-deploy-check: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check if tag is from prod branch - id: check - run: | - TAG_REF="${GITHUB_REF#refs/tags/}" - echo "Tag: $TAG_REF" - echo "Commit SHA: $GITHUB_SHA" - - # Get branches containing this commit - BRANCHES=$(git branch -r --contains HEAD) - echo "Branches containing this commit: $BRANCHES" - - # Using prod-test for testing (change to origin/prod in production) - if echo "$BRANCHES" | grep -q "origin/prod-test"; then - # Additional check: ensure this commit is at the HEAD of prod-test - # This prevents deployment if the same commit exists on multiple branches - PROD_HEAD=$(git rev-parse origin/prod-test) - TAG_COMMIT=$(git rev-parse HEAD) - - echo "Prod-test HEAD: $PROD_HEAD" - echo "Tag commit: $TAG_COMMIT" - - if [ "$PROD_HEAD" = "$TAG_COMMIT" ]; then - echo "is_prod=true" >> $GITHUB_OUTPUT - echo "✅ Tag is at prod-test branch HEAD - will deploy" - else - echo "is_prod=false" >> $GITHUB_OUTPUT - echo "⚠️ Commit is on prod-test but not at HEAD - skipping deployment" - fi - else - echo "is_prod=false" >> $GITHUB_OUTPUT - echo "❌ Tag is not from prod-test branch - skipping deployment" - fi - - - name: Would Deploy - if: steps.check.outputs.is_prod == 'true' - run: echo "🚀 DEPLOYMENT WOULD HAPPEN HERE" - - - name: Would Skip - if: steps.check.outputs.is_prod != 'true' - run: echo "⏭️ DEPLOYMENT SKIPPED" \ No newline at end of file From 12806b04bec616c624e76ca9e0c1954f52313c7c Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Fri, 9 Jan 2026 20:55:59 +0530 Subject: [PATCH 21/26] Remove test entries from README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 87d7624..b7a1a3a 100644 --- a/README.md +++ b/README.md @@ -91,5 +91,3 @@ Thanks to contributors: Thanks to the open-source community: [binwalk](https://github.com/ReFirmLabs/binwalk), [exiftool](https://exiftool.org/), [foremost](https://foremost.sourceforge.net/), [openstego](https://www.openstego.com/), [outguess](https://www.rbcafe.com/software/outguess/), [pngcheck](https://www.libpng.org/pub/png/apps/pngcheck.html), [steghide](https://steghide.sourceforge.net/), [strings](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/strings.html), [zsteg](https://github.com/zed-0xff/zsteg), ... -acpx1337 cicd test from non prod branch ( this should fail hopefully ) -# test Fri Jan 9 20:46:55 IST 2026 From 6cf4364775d91abeeb372c21b4d9169de5371646 Mon Sep 17 00:00:00 2001 From: aradhyacp Date: Sat, 10 Jan 2026 00:22:31 +0530 Subject: [PATCH 22/26] Add logic to determine tag type and build/push Docker images accordingly --- .github/workflows/release.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee22ce0..a824f54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,17 @@ jobs: - name: Downcase username run: echo "lower_actor=${GITHUB_ACTOR,,}" >> $GITHUB_ENV + - name: Determine tag type (prod vs main) + id: tag_type + run: | + if [[ "${{ env.RELEASE_VERSION }}" == *"-prod"* ]]; then + echo "is_prod_tag=true" >> $GITHUB_OUTPUT + echo "📦 Prod tag detected - will push :latest-prod" + else + echo "is_prod_tag=false" >> $GITHUB_OUTPUT + echo "📦 Main tag detected - will push :latest" + fi + - name: Checkout uses: actions/checkout@v4 @@ -32,7 +43,21 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker images + # Build and push for PROD tags (X.X.X-prod) + - name: Build and push Docker images (prod) + if: steps.tag_type.outputs.is_prod_tag == 'true' + uses: docker/build-push-action@v6.9.0 + with: + context: ./ + push: true + tags: | + ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} + ghcr.io/${{ env.lower_actor }}/aperisolve:latest-prod + ghcr.io/${{ env.lower_actor }}/aperisolve:prod + + # Build and push for MAIN tags (X.X.X) + - name: Build and push Docker images (main) + if: steps.tag_type.outputs.is_prod_tag == 'false' uses: docker/build-push-action@v6.9.0 with: context: ./ From ef0b6ca511ae04660cb8e43ed89ba81a650486ba Mon Sep 17 00:00:00 2001 From: Zeecka Date: Fri, 9 Jan 2026 23:07:45 +0100 Subject: [PATCH 23/26] Fix to get merge into main --- .github/workflows/release.yml | 11 +++++------ aperisolve/app.py | 6 ------ aperisolve/templates/base.html | 4 +--- compose.yml | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a824f54..1ee42c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,6 @@ jobs: push: true tags: | ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} - ghcr.io/${{ env.lower_actor }}/aperisolve:latest-prod ghcr.io/${{ env.lower_actor }}/aperisolve:prod # Build and push for MAIN tags (X.X.X) @@ -94,10 +93,10 @@ jobs: # This prevents deployment if the same commit exists on multiple branches PROD_HEAD=$(git rev-parse origin/prod) TAG_COMMIT=$(git rev-parse HEAD) - + echo "Prod HEAD: $PROD_HEAD" echo "Tag commit: $TAG_COMMIT" - + if [ "$PROD_HEAD" = "$TAG_COMMIT" ]; then echo "is_prod=true" >> $GITHUB_OUTPUT echo "✅ Tag is at prod branch HEAD - will deploy" @@ -110,12 +109,12 @@ jobs: echo "❌ Tag is not from prod branch - skipping deployment" fi - # wait for 30 seconds + # wait for 120 seconds - name: Wait for image propagation if: steps.check.outputs.is_prod == 'true' run: | - echo "Waiting 30 seconds for image to propagate in registry..." - sleep 30 + echo "Waiting 120 seconds for image to propagate in registry..." + sleep 120 - name: Deploy to production server if: steps.check.outputs.is_prod == 'true' diff --git a/aperisolve/app.py b/aperisolve/app.py index a55e979..92852ef 100644 --- a/aperisolve/app.py +++ b/aperisolve/app.py @@ -430,12 +430,6 @@ def create_app() -> Flask: return app -@app.route("/ads.txt") -def google_ads() -> str: - """Google Ads required file""" - return "google.com, pub-2324718887045017, DIRECT, f08c47fec0942fa0" - - if __name__ == "__main__": my_app = create_app() debug_mode = os.environ.get("FLASK_DEBUG", "0") == "1" diff --git a/aperisolve/templates/base.html b/aperisolve/templates/base.html index 2e2647a..5e4a155 100644 --- a/aperisolve/templates/base.html +++ b/aperisolve/templates/base.html @@ -10,8 +10,6 @@ - @@ -41,4 +39,4 @@ {% include "footer.html" %} - \ No newline at end of file + diff --git a/compose.yml b/compose.yml index 90959b3..58fb1b0 100644 --- a/compose.yml +++ b/compose.yml @@ -1,6 +1,6 @@ services: web: - image: ghcr.io/zeecka/aperisolve:prod + image: ghcr.io/zeecka/aperisolve:latest #build: . container_name: aperisolve-web restart: always @@ -25,7 +25,7 @@ services: start_period: 900s worker: - image: ghcr.io/zeecka/aperisolve:prod + image: ghcr.io/zeecka/aperisolve:latest #build: . container_name: aperisolve-worker restart: always @@ -40,6 +40,20 @@ services: environment: - CLEAR_AT_RESTART=0 # Always false for worker to prevent double clearing + initdb: + image: ghcr.io/zeecka/aperisolve:latest + #build: . + container_name: aperisolve-initdb + command: python -m aperisolve.utils.init_db + volumes: + - apresults:/aperisolve/results + depends_on: + postgres: + condition: service_healthy + env_file: + - .env.example + restart: "no" + postgres: image: postgres:18 container_name: postgres From 71062b65748b609f60cc19b40b49d98ac27b514a Mon Sep 17 00:00:00 2001 From: Zeecka <24873615+Zeecka@users.noreply.github.com> Date: Fri, 9 Jan 2026 23:12:35 +0100 Subject: [PATCH 24/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ee42c8..e965e04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,8 +62,8 @@ jobs: context: ./ push: true tags: | - ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} - ghcr.io/${{ env.lower_actor }}/aperisolve:latest + ghcr.io/zeecka/aperisolve:${{ env.RELEASE_VERSION }} + ghcr.io/zeecka/aperisolve:latest deploy: runs-on: ubuntu-latest From 4604ab6211db5772bbc000699aa392af8ebaed10 Mon Sep 17 00:00:00 2001 From: Zeecka Date: Fri, 9 Jan 2026 23:55:52 +0100 Subject: [PATCH 25/26] fix compose, remove lower_actor --- .github/workflows/release.yml | 7 ++----- compose.yml | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e965e04..f3bc089 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,6 @@ jobs: - name: Get release version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: Downcase username - run: echo "lower_actor=${GITHUB_ACTOR,,}" >> $GITHUB_ENV - - name: Determine tag type (prod vs main) id: tag_type run: | @@ -51,8 +48,8 @@ jobs: context: ./ push: true tags: | - ghcr.io/${{ env.lower_actor }}/aperisolve:${{ env.RELEASE_VERSION }} - ghcr.io/${{ env.lower_actor }}/aperisolve:prod + ghcr.io/zeecka/aperisolve:${{ env.RELEASE_VERSION }} + ghcr.io/zeecka/aperisolve:prod # Build and push for MAIN tags (X.X.X) - name: Build and push Docker images (main) diff --git a/compose.yml b/compose.yml index 58fb1b0..ea56852 100644 --- a/compose.yml +++ b/compose.yml @@ -5,12 +5,14 @@ services: container_name: aperisolve-web restart: always ports: - - "80:5000" + - "5000:5000" volumes: - - apresults:/aperisolve/results + - apresults:/app/aperisolve/results depends_on: postgres: condition: service_healthy + initdb: + condition: service_completed_successfully redis: condition: service_started worker: @@ -31,14 +33,16 @@ services: restart: always command: rq worker default --url redis://redis:6379/0 volumes: - - apresults:/aperisolve/results + - apresults:/app/aperisolve/results depends_on: - - redis - - postgres + postgres: + condition: service_healthy + initdb: + condition: service_completed_successfully + redis: + condition: service_started env_file: - .env - environment: - - CLEAR_AT_RESTART=0 # Always false for worker to prevent double clearing initdb: image: ghcr.io/zeecka/aperisolve:latest @@ -46,7 +50,7 @@ services: container_name: aperisolve-initdb command: python -m aperisolve.utils.init_db volumes: - - apresults:/aperisolve/results + - apresults:/app/aperisolve/results depends_on: postgres: condition: service_healthy From 2ced2ca801bdf2710ed990515bcb5605ed633ee9 Mon Sep 17 00:00:00 2001 From: Zeecka <24873615+Zeecka@users.noreply.github.com> Date: Fri, 9 Jan 2026 23:56:37 +0100 Subject: [PATCH 26/26] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 75361a7..692ae85 100644 --- a/README.md +++ b/README.md @@ -91,4 +91,3 @@ Thanks to contributors: Thanks to the open-source community: [binwalk](https://github.com/ReFirmLabs/binwalk), [exiftool](https://exiftool.org/), [foremost](https://foremost.sourceforge.net/), [openstego](https://www.openstego.com/), [outguess](https://www.rbcafe.com/software/outguess/), [pngcheck](https://www.libpng.org/pub/png/apps/pngcheck.html), [steghide](https://steghide.sourceforge.net/), [strings](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/strings.html), [zsteg](https://github.com/zed-0xff/zsteg), ... -