mealie: 2.8.0 -> 3.0.2 (#427176)

authored by

Bruno BELANYI and committed by
GitHub
12a04492 43b928e0

+91 -17
+2
doc/release-notes/rl-2511.section.md
··· 97 97 98 98 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> 99 99 100 + - `mealie` has been updated to 3.0.2: This update introduces breaking changes in some API endpoints (see the [release changelog](https://github.com/mealie-recipes/mealie/releases/tag/v3.0.0)) 101 + 100 102 ### Breaking changes {#sec-nixpkgs-release-25.11-lib-breaking} 101 103 102 104 - `reaction` has been updated to version 2, which includes some breaking changes.
+70 -2
nixos/tests/mealie.nix
··· 15 15 services.mealie = { 16 16 enable = true; 17 17 port = 9001; 18 + settings.ALLOW_SIGNUP = "true"; 18 19 }; 19 20 }; 20 21 postgres = { ··· 27 28 }; 28 29 29 30 testScript = '' 30 - start_all() 31 + import json 32 + import urllib.parse 33 + 34 + def api_get(node, path, qry={}, **headers): 35 + url = f"http://localhost:9001/api{path}" 36 + if len(qry) > 0: 37 + url += "?" + "&".join([f"{k}={urllib.parse.quote(v)}" for k, v in qry.items()]) 38 + 39 + headers = " ".join([f"-H '{k}: {str(v)}'" for k, v in headers.items()]) 40 + 41 + got = node.succeed(f"curl -s -X GET {headers} --fail {url}") 42 + print(f"* GET {path}\n{got}") 43 + return json.loads(got) 44 + 45 + def api_post(node, path, method="POST", urlencode=False, body={}, qry={}, **headers): 46 + url = f"http://localhost:9001/api{path}" 47 + if len(qry) > 0: 48 + url += "?" + "&".join([f"{k}={urllib.parse.quote(v)}" for k, v in qry.items()]) 49 + 50 + if urlencode: 51 + headers["Content-Type"] = "application/x-www-form-urlencoded" 52 + print("BODY", body) 53 + body = "&".join([f"{k}={urllib.parse.quote(str(v))}" for k, v in body.items()]) 54 + else: 55 + headers["Content-Type"] = "application/json" 56 + body = json.dumps(body) 57 + 58 + headers["Accept"] = "application/json" 59 + headers = " ".join([f"-H '{k}: {str(v)}'" for k, v in headers.items()]) 60 + 61 + got = node.succeed(f"curl -v --fail -X {method} {url} {headers} -d '{body}'") 62 + print(f"* POST {path}\n{got}") 63 + return json.loads(got) 31 64 32 65 def test_mealie(node): 33 66 node.wait_for_unit("mealie.service") 34 67 node.wait_for_open_port(9001) 35 68 node.succeed("curl --fail http://localhost:9001") 36 69 70 + got = api_get(node, "/app/about") 71 + assert got["version"] == "v${pkgs.mealie.version}" 72 + 73 + new_user = dict( 74 + email=node.name + ".nomail@no.mail", 75 + username="noname-" + node.name, 76 + fullName="No Name" + node.name, 77 + password="SuperSecure" + node.name, 78 + passwordConfirm="SuperSecure" + node.name, 79 + group="mygroup" + node.name, 80 + ) 81 + got = api_post(node, "/users/register", body=new_user) 82 + got = api_post(node, "/auth/token", urlencode=True, body={ 83 + "username": new_user["username"], 84 + "password": new_user["password"], 85 + "remember_me": False, 86 + }) 87 + assert "access_token" in got 88 + token = "Bearer " + got["access_token"] 89 + 90 + got = api_get(node, "/recipes", authorization=token) 91 + assert got["total"] == 0 92 + 93 + slug = api_post(node, "/recipes", body={"name": "TestRecipe"}, authorization=token) 94 + recipe = { "description": "Test recipe" } 95 + got = api_post(node, f"/recipes/{slug}", body=recipe, method="PATCH", authorization=token) 96 + got = api_get(node, "/recipes", authorization=token) 97 + assert got["total"] > 0 98 + assert got["items"][0]["description"] == recipe["description"] 99 + 100 + postgres.start() 101 + test_mealie(postgres) 102 + postgres.send_monitor_command("quit") 103 + postgres.wait_for_shutdown() 104 + 105 + sqlite.start() 37 106 test_mealie(sqlite) 38 107 sqlite.send_monitor_command("quit") 39 108 sqlite.wait_for_shutdown() 40 - test_mealie(postgres) 41 109 ''; 42 110 }
+16 -9
pkgs/by-name/me/mealie/mealie-frontend.nix
··· 1 1 src: version: 2 2 { 3 3 lib, 4 + fetchFromGitHub, 4 5 fetchYarnDeps, 5 - nodejs_20, 6 + dart-sass, 7 + nodePackages_latest, 6 8 fixup-yarn-lock, 7 9 stdenv, 8 10 yarn, 9 11 }: 12 + let 13 + nodejs = nodePackages_latest.nodejs; 14 + in 10 15 stdenv.mkDerivation { 11 16 name = "mealie-frontend"; 12 17 inherit version; ··· 14 19 15 20 yarnOfflineCache = fetchYarnDeps { 16 21 yarnLock = "${src}/frontend/yarn.lock"; 17 - hash = "sha256-a2kIOQHaMzaMWId6+SSYN+SPQM2Ipa+F1ztFZgo3R6A="; 22 + hash = "sha256-712mc/xksjXgnc0inthxE+ztSDl/4107oXw3vKcZD2g="; 18 23 }; 19 24 20 25 nativeBuildInputs = [ 21 26 fixup-yarn-lock 22 - nodejs_20 23 - (yarn.override { nodejs = nodejs_20; }) 27 + nodejs 28 + (yarn.override { inherit nodejs; }) 24 29 ]; 25 30 26 31 configurePhase = '' 27 32 runHook preConfigure 28 33 34 + sed -i 's+"@nuxt/fonts",+// NUXT FONTS DISABLED+g' nuxt.config.ts 35 + 29 36 export HOME=$(mktemp -d) 30 37 yarn config --offline set yarn-offline-mirror "$yarnOfflineCache" 31 38 fixup-yarn-lock yarn.lock 32 - # TODO: Remove --ignore-engines once upstream supports nodejs_20+ 33 - # https://github.com/mealie-recipes/mealie/issues/5400 34 - # https://github.com/mealie-recipes/mealie/pull/5184 35 - yarn install --frozen-lockfile --offline --no-progress --non-interactive --ignore-engines 39 + yarn install --frozen-lockfile --offline --no-progress --non-interactive 36 40 patchShebangs node_modules/ 41 + 42 + mkdir -p node_modules/sass-embedded/dist/lib/src/vendor/dart-sass 43 + ln -s ${dart-sass}/bin/dart-sass node_modules/sass-embedded/dist/lib/src/vendor/dart-sass/sass 37 44 38 45 runHook postConfigure 39 46 ''; ··· 50 57 51 58 installPhase = '' 52 59 runHook preInstall 53 - mv dist $out 60 + mv .output/public $out 54 61 runHook postInstall 55 62 ''; 56 63
+3 -6
pkgs/by-name/me/mealie/package.nix
··· 11 11 }: 12 12 13 13 let 14 - version = "2.8.0"; 14 + version = "3.0.2"; 15 15 src = fetchFromGitHub { 16 16 owner = "mealie-recipes"; 17 17 repo = "mealie"; 18 18 tag = "v${version}"; 19 - hash = "sha256-0LUT7OdYoOZTdR/UXJO2eL2Afo2Y7GjBPIrjWUt205E="; 19 + hash = "sha256-0GlHfyoVEqmfTDSN9BGXrLRkStRjWjv2qzZac2oYu7Q="; 20 20 }; 21 21 22 22 frontend = callPackage (import ./mealie-frontend.nix src version) { }; ··· 24 24 pythonpkgs = python3Packages; 25 25 python = pythonpkgs.python; 26 26 in 27 - 28 27 pythonpkgs.buildPythonApplication rec { 29 28 pname = "mealie"; 30 29 inherit version src; ··· 46 45 apprise 47 46 authlib 48 47 bcrypt 49 - extruct 50 48 fastapi 51 - gunicorn 52 49 html2text 53 50 httpx 54 51 ingredient-parser-nlp ··· 58 55 openai 59 56 orjson 60 57 paho-mqtt 61 - pillow 62 58 pillow-heif 63 59 psycopg2 64 60 pydantic-settings 65 61 pyhumps 66 62 pyjwt 63 + python-dateutil 67 64 python-dotenv 68 65 python-ldap 69 66 python-multipart