about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJames Atkins <james@jamesatkins.com>2024-05-24 07:32:57 -0500
committerJames Atkins <james@jamesatkins.com>2024-05-24 09:17:42 -0500
commitbcaf6de4675240018d07849b6fb86ae98591dce0 (patch)
treec5f6aed81393f28c1fbd9448ffd56c1e9233425b
parenteb6aea88a01f9dbceac6dce3d2e9fae3644b37cc (diff)
mealie: 1.2.0 -> 1.7.0
https://github.com/mealie-recipes/mealie/releases/tag/v1.7.0
-rw-r--r--nixos/modules/services/web-apps/mealie.nix2
-rw-r--r--pkgs/by-name/me/mealie/mealie-frontend.nix2
-rw-r--r--pkgs/by-name/me/mealie/mealie-logs-to-stdout.patch103
-rw-r--r--pkgs/by-name/me/mealie/package.nix42
4 files changed, 9 insertions, 140 deletions
diff --git a/nixos/modules/services/web-apps/mealie.nix b/nixos/modules/services/web-apps/mealie.nix
index 8f68828e7a0be..11bbd2834acc9 100644
--- a/nixos/modules/services/web-apps/mealie.nix
+++ b/nixos/modules/services/web-apps/mealie.nix
@@ -28,8 +28,6 @@ in
         Configuration of the Mealie service.
 
         See [the mealie documentation](https://nightly.mealie.io/documentation/getting-started/installation/backend-config/) for available options and default values.
-
-        In addition to the official documentation, you can set {env}`MEALIE_LOG_FILE`.
       '';
       example = {
         ALLOW_SIGNUP = "false";
diff --git a/pkgs/by-name/me/mealie/mealie-frontend.nix b/pkgs/by-name/me/mealie/mealie-frontend.nix
index a98d22761e71e..477dcd993abcf 100644
--- a/pkgs/by-name/me/mealie/mealie-frontend.nix
+++ b/pkgs/by-name/me/mealie/mealie-frontend.nix
@@ -6,7 +6,7 @@ src: version:
 
   yarnOfflineCache = fetchYarnDeps {
     yarnLock = "${src}/frontend/yarn.lock";
-    hash = "sha256-zQUD/PQWzp2Q6fiVmLicvSusXffu6s9q3x/aAUnCN38=";
+    hash = "sha256-a2kIOQHaMzaMWId6+SSYN+SPQM2Ipa+F1ztFZgo3R6A=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/by-name/me/mealie/mealie-logs-to-stdout.patch b/pkgs/by-name/me/mealie/mealie-logs-to-stdout.patch
deleted file mode 100644
index 521c5cebcf74d..0000000000000
--- a/pkgs/by-name/me/mealie/mealie-logs-to-stdout.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/mealie/core/root_logger.py b/mealie/core/root_logger.py
-index 29db504f..3da5ef84 100644
---- a/mealie/core/root_logger.py
-+++ b/mealie/core/root_logger.py
-@@ -9,7 +9,6 @@ DATA_DIR = determine_data_dir()
- 
- from .config import get_app_settings  # noqa E402
- 
--LOGGER_FILE = DATA_DIR.joinpath("mealie.log")
- DATE_FORMAT = "%d-%b-%y %H:%M:%S"
- LOGGER_FORMAT = "%(levelname)s: %(asctime)s \t%(message)s"
- 
-@@ -40,19 +39,17 @@ def get_logger_config():
-             level=log_level,
-         )
- 
--    output_file_handler = logging.FileHandler(LOGGER_FILE)
-     handler_format = logging.Formatter(LOGGER_FORMAT, datefmt=DATE_FORMAT)
--    output_file_handler.setFormatter(handler_format)
- 
-     # Stdout
-     stdout_handler = logging.StreamHandler(sys.stdout)
-     stdout_handler.setFormatter(handler_format)
- 
-     return LoggerConfig(
--        handlers=[output_file_handler, stdout_handler],
-+        handlers=[stdout_handler],
-         format="%(levelname)s: %(asctime)s \t%(message)s",
-         date_format="%d-%b-%y %H:%M:%S",
--        logger_file=LOGGER_FILE,
-+        logger_file=None,
-         level=log_level,
-     )
- 
-diff --git a/mealie/routes/admin/admin_log.py b/mealie/routes/admin/admin_log.py
-index ac12c12e..0de98b99 100644
---- a/mealie/routes/admin/admin_log.py
-+++ b/mealie/routes/admin/admin_log.py
-@@ -1,6 +1,5 @@
- from fastapi import APIRouter
- 
--from mealie.core.root_logger import LOGGER_FILE
- from mealie.core.security import create_file_token
- 
- router = APIRouter(prefix="/logs")
-@@ -9,15 +8,13 @@ router = APIRouter(prefix="/logs")
- @router.get("/{num}")
- async def get_log(num: int):
-     """Doc Str"""
--    with open(LOGGER_FILE, "rb") as f:
--        log_text = tail(f, num)
--    return log_text
-+    return ""
- 
- 
- @router.get("")
- async def get_log_file():
-     """Returns a token to download a file"""
--    return {"fileToken": create_file_token(LOGGER_FILE)}
-+    return {"fileToken": create_file_token("nofile")}
- 
- 
- def tail(f, lines=20):
-diff --git a/mealie/routes/admin/admin_maintenance.py b/mealie/routes/admin/admin_maintenance.py
-index 23ef8369..322b580f 100644
---- a/mealie/routes/admin/admin_maintenance.py
-+++ b/mealie/routes/admin/admin_maintenance.py
-@@ -6,7 +6,6 @@ from pathlib import Path
- 
- from fastapi import APIRouter, HTTPException
- 
--from mealie.core.root_logger import LOGGER_FILE
- from mealie.pkgs.stats import fs_stats
- from mealie.routes._base import BaseAdminController, controller
- from mealie.schema.admin import MaintenanceSummary
-@@ -73,8 +72,6 @@ class AdminMaintenanceController(BaseAdminController):
-         Get the maintenance summary
-         """
-         log_file_size = 0
--        with contextlib.suppress(FileNotFoundError):
--            log_file_size = os.path.getsize(LOGGER_FILE)
- 
-         return MaintenanceSummary(
-             data_dir_size=fs_stats.pretty_size(fs_stats.get_dir_size(self.folders.DATA_DIR)),
-@@ -85,7 +82,7 @@ class AdminMaintenanceController(BaseAdminController):
- 
-     @router.get("/logs", response_model=MaintenanceLogs)
-     def get_logs(self, lines: int = 200):
--        return MaintenanceLogs(logs=tail_log(LOGGER_FILE, lines))
-+        return MaintenanceLogs(logs="")
- 
-     @router.get("/storage", response_model=MaintenanceStorageDetails)
-     def get_storage_details(self):
-@@ -137,9 +134,6 @@ class AdminMaintenanceController(BaseAdminController):
-         Purges the logs
-         """
-         try:
--            with contextlib.suppress(FileNotFoundError):
--                os.remove(LOGGER_FILE)
--                LOGGER_FILE.touch()
-             return SuccessResponse.respond("Logs cleaned")
-         except Exception as e:
-             raise HTTPException(status_code=500, detail=ErrorResponse.respond("Failed to clean logs")) from e
diff --git a/pkgs/by-name/me/mealie/package.nix b/pkgs/by-name/me/mealie/package.nix
index 0bd096f7977c3..fbe655ead6a5f 100644
--- a/pkgs/by-name/me/mealie/package.nix
+++ b/pkgs/by-name/me/mealie/package.nix
@@ -1,7 +1,6 @@
 { lib
 , callPackage
 , fetchFromGitHub
-, fetchpatch
 , makeWrapper
 , nixosTests
 , python3Packages
@@ -10,21 +9,17 @@
 }:
 
 let
-  version = "1.2.0";
+  version = "1.7.0";
   src = fetchFromGitHub {
     owner = "mealie-recipes";
     repo = "mealie";
     rev = "v${version}";
-    sha256 = "sha256-Kc49XDWcZLeJaYgiAO2/mHeVSOLMeiPr3U32e0IYfdU=";
+    hash = "sha256-z7kLBDzvzPWY7XmpROMpw3LcDpsl+hA+w1SdhrD/yNU=";
   };
 
   frontend = callPackage (import ./mealie-frontend.nix src version) { };
 
-  pythonpkgs = python3Packages.override {
-    overrides = self: super: {
-      pydantic = python3Packages.pydantic_1;
-    };
-  };
+  pythonpkgs = python3Packages;
   python = pythonpkgs.python;
 
   crfpp = stdenv.mkDerivation {
@@ -37,34 +32,11 @@ let
       hash = "sha256-XNps3ZApU8m07bfPEnvip1w+3hLajdn9+L5+IpEaP0c=";
     };
   };
-
-  mealie_patch = { name, commit, hash }: fetchpatch {
-    inherit name hash;
-    url = "https://github.com/mealie-recipes/mealie/commit/${commit}.patch";
-  };
-
 in pythonpkgs.buildPythonPackage rec {
   pname = "mealie";
   inherit version src;
   pyproject = true;
 
-  patches = [
-    # See https://github.com/mealie-recipes/mealie/pull/3102
-    # Replace hardcoded paths in code with environment variables (meant for inside Docker only)
-    # So we can configure easily where the data is stored on the server
-    (mealie_patch {
-      name = "model-path.patch";
-      commit = "e445705c5d26b895d806b96b2f330d4e9aac3723";
-      hash = "sha256-cf0MwvT81lNBTjvag8UUEbXkBu8Jyi/LFwUcs4lBVcY=";
-    })
-    (mealie_patch {
-      name = "alembic-cfg-path.patch";
-      commit = "06c528bfac0708af66aa0629f2e2232ddf07768f";
-      hash = "sha256-IOgdZK7dmWeX2ox16J9v+bOS7nHgCMvCJy6RNJLj0p8=";
-    })
-    ./mealie-logs-to-stdout.patch
-  ];
-
   nativeBuildInputs = [
     pythonpkgs.poetry-core
     pythonpkgs.pythonRelaxDepsHook
@@ -82,6 +54,7 @@ in pythonpkgs.buildPythonPackage rec {
     aniso8601
     appdirs
     apprise
+    authlib
     bcrypt
     extruct
     fastapi
@@ -90,15 +63,16 @@ in pythonpkgs.buildPythonPackage rec {
     httpx
     jinja2
     lxml
+    openai
     orjson
     paho-mqtt
-    passlib
     pillow
+    pillow-heif
     psycopg2
+    pydantic-settings
     pyhumps
-    pytesseract
+    pyjwt
     python-dotenv
-    python-jose
     python-ldap
     python-multipart
     python-slugify