diff --git a/.github/workflows/beta-ci.yml b/.github/workflows/beta-ci.yml index 73ad0d720..05cade054 100644 --- a/.github/workflows/beta-ci.yml +++ b/.github/workflows/beta-ci.yml @@ -37,7 +37,7 @@ jobs: build_ghcr: name: Build Digest for GHCR - runs-on: self-hosted + runs-on: ubuntu-latest needs: - before_build strategy: @@ -158,7 +158,7 @@ jobs: build_dh: name: Build Digest for Docker Hub - runs-on: self-hosted + runs-on: ubuntu-latest needs: - before_build strategy: diff --git a/apps/wizarr-backend/wizarr_backend/app/config.py b/apps/wizarr-backend/wizarr_backend/app/config.py index fd5c863c0..c6386304d 100644 --- a/apps/wizarr-backend/wizarr_backend/app/config.py +++ b/apps/wizarr-backend/wizarr_backend/app/config.py @@ -1,18 +1,15 @@ from datetime import timedelta -from os import environ, getenv, path - +from os import environ, path from flask import Flask - from app.security import secret_key, SchedulerAuth +from definitions import DATABASE_DIR def create_config(app: Flask): config = {} - base_dir = path.abspath(path.join(path.dirname(__file__), "../")) - config["SESSION_TYPE"] = "filesystem" - config["SESSION_FILE_DIR"] = path.join(base_dir, "../", "database", "sessions") + config["SESSION_FILE_DIR"] = path.join(DATABASE_DIR, "sessions") config["PERMANENT_SESSION_LIFETIME"] = timedelta(hours=5) - config["UPLOAD_FOLDER"] = path.join(base_dir, "../", "database", "uploads") + config["UPLOAD_FOLDER"] = path.join(DATABASE_DIR, "uploads") config["SWAGGER_UI_DOC_EXPANSION"] = "list" config["SERVER_NAME"] = "127.0.0.1:5000" config["APPLICATION_ROOT"] = "/" diff --git a/apps/wizarr-backend/wizarr_backend/app/migrator/__init__.py b/apps/wizarr-backend/wizarr_backend/app/migrator/__init__.py index 4f8ca5be0..69e8c3ecb 100644 --- a/apps/wizarr-backend/wizarr_backend/app/migrator/__init__.py +++ b/apps/wizarr-backend/wizarr_backend/app/migrator/__init__.py @@ -5,14 +5,11 @@ from packaging.version import parse from datetime import datetime, timedelta -from definitions import ROOT_DIR +from definitions import LATEST_FILE def get_current_version(): - # File path to the version file - version_file = path.abspath(path.join(ROOT_DIR, "../", "../", "latest")) - # Read the current version - with open(version_file, "r") as f: + with open(LATEST_FILE, "r") as f: current_version = parse(f.read()) return current_version diff --git a/apps/wizarr-backend/wizarr_backend/app/utils/software_lifecycle.py b/apps/wizarr-backend/wizarr_backend/app/utils/software_lifecycle.py index 6a55a8849..0d9e53138 100644 --- a/apps/wizarr-backend/wizarr_backend/app/utils/software_lifecycle.py +++ b/apps/wizarr-backend/wizarr_backend/app/utils/software_lifecycle.py @@ -5,7 +5,7 @@ from json import load from app.models.database.base import db_dir -from definitions import ROOT_DIR +from definitions import LATEST_FILE session = CachedSession(cache_name=path.join(db_dir, "wizarr_cache"), backend="sqlite", expire_after=3600, cache_control=True, stale_if_error=True, allowable_codes=[200]) @@ -35,8 +35,7 @@ def get_latest_beta_version(): return None def get_current_version(): - package = path.abspath(path.join(ROOT_DIR, "../", "../", "latest")) - with open(package, "r", encoding="utf-8") as f: + with open(LATEST_FILE, "r", encoding="utf-8") as f: return parse(f.read()) diff --git a/apps/wizarr-backend/wizarr_backend/definitions.py b/apps/wizarr-backend/wizarr_backend/definitions.py index 8f1f0f11d..0c150f55f 100644 --- a/apps/wizarr-backend/wizarr_backend/definitions.py +++ b/apps/wizarr-backend/wizarr_backend/definitions.py @@ -1,3 +1,5 @@ -from os import path, environ +from os import path, getenv -ROOT_DIR = path.dirname(path.join(path.abspath(__file__), "../", "../")) +ROOT_DIR = getenv("ROOT_DIR", path.abspath(path.join(path.abspath(__file__), "../"))) +LATEST_FILE = getenv("LATEST_FILE", path.join(ROOT_DIR, "../", "../", "../", "latest")) +DATABASE_DIR = getenv("DATABASE_DIR", path.join(ROOT_DIR, "../", "database")) diff --git a/dockerfiles/wizarr-backend/Dockerfile b/dockerfiles/wizarr-backend/Dockerfile index b5c0bc85f..184f76582 100644 --- a/dockerfiles/wizarr-backend/Dockerfile +++ b/dockerfiles/wizarr-backend/Dockerfile @@ -70,7 +70,8 @@ RUN chmod +x /root/.bashrc COPY ../../latest / # Environment Variables -ENV DB_DIR=/data/database +ENV DATABASE_DIR=/data/database +ENV LATEST_FILE=/latest # Set Entrypoint ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/dockerfiles/wizarr-frontend/Dockerfile b/dockerfiles/wizarr-frontend/Dockerfile index fd2b2479c..00786e108 100644 --- a/dockerfiles/wizarr-frontend/Dockerfile +++ b/dockerfiles/wizarr-frontend/Dockerfile @@ -46,5 +46,8 @@ RUN chmod +x /root/.bashrc # Copy latest file COPY ../../latest / +# Environment Variables +ENV LATEST_FILE=/latest + # Set Entrypoint ENTRYPOINT ["/docker-entrypoint.sh"] \ No newline at end of file diff --git a/dockerfiles/wizarr/Dockerfile b/dockerfiles/wizarr/Dockerfile index 40717d259..e9b1688f0 100644 --- a/dockerfiles/wizarr/Dockerfile +++ b/dockerfiles/wizarr/Dockerfile @@ -74,7 +74,8 @@ RUN chmod +x /root/.bashrc COPY ../../latest / # Environment Variables -ENV DB_DIR=/data/database +ENV DATABASE_DIR=/data/database +ENV LATEST_FILE=/latest # Set Entrypoint ENTRYPOINT ["/docker-entrypoint.sh"]