diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 31d8f3427..2ceae625a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ // Use -bullseye variants on local on arm64/Apple Silicon. "VARIANT": "3.12-bullseye", // Options - "NODE_VERSION": "16" + "NODE_VERSION": "20" } }, "mounts": [ @@ -48,12 +48,13 @@ ], // Use 'onCreateCommand' to run commands at the end of container creation. // Use 'postCreateCommand' to run commands after the container is created. - "onCreateCommand": "sudo chown -R vscode:vscode /workspaces/mealie/frontend/node_modules && task setup", + "onCreateCommand": "sudo chown -R vscode:vscode /workspaces/mealie/frontend/node_modules /home/vscode/commandhistory && task setup", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": { "dockerDashComposeVersion": "v2" } - } + }, + "appPort": 3000 } diff --git a/.github/workflows/partial-package.yml b/.github/workflows/build-package.yml similarity index 98% rename from .github/workflows/partial-package.yml rename to .github/workflows/build-package.yml index 1ee258562..dddc7a2f4 100644 --- a/.github/workflows/partial-package.yml +++ b/.github/workflows/build-package.yml @@ -1,4 +1,4 @@ -name: Package build +name: Build Package on: workflow_call: @@ -19,7 +19,7 @@ jobs: - name: Setup node env 🏗 uses: actions/setup-node@v4.0.0 with: - node-version: 16 + node-version: 20 check-latest: true - name: Get yarn cache directory path 🛠 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index df3e5b3a2..07fd7adfc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -3,15 +3,8 @@ on: workflow_call: jobs: - build-package: - name: "Build Python package" - uses: ./.github/workflows/partial-package.yml - with: - tag: e2e - test: timeout-minutes: 60 - needs: build-package runs-on: ubuntu-latest defaults: run: @@ -20,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: 'yarn' cache-dependency-path: ./tests/e2e/yarn.lock - name: Set up Docker Buildx diff --git a/.github/workflows/locale-sync.yml b/.github/workflows/locale-sync.yml new file mode 100644 index 000000000..a5b4999df --- /dev/null +++ b/.github/workflows/locale-sync.yml @@ -0,0 +1,114 @@ +name: Automatic Locale Sync + +on: + schedule: + # Run every Sunday at 2 AM UTC + - cron: "0 2 * * 0" + workflow_dispatch: + # Allow manual triggering from the GitHub UI + +permissions: + contents: write # To checkout, commit, and push changes + pull-requests: write # To create pull requests + +jobs: + sync-locales: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + + - name: Check venv cache + id: cache-validate + if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true' + run: | + echo "import fastapi;print('venv good?')" > test.py && poetry run python test.py && echo "cache-hit-success=true" >> $GITHUB_OUTPUT + rm test.py + continue-on-error: true + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install libsasl2-dev libldap2-dev libssl-dev + poetry install + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + + - name: Run locale generation + run: | + cd dev/code-generation + poetry run python main.py locales + env: + CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }} + + - name: Check for changes + id: changes + run: | + if git diff --quiet; then + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Commit and create PR + if: steps.changes.outputs.has_changes == 'true' + run: | + # Configure git + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + # Use the current branch as the base + BASE_BRANCH="${{ github.ref_name }}" + echo "Using base branch: $BASE_BRANCH" + + # Create a new branch from the base branch + BRANCH_NAME="auto-locale-sync-$(date +%Y%m%d-%H%M%S)" + git checkout -b "$BRANCH_NAME" + + # Add and commit changes + git add . + git commit -m "chore: automatic locale sync" + + # Push the branch + git push origin "$BRANCH_NAME" + + sleep 2 + + # Create PR using GitHub CLI with explicit repository + gh pr create \ + --repo "${{ github.repository }}" \ + --title "chore: automatic locale sync" \ + --base "$BASE_BRANCH" \ + --head "$BRANCH_NAME" \ + --body "## Summary + + Automatically generated locale updates from the weekly sync job. + + ## Changes + - Updated frontend locale files + - Generated from latest translation sources" \ + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: No changes detected + if: steps.changes.outputs.has_changes == 'false' + run: echo "No locale changes detected, skipping PR creation" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e2558c4bc..1e6ea0257 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -18,13 +18,19 @@ concurrency: jobs: backend-tests: name: "Backend Server Tests" - uses: ./.github/workflows/partial-backend.yml + uses: ./.github/workflows/test-backend.yml frontend-tests: name: "Frontend Tests" - uses: ./.github/workflows/partial-frontend.yml + uses: ./.github/workflows/test-frontend.yml - build-release: + build-package: + name: Build Package + uses: ./.github/workflows/build-package.yml + with: + tag: nightly + + publish: permissions: contents: read packages: write @@ -35,10 +41,11 @@ jobs: id-token: write name: Build Tagged Release if: github.repository == 'mealie-recipes/mealie' - uses: ./.github/workflows/partial-builder.yml + uses: ./.github/workflows/publish.yml needs: - frontend-tests - backend-tests + - build-package with: tag: nightly secrets: @@ -49,7 +56,7 @@ jobs: name: Notify Discord if: github.repository == 'mealie-recipes/mealie' needs: - - build-release + - publish runs-on: ubuntu-latest steps: - name: Discord notification diff --git a/.github/workflows/partial-builder.yml b/.github/workflows/publish.yml similarity index 90% rename from .github/workflows/partial-builder.yml rename to .github/workflows/publish.yml index 573325da1..d0fdee5a3 100644 --- a/.github/workflows/partial-builder.yml +++ b/.github/workflows/publish.yml @@ -16,14 +16,7 @@ on: required: true jobs: - build-package: - name: "Build Python package" - uses: ./.github/workflows/partial-package.yml - with: - tag: ${{ inputs.tag }} - publish: - needs: build-package runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index 1cddb2d52..cb0a9216b 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -16,20 +16,16 @@ jobs: backend-tests: name: "Backend Server Tests" - uses: ./.github/workflows/partial-backend.yml + uses: ./.github/workflows/test-backend.yml frontend-tests: name: "Frontend Tests" - uses: ./.github/workflows/partial-frontend.yml + uses: ./.github/workflows/test-frontend.yml container-scanning: name: "Trivy Container Scanning" uses: ./.github/workflows/partial-trivy-container-scanning.yml - end-to-end: - name: "End-to-End Tests" - uses: ./.github/workflows/e2e.yml - code-ql: name: "CodeQL" uses: ./.github/workflows/codeql.yml @@ -37,3 +33,33 @@ jobs: actions: read contents: read security-events: write + + build-package: + name: "Build Python package" + uses: ./.github/workflows/build-package.yml + with: + tag: e2e + + end-to-end: + name: "End-to-End Tests" + needs: build-package + uses: ./.github/workflows/e2e.yml + + publish-image: + name: "Publish PR Image" + if: contains(github.event.pull_request.labels.*.name, 'build-image') && github.repository == 'mealie-recipes/mealie' + permissions: + contents: read + packages: write + # The id-token write permission is needed to connect to Depot.dev + # as part of the partial-builder.yml action. It needs to be declared + # in the parent action, as noted here: + # https://github.com/orgs/community/discussions/76409#discussioncomment-8131390 + id-token: write + needs: build-package + uses: ./.github/workflows/publish.yml + with: + tag: pr-${{ github.event.pull_request.number }} + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55b0ec5d1..695ac4710 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,13 +7,19 @@ on: jobs: backend-tests: name: "Backend Server Tests" - uses: ./.github/workflows/partial-backend.yml + uses: ./.github/workflows/test-backend.yml frontend-tests: name: "Frontend Tests" - uses: ./.github/workflows/partial-frontend.yml + uses: ./.github/workflows/test-frontend.yml - build-release: + build-package: + name: Build Package + uses: ./.github/workflows/build-package.yml + with: + tag: ${{ github.event.release.tag_name }} + + publish: permissions: contents: read packages: write @@ -23,10 +29,11 @@ jobs: # https://github.com/orgs/community/discussions/76409#discussioncomment-8131390 id-token: write name: Build Tagged Release - uses: ./.github/workflows/partial-builder.yml + uses: ./.github/workflows/publish.yml needs: - backend-tests - frontend-tests + - build-package with: tag: ${{ github.event.release.tag_name }} tags: | @@ -39,7 +46,7 @@ jobs: notify-discord: name: Notify Discord needs: - - build-release + - publish runs-on: ubuntu-latest steps: - name: Discord notification @@ -52,7 +59,7 @@ jobs: update-image-tags: name: Update image tag in sample docker-compose files needs: - - build-release + - publish runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index c1443c1d4..9a5c50881 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -16,12 +16,13 @@ jobs: with: stale-issue-label: 'stale' exempt-issue-labels: 'pinned,security,early-stages,bug: confirmed,feedback,task' - stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' - days-before-issue-stale: 30 - days-before-issue-close: 5 + stale-issue-message: 'This issue has been automatically marked as stale because it has been open 90 days with no activity.' + days-before-issue-stale: 90 + # This stops an issue from ever getting closed automatically. + days-before-issue-close: -1 stale-pr-label: 'stale' - stale-pr-message: 'This PR is stale because it has been open 45 days with no activity.' - days-before-pr-stale: 45 + stale-pr-message: 'This PR has been automatically marked as stale because it has been open 90 days with no activity.' + days-before-pr-stale: 90 # This stops a PR from ever getting closed automatically. days-before-pr-close: -1 # If an issue/PR has a milestone, it's exempt from being marked as stale. diff --git a/.github/workflows/partial-backend.yml b/.github/workflows/test-backend.yml similarity index 100% rename from .github/workflows/partial-backend.yml rename to .github/workflows/test-backend.yml diff --git a/.github/workflows/partial-frontend.yml b/.github/workflows/test-frontend.yml similarity index 89% rename from .github/workflows/partial-frontend.yml rename to .github/workflows/test-frontend.yml index 00f8a2673..20d9c98f6 100644 --- a/.github/workflows/partial-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -14,7 +14,7 @@ jobs: - name: Setup node env 🏗 uses: actions/setup-node@v4.0.0 with: - node-version: 16 + node-version: 20 check-latest: true - name: Get yarn cache directory path 🛠 @@ -34,6 +34,10 @@ jobs: run: yarn working-directory: "frontend" + - name: Prepare nuxt 🚀 + run: yarn nuxt prepare + working-directory: "frontend" + - name: Run linter 👀 run: yarn lint working-directory: "frontend" diff --git a/.gitignore b/.gitignore index cd0725b3a..b24f03a93 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ docs/site/ *temp/* .secret frontend/dist/ +frontend/.output/* +frontend/.yarn/* +frontend/.yarnrc.yml dev/code-generation/generated/* dev/data/mealie.db-journal @@ -164,3 +167,5 @@ dev/code-generation/openapi.json .run/ .task/* +.dev.env +frontend/eslint.config.deprecated.js diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1dfd0a074..e5979b41b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: exclude: ^tests/data/ - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.9.7 + rev: v0.12.7 hooks: - id: ruff - id: ruff-format diff --git a/.vscode/settings.json b/.vscode/settings.json index b842cd45e..61ab0e239 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,6 +18,7 @@ "source.organizeImports": "never" }, "editor.formatOnSave": true, + "eslint.useFlatConfig": true, "eslint.workingDirectories": [ "./frontend" ], diff --git a/Taskfile.yml b/Taskfile.yml index c42cb76c7..c54c075db 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -70,7 +70,7 @@ tasks: dev:generate: desc: run code generators cmds: - - poetry run python dev/code-generation/main.py + - poetry run python dev/code-generation/main.py {{ .CLI_ARGS }} - task: py:format dev:services: @@ -243,7 +243,7 @@ tasks: desc: runs the frontend server dir: frontend cmds: - - yarn run dev + - yarn run dev --no-fork docker:build-from-package: desc: Builds the Docker image from the existing Python package in dist/ diff --git a/cliff.toml b/cliff.toml index c43520a59..fa5644fe3 100644 --- a/cliff.toml +++ b/cliff.toml @@ -35,7 +35,7 @@ conventional_commits = true filter_unconventional = true # regex for preprocessing the commit messages commit_preprocessors = [ - { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/hay-kot/mealie/issues/${2}))"}, + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/mealie-recipes/mealie/issues/${2}))"}, ] # regex for parsing and grouping commits commit_parsers = [ diff --git a/dev/code-generation/gen_ts_locales.py b/dev/code-generation/gen_ts_locales.py index e1b73242a..e16554592 100644 --- a/dev/code-generation/gen_ts_locales.py +++ b/dev/code-generation/gen_ts_locales.py @@ -1,3 +1,4 @@ +import os import pathlib from dataclasses import dataclass from pathlib import Path @@ -13,7 +14,7 @@ from mealie.schema._mealie import MealieModel BASE = pathlib.Path(__file__).parent.parent.parent -API_KEY = dotenv.get_key(BASE / ".env", "CROWDIN_API_KEY") +API_KEY = dotenv.get_key(BASE / ".env", "CROWDIN_API_KEY") or os.environ.get("CROWDIN_API_KEY", "") @dataclass @@ -23,19 +24,22 @@ class LocaleData: LOCALE_DATA: dict[str, LocaleData] = { - "en-US": LocaleData(name="American English"), - "en-GB": LocaleData(name="British English"), "af-ZA": LocaleData(name="Afrikaans (Afrikaans)"), "ar-SA": LocaleData(name="العربية (Arabic)", dir="rtl"), + "bg-BG": LocaleData(name="Български (Bulgarian)"), "ca-ES": LocaleData(name="Català (Catalan)"), "cs-CZ": LocaleData(name="Čeština (Czech)"), "da-DK": LocaleData(name="Dansk (Danish)"), "de-DE": LocaleData(name="Deutsch (German)"), "el-GR": LocaleData(name="Ελληνικά (Greek)"), + "en-GB": LocaleData(name="British English"), + "en-US": LocaleData(name="American English"), "es-ES": LocaleData(name="Español (Spanish)"), + "et-EE": LocaleData(name="Eesti (Estonian)"), "fi-FI": LocaleData(name="Suomi (Finnish)"), - "fr-FR": LocaleData(name="Français (French)"), "fr-BE": LocaleData(name="Belge (Belgian)"), + "fr-CA": LocaleData(name="Français canadien (Canadian French)"), + "fr-FR": LocaleData(name="Français (French)"), "gl-ES": LocaleData(name="Galego (Galician)"), "he-IL": LocaleData(name="עברית (Hebrew)", dir="rtl"), "hr-HR": LocaleData(name="Hrvatski (Croatian)"), @@ -53,6 +57,7 @@ LOCALE_DATA: dict[str, LocaleData] = { "pt-PT": LocaleData(name="Português (Portuguese)"), "ro-RO": LocaleData(name="Română (Romanian)"), "ru-RU": LocaleData(name="Pусский (Russian)"), + "sk-SK": LocaleData(name="Slovenčina (Slovak)"), "sl-SI": LocaleData(name="Slovenščina (Slovenian)"), "sr-SP": LocaleData(name="српски (Serbian)"), "sv-SE": LocaleData(name="Svenska (Swedish)"), @@ -71,7 +76,7 @@ export const LOCALES = [{% for locale in locales %} progress: {{ locale.progress }}, dir: "{{ locale.dir }}", },{% endfor %} -] +]; """ @@ -93,8 +98,8 @@ class CrowdinApi: project_id = "451976" api_key = API_KEY - def __init__(self, api_key: str): - api_key = api_key + def __init__(self, api_key: str | None): + self.api_key = api_key or API_KEY @property def headers(self) -> dict: @@ -156,12 +161,13 @@ PROJECT_DIR = Path(__file__).parent.parent.parent datetime_dir = PROJECT_DIR / "frontend" / "lang" / "dateTimeFormats" locales_dir = PROJECT_DIR / "frontend" / "lang" / "messages" -nuxt_config = PROJECT_DIR / "frontend" / "nuxt.config.js" +nuxt_config = PROJECT_DIR / "frontend" / "nuxt.config.ts" +i18n_config = PROJECT_DIR / "frontend" / "i18n.config.ts" reg_valid = PROJECT_DIR / "mealie" / "schema" / "_mealie" / "validators.py" """ This snippet walks the message and dat locales directories and generates the import information -for the nuxt.config.js file and automatically injects it into the nuxt.config.js file. Note that +for the nuxt.config.ts file and automatically injects it into the nuxt.config.ts file. Note that the code generation ID is hardcoded into the script and required in the nuxt config. """ @@ -173,12 +179,18 @@ def inject_nuxt_values(): all_langs = [] for match in locales_dir.glob("*.json"): - lang_string = f'{{ code: "{match.stem}", file: "{match.name}" }},' + match_data = LOCALE_DATA.get(match.stem) + match_dir = match_data.dir if match_data else "ltr" + + lang_string = f'{{ code: "{match.stem}", file: "{match.name.replace(".json", ".ts")}", dir: "{match_dir}" }},' all_langs.append(lang_string) + all_langs.sort() + all_date_locales.sort() + log.debug(f"injecting locales into nuxt config -> {nuxt_config}") inject_inline(nuxt_config, CodeKeys.nuxt_local_messages, all_langs) - inject_inline(nuxt_config, CodeKeys.nuxt_local_dates, all_date_locales) + inject_inline(i18n_config, CodeKeys.nuxt_local_dates, all_date_locales) def inject_registration_validation_values(): @@ -195,7 +207,7 @@ def inject_registration_validation_values(): def generate_locales_ts_file(): - api = CrowdinApi("") + api = CrowdinApi(None) models = api.get_languages() tmpl = Template(LOCALE_TEMPLATE) rendered = tmpl.render(locales=models) diff --git a/dev/code-generation/main.py b/dev/code-generation/main.py index 2fd542e7b..b2d0f2264 100644 --- a/dev/code-generation/main.py +++ b/dev/code-generation/main.py @@ -1,3 +1,4 @@ +import argparse from pathlib import Path import gen_py_pytest_data_paths @@ -11,15 +12,39 @@ CWD = Path(__file__).parent def main(): - items = [ - (gen_py_schema_exports.main, "schema exports"), - (gen_ts_types.main, "frontend types"), - (gen_ts_locales.main, "locales"), - (gen_py_pytest_data_paths.main, "test data paths"), - (gen_py_pytest_routes.main, "pytest routes"), - ] + parser = argparse.ArgumentParser(description="Run code generators") + parser.add_argument( + "generators", + nargs="*", + help="Specific generators to run (schema, types, locales, data-paths, routes). If none specified, all will run.", # noqa: E501 - long line + ) + args = parser.parse_args() - for func, name in items: + # Define all available generators + all_generators = { + "schema": (gen_py_schema_exports.main, "schema exports"), + "types": (gen_ts_types.main, "frontend types"), + "locales": (gen_ts_locales.main, "locales"), + "data-paths": (gen_py_pytest_data_paths.main, "test data paths"), + "routes": (gen_py_pytest_routes.main, "pytest routes"), + } + + # Determine which generators to run + if args.generators: + # Validate requested generators + invalid_generators = [g for g in args.generators if g not in all_generators] + if invalid_generators: + log.error(f"Invalid generator(s): {', '.join(invalid_generators)}") + log.info(f"Available generators: {', '.join(all_generators.keys())}") + return + + generators_to_run = [(all_generators[g][0], all_generators[g][1]) for g in args.generators] + else: + # Run all generators (default behavior) + generators_to_run = list(all_generators.values()) + + # Run the selected generators + for func, name in generators_to_run: log.info(f"Generating {name}...") func() diff --git a/dev/code-generation/utils/template.py b/dev/code-generation/utils/template.py index 6312426e2..32ecf9c47 100644 --- a/dev/code-generation/utils/template.py +++ b/dev/code-generation/utils/template.py @@ -1,5 +1,4 @@ import logging -import re import subprocess from dataclasses import dataclass from pathlib import Path @@ -35,7 +34,7 @@ class CodeSlicer: start: int end: int - indentation: str + indentation: str | None text: list[str] _next_line = None @@ -47,15 +46,24 @@ class CodeSlicer: def push_line(self, string: str) -> None: self._next_line = self._next_line or self.start + 1 - self.text.insert(self._next_line, self.indentation + string + "\n") + self.text.insert(self._next_line, (self.indentation or "") + string + "\n") self._next_line += 1 -def get_indentation_of_string(line: str, comment_char: str = "//|#") -> str: - return re.sub(rf"{comment_char}.*", "", line).removesuffix("\n") +def get_indentation_of_string(line: str) -> str: + # Extract everything before the comment + if "//" in line: + indentation = line.split("//")[0] + elif "#" in line: + indentation = line.split("#")[0] + else: + indentation = line + + # Keep only the whitespace, remove any non-whitespace characters + return "".join(c for c in indentation if c.isspace()) -def find_start_end(file_text: list[str], gen_id: str) -> tuple[int, int, str]: +def find_start_end(file_text: list[str], gen_id: str) -> tuple[int, int, str | None]: start = None end = None indentation = None diff --git a/dev/data/templates/recipes.md b/dev/data/templates/recipes.md deleted file mode 100644 index eda4c6e14..000000000 --- a/dev/data/templates/recipes.md +++ /dev/null @@ -1,24 +0,0 @@ - - -![Recipe Image](../../images/{{ recipe.slug }}/original.jpg) - -# {{ recipe.name }} -{{ recipe.description }} - -## Ingredients -{% for ingredient in recipe.recipeIngredient %} -- [ ] {{ ingredient }} {% endfor %} - -## Instructions -{% for step in recipe.recipeInstructions %} -- [ ] {{ step.text }} {% endfor %} - -{% for note in recipe.notes %} -**{{ note.title }}:** {{ note.text }} -{% endfor %} - ---- - -Tags: {{ recipe.tags }} -Categories: {{ recipe.categories }} -Original URL: {{ recipe.orgURL }} diff --git a/dev/scripts/all_recipes_stress_test.py b/dev/scripts/all_recipes_stress_test.py index 0ce27cb13..ffdded3a0 100644 --- a/dev/scripts/all_recipes_stress_test.py +++ b/dev/scripts/all_recipes_stress_test.py @@ -44,7 +44,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1 cup unsalted butter, cut into cubes", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "ea3b6702-9532-4fbc-a40b-f99917831c26", @@ -54,7 +53,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1 cup light brown sugar", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "c5bbfefb-1e23-4ffd-af88-c0363a0fae82", @@ -64,7 +62,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1/2 cup granulated white sugar", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "034f481b-c426-4a17-b983-5aea9be4974b", @@ -74,7 +71,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "2 large eggs", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "37c1f796-3bdb-4856-859f-dbec90bc27e4", @@ -84,7 +80,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "2 tsp vanilla extract", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "85561ace-f249-401d-834c-e600a2f6280e", @@ -94,7 +89,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1/2 cup creamy peanut butter", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "ac91bda0-e8a8-491a-976a-ae4e72418cfd", @@ -104,7 +98,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1 tsp cornstarch", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "4d1256b3-115e-4475-83cd-464fbc304cb0", @@ -114,7 +107,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1 tsp baking soda", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "64627441-39f9-4ee3-8494-bafe36451d12", @@ -124,7 +116,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1/2 tsp salt", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "7ae212d0-3cd1-44b0-899e-ec5bd91fd384", @@ -134,7 +125,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1 cup cake flour", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "06967994-8548-4952-a8cc-16e8db228ebd", @@ -144,7 +134,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "2 cups all-purpose flour", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "bdb33b23-c767-4465-acf8-3b8e79eb5691", @@ -154,7 +143,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "2 cups peanut butter chips", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "12ba0af8-affd-4fb2-9cca-6f1b3e8d3aef", @@ -164,7 +152,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "note": "1½ cups Reese's Pieces candies", "unit": None, "food": None, - "disableAmount": True, "quantity": 1, "originalText": None, "referenceId": "4bdc0598-a3eb-41ee-8af0-4da9348fbfe2", @@ -221,7 +208,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic "showAssets": False, "landscapeView": False, "disableComments": False, - "disableAmount": True, "locked": False, }, "assets": [], diff --git a/dev/scripts/convert_seed_files_to_new_format.py b/dev/scripts/convert_seed_files_to_new_format.py new file mode 100644 index 000000000..cb689a6a0 --- /dev/null +++ b/dev/scripts/convert_seed_files_to_new_format.py @@ -0,0 +1,75 @@ +import glob +import json +import pathlib + + +def get_seed_locale_names() -> set[str]: + """Find all locales in the seed/resources/ folder + + Returns: + A set of every file name where there's both a seed label and seed food file + """ + + LABELS_PATH = "/workspaces/mealie/mealie/repos/seed/resources/labels/locales/" + FOODS_PATH = "/workspaces/mealie/mealie/repos/seed/resources/foods/locales/" + label_locales = glob.glob("*.json", root_dir=LABELS_PATH) + foods_locales = glob.glob("*.json", root_dir=FOODS_PATH) + + # ensure that a locale has both a label and a food seed file + return set(label_locales).intersection(foods_locales) + + +def get_labels_from_file(locale: str) -> list[str]: + """Query a locale to get all of the labels so that they can be added to the new foods seed format + + Returns: + All of the labels found within the seed file for a given locale + """ + + locale_path = pathlib.Path("/workspaces/mealie/mealie/repos/seed/resources/labels/locales/" + locale) + label_names = [label["name"] for label in json.loads(locale_path.read_text(encoding="utf-8"))] + return label_names + + +def transform_foods(locale: str): + """ + Convert the current food seed file for a locale into a new format which maps each food to a label + + Existing format of foods seed file is a dictionary where each key is a food name and the values are a dictionary + of attributes such as name and plural_name + + New format maps each food to a label. The top-level dictionary has each key as a label e.g. "Fruits". + Each label key as a value that is a dictionary with an element called "foods" + "Foods" is a dictionary of each food for that label, with a key of the english food name e.g. "baking-soda" + and a value of attributes, including the translated name of the item e.g. "bicarbonate of soda" for en-GB. + """ + + locale_path = pathlib.Path("/workspaces/mealie/mealie/repos/seed/resources/foods/locales/" + locale) + + with open(locale_path, encoding="utf-8") as infile: + data = json.load(infile) + + first_value = next(iter(data.values())) + if isinstance(first_value, dict) and "foods" in first_value: + # Locale is already in the new format, skipping transformation + return + + transformed_data = {"": {"foods": dict(data.items())}} + + # Seeding for labels now pulls from the foods file and parses the labels from there (as top-level keys), + # thus we need to add all of the existing labels to the new food seed file and give them an empty foods dictionary + label_names = get_labels_from_file(locale) + for label in label_names: + transformed_data[label] = {"foods": {}} + + with open(locale_path, "w", encoding="utf-8") as outfile: + json.dump(transformed_data, outfile, indent=4, ensure_ascii=False) + + +def main(): + for locale in get_seed_locale_names(): + transform_foods(locale) + + +if __name__ == "__main__": + main() diff --git a/docker/Dockerfile b/docker/Dockerfile index 92d9c48fe..e745a574d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ ############################################### # Frontend Build ############################################### -FROM node:16 AS frontend-builder +FROM node:20 AS frontend-builder WORKDIR /frontend @@ -20,7 +20,7 @@ RUN yarn generate ############################################### # Base Image - Python ############################################### -FROM python:3.12-slim as python-base +FROM python:3.12-slim AS python-base ENV MEALIE_HOME="/app" @@ -119,7 +119,7 @@ RUN . $VENV_PATH/bin/activate \ ############################################### # Production Image ############################################### -FROM python-base as production +FROM python-base AS production LABEL org.opencontainers.image.source="https://github.com/mealie-recipes/mealie" ENV PRODUCTION=true ENV TESTING=false @@ -141,6 +141,11 @@ RUN mkdir -p /run/secrets # Copy venv into image. It contains a fully-installed mealie backend and frontend. COPY --from=venv-builder $VENV_PATH $VENV_PATH +# install nltk data for the ingredient parser +ENV NLTK_DATA="/nltk_data/" +RUN mkdir -p $NLTK_DATA +RUN python -m nltk.downloader -d $NLTK_DATA averaged_perceptron_tagger_eng + VOLUME [ "$MEALIE_HOME/data/" ] ENV APP_PORT=9000 diff --git a/docs/docs/documentation/community-guide/home-assistant.md b/docs/docs/documentation/community-guide/home-assistant.md index d11db6a8d..e3a1c4dd0 100644 --- a/docs/docs/documentation/community-guide/home-assistant.md +++ b/docs/docs/documentation/community-guide/home-assistant.md @@ -13,14 +13,14 @@ Steps: #### 1. Get your API Token -Create an API token from Mealie's User Settings page (https://hay-kot.github.io/mealie/documentation/users-groups/user-settings/#api-key-generation) +Create an API token from Mealie's User Settings page (https://docs.mealie.io/documentation/getting-started/api-usage/#getting-a-token) #### 2. Create Home Assistant Sensors Create REST sensors in home assistant to get the details of today's meal. We will create sensors to get the name and ID of the first meal in today's meal plan (note that this may not be what is wanted if there is more than one meal planned for the day). We need the ID as well as the name to be able to retrieve the image for the meal. -Make sure the url and port (`http://mealie:9000` ) matches your installation's address and _API_ port. +Make sure the url and port (`http://mealie:9000`) matches your installation's address and _API_ port. ```yaml rest: diff --git a/docs/docs/documentation/community-guide/ios-shortcut.md b/docs/docs/documentation/community-guide/ios-shortcut.md new file mode 100644 index 000000000..400dab15d --- /dev/null +++ b/docs/docs/documentation/community-guide/ios-shortcut.md @@ -0,0 +1,27 @@ +!!! info + This guide was submitted by a community member. Find something wrong? Submit a PR to get it fixed! + +An easy way to add recipes to Mealie from an Apple device is via an Apple Shortcut. This is a short guide to install an configure a shortcut able to add recipes via a link or image(s). + +*Note: if adding via images make sure to enable [Mealie's openai integration](https://docs.mealie.io/documentation/getting-started/installation/open-ai/)* + +## Javascript can only be run via Shortcuts on the Safari browser on MacOS and iOS. If you do not use Safari you may skip this section +Some sites have begun blocking AI scraping bots, inadvertently blocking the recipe scraping library Mealie uses as well. To circumvent this, the shortcut uses javascript to capture the raw html loaded in the browser and sends that to mealie when possible. + +**iOS** + +Settings app -> apps -> Shortcuts -> Advanced -> Allow Running Scripts + +**MacOS** + +Shortcuts app -> Settings (CMD ,) -> Advanced -> Allow Running Scripts + +## Initial setup +An API key is needed to authenticate with mealie. To create an api key for a user, navigate to http://YOUR_MEALIE_URL/user/profile/api-tokens. Alternatively you can create a key via the mealie home page by clicking the user's profile pic in the top left -> Api Tokens + +The shortcut can be installed via **[This link](https://www.icloud.com/shortcuts/52834724050b42aebe0f2efd8d067360)**. Upon install, replace "MEALIE_API_KEY" with the API key generated previously and "MEALIE_URI" with the full URL used to access your mealie instance e.g. "http://10.0.0.5:9000" or "https://mealie.domain.com". + +## Using the shortcut +Once installed, the shortcut will automatically appear as an option when sharing an image or webpage. It can also be useful to add the shortcut to the home screen of your device. If selected from the home screen or shortcuts app, a menu will appear with prompts to import via **taking photo(s)**, **selecting photo(s)**, **scanning a URL**, or **pasting a URL**. + +*Note: despite the mealie API being able to accept multiple recipe images for import it is currently impossible to send multiple files in 1 web request via Shortcuts. Instead, the shortcut combines the images into a singular, vertically-concatenated image to send to mealie. This can result in slightly less-accurate text recognition.* \ No newline at end of file diff --git a/docs/docs/documentation/community-guide/ios.md b/docs/docs/documentation/community-guide/ios.md deleted file mode 100644 index 11a875e93..000000000 --- a/docs/docs/documentation/community-guide/ios.md +++ /dev/null @@ -1,82 +0,0 @@ -# Using iOS Shortcuts with Mealie - -!!! info - This guide was submitted by a community member. Find something wrong? Submit a PR to get it fixed! - -Don't know what an iOS shortcut is? Neither did I! Experienced iOS users may already be familiar with this utility but for the uninitiated, here is the official Apple explanation: - -> A shortcut is a quick way to get one or more tasks done with your apps. The Shortcuts app lets you create your own shortcuts with multiple steps. For example, build a “Surf Time” shortcut that grabs the surf report, gives an ETA to the beach, and launches your surf music playlist. - -Basically it is a visual scripting language that lets a user build an automation in a guided fashion. The automation can be [shared with anyone](https://www.icloud.com/shortcuts/94aa272af5ff4d2c8fe5e13a946f89a9) but if it is a user creation, you'll have to jump through a few hoops to make an untrusted automation work on your device. - -## Setup Video - -The following YouTube video walks through setting up the shortcut in 3 minutes for those who prefer following along visually. - - - -## Guide - -### Prerequisites - -Before setting up the shortcut, make sure you have the following information ready and easily accessable on your Apple device. - -1. The URL of your Mealie instance -2. An API Key for your user -3. A Gemini API Key from [Google AI Studio](https://makersuite.google.com) - -!!! note - A Gemini API Key is not required for importing URLs from Safari or your Camera, however you will not be able to take a photo of a recipe and import it without a Gemini key. - - Google AI Studio is currently only available in [certain countries and languages](https://ai.google.dev/available_regions). Most notably it is not currently available in Europe. - -### Setup - -On the Apple device you wish to add the shortcut to, click on [this link](https://www.icloud.com/shortcuts/94aa272af5ff4d2c8fe5e13a946f89a9) to begin the setup of the shortcut. - -![screenshot](../../assets/img/ios/setup.png) - -Next, you need to replace `url` and `port` with the information for your Mealie instance. - -If you have a domain that you use (e.g. `https://mealie.example.com`), put that here. If you just run local, then you need to put in your Mealie instance IP and the port you use (e.g. the default is `9925`). - -![screenshot](../../assets/img/ios/url.png) - -Next, you need to replace `MEALIE_API_KEY` with your API token. - -![screenshot](../../assets/img/ios/api.png) - -Finally, replace `GEMINI_API_KEY` with the one you got from [Google AI Studio](https://makersuite.google.com) - -![screenshot](../../assets/img/ios/gemini.png) - -You may wish to [add the shortcut to your home screen](https://support.apple.com/guide/shortcuts/add-a-shortcut-to-the-home-screen-apd735880972/ios) for easier access. - -## Features - -- Share a website from Safari with Mealie to import via URL. -- Share a recipe photo from photos to perform OCR and import a physical recipe. -- Trigger the shortcut and take a photo of a physical recipe to import. -- Trigger the shortcut to select a photo from your Photos app to import. -- Trigger the shortcut to take a picture of a URL (like on the bottom of a printed recipe) to import. - -## Troubleshooting - -Sometimes Gemini will not be able to parse a recipe, and you will get an error. Users have found success with a combination of the following: - -1. #### Try Again - Sometimes Gemini returns the wrong information which causes the import to fail. Often, trying again will be successful. - -2. #### Photo Quality - Make sure there is no large glare or shadow over the picture, and you have all the text in frame. - -3. #### Edit the Photo - Users have found success by cropping the picture to just the recipe card, adding a "mono" filter, and cranking up the exposure before importing. - -## History - -User [brasilikum](https://github.com/brasilikum) opened an issue on the main repo about how they had created an [iOS shortcut](https://github.com/mealie-recipes/mealie/issues/103) for interested users. - -This original method broke after the transition to version 1.X and an issue was raised on [Github](https://github.com/mealie-recipes/mealie/issues/2092) GitHub user [Zippyy](https://github.com/zippyy) has helped to create a working shortcut for version 1.X. - -When OCR was removed from Mealie, GitHub user [hunterjm](https://github.com/zippyy) created a new shortcut that uses Apple's built-in OCR and Google Gemini to enhance and replace that functionality. diff --git a/docs/docs/documentation/getting-started/authentication/oidc-v2.md b/docs/docs/documentation/getting-started/authentication/oidc-v2.md index ee8c3ba9b..98abc0397 100644 --- a/docs/docs/documentation/getting-started/authentication/oidc-v2.md +++ b/docs/docs/documentation/getting-started/authentication/oidc-v2.md @@ -52,6 +52,8 @@ Before you can start using OIDC Authentication, you must first configure a new c Take the client id and your discovery URL and update your environment variables to include the required OIDC variables described in [Installation - Backend Configuration](../installation/backend-config.md#openid-connect-oidc). +You might also want to set ALLOW_PASSWORD_LOGIN to false, to hide the username+password inputs, if you want to allow logins only via OIDC. + ### Groups There are two (optional) [environment variables](../installation/backend-config.md#openid-connect-oidc) that can control which of the users in your IdP can log in to Mealie and what permissions they will have. Keep in mind that these groups **do not necessarily correspond to groups in Mealie**. The groups claim is configurable via the `OIDC_GROUPS_CLAIM` environment variable. The groups should be **defined in your IdP** and be returned in the configured claim value. diff --git a/docs/docs/documentation/getting-started/authentication/oidc.md b/docs/docs/documentation/getting-started/authentication/oidc.md index 9eb889f02..5edb1e7b8 100644 --- a/docs/docs/documentation/getting-started/authentication/oidc.md +++ b/docs/docs/documentation/getting-started/authentication/oidc.md @@ -36,6 +36,10 @@ Before you can start using OIDC Authentication, you must first configure a new c http://localhost:9091/login https://mealie.example.com/login + If you are hosting Mealie behind a reverse proxy (nginx, Caddy, ...) to terminate TLS, make sure to start Mealie's Gunicorn server + with `--forwarded-allow-ips=`, otherwise the `X-Forwarded-*` headers will be ignored and the generated OIDC redirect + URI will use the wrong scheme (http instead of https). This will lead to authentication errors with strict OIDC providers. + 3. Configure origins If your identity provider enforces CORS on any endpoints, you will need to specify your Mealie URL as an Allowed Origin. diff --git a/docs/docs/documentation/getting-started/faq.md b/docs/docs/documentation/getting-started/faq.md index 365663a62..dc7c0caf9 100644 --- a/docs/docs/documentation/getting-started/faq.md +++ b/docs/docs/documentation/getting-started/faq.md @@ -148,7 +148,7 @@ ```shell docker exec -it mealie bash - python /app/mealie/scripts/reset_locked_users.py + python /opt/mealie/lib64/python3.12/site-packages/mealie/scripts/reset_locked_users.py ``` @@ -161,7 +161,7 @@ ```shell docker exec -it mealie bash - python /app/mealie/scripts/make_admin.py + python /opt/mealie/lib64/python3.12/site-packages/mealie/scripts/make_admin.py ``` @@ -174,7 +174,7 @@ ```shell docker exec -it mealie bash - python /app/mealie/scripts/change_password.py + python /opt/mealie/lib64/python3.12/site-packages/mealie/scripts/change_password.py ``` diff --git a/docs/docs/documentation/getting-started/installation/backend-config.md b/docs/docs/documentation/getting-started/installation/backend-config.md index 819629979..2fd34f973 100644 --- a/docs/docs/documentation/getting-started/installation/backend-config.md +++ b/docs/docs/documentation/getting-started/installation/backend-config.md @@ -16,6 +16,7 @@ | API_DOCS | True | Turns on/off access to the API documentation locally | | TZ | UTC | Must be set to get correct date/time on the server | | ALLOW_SIGNUP\* | false | Allow user sign-up without token | +| ALLOW_PASSWORD_LOGIN | true | Whether or not to display the username+password input fields. Keep set to true unless you use OIDC authentication | | LOG_CONFIG_OVERRIDE | | Override the config for logging with a custom path | | LOG_LEVEL | info | Logging level (e.g. critical, error, warning, info, debug) | | DAILY_SCHEDULE_TIME | 23:45 | The time of day to run daily server tasks, in HH:MM format. Use the server's local time, *not* UTC | @@ -108,7 +109,9 @@ For usage, see [Usage - OpenID Connect](../authentication/oidc-v2.md) | OIDC_REMEMBER_ME | False | Because redirects bypass the login screen, you cant extend your session by clicking the "Remember Me" checkbox. By setting this value to true, a session will be extended as if "Remember Me" was checked | | OIDC_SIGNING_ALGORITHM | RS256 | The algorithm used to sign the id token (examples: RS256, HS256) | | OIDC_USER_CLAIM | email | This is the claim which Mealie will use to look up an existing user by (e.g. "email", "preferred_username") | +| OIDC_NAME_CLAIM | name | This is the claim which Mealie will use for the users Full Name | | OIDC_GROUPS_CLAIM | groups | Optional if not using `OIDC_USER_GROUP` or `OIDC_ADMIN_GROUP`. This is the claim Mealie will request from your IdP and will use to compare to `OIDC_USER_GROUP` or `OIDC_ADMIN_GROUP` to allow the user to log in to Mealie or is set as an admin. **Your IdP must be configured to grant this claim** | +| OIDC_SCOPES_OVERRIDE | None | Advanced configuration used to override the scopes requested from the IdP. **Most users won't need to change this**. At a minimum, 'openid profile email' are required. | | OIDC_TLS_CACERTFILE | None | File path to Certificate Authority used to verify server certificate (e.g. `/path/to/ca.crt`) | ### OpenAI @@ -118,13 +121,17 @@ For usage, see [Usage - OpenID Connect](../authentication/oidc-v2.md) Mealie supports various integrations using OpenAI. For more information, check out our [OpenAI documentation](./open-ai.md). For custom mapping variables (e.g. OPENAI_CUSTOM_HEADERS) you should pass values as JSON encoded strings (e.g. `OPENAI_CUSTOM_PARAMS='{"k1": "v1", "k2": "v2"}'`) -| Variables | Default | Description | -| ------------------------------------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------- | -| OPENAI_BASE_URL[†][secrets] | None | The base URL for the OpenAI API. If you're not sure, leave this empty to use the standard OpenAI platform | -| OPENAI_API_KEY[†][secrets] | None | Your OpenAI API Key. Enables OpenAI-related features | -| OPENAI_MODEL | gpt-4o | Which OpenAI model to use. If you're not sure, leave this empty | -| OPENAI_WORKERS | 2 | Number of OpenAI workers per request. Higher values may increase processing speed, but will incur additional API costs | -| OPENAI_SEND_DATABASE_DATA | True | Whether to send Mealie data to OpenAI to improve request accuracy. This will incur additional API costs | +| Variables | Default | Description | +| ------------------------------------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| OPENAI_BASE_URL[†][secrets] | None | The base URL for the OpenAI API. If you're not sure, leave this empty to use the standard OpenAI platform | +| OPENAI_API_KEY[†][secrets] | None | Your OpenAI API Key. Enables OpenAI-related features | +| OPENAI_MODEL | gpt-4o | Which OpenAI model to use. If you're not sure, leave this empty | +| OPENAI_CUSTOM_HEADERS | None | Custom HTTP headers to add to all OpenAI requests. This should generally be left empty unless your custom service requires them | +| OPENAI_CUSTOM_PARAMS | None | Custom HTTP query params to add to all OpenAI requests. This should generally be left empty unless your custom service requires them | +| OPENAI_ENABLE_IMAGE_SERVICES | True | Whether to enable OpenAI image services, such as creating recipes via image. Leave this enabled unless your custom model doesn't support it, or you want to reduce costs | +| OPENAI_WORKERS | 2 | Number of OpenAI workers per request. Higher values may increase processing speed, but will incur additional API costs | +| OPENAI_SEND_DATABASE_DATA | True | Whether to send Mealie data to OpenAI to improve request accuracy. This will incur additional API costs | +| OPENAI_REQUEST_TIMEOUT | 60 | The number of seconds to wait for an OpenAI request to complete before cancelling the request. Leave this empty unless you're running into timeout issues on slower hardware | ### Theming @@ -149,8 +156,6 @@ Setting the following environmental variables will change the theme of the front ### Docker Secrets -### Docker Secrets - > Starting in version `2.4.2`, any environment variable in the preceding lists with a dagger > symbol next to them support the Docker Compose secrets pattern, below. [Docker Compose secrets][docker-secrets] can be used to secure sensitive information regarding the Mealie implementation diff --git a/docs/docs/documentation/getting-started/installation/installation-checklist.md b/docs/docs/documentation/getting-started/installation/installation-checklist.md index f4bc7fcc9..9bae44c00 100644 --- a/docs/docs/documentation/getting-started/installation/installation-checklist.md +++ b/docs/docs/documentation/getting-started/installation/installation-checklist.md @@ -31,7 +31,7 @@ To deploy mealie on your local network, it is highly recommended to use Docker t We've gone through a few versions of Mealie v1 deployment targets. We have settled on a single container deployment, and we've begun publishing the nightly container on github containers. If you're looking to move from the old nightly (split containers _or_ the omni image) to the new nightly, there are a few things you need to do: 1. Take a backup just in case! -2. Replace the image for the API container with `ghcr.io/mealie-recipes/mealie:v2.7.1` +2. Replace the image for the API container with `ghcr.io/mealie-recipes/mealie:v3.0.2` 3. Take the external port from the frontend container and set that as the port mapped to port `9000` on the new container. The frontend is now served on port 9000 from the new container, so it will need to be mapped for you to have access. 4. Restart the container diff --git a/docs/docs/documentation/getting-started/installation/postgres.md b/docs/docs/documentation/getting-started/installation/postgres.md index cee6869fc..9d8d94853 100644 --- a/docs/docs/documentation/getting-started/installation/postgres.md +++ b/docs/docs/documentation/getting-started/installation/postgres.md @@ -1,5 +1,8 @@ # Installing with PostgreSQL +!!! Warning + When upgrading postgresql major versions, manual steps are required [Postgres#37](https://github.com/docker-library/postgres/issues/37). + PostgreSQL might be considered if you need to support many concurrent users. In addition, some features are only enabled on PostgreSQL, such as fuzzy search. **For Environment Variable Configuration, see** [Backend Configuration](./backend-config.md) @@ -7,7 +10,7 @@ PostgreSQL might be considered if you need to support many concurrent users. In ```yaml services: mealie: - image: ghcr.io/mealie-recipes/mealie:v2.7.1 # (3) + image: ghcr.io/mealie-recipes/mealie:v3.0.2 # (3) container_name: mealie restart: always ports: @@ -38,7 +41,7 @@ services: postgres: container_name: postgres - image: postgres:15 + image: postgres:17 restart: always volumes: - mealie-pgdata:/var/lib/postgresql/data @@ -46,6 +49,7 @@ services: POSTGRES_PASSWORD: mealie POSTGRES_USER: mealie PGUSER: mealie + POSTGRES_DB: mealie healthcheck: test: ["CMD", "pg_isready"] interval: 30s diff --git a/docs/docs/documentation/getting-started/installation/sqlite.md b/docs/docs/documentation/getting-started/installation/sqlite.md index d2aa216eb..38e436176 100644 --- a/docs/docs/documentation/getting-started/installation/sqlite.md +++ b/docs/docs/documentation/getting-started/installation/sqlite.md @@ -11,7 +11,7 @@ SQLite is a popular, open source, self-contained, zero-configuration database th ```yaml services: mealie: - image: ghcr.io/mealie-recipes/mealie:v2.7.1 # (3) + image: ghcr.io/mealie-recipes/mealie:v3.0.2 # (3) container_name: mealie restart: always ports: diff --git a/docs/docs/documentation/getting-started/roadmap.md b/docs/docs/documentation/getting-started/roadmap.md index fd4b66876..9cc71fcf4 100644 --- a/docs/docs/documentation/getting-started/roadmap.md +++ b/docs/docs/documentation/getting-started/roadmap.md @@ -2,6 +2,3 @@ ## Feature Requests [Please request new features on Github](https://github.com/mealie-recipes/mealie/discussions/new?category=feature-request) - -## Progress -See the [Github Projects page](https://github.com/users/hay-kot/projects/2) to see what is currently being worked on diff --git a/docs/docs/overrides/api.html b/docs/docs/overrides/api.html index 59339890d..a6f596205 100644 --- a/docs/docs/overrides/api.html +++ b/docs/docs/overrides/api.html @@ -14,7 +14,7 @@
diff --git a/docs/docs/overrides/home.html b/docs/docs/overrides/home.html index 8112b3153..b5439d0fd 100644 --- a/docs/docs/overrides/home.html +++ b/docs/docs/overrides/home.html @@ -351,7 +351,7 @@