mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-21 22:13:31 -07:00
Merge branch 'mealie-next' into patch-1
This commit is contained in:
commit
07efca5f91
68 changed files with 1762 additions and 863 deletions
|
@ -6,7 +6,7 @@
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
__pycache__/
|
**/__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
*.so
|
*.so
|
||||||
|
@ -25,9 +25,11 @@ venv
|
||||||
|
|
||||||
*/node_modules
|
*/node_modules
|
||||||
*/dist
|
*/dist
|
||||||
|
/dist/
|
||||||
*/data/db
|
*/data/db
|
||||||
*/mealie/test
|
*/mealie/test
|
||||||
*/mealie/.temp
|
*/mealie/.temp
|
||||||
|
/mealie/frontend/
|
||||||
|
|
||||||
model.crfmodel
|
model.crfmodel
|
||||||
|
|
||||||
|
|
14
.github/workflows/e2e.yml
vendored
14
.github/workflows/e2e.yml
vendored
|
@ -3,8 +3,15 @@ on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-package:
|
||||||
|
name: "Build Python package"
|
||||||
|
uses: ./.github/workflows/partial-package.yml
|
||||||
|
with:
|
||||||
|
tag: e2e
|
||||||
|
|
||||||
test:
|
test:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
needs: build-package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -18,11 +25,18 @@ jobs:
|
||||||
cache-dependency-path: ./tests/e2e/yarn.lock
|
cache-dependency-path: ./tests/e2e/yarn.lock
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Retrieve Python package
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: backend-dist
|
||||||
|
path: dist
|
||||||
- name: Build Image
|
- name: Build Image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
context: .
|
context: .
|
||||||
|
build-contexts: |
|
||||||
|
packages=dist
|
||||||
push: false
|
push: false
|
||||||
load: true
|
load: true
|
||||||
tags: mealie:e2e
|
tags: mealie:e2e
|
||||||
|
|
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
|
@ -21,7 +21,7 @@ jobs:
|
||||||
uses: ./.github/workflows/partial-backend.yml
|
uses: ./.github/workflows/partial-backend.yml
|
||||||
|
|
||||||
frontend-tests:
|
frontend-tests:
|
||||||
name: "Frontend and End-to-End Tests"
|
name: "Frontend Tests"
|
||||||
uses: ./.github/workflows/partial-frontend.yml
|
uses: ./.github/workflows/partial-frontend.yml
|
||||||
|
|
||||||
build-release:
|
build-release:
|
||||||
|
|
2
.github/workflows/partial-backend.yml
vendored
2
.github/workflows/partial-backend.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Backend Test/Lint
|
name: Backend Lint and Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
19
.github/workflows/partial-builder.yml
vendored
19
.github/workflows/partial-builder.yml
vendored
|
@ -16,7 +16,14 @@ on:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-package:
|
||||||
|
name: "Build Python package"
|
||||||
|
uses: ./.github/workflows/partial-package.yml
|
||||||
|
with:
|
||||||
|
tag: ${{ inputs.tag }}
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
|
needs: build-package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
@ -35,18 +42,22 @@ jobs:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Override __init__.py
|
|
||||||
run: |
|
|
||||||
echo "__version__ = \"${{ inputs.tag }}\"" > ./mealie/__init__.py
|
|
||||||
|
|
||||||
- uses: depot/setup-action@v1
|
- uses: depot/setup-action@v1
|
||||||
|
|
||||||
|
- name: Retrieve Python package
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: backend-dist
|
||||||
|
path: dist
|
||||||
|
|
||||||
- name: Build and push Docker image, via Depot.dev
|
- name: Build and push Docker image, via Depot.dev
|
||||||
uses: depot/build-push-action@v1
|
uses: depot/build-push-action@v1
|
||||||
with:
|
with:
|
||||||
project: srzjb6mhzm
|
project: srzjb6mhzm
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
context: .
|
context: .
|
||||||
|
build-contexts: |
|
||||||
|
packages=dist
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
|
36
.github/workflows/partial-frontend.yml
vendored
36
.github/workflows/partial-frontend.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Frontend Build/Lin
|
name: Frontend Lint and Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
@ -41,37 +41,3 @@ jobs:
|
||||||
- name: Run tests 🧪
|
- name: Run tests 🧪
|
||||||
run: yarn test:ci
|
run: yarn test:ci
|
||||||
working-directory: "frontend"
|
working-directory: "frontend"
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout 🛎
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup node env 🏗
|
|
||||||
uses: actions/setup-node@v4.0.0
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
check-latest: true
|
|
||||||
|
|
||||||
- name: Get yarn cache directory path 🛠
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Cache node_modules 📦
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- name: Install dependencies 👨🏻💻
|
|
||||||
run: yarn
|
|
||||||
working-directory: "frontend"
|
|
||||||
|
|
||||||
- name: Run Build 🚚
|
|
||||||
run: yarn build
|
|
||||||
working-directory: "frontend"
|
|
||||||
|
|
102
.github/workflows/partial-package.yml
vendored
Normal file
102
.github/workflows/partial-package.yml
vendored
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
name: Package build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-frontend:
|
||||||
|
name: Build frontend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout 🛎
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup node env 🏗
|
||||||
|
uses: actions/setup-node@v4.0.0
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Get yarn cache directory path 🛠
|
||||||
|
id: yarn-cache-dir-path
|
||||||
|
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Cache node_modules 📦
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
|
- name: Install dependencies 👨🏻💻
|
||||||
|
run: yarn
|
||||||
|
working-directory: "frontend"
|
||||||
|
|
||||||
|
- name: Run Build 🚚
|
||||||
|
run: yarn generate
|
||||||
|
working-directory: "frontend"
|
||||||
|
|
||||||
|
- name: Archive built frontend
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: frontend-dist
|
||||||
|
path: frontend/dist
|
||||||
|
retention-days: 5
|
||||||
|
|
||||||
|
build-package:
|
||||||
|
name: Build Python package
|
||||||
|
needs: build-frontend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install Task
|
||||||
|
uses: arduino/setup-task@v2
|
||||||
|
with:
|
||||||
|
version: 3.x
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- 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
|
||||||
|
plugins: |
|
||||||
|
poetry-plugin-export
|
||||||
|
|
||||||
|
- name: Retrieve built frontend
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: frontend-dist
|
||||||
|
path: mealie/frontend
|
||||||
|
|
||||||
|
- name: Override __init__.py
|
||||||
|
run: |
|
||||||
|
echo "__version__ = \"${{ inputs.tag }}\"" > ./mealie/__init__.py
|
||||||
|
|
||||||
|
- name: Build package and requirements.txt
|
||||||
|
env:
|
||||||
|
SKIP_PACKAGE_DEPS: true
|
||||||
|
run: |
|
||||||
|
task py:package
|
||||||
|
|
||||||
|
- name: Archive built package
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: backend-dist
|
||||||
|
path: dist
|
||||||
|
retention-days: 5
|
2
.github/workflows/pull-requests.yml
vendored
2
.github/workflows/pull-requests.yml
vendored
|
@ -19,7 +19,7 @@ jobs:
|
||||||
uses: ./.github/workflows/partial-backend.yml
|
uses: ./.github/workflows/partial-backend.yml
|
||||||
|
|
||||||
frontend-tests:
|
frontend-tests:
|
||||||
name: "Frontend and End-to-End Tests"
|
name: "Frontend Tests"
|
||||||
uses: ./.github/workflows/partial-frontend.yml
|
uses: ./.github/workflows/partial-frontend.yml
|
||||||
|
|
||||||
container-scanning:
|
container-scanning:
|
||||||
|
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -10,7 +10,7 @@ jobs:
|
||||||
uses: ./.github/workflows/partial-backend.yml
|
uses: ./.github/workflows/partial-backend.yml
|
||||||
|
|
||||||
frontend-tests:
|
frontend-tests:
|
||||||
name: "Frontend and End-to-End Tests"
|
name: "Frontend Tests"
|
||||||
uses: ./.github/workflows/partial-frontend.yml
|
uses: ./.github/workflows/partial-frontend.yml
|
||||||
|
|
||||||
build-release:
|
build-release:
|
||||||
|
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -52,7 +52,7 @@ pnpm-debug.log*
|
||||||
env/
|
env/
|
||||||
build/
|
build/
|
||||||
develop-eggs/
|
develop-eggs/
|
||||||
|
/dist/
|
||||||
downloads/
|
downloads/
|
||||||
eggs/
|
eggs/
|
||||||
.eggs/
|
.eggs/
|
||||||
|
@ -66,6 +66,9 @@ wheels/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
|
|
||||||
|
# frontend copied into Python module for packaging purposes
|
||||||
|
/mealie/frontend/
|
||||||
|
|
||||||
# PyInstaller
|
# PyInstaller
|
||||||
# Usually these files are written by a python script from a template
|
# Usually these files are written by a python script from a template
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
|
|
@ -12,7 +12,7 @@ repos:
|
||||||
exclude: ^tests/data/
|
exclude: ^tests/data/
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
# Ruff version.
|
# Ruff version.
|
||||||
rev: v0.9.4
|
rev: v0.9.7
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
@ -60,5 +60,9 @@
|
||||||
},
|
},
|
||||||
"[vue]": {
|
"[vue]": {
|
||||||
"editor.formatOnSave": false
|
"editor.formatOnSave": false
|
||||||
|
},
|
||||||
|
"[python]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "charliermarsh.ruff"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
86
Taskfile.yml
86
Taskfile.yml
|
@ -41,14 +41,25 @@ tasks:
|
||||||
setup:ui:
|
setup:ui:
|
||||||
desc: setup frontend dependencies
|
desc: setup frontend dependencies
|
||||||
dir: frontend
|
dir: frontend
|
||||||
|
run: once
|
||||||
cmds:
|
cmds:
|
||||||
- yarn install
|
- yarn install
|
||||||
|
sources:
|
||||||
|
- package.json
|
||||||
|
- yarn.lock
|
||||||
|
generates:
|
||||||
|
- node_modules/**
|
||||||
|
|
||||||
setup:py:
|
setup:py:
|
||||||
desc: setup python dependencies
|
desc: setup python dependencies
|
||||||
|
run: once
|
||||||
cmds:
|
cmds:
|
||||||
- poetry install --with main,dev,postgres
|
- poetry install --with main,dev,postgres
|
||||||
- poetry run pre-commit install
|
- poetry run pre-commit install
|
||||||
|
sources:
|
||||||
|
- poetry.lock
|
||||||
|
- pyproject.toml
|
||||||
|
- .pre-commit-config.yaml
|
||||||
|
|
||||||
setup:model:
|
setup:model:
|
||||||
desc: setup nlp model
|
desc: setup nlp model
|
||||||
|
@ -131,6 +142,63 @@ tasks:
|
||||||
- poetry run coverage html
|
- poetry run coverage html
|
||||||
- open htmlcov/index.html
|
- open htmlcov/index.html
|
||||||
|
|
||||||
|
py:package:copy-frontend:
|
||||||
|
desc: copy the frontend files into the Python package
|
||||||
|
internal: true
|
||||||
|
deps:
|
||||||
|
- ui:generate
|
||||||
|
cmds:
|
||||||
|
- rm -rf mealie/frontend
|
||||||
|
- cp -a frontend/dist mealie/frontend
|
||||||
|
sources:
|
||||||
|
- frontend/dist/**
|
||||||
|
generates:
|
||||||
|
- mealie/frontend/**
|
||||||
|
|
||||||
|
py:package:generate-requirements:
|
||||||
|
desc: Generate requirements file to pin all packages, effectively a "pip freeze" before installation begins
|
||||||
|
internal: true
|
||||||
|
cmds:
|
||||||
|
- poetry export -n --only=main --extras=pgsql --output=dist/requirements.txt
|
||||||
|
# Include mealie in the requirements, hashing the package that was just built to ensure it's the one installed
|
||||||
|
- echo "mealie[pgsql]=={{.MEALIE_VERSION}} \\" >> dist/requirements.txt
|
||||||
|
- poetry run pip hash dist/mealie-{{.MEALIE_VERSION}}-py3-none-any.whl | tail -n1 | tr -d '\n' >> dist/requirements.txt
|
||||||
|
- echo " \\" >> dist/requirements.txt
|
||||||
|
- poetry run pip hash dist/mealie-{{.MEALIE_VERSION}}.tar.gz | tail -n1 >> dist/requirements.txt
|
||||||
|
vars:
|
||||||
|
MEALIE_VERSION:
|
||||||
|
sh: poetry version --short
|
||||||
|
sources:
|
||||||
|
- poetry.lock
|
||||||
|
- pyproject.toml
|
||||||
|
- dist/mealie-*.whl
|
||||||
|
- dist/mealie-*.tar.gz
|
||||||
|
generates:
|
||||||
|
- dist/requirements.txt
|
||||||
|
|
||||||
|
py:package:deps-parallel:
|
||||||
|
desc: Run py:package dependencies in parallel
|
||||||
|
internal: true
|
||||||
|
deps:
|
||||||
|
- setup:py
|
||||||
|
- py:package:copy-frontend
|
||||||
|
|
||||||
|
py:package:deps:
|
||||||
|
desc: Dependencies of py:package, skippable by setting SKIP_PACKAGE_DEPS=true
|
||||||
|
internal: true
|
||||||
|
cmds:
|
||||||
|
- task: py:package:deps-parallel
|
||||||
|
status:
|
||||||
|
- '{{ .SKIP_PACKAGE_DEPS | default "false"}}'
|
||||||
|
|
||||||
|
py:package:
|
||||||
|
desc: builds Python packages (sdist and wheel) in top-level dist directory
|
||||||
|
deps:
|
||||||
|
- py:package:deps
|
||||||
|
cmds:
|
||||||
|
- poetry build -n --output=dist
|
||||||
|
- task: py:package:generate-requirements
|
||||||
|
|
||||||
py:
|
py:
|
||||||
desc: runs the backend server
|
desc: runs the backend server
|
||||||
cmds:
|
cmds:
|
||||||
|
@ -160,6 +228,14 @@ tasks:
|
||||||
cmds:
|
cmds:
|
||||||
- yarn build
|
- yarn build
|
||||||
|
|
||||||
|
ui:generate:
|
||||||
|
desc: generates a static version of the frontend in frontend/dist
|
||||||
|
dir: frontend
|
||||||
|
deps:
|
||||||
|
- setup:ui
|
||||||
|
cmds:
|
||||||
|
- yarn generate
|
||||||
|
|
||||||
ui:lint:
|
ui:lint:
|
||||||
desc: runs the frontend linter
|
desc: runs the frontend linter
|
||||||
dir: frontend
|
dir: frontend
|
||||||
|
@ -184,6 +260,16 @@ tasks:
|
||||||
cmds:
|
cmds:
|
||||||
- yarn run dev
|
- yarn run dev
|
||||||
|
|
||||||
|
docker:build-from-package:
|
||||||
|
desc: Builds the Docker image from the existing Python package in dist/
|
||||||
|
deps:
|
||||||
|
- py:package
|
||||||
|
cmds:
|
||||||
|
- docker build --tag mealie:dev --file docker/Dockerfile --build-arg COMMIT={{.GIT_COMMIT}} --build-context packages=dist .
|
||||||
|
vars:
|
||||||
|
GIT_COMMIT:
|
||||||
|
sh: git rev-parse HEAD
|
||||||
|
|
||||||
docker:prod:
|
docker:prod:
|
||||||
desc: builds and runs the production docker image locally
|
desc: builds and runs the production docker image locally
|
||||||
dir: docker
|
dir: docker
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
FROM node:16 as builder
|
###############################################
|
||||||
|
# Frontend Build
|
||||||
|
###############################################
|
||||||
|
FROM node:16 AS frontend-builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /frontend
|
||||||
|
|
||||||
COPY ./frontend .
|
COPY frontend .
|
||||||
|
|
||||||
RUN yarn install \
|
RUN yarn install \
|
||||||
--prefer-offline \
|
--prefer-offline \
|
||||||
|
@ -26,14 +29,10 @@ ENV PYTHONUNBUFFERED=1 \
|
||||||
PIP_NO_CACHE_DIR=off \
|
PIP_NO_CACHE_DIR=off \
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
||||||
PIP_DEFAULT_TIMEOUT=100 \
|
PIP_DEFAULT_TIMEOUT=100 \
|
||||||
POETRY_HOME="/opt/poetry" \
|
VENV_PATH="/opt/mealie"
|
||||||
POETRY_VIRTUALENVS_IN_PROJECT=true \
|
|
||||||
POETRY_NO_INTERACTION=1 \
|
|
||||||
PYSETUP_PATH="/opt/pysetup" \
|
|
||||||
VENV_PATH="/opt/pysetup/.venv"
|
|
||||||
|
|
||||||
# prepend poetry and venv to path
|
# prepend venv to path
|
||||||
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
|
ENV PATH="$VENV_PATH/bin:$PATH"
|
||||||
|
|
||||||
# create user account
|
# create user account
|
||||||
RUN useradd -u 911 -U -d $MEALIE_HOME -s /bin/bash abc \
|
RUN useradd -u 911 -U -d $MEALIE_HOME -s /bin/bash abc \
|
||||||
|
@ -41,31 +40,81 @@ RUN useradd -u 911 -U -d $MEALIE_HOME -s /bin/bash abc \
|
||||||
&& mkdir $MEALIE_HOME
|
&& mkdir $MEALIE_HOME
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
# Builder Image
|
# Backend Package Build
|
||||||
###############################################
|
###############################################
|
||||||
FROM python-base as builder-base
|
FROM python-base AS backend-builder
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install --no-install-recommends -y \
|
&& apt-get install --no-install-recommends -y \
|
||||||
curl \
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV POETRY_HOME="/opt/poetry" \
|
||||||
|
POETRY_NO_INTERACTION=1
|
||||||
|
|
||||||
|
# prepend poetry to path
|
||||||
|
ENV PATH="$POETRY_HOME/bin:$PATH"
|
||||||
|
|
||||||
|
# install poetry - respects $POETRY_VERSION & $POETRY_HOME
|
||||||
|
ENV POETRY_VERSION=2.0.1
|
||||||
|
RUN curl -sSL https://install.python-poetry.org | python3 -
|
||||||
|
|
||||||
|
# install poetry plugins needed to build the package
|
||||||
|
RUN poetry self add "poetry-plugin-export>=1.9"
|
||||||
|
|
||||||
|
WORKDIR /mealie
|
||||||
|
|
||||||
|
# copy project files here to ensure they will be cached.
|
||||||
|
COPY poetry.lock pyproject.toml ./
|
||||||
|
COPY mealie ./mealie
|
||||||
|
|
||||||
|
# Copy frontend to package it into the wheel
|
||||||
|
COPY --from=frontend-builder /frontend/dist ./mealie/frontend
|
||||||
|
|
||||||
|
# Build the source and binary package
|
||||||
|
RUN poetry build --output=dist
|
||||||
|
|
||||||
|
# Create the requirements file, which is used to install the built package and
|
||||||
|
# its pinned dependencies later. mealie is included to ensure the built one is
|
||||||
|
# what's installed.
|
||||||
|
RUN export MEALIE_VERSION=$(poetry version --short) \
|
||||||
|
&& poetry export --only=main --extras=pgsql --output=dist/requirements.txt \
|
||||||
|
&& echo "mealie[pgsql]==$MEALIE_VERSION \\" >> dist/requirements.txt \
|
||||||
|
&& poetry run pip hash dist/mealie-$MEALIE_VERSION-py3-none-any.whl | tail -n1 | tr -d '\n' >> dist/requirements.txt \
|
||||||
|
&& echo " \\" >> dist/requirements.txt \
|
||||||
|
&& poetry run pip hash dist/mealie-$MEALIE_VERSION.tar.gz | tail -n1 >> dist/requirements.txt
|
||||||
|
|
||||||
|
###############################################
|
||||||
|
# Package Container
|
||||||
|
# Only role is to hold the packages, or be overriden by a --build-context flag.
|
||||||
|
###############################################
|
||||||
|
FROM scratch AS packages
|
||||||
|
COPY --from=backend-builder /mealie/dist /
|
||||||
|
|
||||||
|
###############################################
|
||||||
|
# Python Virtual Environment Build
|
||||||
|
###############################################
|
||||||
|
# Install packages required to build the venv, in parallel to building the wheel
|
||||||
|
FROM python-base AS venv-builder-base
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install --no-install-recommends -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
libwebp-dev \
|
libwebp-dev \
|
||||||
# LDAP Dependencies
|
# LDAP Dependencies
|
||||||
libsasl2-dev libldap2-dev libssl-dev \
|
libsasl2-dev libldap2-dev libssl-dev \
|
||||||
gnupg gnupg2 gnupg1 \
|
gnupg gnupg2 gnupg1 \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
&& pip install -U --no-cache-dir pip
|
RUN python3 -m venv --upgrade-deps $VENV_PATH
|
||||||
|
|
||||||
# install poetry - respects $POETRY_VERSION & $POETRY_HOME
|
# Install the wheel and all dependencies into the venv
|
||||||
ENV POETRY_VERSION=1.3.1
|
FROM venv-builder-base AS venv-builder
|
||||||
RUN curl -sSL https://install.python-poetry.org | python3 -
|
|
||||||
|
|
||||||
# copy project requirement files here to ensure they will be cached.
|
# Copy built package (wheel) and its dependency requirements
|
||||||
WORKDIR $PYSETUP_PATH
|
COPY --from=packages * /dist/
|
||||||
COPY ./poetry.lock ./pyproject.toml ./
|
|
||||||
|
|
||||||
# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
|
# Install the wheel with exact versions of dependencies into the venv
|
||||||
RUN poetry install -E pgsql --only main
|
RUN . $VENV_PATH/bin/activate \
|
||||||
|
&& pip install --require-hashes -r /dist/requirements.txt --find-links /dist
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
# CRFPP Image
|
# CRFPP Image
|
||||||
|
@ -96,39 +145,25 @@ RUN apt-get update \
|
||||||
# create directory used for Docker Secrets
|
# create directory used for Docker Secrets
|
||||||
RUN mkdir -p /run/secrets
|
RUN mkdir -p /run/secrets
|
||||||
|
|
||||||
# copying poetry and venv into image
|
# copy CRF++ and add it to the library path
|
||||||
COPY --from=builder-base $POETRY_HOME $POETRY_HOME
|
|
||||||
COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH
|
|
||||||
|
|
||||||
ENV LD_LIBRARY_PATH=/usr/local/lib
|
ENV LD_LIBRARY_PATH=/usr/local/lib
|
||||||
COPY --from=crfpp /usr/local/lib/ /usr/local/lib
|
COPY --from=crfpp /usr/local/lib/ /usr/local/lib
|
||||||
COPY --from=crfpp /usr/local/bin/crf_learn /usr/local/bin/crf_learn
|
COPY --from=crfpp /usr/local/bin/crf_learn /usr/local/bin/crf_learn
|
||||||
COPY --from=crfpp /usr/local/bin/crf_test /usr/local/bin/crf_test
|
COPY --from=crfpp /usr/local/bin/crf_test /usr/local/bin/crf_test
|
||||||
|
|
||||||
# copy backend
|
# Copy venv into image. It contains a fully-installed mealie backend and frontend.
|
||||||
COPY ./mealie $MEALIE_HOME/mealie
|
COPY --from=venv-builder $VENV_PATH $VENV_PATH
|
||||||
COPY ./poetry.lock ./pyproject.toml $MEALIE_HOME/
|
|
||||||
|
|
||||||
# venv already has runtime deps installed we get a quicker install
|
|
||||||
WORKDIR $MEALIE_HOME
|
|
||||||
RUN . $VENV_PATH/bin/activate && poetry install -E pgsql --only main
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
# Grab CRF++ Model Release
|
# Grab CRF++ Model Release
|
||||||
RUN python $MEALIE_HOME/mealie/scripts/install_model.py
|
RUN python -m mealie.scripts.install_model
|
||||||
|
|
||||||
VOLUME [ "$MEALIE_HOME/data/" ]
|
VOLUME [ "$MEALIE_HOME/data/" ]
|
||||||
ENV APP_PORT=9000
|
ENV APP_PORT=9000
|
||||||
|
|
||||||
EXPOSE ${APP_PORT}
|
EXPOSE ${APP_PORT}
|
||||||
|
|
||||||
HEALTHCHECK CMD python $MEALIE_HOME/mealie/scripts/healthcheck.py || exit 1
|
HEALTHCHECK CMD python -m mealie.scripts.healthcheck || exit 1
|
||||||
|
|
||||||
# ----------------------------------
|
|
||||||
# Copy Frontend
|
|
||||||
|
|
||||||
ENV STATIC_FILES=/spa/static
|
|
||||||
COPY --from=builder /app/dist ${STATIC_FILES}
|
|
||||||
|
|
||||||
ENV HOST 0.0.0.0
|
ENV HOST 0.0.0.0
|
||||||
|
|
||||||
|
|
|
@ -32,13 +32,51 @@ init() {
|
||||||
cd /app
|
cd /app
|
||||||
|
|
||||||
# Activate our virtual environment here
|
# Activate our virtual environment here
|
||||||
. /opt/pysetup/.venv/bin/activate
|
. /opt/mealie/bin/activate
|
||||||
|
}
|
||||||
|
|
||||||
|
load_secrets() {
|
||||||
|
# Each of these environment variables will support a `_FILE` suffix that allows
|
||||||
|
# for setting the environment variable through the Docker Compose secret
|
||||||
|
# pattern.
|
||||||
|
local -a secret_supported_vars=(
|
||||||
|
"POSTGRES_USER"
|
||||||
|
"POSTGRES_PASSWORD"
|
||||||
|
"POSTGRES_SERVER"
|
||||||
|
"POSTGRES_PORT"
|
||||||
|
"POSTGRES_DB"
|
||||||
|
"POSTGRES_URL_OVERRIDE"
|
||||||
|
|
||||||
|
"SMTP_HOST"
|
||||||
|
"SMTP_PORT"
|
||||||
|
"SMTP_USER"
|
||||||
|
"SMTP_PASSWORD"
|
||||||
|
|
||||||
|
"LDAP_SERVER_URL"
|
||||||
|
"LDAP_QUERY_PASSWORD"
|
||||||
|
|
||||||
|
"OIDC_CONFIGURATION_URL"
|
||||||
|
"OIDC_CLIENT_ID"
|
||||||
|
"OIDC_CLIENT_SECRET"
|
||||||
|
|
||||||
|
"OPENAI_BASE_URL"
|
||||||
|
"OPENAI_API_KEY"
|
||||||
|
)
|
||||||
|
|
||||||
|
# If any secrets are set, prefer them over base environment variables.
|
||||||
|
for var in "${secret_supported_vars[@]}"; do
|
||||||
|
file_var="${var}_FILE"
|
||||||
|
if [ -n "${!file_var}" ]; then
|
||||||
|
export "$var=$(<"${!file_var}")"
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
change_user
|
change_user
|
||||||
init
|
init
|
||||||
|
load_secrets
|
||||||
|
|
||||||
# Start API
|
# Start API
|
||||||
HOST_IP=`/sbin/ip route|awk '/default/ { print $3 }'`
|
HOST_IP=`/sbin/ip route|awk '/default/ { print $3 }'`
|
||||||
|
|
||||||
exec python /app/mealie/main.py
|
exec mealie
|
||||||
|
|
40
docs/docs/contributors/developers-guide/building-packages.md
Normal file
40
docs/docs/contributors/developers-guide/building-packages.md
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
# Building Packages
|
||||||
|
|
||||||
|
Released packages are [built and published via GitHub actions](maintainers.md#drafting-releases).
|
||||||
|
|
||||||
|
## Python packages
|
||||||
|
|
||||||
|
To build Python packages locally for testing, use [`task`](starting-dev-server.md#without-dev-containers). After installing `task`, run `task py:package` to perform all the steps needed to build the package and a requirements file. To do it manually, run:
|
||||||
|
```sh
|
||||||
|
pushd frontend
|
||||||
|
yarnpkg install
|
||||||
|
yarnpkg generate
|
||||||
|
popd
|
||||||
|
rm -r mealie/frontend
|
||||||
|
cp -a frontend/dist mealie/frontend
|
||||||
|
poetry build
|
||||||
|
poetry export -n --only=main --extras=pgsql --output=dist/requirements.txt
|
||||||
|
MEALIE_VERSION=$(poetry version --short)
|
||||||
|
echo "mealie[pgsql]==${MEALIE_VERSION} \\" >> dist/requirements.txt
|
||||||
|
poetry run pip hash dist/mealie-${MEALIE_VERSION}-py3-none-any.whl | tail -n1 | tr -d '\n' >> dist/requirements.txt
|
||||||
|
echo " \\" >> dist/requirements.txt
|
||||||
|
poetry run pip hash dist/mealie-${MEALIE_VERSION}.tar.gz | tail -n1 >> dist/requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
The Python package can be installed with all of its dependencies pinned to the versions tested by the developers with:
|
||||||
|
```sh
|
||||||
|
pip3 install -r dist/requirements.txt --find-links dist
|
||||||
|
```
|
||||||
|
|
||||||
|
To install with the latest but still compatible dependency versions, instead run `pip3 install dist/mealie-$VERSION-py3-none-any.whl` (where `$VERSION` is the version of mealie to install).
|
||||||
|
|
||||||
|
## Docker image
|
||||||
|
One way to build the Docker image is to run the following command in the project root directory:
|
||||||
|
```sh
|
||||||
|
docker build --tag mealie:dev --file docker/Dockerfile --build-arg COMMIT=$(git rev-parse HEAD) .
|
||||||
|
```
|
||||||
|
|
||||||
|
The Docker image can be built from the pre-built Python packages with the task command `task docker:build-from-package`. This is equivalent to:
|
||||||
|
```sh
|
||||||
|
docker build --tag mealie:dev --file docker/Dockerfile --build-arg COMMIT=$(git rev-parse HEAD) --build-context packages=dist .
|
||||||
|
```
|
|
@ -35,7 +35,7 @@ Mealie has a robust and flexible recipe organization system with a few different
|
||||||
|
|
||||||
#### Categories
|
#### Categories
|
||||||
|
|
||||||
Categories are the overarching organizer for recipes. You can assign as many categories as you'd like to a recipe, but we recommend that you try to limit the categories you assign to a recipe to one or two. This helps keep categories as focused as possible while still allowing you to find recipes that are related to each other. For example, you might assign a recipe to the category **Breakfast**, **Lunch**, **Dinner**, or **Side**.
|
Categories are the overarching organizer for recipes. You can assign as many categories as you'd like to a recipe, but we recommend that you try to limit the categories you assign to a recipe to one or two. This helps keep categories as focused as possible while still allowing you to find recipes that are related to each other. For example, you might assign a recipe to the category **Breakfast**, **Lunch**, **Dinner**, **Side**, or **Drinks**.
|
||||||
|
|
||||||
[Categories Demo](https://demo.mealie.io/g/home/recipes/categories){ .md-button .md-button--primary }
|
[Categories Demo](https://demo.mealie.io/g/home/recipes/categories){ .md-button .md-button--primary }
|
||||||
|
|
||||||
|
@ -84,7 +84,30 @@ The meal planner has the concept of plan rules. These offer a flexible way to us
|
||||||
|
|
||||||
The shopping lists feature is a great way to keep track of what you need to buy for your next meal. You can add items directly to the shopping list or link a recipe and all of it's ingredients to track meals during the week.
|
The shopping lists feature is a great way to keep track of what you need to buy for your next meal. You can add items directly to the shopping list or link a recipe and all of it's ingredients to track meals during the week.
|
||||||
|
|
||||||
|
Managing shopping lists can be done from the Sidebar > Shopping Lists.
|
||||||
|
|
||||||
|
Here you will be able to:
|
||||||
|
- See items already on the Shopping List
|
||||||
|
- See linked recipes with ingredients
|
||||||
|
- Toggling via the 'Pot' icon will show you the linked recipe, allowing you to click to access it.
|
||||||
|
- Check off an item
|
||||||
|
- Add / Change / Remove / Sort Items via the grid icon
|
||||||
|
- Be sure if you are modifying an ingredient to click the 'Save' icon.
|
||||||
|
- Add / Change / Remove / Sort Labels
|
||||||
|
- 'No Label' will always be on the top, others can be Reordered via the 'Reorder Labels' button
|
||||||
|
|
||||||
|
!!! tip
|
||||||
|
If you accidentally checked off an item, you can uncheck it by expanding 'items checked' and unchecking it. This will add it back to the Shopping List.
|
||||||
|
|
||||||
|
!!! tip
|
||||||
|
You can use Labels to categorize your ingredients. You may want to Label by Food Type (Frozen, Fresh, etc), by Store, Tool, Recipe, or more. Play around with this to see what works best for you.
|
||||||
|
|
||||||
|
!!! tip
|
||||||
|
You can toggle 'Food' on items so that if you add multiple of the same food / ingredient, Mealie will automatically combine them together. Do this by editing an item in the Shopping List and clicking the 'Apple' icon. If you then have recipes that contain "1 | cup | cheese" and "2 | cup | cheese" this would be combined to show "3 cups of cheese."
|
||||||
|
|
||||||
|
[See FAQ for more information](../getting-started/faq.md)
|
||||||
|
|
||||||
|
|
||||||
[Shopping List Demo](https://demo.mealie.io/shopping-lists){ .md-button .md-button--primary }
|
[Shopping List Demo](https://demo.mealie.io/shopping-lists){ .md-button .md-button--primary }
|
||||||
|
|
||||||
## Integrations
|
## Integrations
|
||||||
|
@ -94,9 +117,9 @@ Mealie is designed to integrate with many different external services. There are
|
||||||
### Notifiers
|
### Notifiers
|
||||||
|
|
||||||
Notifiers are event-driven notifications sent when specific actions are performed within Mealie. Some actions include:
|
Notifiers are event-driven notifications sent when specific actions are performed within Mealie. Some actions include:
|
||||||
- creating a recipe
|
- Creating / Updating a recipe
|
||||||
- adding items to a shopping list
|
- Adding items to a shopping list
|
||||||
- creating a new mealplan
|
- Creating a new mealplan
|
||||||
|
|
||||||
Notifiers use the [Apprise library](https://github.com/caronc/apprise/wiki), which integrates with a large number of notification services. In addition, certain custom notifiers send basic event data to the consumer (e.g. the `id` of the resource). These include:
|
Notifiers use the [Apprise library](https://github.com/caronc/apprise/wiki), which integrates with a large number of notification services. In addition, certain custom notifiers send basic event data to the consumer (e.g. the `id` of the resource). These include:
|
||||||
|
|
||||||
|
|
|
@ -31,27 +31,27 @@
|
||||||
|
|
||||||
### Database
|
### Database
|
||||||
|
|
||||||
| Variables | Default | Description |
|
| Variables | Default | Description |
|
||||||
| --------------------- | :------: | ----------------------------------------------------------------------- |
|
| ------------------------------------------------------- | :------: | ----------------------------------------------------------------------- |
|
||||||
| DB_ENGINE | sqlite | Optional: 'sqlite', 'postgres' |
|
| DB_ENGINE | sqlite | Optional: 'sqlite', 'postgres' |
|
||||||
| POSTGRES_USER | mealie | Postgres database user |
|
| POSTGRES_USER<super>[†][secrets]</super> | mealie | Postgres database user |
|
||||||
| POSTGRES_PASSWORD | mealie | Postgres database password |
|
| POSTGRES_PASSWORD<super>[†][secrets]</super> | mealie | Postgres database password |
|
||||||
| POSTGRES_SERVER | postgres | Postgres database server address |
|
| POSTGRES_SERVER<super>[†][secrets]</super> | postgres | Postgres database server address |
|
||||||
| POSTGRES_PORT | 5432 | Postgres database port |
|
| POSTGRES_PORT<super>[†][secrets]</super> | 5432 | Postgres database port |
|
||||||
| POSTGRES_DB | mealie | Postgres database name |
|
| POSTGRES_DB<super>[†][secrets]</super> | mealie | Postgres database name |
|
||||||
| POSTGRES_URL_OVERRIDE | None | Optional Postgres URL override to use instead of POSTGRES\_\* variables |
|
| POSTGRES_URL_OVERRIDE<super>[†][secrets]</super> | None | Optional Postgres URL override to use instead of POSTGRES\_\* variables |
|
||||||
|
|
||||||
### Email
|
### Email
|
||||||
|
|
||||||
| Variables | Default | Description |
|
| Variables | Default | Description |
|
||||||
| ------------------ | :-----: | ------------------------------------------------- |
|
| ----------------------------------------------- | :-----: | ------------------------------------------------- |
|
||||||
| SMTP_HOST | None | Required For email |
|
| SMTP_HOST<super>[†][secrets]</super> | None | Required For email |
|
||||||
| SMTP_PORT | 587 | Required For email |
|
| SMTP_PORT<super>[†][secrets]</super> | 587 | Required For email |
|
||||||
| SMTP_FROM_NAME | Mealie | Required For email |
|
| SMTP_FROM_NAME | Mealie | Required For email |
|
||||||
| SMTP_AUTH_STRATEGY | TLS | Required For email, Options: 'TLS', 'SSL', 'NONE' |
|
| SMTP_AUTH_STRATEGY | TLS | Required For email, Options: 'TLS', 'SSL', 'NONE' |
|
||||||
| SMTP_FROM_EMAIL | None | Required For email |
|
| SMTP_FROM_EMAIL | None | Required For email |
|
||||||
| SMTP_USER | None | Required if SMTP_AUTH_STRATEGY is 'TLS' or 'SSL' |
|
| SMTP_USER<super>[†][secrets]</super> | None | Required if SMTP_AUTH_STRATEGY is 'TLS' or 'SSL' |
|
||||||
| SMTP_PASSWORD | None | Required if SMTP_AUTH_STRATEGY is 'TLS' or 'SSL' |
|
| SMTP_PASSWORD<super>[†][secrets]</super> | None | Required if SMTP_AUTH_STRATEGY is 'TLS' or 'SSL' |
|
||||||
|
|
||||||
### Webworker
|
### Webworker
|
||||||
|
|
||||||
|
@ -72,21 +72,21 @@ Use this only when mealie is run without a webserver or reverse proxy.
|
||||||
|
|
||||||
### LDAP
|
### LDAP
|
||||||
|
|
||||||
| Variables | Default | Description |
|
| Variables | Default | Description |
|
||||||
| -------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------------------------- |
|
| ----------------------------------------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| LDAP_AUTH_ENABLED | False | Authenticate via an external LDAP server in addidion to built-in Mealie auth |
|
| LDAP_AUTH_ENABLED | False | Authenticate via an external LDAP server in addidion to built-in Mealie auth |
|
||||||
| LDAP_SERVER_URL | None | LDAP server URL (e.g. ldap://ldap.example.com) |
|
| LDAP_SERVER_URL<super>[†][secrets]</super> | None | LDAP server URL (e.g. ldap://ldap.example.com) |
|
||||||
| LDAP_TLS_INSECURE | False | Do not verify server certificate when using secure LDAP |
|
| LDAP_TLS_INSECURE | False | Do not verify server certificate when using secure LDAP |
|
||||||
| LDAP_TLS_CACERTFILE | None | File path to Certificate Authority used to verify server certificate (e.g. `/path/to/ca.crt`) |
|
| LDAP_TLS_CACERTFILE | None | File path to Certificate Authority used to verify server certificate (e.g. `/path/to/ca.crt`) |
|
||||||
| LDAP_ENABLE_STARTTLS | False | Optional. Use STARTTLS to connect to the server |
|
| LDAP_ENABLE_STARTTLS | False | Optional. Use STARTTLS to connect to the server |
|
||||||
| LDAP_BASE_DN | None | Starting point when searching for users authentication (e.g. `CN=Users,DC=xx,DC=yy,DC=de`) |
|
| LDAP_BASE_DN | None | Starting point when searching for users authentication (e.g. `CN=Users,DC=xx,DC=yy,DC=de`) |
|
||||||
| LDAP_QUERY_BIND | None | Optional bind user for LDAP search queries (e.g. `cn=admin,cn=users,dc=example,dc=com`). If `None` then anonymous bind will be used |
|
| LDAP_QUERY_BIND | None | Optional bind user for LDAP search queries (e.g. `cn=admin,cn=users,dc=example,dc=com`). If `None` then anonymous bind will be used |
|
||||||
| LDAP_QUERY_PASSWORD | None | Optional password for the bind user used in LDAP_QUERY_BIND |
|
| LDAP_QUERY_PASSWORD<super>[†][secrets]</super> | None | Optional password for the bind user used in LDAP_QUERY_BIND |
|
||||||
| LDAP_USER_FILTER | None | Optional LDAP filter to narrow down eligible users (e.g. `(memberOf=cn=mealie_user,dc=example,dc=com)`) |
|
| LDAP_USER_FILTER | None | Optional LDAP filter to narrow down eligible users (e.g. `(memberOf=cn=mealie_user,dc=example,dc=com)`) |
|
||||||
| LDAP_ADMIN_FILTER | None | Optional LDAP filter, which tells Mealie the LDAP user is an admin (e.g. `(memberOf=cn=admins,dc=example,dc=com)`) |
|
| LDAP_ADMIN_FILTER | None | Optional LDAP filter, which tells Mealie the LDAP user is an admin (e.g. `(memberOf=cn=admins,dc=example,dc=com)`) |
|
||||||
| LDAP_ID_ATTRIBUTE | uid | The LDAP attribute that maps to the user's id |
|
| LDAP_ID_ATTRIBUTE | uid | The LDAP attribute that maps to the user's id |
|
||||||
| LDAP_NAME_ATTRIBUTE | name | The LDAP attribute that maps to the user's name |
|
| LDAP_NAME_ATTRIBUTE | name | The LDAP attribute that maps to the user's name |
|
||||||
| LDAP_MAIL_ATTRIBUTE | mail | The LDAP attribute that maps to the user's email |
|
| LDAP_MAIL_ATTRIBUTE | mail | The LDAP attribute that maps to the user's email |
|
||||||
|
|
||||||
### OpenID Connect (OIDC)
|
### OpenID Connect (OIDC)
|
||||||
|
|
||||||
|
@ -94,23 +94,22 @@ Use this only when mealie is run without a webserver or reverse proxy.
|
||||||
|
|
||||||
For usage, see [Usage - OpenID Connect](../authentication/oidc-v2.md)
|
For usage, see [Usage - OpenID Connect](../authentication/oidc-v2.md)
|
||||||
|
|
||||||
| Variables | Default | Description |
|
| Variables | Default | Description |
|
||||||
|---------------------------------------------------|:-------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| ----------------------------------------------------------------------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| OIDC_AUTH_ENABLED | False | Enables authentication via OpenID Connect |
|
| OIDC_AUTH_ENABLED | False | Enables authentication via OpenID Connect |
|
||||||
| OIDC_SIGNUP_ENABLED | True | Enables new users to be created when signing in for the first time with OIDC |
|
| OIDC_SIGNUP_ENABLED | True | Enables new users to be created when signing in for the first time with OIDC |
|
||||||
| OIDC_CONFIGURATION_URL | None | The URL to the OIDC configuration of your provider. This is usually something like https://auth.example.com/.well-known/openid-configuration |
|
| OIDC_CONFIGURATION_URL<super>[†][secrets]</super> | None | The URL to the OIDC configuration of your provider. This is usually something like https://auth.example.com/.well-known/openid-configuration |
|
||||||
| OIDC_CLIENT_ID | None | The client id of your configured client in your provider |
|
| OIDC_CLIENT_ID<super>[†][secrets]</super> | None | The client id of your configured client in your provider |
|
||||||
| OIDC_CLIENT_SECRET <br/> :octicons-tag-24: v2.0.0 | None | The client secret of your configured client in your provider |
|
| OIDC_CLIENT_SECRET<super>[†][secrets]</super> <br/> :octicons-tag-24: v2.0.0 | None | The client secret of your configured client in your provider |
|
||||||
| OIDC_USER_GROUP | None | If specified, only users belonging to this group will be able to successfully authenticate. For more information see [this page](../authentication/oidc-v2.md#groups) |
|
| OIDC_USER_GROUP | None | If specified, only users belonging to this group will be able to successfully authenticate, regardless of the `OIDC_ADMIN_GROUP`. For more information see [this page](../authentication/oidc.md#groups) |
|
||||||
| OIDC_ADMIN_GROUP | None | If specified, users belonging to this group will be able to successfully authenticate *and* be made an admin. For more information see [this page](../authentication/oidc-v2.md#groups) |
|
| OIDC_ADMIN_GROUP | None | If specified, users belonging to this group will be made an admin. For more information see [this page](../authentication/oidc.md#groups) |
|
||||||
| OIDC_AUTO_REDIRECT | False | If `True`, then the login page will be bypassed and you will be sent directly to your Identity Provider. You can still get to the login page by adding `?direct=1` to the login URL |
|
| OIDC_AUTO_REDIRECT | False | If `True`, then the login page will be bypassed an you will be sent directly to your Identity Provider. You can still get to the login page by adding `?direct=1` to the login URL |
|
||||||
| OIDC_PROVIDER_NAME | OAuth | The provider name is shown in SSO login button. "Login with <OIDC_PROVIDER_NAME\>" |
|
| OIDC_PROVIDER_NAME | OAuth | The provider name is shown in SSO login button. "Login with <OIDC_PROVIDER_NAME\>" |
|
||||||
| 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_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_USER_CLAIM | email | This is the claim which Mealie will use to look up an existing user by (e.g. "email", "preferred_username") |
|
| OIDC_SIGNING_ALGORITHM | RS256 | The algorithm used to sign the id token (examples: RS256, HS256) |
|
||||||
| OIDC_NAME_CLAIM | name | This is the claim which Mealie will use for the users Full Name |
|
| 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_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_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`) |
|
||||||
| OIDC_TLS_CACERTFILE | None | File path to Certificate Authority used to verify server certificate (e.g. `/path/to/ca.crt`) |
|
|
||||||
|
|
||||||
### OpenAI
|
### OpenAI
|
||||||
|
|
||||||
|
@ -119,17 +118,13 @@ 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).
|
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"}'`)
|
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 |
|
| Variables | Default | Description |
|
||||||
| ---------------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------- |
|
||||||
| OPENAI_BASE_URL | None | The base URL for the OpenAI API. If you're not sure, leave this empty to use the standard OpenAI platform |
|
| OPENAI_BASE_URL<super>[†][secrets]</super> | 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 | None | Your OpenAI API Key. Enables OpenAI-related features |
|
| OPENAI_API_KEY<super>[†][secrets]</super> | 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_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_WORKERS | 2 | Number of OpenAI workers per request. Higher values may increase processing speed, but will incur additional API costs |
|
||||||
| 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_SEND_DATABASE_DATA | True | Whether to send Mealie data to OpenAI to improve request accuracy. This will incur additional API costs |
|
||||||
| 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
|
### Theming
|
||||||
|
|
||||||
|
@ -154,24 +149,80 @@ Setting the following environmental variables will change the theme of the front
|
||||||
|
|
||||||
### Docker Secrets
|
### Docker Secrets
|
||||||
|
|
||||||
Setting a credential can be done using secrets when running in a Docker container.
|
### Docker Secrets
|
||||||
This can be used to avoid leaking passwords through compose files, environment variables, or command-line history.
|
|
||||||
For example, to configure the Postgres database password in Docker compose, create a file on the host that contains only the password, and expose that file to the Mealie service as a secret with the correct name.
|
> <super>†</super> Starting in version `2.4.2`, any environment variable in the preceding lists with a dagger
|
||||||
Note that environment variables take priority over secrets, so any previously defined environment variables should be removed when migrating to secrets.
|
> 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
|
||||||
|
by managing control of each secret independently from the single `.env` file. This is helpful for users that may need
|
||||||
|
different levels of access for various, sensitive environment variables, such as differentiating between hardening
|
||||||
|
operations (e.g., server endpoints and ports) and user access control (e.g., usernames, passwords, and API keys).
|
||||||
|
|
||||||
|
To convert any of these environment variables to a Docker Compose secret, append `_FILE` to the environment variable and
|
||||||
|
connect it with a Docker Compose secret, per the [Docker documentation][docker-secrets].
|
||||||
|
|
||||||
|
If both the base environment variable and the secret pattern of the environment variable are set, the secret will always
|
||||||
|
take precedence.
|
||||||
|
|
||||||
|
For example, a user that wishes to harden their operations by only giving some access to their database URL, but who
|
||||||
|
wish to place additional security around their user access control, may have a Docker Compose configuration similar to:
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
mealie:
|
mealie:
|
||||||
...
|
|
||||||
environment:
|
|
||||||
...
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
secrets:
|
secrets:
|
||||||
- POSTGRES_PASSWORD
|
# These secrets will be loaded by Docker into the `/run/secrets` folder within the container.
|
||||||
|
- postgres-host
|
||||||
|
- postgres-port
|
||||||
|
- postgres-db-name
|
||||||
|
- postgres-user
|
||||||
|
- postgres-password
|
||||||
|
|
||||||
|
environment:
|
||||||
|
DB_ENGINE: postgres
|
||||||
|
POSTGRES_SERVER: duplicate.entry.tld # This will be ignored, due to the secret defined, below.
|
||||||
|
POSTGRES_SERVER_FILE: /run/secrets/postgres-host
|
||||||
|
POSTGRES_PORT_FILE: /run/secrets/postgres-port
|
||||||
|
POSTGRES_DB_FILE: /run/secrets/postgres-db-name
|
||||||
|
POSTGRES_USER_FILE: /run/secrets/postgres-user
|
||||||
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password
|
||||||
|
|
||||||
|
# Each of these secrets are loaded via these local files. Different patterns are available. See the Docker Compose
|
||||||
|
# documentation for more information.
|
||||||
secrets:
|
secrets:
|
||||||
POSTGRES_PASSWORD:
|
postgres-host:
|
||||||
file: postgrespassword.txt
|
file: ./secrets/postgres-host.txt
|
||||||
|
postgres-port:
|
||||||
|
file: ./secrets/postgres-port.txt
|
||||||
|
postgres-db-name:
|
||||||
|
file: ./secrets/sensitive/postgres-db-name.txt
|
||||||
|
postgres-user:
|
||||||
|
file: ./secrets/sensitive/postgres-user.txt
|
||||||
|
postgres-password:
|
||||||
|
file: ./secrets/sensitive/postgres-password.txt
|
||||||
|
```
|
||||||
|
In the example above, a directory organization and access pattern may look like the following:
|
||||||
|
```text
|
||||||
|
.
|
||||||
|
├── docker-compose.yml
|
||||||
|
└── secrets # Access restricted to anyone that can manage secrets
|
||||||
|
├── postgres-host.txt
|
||||||
|
├── postgres-port.txt
|
||||||
|
└── sensitive # Access further-restricted to anyone managing service accounts
|
||||||
|
├── postgres-db-name.txt
|
||||||
|
├── postgres-password.txt
|
||||||
|
└── postgres-user.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
How you organize your secrets is ultimately up to you. At minimum, it's highly recommended to use secret patterns for
|
||||||
|
at least these sensitive environment variables when working within shared environments:
|
||||||
|
|
||||||
|
- `POSTGRES_PASSWORD`
|
||||||
|
- `SMTP_PASSWORD`
|
||||||
|
- `LDAP_QUERY_PASSWORD`
|
||||||
|
- `OPENAI_API_KEY`
|
||||||
|
|
||||||
|
[docker-secrets]: https://docs.docker.com/compose/use-secrets/
|
||||||
|
[secrets]: #docker-secrets
|
||||||
[unicorn_workers]: https://www.uvicorn.org/deployment/#built-in
|
[unicorn_workers]: https://www.uvicorn.org/deployment/#built-in
|
||||||
|
|
|
@ -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:
|
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!
|
1. Take a backup just in case!
|
||||||
2. Replace the image for the API container with `ghcr.io/mealie-recipes/mealie:v2.5.0`
|
2. Replace the image for the API container with `ghcr.io/mealie-recipes/mealie:v2.6.0`
|
||||||
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.
|
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
|
4. Restart the container
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ PostgreSQL might be considered if you need to support many concurrent users. In
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
mealie:
|
mealie:
|
||||||
image: ghcr.io/mealie-recipes/mealie:v2.5.0 # (3)
|
image: ghcr.io/mealie-recipes/mealie:v2.6.0 # (3)
|
||||||
container_name: mealie
|
container_name: mealie
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -11,7 +11,7 @@ SQLite is a popular, open source, self-contained, zero-configuration database th
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
mealie:
|
mealie:
|
||||||
image: ghcr.io/mealie-recipes/mealie:v2.5.0 # (3)
|
image: ghcr.io/mealie-recipes/mealie:v2.6.0 # (3)
|
||||||
container_name: mealie
|
container_name: mealie
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -1,17 +1,24 @@
|
||||||
# Backups and Restoring
|
# Backups and Restores
|
||||||
|
|
||||||
Mealie provides an integrated mechanics for doing full installation backups of the database. Navigate to `/admin/backups` to
|
Mealie provides an integrated mechanic for doing full installation backups of the database.
|
||||||
|
|
||||||
|
Navigate to Settings > Backups or manually by adding `/admin/backups` to your instance URL.
|
||||||
|
|
||||||
|
From this page, you will be able to:
|
||||||
|
|
||||||
- See a list of available backups
|
- See a list of available backups
|
||||||
- Perform a backups
|
- Create a backup
|
||||||
- Restore a backup
|
- Upload a backup
|
||||||
|
- Delete a backup (Confirmation Required)
|
||||||
|
- Download a backup
|
||||||
|
- Perform a restore
|
||||||
|
|
||||||
!!! tip
|
!!! tip
|
||||||
If you're using Mealie with SQLite all your data is stored in the /app/data/ folder in the container. You can easily perform entire site backups by stopping the container, and backing up this folder with your chosen tool. This is the **best** way to backup your data.
|
If you're using Mealie with SQLite all your data is stored in the /app/data/ folder in the container. You can easily perform entire site backups by stopping the container, and backing up this folder with your chosen tool. This is the **best** way to backup your data.
|
||||||
|
|
||||||
## Restoring from a Backup
|
## Restoring from a Backup
|
||||||
|
|
||||||
To restore from a backup it needs to be uploaded to your instance, this can be done through the web portal. On the lower left hand corner of the backups data table you'll see an upload button. Click this button and select the backup file you want to upload and it will be available to import shortly.
|
To restore from a backup it needs to be uploaded to your instance which can be done through the web portal. On the top left of the page you'll see an upload button. Click this button and select the backup file you want to upload and it will be available to import shortly. You can alternatively use one of the backups you see on the screen, if one exists.
|
||||||
|
|
||||||
Before importing it's critical that you understand the following:
|
Before importing it's critical that you understand the following:
|
||||||
|
|
||||||
|
@ -19,6 +26,9 @@ Before importing it's critical that you understand the following:
|
||||||
- This action cannot be undone
|
- This action cannot be undone
|
||||||
- If this action is successful you will be logged out and you will need to log back in to complete the restore
|
- If this action is successful you will be logged out and you will need to log back in to complete the restore
|
||||||
|
|
||||||
|
!!! tip
|
||||||
|
If for some reason the restore does not succeed, you can review the logs of what the issue may be, download the backup .ZIP and edit the contents of database.json to potentially resolve the issue. For example, if you receive an error restoring 'shopping-list' you can edit out the contents of that list while allowing other sections to restore. If you would like any assistance on this, reach out over Discord.
|
||||||
|
|
||||||
!!! warning
|
!!! warning
|
||||||
Prior to beta-v5 using a mis-matched version of the database backup will result in an error that will prevent you from using the instance of Mealie requiring you to remove all data and reinstall. Post beta-v5 performing a mismatched restore will throw an error and alert the user of the issue.
|
Prior to beta-v5 using a mis-matched version of the database backup will result in an error that will prevent you from using the instance of Mealie requiring you to remove all data and reinstall. Post beta-v5 performing a mismatched restore will throw an error and alert the user of the issue.
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,7 @@ nav:
|
||||||
- Non-Code: "contributors/non-coders.md"
|
- Non-Code: "contributors/non-coders.md"
|
||||||
- Translating: "contributors/translating.md"
|
- Translating: "contributors/translating.md"
|
||||||
- Developers Guide:
|
- Developers Guide:
|
||||||
|
- Building Packages: "contributors/developers-guide/building-packages.md"
|
||||||
- Code Contributions: "contributors/developers-guide/code-contributions.md"
|
- Code Contributions: "contributors/developers-guide/code-contributions.md"
|
||||||
- Dev Getting Started: "contributors/developers-guide/starting-dev-server.md"
|
- Dev Getting Started: "contributors/developers-guide/starting-dev-server.md"
|
||||||
- Database Changes: "contributors/developers-guide/database-changes.md"
|
- Database Changes: "contributors/developers-guide/database-changes.md"
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
:label="$t('shopping-list.note')"
|
:label="$t('shopping-list.note')"
|
||||||
rows="1"
|
rows="1"
|
||||||
auto-grow
|
auto-grow
|
||||||
|
autofocus
|
||||||
@keypress="handleNoteKeyPress"
|
@keypress="handleNoteKeyPress"
|
||||||
></v-textarea>
|
></v-textarea>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,37 +81,37 @@
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
<v-card-actions class="ma-0 pt-0 pb-1 justify-end">
|
||||||
|
<BaseButtonGroup
|
||||||
|
:buttons="[
|
||||||
|
...(allowDelete ? [{
|
||||||
|
icon: $globals.icons.delete,
|
||||||
|
text: $t('general.delete'),
|
||||||
|
event: 'delete',
|
||||||
|
}] : []),
|
||||||
|
{
|
||||||
|
icon: $globals.icons.close,
|
||||||
|
text: $t('general.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: $globals.icons.foods,
|
||||||
|
text: $t('shopping-list.toggle-food'),
|
||||||
|
event: 'toggle-foods',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: $globals.icons.save,
|
||||||
|
text: $t('general.save'),
|
||||||
|
event: 'save',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
@save="$emit('save')"
|
||||||
|
@cancel="$emit('cancel')"
|
||||||
|
@delete="$emit('delete')"
|
||||||
|
@toggle-foods="listItem.isFood = !listItem.isFood"
|
||||||
|
/>
|
||||||
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-card-actions class="ma-0 pt-0 pb-1 justify-end">
|
|
||||||
<BaseButtonGroup
|
|
||||||
:buttons="[
|
|
||||||
{
|
|
||||||
icon: $globals.icons.delete,
|
|
||||||
text: $t('general.delete'),
|
|
||||||
event: 'delete',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: $globals.icons.close,
|
|
||||||
text: $t('general.cancel'),
|
|
||||||
event: 'cancel',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: $globals.icons.foods,
|
|
||||||
text: $t('shopping-list.toggle-food'),
|
|
||||||
event: 'toggle-foods',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: $globals.icons.save,
|
|
||||||
text: $t('general.save'),
|
|
||||||
event: 'save',
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
@save="$emit('save')"
|
|
||||||
@cancel="$emit('cancel')"
|
|
||||||
@delete="$emit('delete')"
|
|
||||||
@toggle-foods="listItem.isFood = !listItem.isFood"
|
|
||||||
/>
|
|
||||||
</v-card-actions>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -139,6 +140,11 @@ export default defineComponent({
|
||||||
type: Array as () => IngredientFood[],
|
type: Array as () => IngredientFood[],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
allowDelete: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
const foodStore = useFoodStore();
|
const foodStore = useFoodStore();
|
||||||
|
|
|
@ -550,7 +550,7 @@
|
||||||
"yields-amount-with-text": "Yields {amount} {text}",
|
"yields-amount-with-text": "Yields {amount} {text}",
|
||||||
"yield-text": "Yield Text",
|
"yield-text": "Yield Text",
|
||||||
"quantity": "Quantity",
|
"quantity": "Quantity",
|
||||||
"choose-unit": "Choose Unit",
|
"choose-unit": "اختر الوحدة",
|
||||||
"press-enter-to-create": "Press Enter to Create",
|
"press-enter-to-create": "Press Enter to Create",
|
||||||
"choose-food": "Choose Food",
|
"choose-food": "Choose Food",
|
||||||
"notes": "Notes",
|
"notes": "Notes",
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
"date": "Data",
|
"date": "Data",
|
||||||
"id": "Id",
|
"id": "Id",
|
||||||
"owner": "Dono",
|
"owner": "Dono",
|
||||||
"change-owner": "Change Owner",
|
"change-owner": "Mudar Proprietario",
|
||||||
"date-added": "Engadida o",
|
"date-added": "Engadida o",
|
||||||
"none": "Nada",
|
"none": "Nada",
|
||||||
"run": "Executar",
|
"run": "Executar",
|
||||||
|
@ -214,10 +214,10 @@
|
||||||
"confirm-delete-generic-items": "Estás seguro de que queres eliminar os seguintes elementos?",
|
"confirm-delete-generic-items": "Estás seguro de que queres eliminar os seguintes elementos?",
|
||||||
"organizers": "Organizadores",
|
"organizers": "Organizadores",
|
||||||
"caution": "Coidado",
|
"caution": "Coidado",
|
||||||
"show-advanced": "Show Advanced",
|
"show-advanced": "Mostrar Avanzadas",
|
||||||
"add-field": "Add Field",
|
"add-field": "Adicionar Campo",
|
||||||
"date-created": "Date Created",
|
"date-created": "Date Created",
|
||||||
"date-updated": "Date Updated"
|
"date-updated": "Data de Atualización"
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"are-you-sure-you-want-to-delete-the-group": "Estás seguro de que queres eliminar <b>{groupName}<b/>?",
|
"are-you-sure-you-want-to-delete-the-group": "Estás seguro de que queres eliminar <b>{groupName}<b/>?",
|
||||||
|
@ -295,11 +295,11 @@
|
||||||
"private-household-description": "Setting your household to private will disable all public view options. This overrides any individual public view settings",
|
"private-household-description": "Setting your household to private will disable all public view options. This overrides any individual public view settings",
|
||||||
"lock-recipe-edits-from-other-households": "Lock recipe edits from other households",
|
"lock-recipe-edits-from-other-households": "Lock recipe edits from other households",
|
||||||
"lock-recipe-edits-from-other-households-description": "When enabled only users in your household can edit recipes created by your household",
|
"lock-recipe-edits-from-other-households-description": "When enabled only users in your household can edit recipes created by your household",
|
||||||
"household-recipe-preferences": "Household Recipe Preferences",
|
"household-recipe-preferences": "Preferencias de receitas da casa",
|
||||||
"default-recipe-preferences-description": "These are the default settings when a new recipe is created in your household. These can be changed for individual recipes in the recipe settings menu.",
|
"default-recipe-preferences-description": "These are the default settings when a new recipe is created in your household. These can be changed for individual recipes in the recipe settings menu.",
|
||||||
"allow-users-outside-of-your-household-to-see-your-recipes": "Allow users outside of your household to see your recipes",
|
"allow-users-outside-of-your-household-to-see-your-recipes": "Allow users outside of your household to see your recipes",
|
||||||
"allow-users-outside-of-your-household-to-see-your-recipes-description": "When enabled you can use a public share link to share specific recipes without authorizing the user. When disabled, you can only share recipes with users who are in your household or with a pre-generated private link",
|
"allow-users-outside-of-your-household-to-see-your-recipes-description": "When enabled you can use a public share link to share specific recipes without authorizing the user. When disabled, you can only share recipes with users who are in your household or with a pre-generated private link",
|
||||||
"household-preferences": "Household Preferences"
|
"household-preferences": "Preferencias da Casa"
|
||||||
},
|
},
|
||||||
"meal-plan": {
|
"meal-plan": {
|
||||||
"create-a-new-meal-plan": "Crea un Novo Menú",
|
"create-a-new-meal-plan": "Crea un Novo Menú",
|
||||||
|
@ -322,9 +322,9 @@
|
||||||
"mealplan-update-failed": "Produciuse un erro na actualización do menú",
|
"mealplan-update-failed": "Produciuse un erro na actualización do menú",
|
||||||
"mealplan-updated": "Menú Actualizado",
|
"mealplan-updated": "Menú Actualizado",
|
||||||
"mealplan-households-description": "If no household is selected, recipes can be added from any household",
|
"mealplan-households-description": "If no household is selected, recipes can be added from any household",
|
||||||
"any-category": "Any Category",
|
"any-category": "Calquer Categoria",
|
||||||
"any-tag": "Any Tag",
|
"any-tag": "Calquer Etiqueta",
|
||||||
"any-household": "Any Household",
|
"any-household": "Calquer Casa",
|
||||||
"no-meal-plan-defined-yet": "Aínda non se definiu ningún menú",
|
"no-meal-plan-defined-yet": "Aínda non se definiu ningún menú",
|
||||||
"no-meal-planned-for-today": "Non hai ningunha comida prevista para hoxe",
|
"no-meal-planned-for-today": "Non hai ningunha comida prevista para hoxe",
|
||||||
"numberOfDays-hint": "Número de días ao cargar a páxina",
|
"numberOfDays-hint": "Número de días ao cargar a páxina",
|
||||||
|
@ -395,7 +395,7 @@
|
||||||
},
|
},
|
||||||
"tandoor": {
|
"tandoor": {
|
||||||
"description-long": "Mealie can import recipes from Tandoor. Export your data in the \"Default\" format, then upload the .zip below.",
|
"description-long": "Mealie can import recipes from Tandoor. Export your data in the \"Default\" format, then upload the .zip below.",
|
||||||
"title": "Tandoor Recipes"
|
"title": "Receitas do Tandoor"
|
||||||
},
|
},
|
||||||
"recipe-data-migrations": "Recipe Data Migrations",
|
"recipe-data-migrations": "Recipe Data Migrations",
|
||||||
"recipe-data-migrations-explanation": "Recipes can be migrated from another supported application to Mealie. This is a great way to get started with Mealie.",
|
"recipe-data-migrations-explanation": "Recipes can be migrated from another supported application to Mealie. This is a great way to get started with Mealie.",
|
||||||
|
@ -404,8 +404,8 @@
|
||||||
"tag-all-recipes": "Tag all recipes with {tag-name} tag",
|
"tag-all-recipes": "Tag all recipes with {tag-name} tag",
|
||||||
"nextcloud-text": "Nextcloud recipes can be imported from a zip file that contains the data stored in Nextcloud. See the example folder structure below to ensure your recipes are able to be imported.",
|
"nextcloud-text": "Nextcloud recipes can be imported from a zip file that contains the data stored in Nextcloud. See the example folder structure below to ensure your recipes are able to be imported.",
|
||||||
"chowdown-text": "Mealie admite de forma nativa o formato do repositorio de chowdown. Descarga o repositorio de códigos como ficheiro .zip e cárgao a continuación.",
|
"chowdown-text": "Mealie admite de forma nativa o formato do repositorio de chowdown. Descarga o repositorio de códigos como ficheiro .zip e cárgao a continuación.",
|
||||||
"recipe-1": "Recipe 1",
|
"recipe-1": "Receita 1",
|
||||||
"recipe-2": "Recipe 2",
|
"recipe-2": "Receita 2",
|
||||||
"paprika-text": "Mealie can import recipes from the Paprika application. Export your recipes from paprika, rename the export extension to .zip and upload it below.",
|
"paprika-text": "Mealie can import recipes from the Paprika application. Export your recipes from paprika, rename the export extension to .zip and upload it below.",
|
||||||
"mealie-text": "Mealie can import recipes from the Mealie application from a pre v1.0 release. Export your recipes from your old instance, and upload the zip file below. Note that only recipes can be imported from the export.",
|
"mealie-text": "Mealie can import recipes from the Mealie application from a pre v1.0 release. Export your recipes from your old instance, and upload the zip file below. Note that only recipes can be imported from the export.",
|
||||||
"plantoeat": {
|
"plantoeat": {
|
||||||
|
@ -424,15 +424,15 @@
|
||||||
"new-recipe": {
|
"new-recipe": {
|
||||||
"bulk-add": "Bulk Add",
|
"bulk-add": "Bulk Add",
|
||||||
"error-details": "Only websites containing ld+json or microdata can be imported by Mealie. Most major recipe websites support this data structure. If your site cannot be imported but there is json data in the log, please submit a github issue with the URL and data.",
|
"error-details": "Only websites containing ld+json or microdata can be imported by Mealie. Most major recipe websites support this data structure. If your site cannot be imported but there is json data in the log, please submit a github issue with the URL and data.",
|
||||||
"error-title": "Looks Like We Couldn't Find Anything",
|
"error-title": "Parece que non conseguimos encontrar nada",
|
||||||
"from-url": "Import a Recipe",
|
"from-url": "Importar unha Receita",
|
||||||
"github-issues": "GitHub Issues",
|
"github-issues": "Problemas no GitHub",
|
||||||
"google-ld-json-info": "Google ld+json Info",
|
"google-ld-json-info": "Google ld+json Info",
|
||||||
"must-be-a-valid-url": "Must be a Valid URL",
|
"must-be-a-valid-url": "Precisa ser un URL válido",
|
||||||
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Paste in your recipe data. Each line will be treated as an item in a list",
|
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Pegue os datos da sua receita. Cada liña será tratada como un item nunha lista",
|
||||||
"recipe-markup-specification": "Recipe Markup Specification",
|
"recipe-markup-specification": "Especificación Markup da Receita",
|
||||||
"recipe-url": "Recipe URL",
|
"recipe-url": "URL da Receita",
|
||||||
"recipe-html-or-json": "Recipe HTML or JSON",
|
"recipe-html-or-json": "Receita en HTML ou JSON",
|
||||||
"upload-a-recipe": "Upload a Recipe",
|
"upload-a-recipe": "Upload a Recipe",
|
||||||
"upload-individual-zip-file": "Upload an individual .zip file exported from another Mealie instance.",
|
"upload-individual-zip-file": "Upload an individual .zip file exported from another Mealie instance.",
|
||||||
"url-form-hint": "Copy and paste a link from your favorite recipe website",
|
"url-form-hint": "Copy and paste a link from your favorite recipe website",
|
||||||
|
@ -440,13 +440,13 @@
|
||||||
"trim-whitespace-description": "Trim leading and trailing whitespace as well as blank lines",
|
"trim-whitespace-description": "Trim leading and trailing whitespace as well as blank lines",
|
||||||
"trim-prefix-description": "Trim first character from each line",
|
"trim-prefix-description": "Trim first character from each line",
|
||||||
"split-by-numbered-line-description": "Attempts to split a paragraph by matching '1)' or '1.' patterns",
|
"split-by-numbered-line-description": "Attempts to split a paragraph by matching '1)' or '1.' patterns",
|
||||||
"import-by-url": "Import a recipe by URL",
|
"import-by-url": "Importar unha receita por URL",
|
||||||
"create-manually": "Create a recipe manually",
|
"create-manually": "Create a recipe manually",
|
||||||
"make-recipe-image": "Make this the recipe image"
|
"make-recipe-image": "Make this the recipe image"
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
"404-page-not-found": "404 Page not found",
|
"404-page-not-found": "404 Páxina non encontrada",
|
||||||
"all-recipes": "All Recipes",
|
"all-recipes": "Todas as receitas",
|
||||||
"new-page-created": "New page created",
|
"new-page-created": "New page created",
|
||||||
"page": "Páxina",
|
"page": "Páxina",
|
||||||
"page-creation-failed": "Produciuse un erro ao creala páxina",
|
"page-creation-failed": "Produciuse un erro ao creala páxina",
|
||||||
|
@ -467,7 +467,7 @@
|
||||||
"calories-suffix": "calorías",
|
"calories-suffix": "calorías",
|
||||||
"carbohydrate-content": "Carbohidratos",
|
"carbohydrate-content": "Carbohidratos",
|
||||||
"categories": "Categorías",
|
"categories": "Categorías",
|
||||||
"cholesterol-content": "Cholesterol",
|
"cholesterol-content": "Colesterol",
|
||||||
"comment-action": "Comentar",
|
"comment-action": "Comentar",
|
||||||
"comment": "Comentario",
|
"comment": "Comentario",
|
||||||
"comments": "Comentarios",
|
"comments": "Comentarios",
|
||||||
|
@ -535,7 +535,7 @@
|
||||||
"add-recipe-to-mealplan": "Add Recipe to Mealplan",
|
"add-recipe-to-mealplan": "Add Recipe to Mealplan",
|
||||||
"entry-type": "Entry Type",
|
"entry-type": "Entry Type",
|
||||||
"date-format-hint": "Formato MM/DD/YYYY",
|
"date-format-hint": "Formato MM/DD/YYYY",
|
||||||
"date-format-hint-yyyy-mm-dd": "YYYY-MM-DD format",
|
"date-format-hint-yyyy-mm-dd": "Formato AAAA-MM-DD",
|
||||||
"add-to-list": "Add to List",
|
"add-to-list": "Add to List",
|
||||||
"add-to-plan": "Add to Plan",
|
"add-to-plan": "Add to Plan",
|
||||||
"add-to-timeline": "Add to Timeline",
|
"add-to-timeline": "Add to Timeline",
|
||||||
|
@ -553,7 +553,7 @@
|
||||||
"choose-unit": "Choose Unit",
|
"choose-unit": "Choose Unit",
|
||||||
"press-enter-to-create": "Press Enter to Create",
|
"press-enter-to-create": "Press Enter to Create",
|
||||||
"choose-food": "Choose Food",
|
"choose-food": "Choose Food",
|
||||||
"notes": "Notes",
|
"notes": "Notas",
|
||||||
"toggle-section": "Toggle Section",
|
"toggle-section": "Toggle Section",
|
||||||
"see-original-text": "See Original Text",
|
"see-original-text": "See Original Text",
|
||||||
"original-text-with-value": "Original Text: {originalText}",
|
"original-text-with-value": "Original Text: {originalText}",
|
||||||
|
@ -1194,8 +1194,8 @@
|
||||||
"demo_password": "Password: {password}"
|
"demo_password": "Password: {password}"
|
||||||
},
|
},
|
||||||
"ocr-editor": {
|
"ocr-editor": {
|
||||||
"ocr-editor": "Ocr editor",
|
"ocr-editor": "Editor OCR",
|
||||||
"toolbar": "Toolbar",
|
"toolbar": "Barra de ferramentas",
|
||||||
"selection-mode": "Selection mode",
|
"selection-mode": "Selection mode",
|
||||||
"pan-and-zoom-picture": "Pan and zoom picture",
|
"pan-and-zoom-picture": "Pan and zoom picture",
|
||||||
"split-text": "Split text",
|
"split-text": "Split text",
|
||||||
|
@ -1203,7 +1203,7 @@
|
||||||
"split-by-block": "Split by text block",
|
"split-by-block": "Split by text block",
|
||||||
"flatten": "Flatten regardless of original formating",
|
"flatten": "Flatten regardless of original formating",
|
||||||
"help": {
|
"help": {
|
||||||
"help": "Help",
|
"help": "Axuda",
|
||||||
"mouse-modes": "Mouse modes",
|
"mouse-modes": "Mouse modes",
|
||||||
"selection-mode": "Selection Mode (default)",
|
"selection-mode": "Selection Mode (default)",
|
||||||
"selection-mode-desc": "The selection mode is the main mode that can be used to enter data:",
|
"selection-mode-desc": "The selection mode is the main mode that can be used to enter data:",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"database-type": "Tipo do Banco de Dados",
|
"database-type": "Tipo do Banco de Dados",
|
||||||
"database-url": "URL do banco de dados",
|
"database-url": "URL do banco de dados",
|
||||||
"default-group": "Grupo Padrão",
|
"default-group": "Grupo Padrão",
|
||||||
"default-household": "Default Household",
|
"default-household": "Casa Padrão",
|
||||||
"demo": "Demonstração",
|
"demo": "Demonstração",
|
||||||
"demo-status": "Status da Demonstração",
|
"demo-status": "Status da Demonstração",
|
||||||
"development": "Desenvolvimento",
|
"development": "Desenvolvimento",
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
"date": "Data",
|
"date": "Data",
|
||||||
"id": "Id",
|
"id": "Id",
|
||||||
"owner": "Proprietário",
|
"owner": "Proprietário",
|
||||||
"change-owner": "Change Owner",
|
"change-owner": "Alterar Dono",
|
||||||
"date-added": "Data de inclusão",
|
"date-added": "Data de inclusão",
|
||||||
"none": "Nenhum",
|
"none": "Nenhum",
|
||||||
"run": "Executar",
|
"run": "Executar",
|
||||||
|
@ -214,10 +214,10 @@
|
||||||
"confirm-delete-generic-items": "Tem certeza que quer excluir os itens seguintes?",
|
"confirm-delete-generic-items": "Tem certeza que quer excluir os itens seguintes?",
|
||||||
"organizers": "Organizadores",
|
"organizers": "Organizadores",
|
||||||
"caution": "Cuidado",
|
"caution": "Cuidado",
|
||||||
"show-advanced": "Show Advanced",
|
"show-advanced": "Mostrar Avançado",
|
||||||
"add-field": "Add Field",
|
"add-field": "Adicionar Campo",
|
||||||
"date-created": "Date Created",
|
"date-created": "Data de Criação",
|
||||||
"date-updated": "Date Updated"
|
"date-updated": "Data de Atualização"
|
||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"are-you-sure-you-want-to-delete-the-group": "Tem certeza que deseja excluir o grupo <b>{groupName}<b/>?",
|
"are-you-sure-you-want-to-delete-the-group": "Tem certeza que deseja excluir o grupo <b>{groupName}<b/>?",
|
||||||
|
@ -244,9 +244,9 @@
|
||||||
"keep-my-recipes-private-description": "Define o seu grupo e todas as receitas padrão como privadas. Você sempre pode mudar isso mais tarde."
|
"keep-my-recipes-private-description": "Define o seu grupo e todas as receitas padrão como privadas. Você sempre pode mudar isso mais tarde."
|
||||||
},
|
},
|
||||||
"manage-members": "Gerenciar membros",
|
"manage-members": "Gerenciar membros",
|
||||||
"manage-members-description": "Manage the permissions of the members in your household. {manage} allows the user to access the data-management page, and {invite} allows the user to generate invitation links for other users. Group owners cannot change their own permissions.",
|
"manage-members-description": "Gerencie as permissões dos membros da sua casa. {manage} permite ao usuário acessar a página de gerenciamento de dados, e {invite} permite ao usuário gerar links de convites para outros usuários. Os proprietários de grupos não podem mudar suas próprias permissões.",
|
||||||
"manage": "Gerenciar",
|
"manage": "Gerenciar",
|
||||||
"manage-household": "Manage Household",
|
"manage-household": "Gerenciar Casa",
|
||||||
"invite": "Convidar",
|
"invite": "Convidar",
|
||||||
"looking-to-update-your-profile": "Procurando atualizar seu perfil?",
|
"looking-to-update-your-profile": "Procurando atualizar seu perfil?",
|
||||||
"default-recipe-preferences-description": "Estas são as configurações padrão quando uma nova receita é criada no seu grupo. Elas podem ser alteradas para receitas individuais no menu de configurações de receitas.",
|
"default-recipe-preferences-description": "Estas são as configurações padrão quando uma nova receita é criada no seu grupo. Elas podem ser alteradas para receitas individuais no menu de configurações de receitas.",
|
||||||
|
@ -267,7 +267,7 @@
|
||||||
"disable-users-from-commenting-on-recipes": "Desabilitar usuários de comentar em receitas",
|
"disable-users-from-commenting-on-recipes": "Desabilitar usuários de comentar em receitas",
|
||||||
"disable-users-from-commenting-on-recipes-description": "Oculta a seção de comentários na página de receita e desativa os comentários",
|
"disable-users-from-commenting-on-recipes-description": "Oculta a seção de comentários na página de receita e desativa os comentários",
|
||||||
"disable-organizing-recipe-ingredients-by-units-and-food": "Desativar a organização de ingredientes de receita por unidades e alimentos",
|
"disable-organizing-recipe-ingredients-by-units-and-food": "Desativar a organização de ingredientes de receita por unidades e alimentos",
|
||||||
"disable-organizing-recipe-ingredients-by-units-and-food-description": "Hides the Food, Unit, and Amount fields for ingredients and treats ingredients as plain text fields",
|
"disable-organizing-recipe-ingredients-by-units-and-food-description": "Oculta os campos Comida, Unidade e Quantidade de ingredientes e trata os ingredientes como campos de texto simples",
|
||||||
"general-preferences": "Preferências Gerais",
|
"general-preferences": "Preferências Gerais",
|
||||||
"group-recipe-preferences": "Preferências de Grupo de Receitas",
|
"group-recipe-preferences": "Preferências de Grupo de Receitas",
|
||||||
"report": "Denunciar",
|
"report": "Denunciar",
|
||||||
|
@ -280,8 +280,8 @@
|
||||||
"you-must-select-a-group-before-selecting-a-household": "You must select a group before selecting a household"
|
"you-must-select-a-group-before-selecting-a-household": "You must select a group before selecting a household"
|
||||||
},
|
},
|
||||||
"household": {
|
"household": {
|
||||||
"household": "Household",
|
"household": "Casa",
|
||||||
"households": "Households",
|
"households": "Casas",
|
||||||
"user-household": "User Household",
|
"user-household": "User Household",
|
||||||
"create-household": "Create Household",
|
"create-household": "Create Household",
|
||||||
"household-name": "Household Name",
|
"household-name": "Household Name",
|
||||||
|
@ -467,7 +467,7 @@
|
||||||
"calories-suffix": "calorias",
|
"calories-suffix": "calorias",
|
||||||
"carbohydrate-content": "Carboidrato",
|
"carbohydrate-content": "Carboidrato",
|
||||||
"categories": "Categorias",
|
"categories": "Categorias",
|
||||||
"cholesterol-content": "Cholesterol",
|
"cholesterol-content": "Colesterol",
|
||||||
"comment-action": "Comentário",
|
"comment-action": "Comentário",
|
||||||
"comment": "Comentário",
|
"comment": "Comentário",
|
||||||
"comments": "Comentários",
|
"comments": "Comentários",
|
||||||
|
@ -514,11 +514,11 @@
|
||||||
"recipe-updated": "Receita atualizada",
|
"recipe-updated": "Receita atualizada",
|
||||||
"remove-from-favorites": "Remover dos Favoritos",
|
"remove-from-favorites": "Remover dos Favoritos",
|
||||||
"remove-section": "Remover Seção",
|
"remove-section": "Remover Seção",
|
||||||
"saturated-fat-content": "Saturated fat",
|
"saturated-fat-content": "Gorduras saturadas",
|
||||||
"save-recipe-before-use": "Salve a receita antes de utilizar",
|
"save-recipe-before-use": "Salve a receita antes de utilizar",
|
||||||
"section-title": "Título da Seção",
|
"section-title": "Título da Seção",
|
||||||
"servings": "Porções",
|
"servings": "Porções",
|
||||||
"serves-amount": "Serves {amount}",
|
"serves-amount": "Serve {amount}",
|
||||||
"share-recipe-message": "Eu quero compartilhar minha receita de {0} com você.",
|
"share-recipe-message": "Eu quero compartilhar minha receita de {0} com você.",
|
||||||
"show-nutrition-values": "Mostrar informações nutricionais",
|
"show-nutrition-values": "Mostrar informações nutricionais",
|
||||||
"sodium-content": "Sódio",
|
"sodium-content": "Sódio",
|
||||||
|
@ -528,7 +528,7 @@
|
||||||
"total-time": "Tempo Total",
|
"total-time": "Tempo Total",
|
||||||
"trans-fat-content": "Trans-fat",
|
"trans-fat-content": "Trans-fat",
|
||||||
"unable-to-delete-recipe": "Não foi possível apagar a receita",
|
"unable-to-delete-recipe": "Não foi possível apagar a receita",
|
||||||
"unsaturated-fat-content": "Unsaturated fat",
|
"unsaturated-fat-content": "Gorduras não saturadas",
|
||||||
"no-recipe": "Nenhuma Receita",
|
"no-recipe": "Nenhuma Receita",
|
||||||
"locked-by-owner": "Bloqueado pelo Proprietário",
|
"locked-by-owner": "Bloqueado pelo Proprietário",
|
||||||
"join-the-conversation": "Participe da conversa",
|
"join-the-conversation": "Participe da conversa",
|
||||||
|
@ -600,9 +600,9 @@
|
||||||
"create-recipe-from-an-image": "Create Recipe from an Image",
|
"create-recipe-from-an-image": "Create Recipe from an Image",
|
||||||
"create-recipe-from-an-image-description": "Create a recipe by uploading an image of it. Mealie will attempt to extract the text from the image using AI and create a recipe from it.",
|
"create-recipe-from-an-image-description": "Create a recipe by uploading an image of it. Mealie will attempt to extract the text from the image using AI and create a recipe from it.",
|
||||||
"crop-and-rotate-the-image": "Crop and rotate the image so that only the text is visible, and it's in the correct orientation.",
|
"crop-and-rotate-the-image": "Crop and rotate the image so that only the text is visible, and it's in the correct orientation.",
|
||||||
"create-from-image": "Create from Image",
|
"create-from-image": "Criar a partir da imagem",
|
||||||
"should-translate-description": "Translate the recipe into my language",
|
"should-translate-description": "Traduza a receita para o meu idioma",
|
||||||
"please-wait-image-procesing": "Please wait, the image is processing. This may take some time.",
|
"please-wait-image-procesing": "Por favor aguarde, a imagem está sendo processada. Isto pode levar algum tempo.",
|
||||||
"bulk-url-import": "Importação de URL em massa",
|
"bulk-url-import": "Importação de URL em massa",
|
||||||
"debug-scraper": "Debug Scraper",
|
"debug-scraper": "Debug Scraper",
|
||||||
"create-a-recipe-by-providing-the-name-all-recipes-must-have-unique-names": "Crie uma receita fornecendo o nome. Todas as receitas devem ter nomes exclusivos.",
|
"create-a-recipe-by-providing-the-name-all-recipes-must-have-unique-names": "Crie uma receita fornecendo o nome. Todas as receitas devem ter nomes exclusivos.",
|
||||||
|
@ -611,7 +611,7 @@
|
||||||
"scrape-recipe-description": "Scrape uma receita por url. Forneça o Url para o site que você deseja scrape, e Mealie tentará raspar a receita desse site e adicioná-la à sua coleção.",
|
"scrape-recipe-description": "Scrape uma receita por url. Forneça o Url para o site que você deseja scrape, e Mealie tentará raspar a receita desse site e adicioná-la à sua coleção.",
|
||||||
"scrape-recipe-have-a-lot-of-recipes": "Tem muitas receitas a extrair de uma vez?",
|
"scrape-recipe-have-a-lot-of-recipes": "Tem muitas receitas a extrair de uma vez?",
|
||||||
"scrape-recipe-suggest-bulk-importer": "Tente o importador em massa",
|
"scrape-recipe-suggest-bulk-importer": "Tente o importador em massa",
|
||||||
"scrape-recipe-have-raw-html-or-json-data": "Have raw HTML or JSON data?",
|
"scrape-recipe-have-raw-html-or-json-data": "Tem dados HTML ou JSON brutos?",
|
||||||
"scrape-recipe-you-can-import-from-raw-data-directly": "You can import from raw data directly",
|
"scrape-recipe-you-can-import-from-raw-data-directly": "You can import from raw data directly",
|
||||||
"import-original-keywords-as-tags": "Importar palavras-chave originais como marcadores",
|
"import-original-keywords-as-tags": "Importar palavras-chave originais como marcadores",
|
||||||
"stay-in-edit-mode": "Permanecer no modo de edição",
|
"stay-in-edit-mode": "Permanecer no modo de edição",
|
||||||
|
@ -662,22 +662,22 @@
|
||||||
"no-food": "Sem Comida"
|
"no-food": "Sem Comida"
|
||||||
},
|
},
|
||||||
"reset-servings-count": "Reset Servings Count",
|
"reset-servings-count": "Reset Servings Count",
|
||||||
"not-linked-ingredients": "Additional Ingredients"
|
"not-linked-ingredients": "Ingredientes adicionais"
|
||||||
},
|
},
|
||||||
"recipe-finder": {
|
"recipe-finder": {
|
||||||
"recipe-finder": "Recipe Finder",
|
"recipe-finder": "Localizador de Receitas",
|
||||||
"recipe-finder-description": "Search for recipes based on ingredients you have on hand. You can also filter by tools you have available, and set a maximum number of missing ingredients or tools.",
|
"recipe-finder-description": "Procure por receitas baseadas em ingredientes que você tem na mão. Você também pode filtrar por ferramentas disponíveis e definir um número máximo de ingredientes ou ferramentas que faltam.",
|
||||||
"selected-ingredients": "Selected Ingredients",
|
"selected-ingredients": "Ingredientes selecionados",
|
||||||
"no-ingredients-selected": "No ingredients selected",
|
"no-ingredients-selected": "Nenhum ingrediente selecionado",
|
||||||
"missing": "Missing",
|
"missing": "Ausente",
|
||||||
"no-recipes-found": "No recipes found",
|
"no-recipes-found": "Nenhuma receita encontrada",
|
||||||
"no-recipes-found-description": "Try adding more ingredients to your search or adjusting your filters",
|
"no-recipes-found-description": "Try adding more ingredients to your search or adjusting your filters",
|
||||||
"include-ingredients-on-hand": "Include Ingredients On Hand",
|
"include-ingredients-on-hand": "Include Ingredients On Hand",
|
||||||
"include-tools-on-hand": "Include Tools On Hand",
|
"include-tools-on-hand": "Include Tools On Hand",
|
||||||
"max-missing-ingredients": "Max Missing Ingredients",
|
"max-missing-ingredients": "Max Missing Ingredients",
|
||||||
"max-missing-tools": "Max Missing Tools",
|
"max-missing-tools": "Max Missing Tools",
|
||||||
"selected-tools": "Selected Tools",
|
"selected-tools": "Ferramentas Selecionadas",
|
||||||
"other-filters": "Other Filters",
|
"other-filters": "Outros Filtros",
|
||||||
"ready-to-make": "Ready to Make",
|
"ready-to-make": "Ready to Make",
|
||||||
"almost-ready-to-make": "Almost Ready to Make"
|
"almost-ready-to-make": "Almost Ready to Make"
|
||||||
},
|
},
|
||||||
|
@ -690,7 +690,7 @@
|
||||||
"or": "Ou",
|
"or": "Ou",
|
||||||
"has-any": "Tem alguma",
|
"has-any": "Tem alguma",
|
||||||
"has-all": "Tem todos",
|
"has-all": "Tem todos",
|
||||||
"clear-selection": "Clear Selection",
|
"clear-selection": "Limpar Seleção",
|
||||||
"results": "Resultados",
|
"results": "Resultados",
|
||||||
"search": "Pesquisar",
|
"search": "Pesquisar",
|
||||||
"search-mealie": "Pesquisar no Mealie (pressione /)",
|
"search-mealie": "Pesquisar no Mealie (pressione /)",
|
||||||
|
@ -884,7 +884,7 @@
|
||||||
"are-you-sure-you-want-to-check-all-items": "Tem certeza que deseja marcar todos os itens?",
|
"are-you-sure-you-want-to-check-all-items": "Tem certeza que deseja marcar todos os itens?",
|
||||||
"are-you-sure-you-want-to-uncheck-all-items": "Tem certeza que deseja desmarcar todos os itens?",
|
"are-you-sure-you-want-to-uncheck-all-items": "Tem certeza que deseja desmarcar todos os itens?",
|
||||||
"are-you-sure-you-want-to-delete-checked-items": "Tem certeza que deseja apagar todos os itens marcados?",
|
"are-you-sure-you-want-to-delete-checked-items": "Tem certeza que deseja apagar todos os itens marcados?",
|
||||||
"no-shopping-lists-found": "No Shopping Lists Found"
|
"no-shopping-lists-found": "Nenhuma lista de compras encontrada"
|
||||||
},
|
},
|
||||||
"sidebar": {
|
"sidebar": {
|
||||||
"all-recipes": "Todas as Receitas",
|
"all-recipes": "Todas as Receitas",
|
||||||
|
@ -1286,17 +1286,17 @@
|
||||||
"restore-from-v1-backup": "Tem uma cópia de segurança de uma instância anterior do Mealie v1? Você pode restaurá-la aqui.",
|
"restore-from-v1-backup": "Tem uma cópia de segurança de uma instância anterior do Mealie v1? Você pode restaurá-la aqui.",
|
||||||
"manage-profile-or-get-invite-link": "Gerencie seu próprio perfil, ou pegue um link de convite para compartilhar."
|
"manage-profile-or-get-invite-link": "Gerencie seu próprio perfil, ou pegue um link de convite para compartilhar."
|
||||||
},
|
},
|
||||||
"debug-openai-services": "Debug OpenAI Services",
|
"debug-openai-services": "Debug de Serviços OpenAI",
|
||||||
"debug-openai-services-description": "Use this page to debug OpenAI services. You can test your OpenAI connection and see the results here. If you have image services enabled, you can also provide an image.",
|
"debug-openai-services-description": "Use esta página para depurar serviços OpenAI. Você pode testar a sua conexão OpenAI e ver os resultados aqui. Se você tiver os serviços de imagem ativados, você também pode fornecer uma imagem.",
|
||||||
"run-test": "Run Test",
|
"run-test": "Executar teste",
|
||||||
"test-results": "Test Results",
|
"test-results": "Resultados do teste",
|
||||||
"group-delete-note": "Groups with users or households cannot be deleted",
|
"group-delete-note": "Groups with users or households cannot be deleted",
|
||||||
"household-delete-note": "Households with users cannot be deleted"
|
"household-delete-note": "Households with users cannot be deleted"
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
"welcome-user": "👋 Bem-vindo(a), {0}!",
|
"welcome-user": "👋 Bem-vindo(a), {0}!",
|
||||||
"description": "Gerencie seu perfil, receitas e configurações de grupo.",
|
"description": "Gerencie seu perfil, receitas e configurações de grupo.",
|
||||||
"invite-link": "Invite Link",
|
"invite-link": "Link de convite",
|
||||||
"get-invite-link": "Obter link de convite",
|
"get-invite-link": "Obter link de convite",
|
||||||
"get-public-link": "Obter link público",
|
"get-public-link": "Obter link público",
|
||||||
"account-summary": "Resumo da conta",
|
"account-summary": "Resumo da conta",
|
||||||
|
@ -1367,21 +1367,21 @@
|
||||||
"or": "OR"
|
"or": "OR"
|
||||||
},
|
},
|
||||||
"relational-operators": {
|
"relational-operators": {
|
||||||
"equals": "equals",
|
"equals": "igual a",
|
||||||
"does-not-equal": "does not equal",
|
"does-not-equal": "não é igual a",
|
||||||
"is-greater-than": "is greater than",
|
"is-greater-than": "é maior que",
|
||||||
"is-greater-than-or-equal-to": "is greater than or equal to",
|
"is-greater-than-or-equal-to": "é maior ou igual a",
|
||||||
"is-less-than": "is less than",
|
"is-less-than": "é menor que",
|
||||||
"is-less-than-or-equal-to": "is less than or equal to"
|
"is-less-than-or-equal-to": "é menor ou igual a"
|
||||||
},
|
},
|
||||||
"relational-keywords": {
|
"relational-keywords": {
|
||||||
"is": "is",
|
"is": "é",
|
||||||
"is-not": "is not",
|
"is-not": "não é",
|
||||||
"is-one-of": "is one of",
|
"is-one-of": "é um(a) de",
|
||||||
"is-not-one-of": "is not one of",
|
"is-not-one-of": "não é um de",
|
||||||
"contains-all-of": "contains all of",
|
"contains-all-of": "contém todos de",
|
||||||
"is-like": "is like",
|
"is-like": "é como",
|
||||||
"is-not-like": "is not like"
|
"is-not-like": "não é como"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
"category-filter": "Kategorifilter",
|
"category-filter": "Kategorifilter",
|
||||||
"category-update-failed": "Kategori gick inte att uppdatera",
|
"category-update-failed": "Kategori gick inte att uppdatera",
|
||||||
"category-updated": "Kategori uppdaterad",
|
"category-updated": "Kategori uppdaterad",
|
||||||
"uncategorized-count": "Ingen Kategori {count}",
|
"uncategorized-count": "Utan kategori {count}",
|
||||||
"create-a-category": "Skapa kategori",
|
"create-a-category": "Skapa kategori",
|
||||||
"category-name": "Kategorinamn",
|
"category-name": "Kategorinamn",
|
||||||
"category": "Kategori"
|
"category": "Kategori"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"api-docs": "Документація API",
|
"api-docs": "Документація API",
|
||||||
"api-port": "Порт API",
|
"api-port": "Порт API",
|
||||||
"application-mode": "Режим додатку",
|
"application-mode": "Режим додатку",
|
||||||
"database-type": "Тип бази данних",
|
"database-type": "Тип бази даних",
|
||||||
"database-url": "URL-адреса бази даних",
|
"database-url": "URL-адреса бази даних",
|
||||||
"default-group": "Групи за замовчуванням",
|
"default-group": "Групи за замовчуванням",
|
||||||
"default-household": "Сімʼя за замовчуванням",
|
"default-household": "Сімʼя за замовчуванням",
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
"a-name-is-required": "Необхідно вказати назву",
|
"a-name-is-required": "Необхідно вказати назву",
|
||||||
"delete-with-name": "Видалити {name}",
|
"delete-with-name": "Видалити {name}",
|
||||||
"confirm-delete-generic-with-name": "Ви дійсно хочете видалити {name}?",
|
"confirm-delete-generic-with-name": "Ви дійсно хочете видалити {name}?",
|
||||||
"confirm-delete-own-admin-account": "Зверніть увагу, що ви намагаєтеся видалити свій обліковий запис адміністратора! Цю дію неможливо скасувати і ви остаточно видалите ваш обліковий запис?",
|
"confirm-delete-own-admin-account": "Зверніть увагу, що ви намагаєтеся видалити свій обліковий запис адміністратора! Цю дію неможливо скасувати й ви остаточно видалите ваш обліковий запис?",
|
||||||
"organizer": "Організатор",
|
"organizer": "Організатор",
|
||||||
"transfer": "Передача",
|
"transfer": "Передача",
|
||||||
"copy": "Скопіювати",
|
"copy": "Скопіювати",
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
"learn-more": "Дізнатися більше",
|
"learn-more": "Дізнатися більше",
|
||||||
"this-feature-is-currently-inactive": "Ця функція наразі не активна",
|
"this-feature-is-currently-inactive": "Ця функція наразі не активна",
|
||||||
"clipboard-not-supported": "Буфер обміну не підтримується",
|
"clipboard-not-supported": "Буфер обміну не підтримується",
|
||||||
"copied-to-clipboard": "Скопійовано до буферу обміну",
|
"copied-to-clipboard": "Скопійовано до буфера обміну",
|
||||||
"your-browser-does-not-support-clipboard": "Ваш браузер не підтримує буфер обміну",
|
"your-browser-does-not-support-clipboard": "Ваш браузер не підтримує буфер обміну",
|
||||||
"copied-items-to-clipboard": "Жоден елемент не скопійовано в буфер обміну|Один елемент скопійовано в буфер обміну|Скопійовано {count} елементів в буфер обміну",
|
"copied-items-to-clipboard": "Жоден елемент не скопійовано в буфер обміну|Один елемент скопійовано в буфер обміну|Скопійовано {count} елементів в буфер обміну",
|
||||||
"actions": "Дії",
|
"actions": "Дії",
|
||||||
|
@ -246,14 +246,14 @@
|
||||||
"manage-members": "Керування Користувачами",
|
"manage-members": "Керування Користувачами",
|
||||||
"manage-members-description": "Керуйте дозволами учасників вашої сімʼї. {manage} дозволяє користувачеві отримати доступ до сторінки керування даними {invite} дозволяє користувачеві генерувати посилання запрошення для інших користувачів. Власники групи не можуть змінити власні дозволи.",
|
"manage-members-description": "Керуйте дозволами учасників вашої сімʼї. {manage} дозволяє користувачеві отримати доступ до сторінки керування даними {invite} дозволяє користувачеві генерувати посилання запрошення для інших користувачів. Власники групи не можуть змінити власні дозволи.",
|
||||||
"manage": "Керування",
|
"manage": "Керування",
|
||||||
"manage-household": "Manage Household",
|
"manage-household": "Керувати сімʼєю",
|
||||||
"invite": "Запрошення",
|
"invite": "Запрошення",
|
||||||
"looking-to-update-your-profile": "Бажаєте оновити свій профіль?",
|
"looking-to-update-your-profile": "Бажаєте оновити свій профіль?",
|
||||||
"default-recipe-preferences-description": "Це типові налаштування, коли створюється новий рецепт у вашій групі. Ці параметри можна змінити для окремих рецептів в меню налаштувань рецептів.",
|
"default-recipe-preferences-description": "Це типові налаштування, коли створюється новий рецепт у вашій групі. Ці параметри можна змінити для окремих рецептів в меню налаштувань рецептів.",
|
||||||
"default-recipe-preferences": "Параметри за умовчанням",
|
"default-recipe-preferences": "Параметри за умовчанням",
|
||||||
"group-preferences": "Налаштування групи",
|
"group-preferences": "Налаштування групи",
|
||||||
"private-group": "Приватна група",
|
"private-group": "Приватна група",
|
||||||
"private-group-description": "Setting your group to private will disable all public view options. This overrides any individual public view settings",
|
"private-group-description": "Якщо зробити групу приватною, то всі налаштування публічного перегляду буде скинуто. Це замінить індивідуальні налаштування публічного перегляду",
|
||||||
"enable-public-access": "Дозволити загальний доступ",
|
"enable-public-access": "Дозволити загальний доступ",
|
||||||
"enable-public-access-description": "Робить групові рецепти загальнодоступними за замовчуванням і дозволяє користувачам переглядати рецепти без входу в систему",
|
"enable-public-access-description": "Робить групові рецепти загальнодоступними за замовчуванням і дозволяє користувачам переглядати рецепти без входу в систему",
|
||||||
"allow-users-outside-of-your-group-to-see-your-recipes": "Дозволити користувачам за межами вашої групи бачити ваші рецепти",
|
"allow-users-outside-of-your-group-to-see-your-recipes": "Дозволити користувачам за межами вашої групи бачити ваші рецепти",
|
||||||
|
@ -277,7 +277,7 @@
|
||||||
"admin-group-management-text": "Зміни до цієї групи будуть відображені негайно.",
|
"admin-group-management-text": "Зміни до цієї групи будуть відображені негайно.",
|
||||||
"group-id-value": "Id групи: {0}",
|
"group-id-value": "Id групи: {0}",
|
||||||
"total-households": "Всього сімей",
|
"total-households": "Всього сімей",
|
||||||
"you-must-select-a-group-before-selecting-a-household": "You must select a group before selecting a household"
|
"you-must-select-a-group-before-selecting-a-household": "Ви маєте вибрати групу перед тим, як вибирати сім'ю"
|
||||||
},
|
},
|
||||||
"household": {
|
"household": {
|
||||||
"household": "Сімʼя",
|
"household": "Сімʼя",
|
||||||
|
@ -292,9 +292,9 @@
|
||||||
"admin-household-management-text": "Зміни до цієї сімʼї будуть відображені негайно.",
|
"admin-household-management-text": "Зміни до цієї сімʼї будуть відображені негайно.",
|
||||||
"household-id-value": "Ідентифікатор сімʼї: {0}",
|
"household-id-value": "Ідентифікатор сімʼї: {0}",
|
||||||
"private-household": "Приватна сімʼя",
|
"private-household": "Приватна сімʼя",
|
||||||
"private-household-description": "Setting your household to private will disable all public view options. This overrides any individual public view settings",
|
"private-household-description": "Якщо зробити сім'ю приватною, то всі налаштування публічного перегляду буде скинуто. Це замінить індивідуальні налаштування публічного перегляду",
|
||||||
"lock-recipe-edits-from-other-households": "Lock recipe edits from other households",
|
"lock-recipe-edits-from-other-households": "Заблокувати редагування рецептів іншими сім'ями",
|
||||||
"lock-recipe-edits-from-other-households-description": "When enabled only users in your household can edit recipes created by your household",
|
"lock-recipe-edits-from-other-households-description": "Якщо увімкнено, тільки члени вашої сім'ї зможуть редагувати рецепти, які були створені вашою сім'єю",
|
||||||
"household-recipe-preferences": "Налаштування рецептів сімʼї",
|
"household-recipe-preferences": "Налаштування рецептів сімʼї",
|
||||||
"default-recipe-preferences-description": "Це типові налаштування для нового рецепта у вашій сімʼї. Ці параметри можна змінити для окремих рецептів в меню налаштувань рецептів.",
|
"default-recipe-preferences-description": "Це типові налаштування для нового рецепта у вашій сімʼї. Ці параметри можна змінити для окремих рецептів в меню налаштувань рецептів.",
|
||||||
"allow-users-outside-of-your-household-to-see-your-recipes": "Дозволити користувачам за межами вашої сімʼї бачити ваші рецепти",
|
"allow-users-outside-of-your-household-to-see-your-recipes": "Дозволити користувачам за межами вашої сімʼї бачити ваші рецепти",
|
||||||
|
@ -321,10 +321,10 @@
|
||||||
"mealplan-settings": "Налаштування плану харчування",
|
"mealplan-settings": "Налаштування плану харчування",
|
||||||
"mealplan-update-failed": "Не вдалося оновити план харчування",
|
"mealplan-update-failed": "Не вдалося оновити план харчування",
|
||||||
"mealplan-updated": "План харчування оновлено",
|
"mealplan-updated": "План харчування оновлено",
|
||||||
"mealplan-households-description": "If no household is selected, recipes can be added from any household",
|
"mealplan-households-description": "Якщо жодної сім'ї не вибрано, рецепти можуть бути доданими з будь-якої сім'ї",
|
||||||
"any-category": "Будь-яка категорія",
|
"any-category": "Будь-яка категорія",
|
||||||
"any-tag": "Будь-який тег",
|
"any-tag": "Будь-який тег",
|
||||||
"any-household": "Any Household",
|
"any-household": "Будь-яка сім'я",
|
||||||
"no-meal-plan-defined-yet": "Не створено жодного плану харчування",
|
"no-meal-plan-defined-yet": "Не створено жодного плану харчування",
|
||||||
"no-meal-planned-for-today": "Не заплановано харчування на сьогодні",
|
"no-meal-planned-for-today": "Не заплановано харчування на сьогодні",
|
||||||
"numberOfDays-hint": "Скільки днів завантажувати на сторінку",
|
"numberOfDays-hint": "Скільки днів завантажувати на сторінку",
|
||||||
|
@ -357,7 +357,7 @@
|
||||||
"for-type-meal-types": "для {0} типів харчування",
|
"for-type-meal-types": "для {0} типів харчування",
|
||||||
"meal-plan-rules": "Правила планів харчування",
|
"meal-plan-rules": "Правила планів харчування",
|
||||||
"new-rule": "Нове правило",
|
"new-rule": "Нове правило",
|
||||||
"meal-plan-rules-description": "You can create rules for auto selecting recipes for your meal plans. These rules are used by the server to determine the random pool of recipes to select from when creating meal plans. Note that if rules have the same day/type constraints then the rule filters will be merged. In practice, it's unnecessary to create duplicate rules, but it's possible to do so.",
|
"meal-plan-rules-description": "Ви можете створити правила для автоматичного вибору рецептів для ваших планів харчування. Ці правила використовуються сервером для вибору рецептів при створенні плану харчування. Зверніть увагу, що якщо правила мають обмеження на день/тип, то їх категорії будуть об'єднані. Дублювати правила немає сенсу, але можливо.",
|
||||||
"new-rule-description": "При створенні нового правила для плану харчування, ви можете обмежити правило на певний день тижня та/або певний тип їжі. Щоб застосувати правило до всіх днів або всіх типів їжі, ви можете встановити правило \"Будь-який\", що застосовуватиме його до всіх можливих значень для дня та/або типу їжі.",
|
"new-rule-description": "При створенні нового правила для плану харчування, ви можете обмежити правило на певний день тижня та/або певний тип їжі. Щоб застосувати правило до всіх днів або всіх типів їжі, ви можете встановити правило \"Будь-який\", що застосовуватиме його до всіх можливих значень для дня та/або типу їжі.",
|
||||||
"recipe-rules": "Правила рецептів",
|
"recipe-rules": "Правила рецептів",
|
||||||
"applies-to-all-days": "Застосовується до всіх днів",
|
"applies-to-all-days": "Застосовується до всіх днів",
|
||||||
|
@ -518,7 +518,7 @@
|
||||||
"save-recipe-before-use": "Зберегти рецепт перед використанням",
|
"save-recipe-before-use": "Зберегти рецепт перед використанням",
|
||||||
"section-title": "Назва розділу",
|
"section-title": "Назва розділу",
|
||||||
"servings": "Порції",
|
"servings": "Порції",
|
||||||
"serves-amount": "Serves {amount}",
|
"serves-amount": "Порцій: {amount}",
|
||||||
"share-recipe-message": "Я хотів би поділитися з тобою своїм рецептом {0}.",
|
"share-recipe-message": "Я хотів би поділитися з тобою своїм рецептом {0}.",
|
||||||
"show-nutrition-values": "Показати харчову цінність",
|
"show-nutrition-values": "Показати харчову цінність",
|
||||||
"sodium-content": "Натрій",
|
"sodium-content": "Натрій",
|
||||||
|
@ -547,8 +547,8 @@
|
||||||
"failed-to-add-recipe-to-mealplan": "Не вдалося додати рецепт до плану харчування",
|
"failed-to-add-recipe-to-mealplan": "Не вдалося додати рецепт до плану харчування",
|
||||||
"failed-to-add-to-list": "Не вдалося додати до списку",
|
"failed-to-add-to-list": "Не вдалося додати до списку",
|
||||||
"yield": "Вихід",
|
"yield": "Вихід",
|
||||||
"yields-amount-with-text": "Yields {amount} {text}",
|
"yields-amount-with-text": "Вийде: {amount} {text}",
|
||||||
"yield-text": "Yield Text",
|
"yield-text": "Текст виходу",
|
||||||
"quantity": "Кількість",
|
"quantity": "Кількість",
|
||||||
"choose-unit": "Виберіть одиниці вимірювання",
|
"choose-unit": "Виберіть одиниці вимірювання",
|
||||||
"press-enter-to-create": "Натисніть Enter, щоб створити",
|
"press-enter-to-create": "Натисніть Enter, щоб створити",
|
||||||
|
@ -662,24 +662,24 @@
|
||||||
"no-food": "Немає їжі"
|
"no-food": "Немає їжі"
|
||||||
},
|
},
|
||||||
"reset-servings-count": "Скинути кількість порцій",
|
"reset-servings-count": "Скинути кількість порцій",
|
||||||
"not-linked-ingredients": "Additional Ingredients"
|
"not-linked-ingredients": "Додаткові продукти"
|
||||||
},
|
},
|
||||||
"recipe-finder": {
|
"recipe-finder": {
|
||||||
"recipe-finder": "Recipe Finder",
|
"recipe-finder": "Шукач рецептів",
|
||||||
"recipe-finder-description": "Search for recipes based on ingredients you have on hand. You can also filter by tools you have available, and set a maximum number of missing ingredients or tools.",
|
"recipe-finder-description": "Пошук рецептів базується на продуктах, які ви маєте. Ви також можете фільтрувати за наявними інструментами та встановити максимальну кількість відсутніх продуктів або інструментів.",
|
||||||
"selected-ingredients": "Selected Ingredients",
|
"selected-ingredients": "Вибрані продукти",
|
||||||
"no-ingredients-selected": "No ingredients selected",
|
"no-ingredients-selected": "Жодного продукту не вибрано",
|
||||||
"missing": "Missing",
|
"missing": "Відсутні",
|
||||||
"no-recipes-found": "No recipes found",
|
"no-recipes-found": "Рецептів не знайдено",
|
||||||
"no-recipes-found-description": "Try adding more ingredients to your search or adjusting your filters",
|
"no-recipes-found-description": "Спробуйте додати більше продуктів до пошукового списку або підлаштувати фільтри",
|
||||||
"include-ingredients-on-hand": "Include Ingredients On Hand",
|
"include-ingredients-on-hand": "Включити наявні продукти",
|
||||||
"include-tools-on-hand": "Include Tools On Hand",
|
"include-tools-on-hand": "Включити наявні інструменти",
|
||||||
"max-missing-ingredients": "Max Missing Ingredients",
|
"max-missing-ingredients": "Максимум відсутніх продуктів",
|
||||||
"max-missing-tools": "Max Missing Tools",
|
"max-missing-tools": "Максимум відсутніх інструментів",
|
||||||
"selected-tools": "Selected Tools",
|
"selected-tools": "Вибрані інструменти",
|
||||||
"other-filters": "Other Filters",
|
"other-filters": "Інші фільтри",
|
||||||
"ready-to-make": "Ready to Make",
|
"ready-to-make": "Готове до приготування",
|
||||||
"almost-ready-to-make": "Almost Ready to Make"
|
"almost-ready-to-make": "Майже готове до приготування"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"advanced-search": "Розширений пошук",
|
"advanced-search": "Розширений пошук",
|
||||||
|
@ -884,7 +884,7 @@
|
||||||
"are-you-sure-you-want-to-check-all-items": "Ви впевнені, що хочете відмітити всі елементи?",
|
"are-you-sure-you-want-to-check-all-items": "Ви впевнені, що хочете відмітити всі елементи?",
|
||||||
"are-you-sure-you-want-to-uncheck-all-items": "Ви впевнені, що хочете зняти відмітку з усіх елементів?",
|
"are-you-sure-you-want-to-uncheck-all-items": "Ви впевнені, що хочете зняти відмітку з усіх елементів?",
|
||||||
"are-you-sure-you-want-to-delete-checked-items": "Ви впевнені, що хочете видалити всі відмічені елементи?",
|
"are-you-sure-you-want-to-delete-checked-items": "Ви впевнені, що хочете видалити всі відмічені елементи?",
|
||||||
"no-shopping-lists-found": "No Shopping Lists Found"
|
"no-shopping-lists-found": "Списків покупок не знайдено"
|
||||||
},
|
},
|
||||||
"sidebar": {
|
"sidebar": {
|
||||||
"all-recipes": "Всі рецепти",
|
"all-recipes": "Всі рецепти",
|
||||||
|
@ -1030,7 +1030,7 @@
|
||||||
"administrator": "Адміністратор",
|
"administrator": "Адміністратор",
|
||||||
"user-can-invite-other-to-group": "Користувач може запрошувати інших в групу",
|
"user-can-invite-other-to-group": "Користувач може запрошувати інших в групу",
|
||||||
"user-can-manage-group": "Користувач може керувати групою",
|
"user-can-manage-group": "Користувач може керувати групою",
|
||||||
"user-can-manage-household": "User can manage household",
|
"user-can-manage-household": "Користувач може управляти сім'єю",
|
||||||
"user-can-organize-group-data": "Користувач може впорядковувати дані групи",
|
"user-can-organize-group-data": "Користувач може впорядковувати дані групи",
|
||||||
"enable-advanced-features": "Увімкнути додаткові функції",
|
"enable-advanced-features": "Увімкнути додаткові функції",
|
||||||
"it-looks-like-this-is-your-first-time-logging-in": "Схоже, ви заходите вперше.",
|
"it-looks-like-this-is-your-first-time-logging-in": "Схоже, ви заходите вперше.",
|
||||||
|
@ -1290,13 +1290,13 @@
|
||||||
"debug-openai-services-description": "Використовуйте цю сторінку, щоб налагодити служби OpenAI. Ви можете перевірити ваше з'єднання з OpenAI й побачити результати тут. Якщо ввімкнено служби зображень, ви також можете надати зображення.",
|
"debug-openai-services-description": "Використовуйте цю сторінку, щоб налагодити служби OpenAI. Ви можете перевірити ваше з'єднання з OpenAI й побачити результати тут. Якщо ввімкнено служби зображень, ви також можете надати зображення.",
|
||||||
"run-test": "Запустити перевірку",
|
"run-test": "Запустити перевірку",
|
||||||
"test-results": "Результати перевірки",
|
"test-results": "Результати перевірки",
|
||||||
"group-delete-note": "Groups with users or households cannot be deleted",
|
"group-delete-note": "Не можна видалити групи з користувачами чи сім'ями в ній",
|
||||||
"household-delete-note": "Households with users cannot be deleted"
|
"household-delete-note": "Не можна видалити сім'ю з користувачами в ній"
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
"welcome-user": "👋 Ласкаво просимо, {0}!",
|
"welcome-user": "👋 Ласкаво просимо, {0}!",
|
||||||
"description": "Керування вашим профілем, рецептами та налаштуваннями групи.",
|
"description": "Керування вашим профілем, рецептами та налаштуваннями групи.",
|
||||||
"invite-link": "Invite Link",
|
"invite-link": "Посилання-запрошення",
|
||||||
"get-invite-link": "Отримати посилання-запрошення",
|
"get-invite-link": "Отримати посилання-запрошення",
|
||||||
"get-public-link": "Отримати публічне посилання",
|
"get-public-link": "Отримати публічне посилання",
|
||||||
"account-summary": "Аккаунт",
|
"account-summary": "Аккаунт",
|
||||||
|
@ -1345,9 +1345,9 @@
|
||||||
},
|
},
|
||||||
"cookbook": {
|
"cookbook": {
|
||||||
"cookbooks": "Кулінарні книги",
|
"cookbooks": "Кулінарні книги",
|
||||||
"description": "Cookbooks are another way to organize recipes by creating cross sections of recipes, organizers, and other filters. Creating a cookbook will add an entry to the side-bar and all the recipes with the filters chosen will be displayed in the cookbook.",
|
"description": "Кулінарні книги - це ще один спосіб організовувати рецепти за допомогою розділів та інших фільтрів. Нова кулінарна книга з'явиться на боковій панелі, і всі рецепти, які відповідають обраним фільтрам, будуть показуватися в кулінарній книзі.",
|
||||||
"hide-cookbooks-from-other-households": "Hide Cookbooks from Other Households",
|
"hide-cookbooks-from-other-households": "Приховати кулінарні книги від інших сімей",
|
||||||
"hide-cookbooks-from-other-households-description": "When enabled, only cookbooks from your household will appear on the sidebar",
|
"hide-cookbooks-from-other-households-description": "Якщо вибрано, тільки кулінарні книги вашої сім'ї буде видно на боковій панелі",
|
||||||
"public-cookbook": "Публічна кулінарна книга",
|
"public-cookbook": "Публічна кулінарна книга",
|
||||||
"public-cookbook-description": "Публічними кулінарними книгами можна поділитися з будь-ким, і вони будуть відображатися на сторінці вашої групи.",
|
"public-cookbook-description": "Публічними кулінарними книгами можна поділитися з будь-ким, і вони будуть відображатися на сторінці вашої групи.",
|
||||||
"filter-options": "Параметри фільтра",
|
"filter-options": "Параметри фільтра",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mealie",
|
"name": "mealie",
|
||||||
"version": "2.5.0",
|
"version": "2.6.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nuxt",
|
"dev": "nuxt",
|
||||||
|
|
|
@ -151,6 +151,24 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Create Item -->
|
||||||
|
<div v-if="createEditorOpen">
|
||||||
|
<ShoppingListItemEditor
|
||||||
|
v-model="createListItemData"
|
||||||
|
class="my-4"
|
||||||
|
:labels="allLabels || []"
|
||||||
|
:units="allUnits || []"
|
||||||
|
:foods="allFoods || []"
|
||||||
|
:allow-delete="false"
|
||||||
|
@delete="createEditorOpen = false"
|
||||||
|
@cancel="createEditorOpen = false"
|
||||||
|
@save="createListItem"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else class="d-flex justify-end">
|
||||||
|
<BaseButton create @click="createEditorOpen = true" > {{ $t('general.add') }} </BaseButton>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Reorder Labels -->
|
<!-- Reorder Labels -->
|
||||||
<BaseDialog
|
<BaseDialog
|
||||||
v-model="reorderLabelsDialog"
|
v-model="reorderLabelsDialog"
|
||||||
|
@ -177,23 +195,6 @@
|
||||||
</v-card>
|
</v-card>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
|
||||||
<!-- Create Item -->
|
|
||||||
<div v-if="createEditorOpen">
|
|
||||||
<ShoppingListItemEditor
|
|
||||||
v-model="createListItemData"
|
|
||||||
class="my-4"
|
|
||||||
:labels="allLabels || []"
|
|
||||||
:units="allUnits || []"
|
|
||||||
:foods="allFoods || []"
|
|
||||||
@delete="createEditorOpen = false"
|
|
||||||
@cancel="createEditorOpen = false"
|
|
||||||
@save="createListItem"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-else class="mt-4 d-flex justify-end">
|
|
||||||
<BaseButton create @click="createEditorOpen = true" > {{ $t('general.add') }} </BaseButton>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Checked Items -->
|
<!-- Checked Items -->
|
||||||
<div v-if="listItems.checked && listItems.checked.length > 0" class="mt-6">
|
<div v-if="listItems.checked && listItems.checked.length > 0" class="mt-6">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
"""remove instructions index
|
||||||
|
|
||||||
|
Revision ID: 7cf3054cbbcc
|
||||||
|
Revises: b9e516e2d3b3
|
||||||
|
Create Date: 2025-02-09 15:31:00.772295
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy import orm
|
||||||
|
from alembic import op
|
||||||
|
from mealie.db.models._model_utils.guid import GUID
|
||||||
|
from mealie.core.root_logger import get_logger
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = "7cf3054cbbcc"
|
||||||
|
down_revision: str | None = "b9e516e2d3b3"
|
||||||
|
branch_labels: str | tuple[str, ...] | None = None
|
||||||
|
depends_on: str | tuple[str, ...] | None = None
|
||||||
|
|
||||||
|
logger = get_logger()
|
||||||
|
|
||||||
|
|
||||||
|
class SqlAlchemyBase(orm.DeclarativeBase):
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls) -> list[orm.InstrumentedAttribute]:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
class RecipeModel(SqlAlchemyBase):
|
||||||
|
__tablename__ = "recipes"
|
||||||
|
|
||||||
|
id: orm.Mapped[GUID] = orm.mapped_column(GUID, primary_key=True, default=GUID.generate)
|
||||||
|
name_normalized: orm.Mapped[str] = orm.mapped_column(sa.String, nullable=False, index=True)
|
||||||
|
description_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls):
|
||||||
|
return [cls.name_normalized, cls.description_normalized]
|
||||||
|
|
||||||
|
|
||||||
|
class RecipeIngredientModel(SqlAlchemyBase):
|
||||||
|
__tablename__ = "recipes_ingredients"
|
||||||
|
|
||||||
|
id: orm.Mapped[int] = orm.mapped_column(sa.Integer, primary_key=True)
|
||||||
|
note_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
original_text_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls):
|
||||||
|
return [cls.note_normalized, cls.original_text_normalized]
|
||||||
|
|
||||||
|
|
||||||
|
class IngredientFoodModel(SqlAlchemyBase):
|
||||||
|
__tablename__ = "ingredient_foods"
|
||||||
|
id: orm.Mapped[GUID] = orm.mapped_column(GUID, primary_key=True, default=GUID.generate)
|
||||||
|
name_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
plural_name_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls):
|
||||||
|
return [cls.name_normalized, cls.plural_name_normalized]
|
||||||
|
|
||||||
|
|
||||||
|
class IngredientFoodAliasModel(SqlAlchemyBase):
|
||||||
|
__tablename__ = "ingredient_foods_aliases"
|
||||||
|
id: orm.Mapped[GUID] = orm.mapped_column(GUID, primary_key=True, default=GUID.generate)
|
||||||
|
name_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls):
|
||||||
|
return [cls.name_normalized]
|
||||||
|
|
||||||
|
|
||||||
|
class IngredientUnitModel(SqlAlchemyBase):
|
||||||
|
__tablename__ = "ingredient_units"
|
||||||
|
id: orm.Mapped[GUID] = orm.mapped_column(GUID, primary_key=True, default=GUID.generate)
|
||||||
|
name_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
plural_name_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
abbreviation_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
plural_abbreviation_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls):
|
||||||
|
return [
|
||||||
|
cls.name_normalized,
|
||||||
|
cls.plural_name_normalized,
|
||||||
|
cls.abbreviation_normalized,
|
||||||
|
cls.plural_abbreviation_normalized,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class IngredientUnitAliasModel(SqlAlchemyBase):
|
||||||
|
__tablename__ = "ingredient_units_aliases"
|
||||||
|
id: orm.Mapped[GUID] = orm.mapped_column(GUID, primary_key=True, default=GUID.generate)
|
||||||
|
name_normalized: orm.Mapped[str | None] = orm.mapped_column(sa.String, index=True)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def normalized_fields(cls):
|
||||||
|
return [cls.name_normalized]
|
||||||
|
|
||||||
|
|
||||||
|
def truncate_normalized_fields() -> None:
|
||||||
|
bind = op.get_bind()
|
||||||
|
session = orm.Session(bind=bind)
|
||||||
|
|
||||||
|
models: list[type[SqlAlchemyBase]] = [
|
||||||
|
RecipeModel,
|
||||||
|
RecipeIngredientModel,
|
||||||
|
IngredientFoodModel,
|
||||||
|
IngredientFoodAliasModel,
|
||||||
|
IngredientUnitModel,
|
||||||
|
IngredientUnitAliasModel,
|
||||||
|
]
|
||||||
|
|
||||||
|
for model in models:
|
||||||
|
for record in session.query(model).all():
|
||||||
|
for field in model.normalized_fields():
|
||||||
|
if not (field_value := getattr(record, field.key)):
|
||||||
|
continue
|
||||||
|
|
||||||
|
setattr(record, field.key, field_value[:255])
|
||||||
|
|
||||||
|
try:
|
||||||
|
session.commit()
|
||||||
|
except Exception:
|
||||||
|
logger.exception(f"Failed to truncate normalized fields for {model.__name__}")
|
||||||
|
session.rollback()
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table("recipe_instructions", schema=None) as batch_op:
|
||||||
|
batch_op.drop_index("ix_recipe_instructions_text")
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
truncate_normalized_fields()
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table("recipe_instructions", schema=None) as batch_op:
|
||||||
|
batch_op.create_index("ix_recipe_instructions_text", ["text"], unique=False)
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
|
@ -1,3 +1,12 @@
|
||||||
|
import re
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
# pyrdfa3 is no longer being updated and has docstrings that emit syntax warnings
|
||||||
|
warnings.filterwarnings(
|
||||||
|
"ignore", module=".*pyRdfa", category=SyntaxWarning, message=re.escape("invalid escape sequence '\\-'")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ruff: noqa: E402
|
||||||
from collections.abc import AsyncGenerator
|
from collections.abc import AsyncGenerator
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
|
@ -115,6 +124,7 @@ register_debug_handler(app)
|
||||||
|
|
||||||
async def start_scheduler():
|
async def start_scheduler():
|
||||||
SchedulerRegistry.register_daily(
|
SchedulerRegistry.register_daily(
|
||||||
|
tasks.purge_expired_tokens,
|
||||||
tasks.purge_group_registration,
|
tasks.purge_group_registration,
|
||||||
tasks.purge_password_reset_tokens,
|
tasks.purge_password_reset_tokens,
|
||||||
tasks.purge_group_data_exports,
|
tasks.purge_group_data_exports,
|
||||||
|
|
|
@ -12,6 +12,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||||
from mealie.core.settings.themes import Theme
|
from mealie.core.settings.themes import Theme
|
||||||
|
|
||||||
from .db_providers import AbstractDBProvider, db_provider_factory
|
from .db_providers import AbstractDBProvider, db_provider_factory
|
||||||
|
from .static import PACKAGE_DIR
|
||||||
|
|
||||||
|
|
||||||
class ScheduleTime(NamedTuple):
|
class ScheduleTime(NamedTuple):
|
||||||
|
@ -109,7 +110,7 @@ class AppSettings(AppLoggingSettings):
|
||||||
BASE_URL: str = "http://localhost:8080"
|
BASE_URL: str = "http://localhost:8080"
|
||||||
"""trailing slashes are trimmed (ex. `http://localhost:8080/` becomes ``http://localhost:8080`)"""
|
"""trailing slashes are trimmed (ex. `http://localhost:8080/` becomes ``http://localhost:8080`)"""
|
||||||
|
|
||||||
STATIC_FILES: str = ""
|
STATIC_FILES: str = str(PACKAGE_DIR / "frontend")
|
||||||
"""path to static files directory (ex. `mealie/dist`)"""
|
"""path to static files directory (ex. `mealie/dist`)"""
|
||||||
|
|
||||||
IS_DEMO: bool = False
|
IS_DEMO: bool = False
|
||||||
|
|
|
@ -5,4 +5,5 @@ from mealie import __version__
|
||||||
APP_VERSION = __version__
|
APP_VERSION = __version__
|
||||||
|
|
||||||
CWD = Path(__file__).parent
|
CWD = Path(__file__).parent
|
||||||
|
PACKAGE_DIR = CWD.parent.parent
|
||||||
BASE_DIR = CWD.parent.parent.parent
|
BASE_DIR = CWD.parent.parent.parent
|
||||||
|
|
|
@ -69,16 +69,16 @@ def db_is_at_head(alembic_cfg: config.Config) -> bool:
|
||||||
def safe_try(func: Callable):
|
def safe_try(func: Callable):
|
||||||
try:
|
try:
|
||||||
func()
|
func()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
logger.error(f"Error calling '{func.__name__}': {e}")
|
logger.exception(f"Error calling '{func.__name__}'")
|
||||||
|
|
||||||
|
|
||||||
def connect(session: orm.Session) -> bool:
|
def connect(session: orm.Session) -> bool:
|
||||||
try:
|
try:
|
||||||
session.execute(text("SELECT 1"))
|
session.execute(text("SELECT 1"))
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception:
|
||||||
logger.error(f"Error connecting to database: {e}")
|
logger.exception("Error connecting to database")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,23 +106,27 @@ def main():
|
||||||
if not os.path.isfile(alembic_cfg_path):
|
if not os.path.isfile(alembic_cfg_path):
|
||||||
raise Exception("Provided alembic config path doesn't exist")
|
raise Exception("Provided alembic config path doesn't exist")
|
||||||
|
|
||||||
|
run_fixes = False
|
||||||
alembic_cfg = Config(alembic_cfg_path)
|
alembic_cfg = Config(alembic_cfg_path)
|
||||||
if db_is_at_head(alembic_cfg):
|
if db_is_at_head(alembic_cfg):
|
||||||
logger.debug("Migration not needed.")
|
logger.debug("Migration not needed.")
|
||||||
else:
|
else:
|
||||||
logger.info("Migration needed. Performing migration...")
|
logger.info("Migration needed. Performing migration...")
|
||||||
command.upgrade(alembic_cfg, "head")
|
command.upgrade(alembic_cfg, "head")
|
||||||
|
run_fixes = True
|
||||||
|
|
||||||
if session.get_bind().name == "postgresql": # needed for fuzzy search and fast GIN text indices
|
if session.get_bind().name == "postgresql": # needed for fuzzy search and fast GIN text indices
|
||||||
session.execute(text("CREATE EXTENSION IF NOT EXISTS pg_trgm;"))
|
session.execute(text("CREATE EXTENSION IF NOT EXISTS pg_trgm;"))
|
||||||
|
|
||||||
db = get_repositories(session, group_id=None, household_id=None)
|
db = get_repositories(session, group_id=None, household_id=None)
|
||||||
safe_try(lambda: fix_migration_data(session))
|
|
||||||
safe_try(lambda: fix_slug_food_names(db))
|
|
||||||
safe_try(lambda: fix_group_with_no_name(session))
|
|
||||||
|
|
||||||
if db.users.get_all():
|
if db.users.get_all():
|
||||||
logger.debug("Database exists")
|
logger.debug("Database exists")
|
||||||
|
if run_fixes:
|
||||||
|
safe_try(lambda: fix_migration_data(session))
|
||||||
|
safe_try(lambda: fix_slug_food_names(db))
|
||||||
|
safe_try(lambda: fix_group_with_no_name(session))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.info("Database contains no users, initializing...")
|
logger.info("Database contains no users, initializing...")
|
||||||
init_db(session)
|
init_db(session)
|
||||||
|
|
|
@ -18,7 +18,9 @@ class SqlAlchemyBase(DeclarativeBase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def normalize(cls, val: str) -> str:
|
def normalize(cls, val: str) -> str:
|
||||||
return unidecode(val).lower().strip()
|
# We cap the length to 255 to prevent indexes from being too long; see:
|
||||||
|
# https://www.postgresql.org/docs/current/btree.html
|
||||||
|
return unidecode(val).lower().strip()[:255]
|
||||||
|
|
||||||
|
|
||||||
class BaseMixins:
|
class BaseMixins:
|
||||||
|
|
|
@ -23,8 +23,8 @@ class RecipeInstruction(SqlAlchemyBase):
|
||||||
recipe_id: Mapped[GUID | None] = mapped_column(GUID, ForeignKey("recipes.id"), index=True)
|
recipe_id: Mapped[GUID | None] = mapped_column(GUID, ForeignKey("recipes.id"), index=True)
|
||||||
position: Mapped[int | None] = mapped_column(Integer, index=True)
|
position: Mapped[int | None] = mapped_column(Integer, index=True)
|
||||||
type: Mapped[str | None] = mapped_column(String, default="")
|
type: Mapped[str | None] = mapped_column(String, default="")
|
||||||
title: Mapped[str | None] = mapped_column(String) # This is the section title!!!
|
title: Mapped[str | None] = mapped_column(String) # This is the section title
|
||||||
text: Mapped[str | None] = mapped_column(String, index=True)
|
text: Mapped[str | None] = mapped_column(String)
|
||||||
summary: Mapped[str | None] = mapped_column(String)
|
summary: Mapped[str | None] = mapped_column(String)
|
||||||
|
|
||||||
ingredient_references: Mapped[list[RecipeIngredientRefLink]] = orm.relationship(
|
ingredient_references: Mapped[list[RecipeIngredientRefLink]] = orm.relationship(
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"generic": {
|
"generic": {
|
||||||
"server-error": "An unexpected error occurred"
|
"server-error": "Ocorreu un erro inesperado"
|
||||||
},
|
},
|
||||||
"recipe": {
|
"recipe": {
|
||||||
"unique-name-error": "Recipe names must be unique",
|
"unique-name-error": "Os nomes de receitas deven ser únicos",
|
||||||
"recipe-created": "Recipe Created",
|
"recipe-created": "Receita creada",
|
||||||
"recipe-defaults": {
|
"recipe-defaults": {
|
||||||
"ingredient-note": "1 Cup Flour",
|
"ingredient-note": "1 Cup Flour",
|
||||||
"step-text": "Recipe steps as well as other fields in the recipe page support markdown syntax.\n\n**Add a link**\n\n[My Link](https://demo.mealie.io)\n"
|
"step-text": "Os pasos da receita, como outros campos na páxina da receita, suportan a sintaxe markdown.\n\n**Adicionar un link**\n\n[Meu link](https://demo.mealie.io)\n"
|
||||||
},
|
},
|
||||||
"servings-text": {
|
"servings-text": {
|
||||||
"makes": "Makes",
|
"makes": "Makes",
|
||||||
|
@ -33,26 +33,26 @@
|
||||||
"exceptions": {
|
"exceptions": {
|
||||||
"permission_denied": "You do not have permission to perform this action",
|
"permission_denied": "You do not have permission to perform this action",
|
||||||
"no-entry-found": "The requested resource was not found",
|
"no-entry-found": "The requested resource was not found",
|
||||||
"integrity-error": "Database integrity error",
|
"integrity-error": "Erro de integridade da base de datos",
|
||||||
"username-conflict-error": "This username is already taken",
|
"username-conflict-error": "Este nome de usuario xa está en uso",
|
||||||
"email-conflict-error": "This email is already in use"
|
"email-conflict-error": "This email is already in use"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"generic-created": "{name} was created",
|
"generic-created": "{name} creado",
|
||||||
"generic-updated": "{name} was updated",
|
"generic-updated": "{name} atualizado",
|
||||||
"generic-created-with-url": "{name} has been created, {url}",
|
"generic-created-with-url": "{name} foi creado, {url}",
|
||||||
"generic-updated-with-url": "{name} has been updated, {url}",
|
"generic-updated-with-url": "{name} foi atualizado, {url}",
|
||||||
"generic-duplicated": "{name} has been duplicated",
|
"generic-duplicated": "{name} foi duplicado",
|
||||||
"generic-deleted": "{name} has been deleted"
|
"generic-deleted": "{name} has been deleted"
|
||||||
},
|
},
|
||||||
"datetime": {
|
"datetime": {
|
||||||
"year": "year|years",
|
"year": "ano|anos",
|
||||||
"day": "day|days",
|
"day": "dia|dias",
|
||||||
"hour": "hour|hours",
|
"hour": "hora|horas",
|
||||||
"minute": "minute|minutes",
|
"minute": "minuto|minutos",
|
||||||
"second": "second|seconds",
|
"second": "segundo|segundos",
|
||||||
"millisecond": "millisecond|milliseconds",
|
"millisecond": "milisegundo|milisegundos",
|
||||||
"microsecond": "microsecond|microseconds"
|
"microsecond": "microsegundo|microsegundos"
|
||||||
},
|
},
|
||||||
"emails": {
|
"emails": {
|
||||||
"password": {
|
"password": {
|
||||||
|
@ -67,14 +67,14 @@
|
||||||
"header_text": "You're Invited!",
|
"header_text": "You're Invited!",
|
||||||
"message_top": "You have been invited to join Mealie.",
|
"message_top": "You have been invited to join Mealie.",
|
||||||
"message_bottom": "Please click the button above to accept the invitation.",
|
"message_bottom": "Please click the button above to accept the invitation.",
|
||||||
"button_text": "Accept Invitation"
|
"button_text": "Aceptar Convite"
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"subject": "Mealie Test Email",
|
"subject": "Mealie Test Email",
|
||||||
"header_text": "Test Email",
|
"header_text": "Test Email",
|
||||||
"message_top": "This is a test email.",
|
"message_top": "This is a test email.",
|
||||||
"message_bottom": "Please click the button above to test the email.",
|
"message_bottom": "Please click the button above to test the email.",
|
||||||
"button_text": "Open Mealie"
|
"button_text": "Abrir o Mealie"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
},
|
},
|
||||||
"recipe": {
|
"recipe": {
|
||||||
"unique-name-error": "Nomes de receitas devem ser únicos",
|
"unique-name-error": "Nomes de receitas devem ser únicos",
|
||||||
"recipe-created": "Recipe Created",
|
"recipe-created": "Receita criada",
|
||||||
"recipe-defaults": {
|
"recipe-defaults": {
|
||||||
"ingredient-note": "1 Xícara de Farinha",
|
"ingredient-note": "1 Xícara de Farinha",
|
||||||
"step-text": "Passos das receitas, assim como outros campos na página da receita, suportam sintaxe \"markdown\".\n\n**Adicione um link**\n\n[Meu Link](https://demo.mealie.io)\n"
|
"step-text": "Passos das receitas, assim como outros campos na página da receita, suportam sintaxe \"markdown\".\n\n**Adicione um link**\n\n[Meu Link](https://demo.mealie.io)\n"
|
||||||
|
@ -12,8 +12,8 @@
|
||||||
"servings-text": {
|
"servings-text": {
|
||||||
"makes": "Makes",
|
"makes": "Makes",
|
||||||
"serves": "Serves",
|
"serves": "Serves",
|
||||||
"serving": "Serving",
|
"serving": "Porção",
|
||||||
"servings": "Servings",
|
"servings": "Porções",
|
||||||
"yield": "Yield",
|
"yield": "Yield",
|
||||||
"yields": "Yields"
|
"yields": "Yields"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,16 @@
|
||||||
},
|
},
|
||||||
"recipe": {
|
"recipe": {
|
||||||
"unique-name-error": "Назва рецепту повинна бути унікальною",
|
"unique-name-error": "Назва рецепту повинна бути унікальною",
|
||||||
"recipe-created": "Recipe Created",
|
"recipe-created": "Рецепт створено",
|
||||||
"recipe-defaults": {
|
"recipe-defaults": {
|
||||||
"ingredient-note": "Стакан борошна",
|
"ingredient-note": "Стакан борошна",
|
||||||
"step-text": "Кроки рецептів, так само як і інші поля сторінки, підтримують синтаксис markdown.\n\n**Додати посилання**\n\n[Mоє посилання](https://demo.mealie.io)\n"
|
"step-text": "Кроки рецептів, так само як і інші поля сторінки, підтримують синтаксис markdown.\n\n**Додати посилання**\n\n[Моє посилання](https://demo.mealie.io)\n"
|
||||||
},
|
},
|
||||||
"servings-text": {
|
"servings-text": {
|
||||||
"makes": "Makes",
|
"makes": "Makes",
|
||||||
"serves": "Serves",
|
"serves": "Serves",
|
||||||
"serving": "Serving",
|
"serving": "Порція",
|
||||||
"servings": "Servings",
|
"servings": "Порції",
|
||||||
"yield": "Yield",
|
"yield": "Yield",
|
||||||
"yields": "Yields"
|
"yields": "Yields"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ from mealie.core.logger.config import log_config
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
uvicorn.run(
|
uvicorn.run(
|
||||||
"app:app",
|
"mealie.app:app",
|
||||||
host=settings.API_HOST,
|
host=settings.API_HOST,
|
||||||
port=settings.API_PORT,
|
port=settings.API_PORT,
|
||||||
log_level=settings.LOG_LEVEL.lower(),
|
log_level=settings.LOG_LEVEL.lower(),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"acorn-squash": {
|
"acorn-squash": {
|
||||||
"name": "courgeron"
|
"name": "courge poivrée"
|
||||||
},
|
},
|
||||||
"alfalfa-sprouts": {
|
"alfalfa-sprouts": {
|
||||||
"name": "pousses de luzerne"
|
"name": "pousses de luzerne"
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
"name": "cannabis"
|
"name": "cannabis"
|
||||||
},
|
},
|
||||||
"capsicum": {
|
"capsicum": {
|
||||||
"name": "capsicum"
|
"name": "piment"
|
||||||
},
|
},
|
||||||
"caraway": {
|
"caraway": {
|
||||||
"name": "cumin"
|
"name": "cumin"
|
||||||
|
|
|
@ -6,20 +6,20 @@
|
||||||
"name": "alfalfa sprouts"
|
"name": "alfalfa sprouts"
|
||||||
},
|
},
|
||||||
"anchovies": {
|
"anchovies": {
|
||||||
"name": "anchovies"
|
"name": "anchoas"
|
||||||
},
|
},
|
||||||
"apples": {
|
"apples": {
|
||||||
"name": "apple",
|
"name": "mazá",
|
||||||
"plural_name": "apples"
|
"plural_name": "mazás"
|
||||||
},
|
},
|
||||||
"artichoke": {
|
"artichoke": {
|
||||||
"name": "artichoke"
|
"name": "alcachofa"
|
||||||
},
|
},
|
||||||
"arugula": {
|
"arugula": {
|
||||||
"name": "arugula"
|
"name": "rúcula"
|
||||||
},
|
},
|
||||||
"asparagus": {
|
"asparagus": {
|
||||||
"name": "asparagus"
|
"name": "espárragos"
|
||||||
},
|
},
|
||||||
"avocado": {
|
"avocado": {
|
||||||
"name": "avocado",
|
"name": "avocado",
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
"name": "bacon"
|
"name": "bacon"
|
||||||
},
|
},
|
||||||
"baking-powder": {
|
"baking-powder": {
|
||||||
"name": "baking powder"
|
"name": "fermento en po"
|
||||||
},
|
},
|
||||||
"baking-soda": {
|
"baking-soda": {
|
||||||
"name": "baking soda"
|
"name": "baking soda"
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
"plural_name": "bell peppers"
|
"plural_name": "bell peppers"
|
||||||
},
|
},
|
||||||
"blackberries": {
|
"blackberries": {
|
||||||
"name": "blackberries"
|
"name": "amoras"
|
||||||
},
|
},
|
||||||
"bok-choy": {
|
"bok-choy": {
|
||||||
"name": "bok choy"
|
"name": "bok choy"
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
"name": "brassicas"
|
"name": "brassicas"
|
||||||
},
|
},
|
||||||
"bread": {
|
"bread": {
|
||||||
"name": "bread"
|
"name": "pan"
|
||||||
},
|
},
|
||||||
"breadfruit": {
|
"breadfruit": {
|
||||||
"name": "breadfruit"
|
"name": "breadfruit"
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
"name": "brussels sprouts"
|
"name": "brussels sprouts"
|
||||||
},
|
},
|
||||||
"butter": {
|
"butter": {
|
||||||
"name": "butter"
|
"name": "manteiga"
|
||||||
},
|
},
|
||||||
"butternut-pumpkin": {
|
"butternut-pumpkin": {
|
||||||
"name": "butternut pumpkin"
|
"name": "butternut pumpkin"
|
||||||
|
@ -93,8 +93,8 @@
|
||||||
"name": "butternut squash"
|
"name": "butternut squash"
|
||||||
},
|
},
|
||||||
"cabbage": {
|
"cabbage": {
|
||||||
"name": "cabbage",
|
"name": "repolo",
|
||||||
"plural_name": "cabbages"
|
"plural_name": "repolos"
|
||||||
},
|
},
|
||||||
"cactus-edible": {
|
"cactus-edible": {
|
||||||
"name": "cactus, edible"
|
"name": "cactus, edible"
|
||||||
|
@ -115,8 +115,8 @@
|
||||||
"name": "caraway"
|
"name": "caraway"
|
||||||
},
|
},
|
||||||
"carrot": {
|
"carrot": {
|
||||||
"name": "carrot",
|
"name": "cenoura",
|
||||||
"plural_name": "carrots"
|
"plural_name": "cenouras"
|
||||||
},
|
},
|
||||||
"caster-sugar": {
|
"caster-sugar": {
|
||||||
"name": "caster sugar"
|
"name": "caster sugar"
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
"name": "cereal grains"
|
"name": "cereal grains"
|
||||||
},
|
},
|
||||||
"chard": {
|
"chard": {
|
||||||
"name": "chard"
|
"name": "acelga"
|
||||||
},
|
},
|
||||||
"cheese": {
|
"cheese": {
|
||||||
"name": "queixo"
|
"name": "queixo"
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
},
|
},
|
||||||
"coconut": {
|
"coconut": {
|
||||||
"name": "coco",
|
"name": "coco",
|
||||||
"plural_name": "coconuts"
|
"plural_name": "cocos"
|
||||||
},
|
},
|
||||||
"coconut-milk": {
|
"coconut-milk": {
|
||||||
"name": "leite de coco"
|
"name": "leite de coco"
|
||||||
|
@ -194,7 +194,7 @@
|
||||||
"name": "confectioners' sugar"
|
"name": "confectioners' sugar"
|
||||||
},
|
},
|
||||||
"coriander": {
|
"coriander": {
|
||||||
"name": "coriander"
|
"name": "coentro"
|
||||||
},
|
},
|
||||||
"corn": {
|
"corn": {
|
||||||
"name": "millo",
|
"name": "millo",
|
||||||
|
@ -213,7 +213,7 @@
|
||||||
"name": "cream of tartar"
|
"name": "cream of tartar"
|
||||||
},
|
},
|
||||||
"cucumber": {
|
"cucumber": {
|
||||||
"name": "pepino",
|
"name": "cogombro",
|
||||||
"plural_name": "cucumbers"
|
"plural_name": "cucumbers"
|
||||||
},
|
},
|
||||||
"cumin": {
|
"cumin": {
|
||||||
|
@ -243,8 +243,8 @@
|
||||||
"plural_name": "eggplants"
|
"plural_name": "eggplants"
|
||||||
},
|
},
|
||||||
"eggs": {
|
"eggs": {
|
||||||
"name": "ovos",
|
"name": "ovo",
|
||||||
"plural_name": "eggs"
|
"plural_name": "ovos"
|
||||||
},
|
},
|
||||||
"endive": {
|
"endive": {
|
||||||
"name": "endive",
|
"name": "endive",
|
||||||
|
@ -291,14 +291,14 @@
|
||||||
"name": "garam masala"
|
"name": "garam masala"
|
||||||
},
|
},
|
||||||
"garlic": {
|
"garlic": {
|
||||||
"name": "garlic",
|
"name": "allo",
|
||||||
"plural_name": "garlics"
|
"plural_name": "allos"
|
||||||
},
|
},
|
||||||
"gem-squash": {
|
"gem-squash": {
|
||||||
"name": "gem squash"
|
"name": "gem squash"
|
||||||
},
|
},
|
||||||
"ghee": {
|
"ghee": {
|
||||||
"name": "ghee"
|
"name": "manteiga ghee"
|
||||||
},
|
},
|
||||||
"giblets": {
|
"giblets": {
|
||||||
"name": "giblets"
|
"name": "giblets"
|
||||||
|
@ -330,7 +330,7 @@
|
||||||
"name": "herbs"
|
"name": "herbs"
|
||||||
},
|
},
|
||||||
"honey": {
|
"honey": {
|
||||||
"name": "honey"
|
"name": "mel"
|
||||||
},
|
},
|
||||||
"isomalt": {
|
"isomalt": {
|
||||||
"name": "isomalt"
|
"name": "isomalt"
|
||||||
|
@ -383,8 +383,8 @@
|
||||||
"name": "lettuce"
|
"name": "lettuce"
|
||||||
},
|
},
|
||||||
"liver": {
|
"liver": {
|
||||||
"name": "liver",
|
"name": "fígado",
|
||||||
"plural_name": "livers"
|
"plural_name": "figados"
|
||||||
},
|
},
|
||||||
"maize": {
|
"maize": {
|
||||||
"name": "maize"
|
"name": "maize"
|
||||||
|
@ -393,20 +393,20 @@
|
||||||
"name": "maple syrup"
|
"name": "maple syrup"
|
||||||
},
|
},
|
||||||
"meat": {
|
"meat": {
|
||||||
"name": "meat"
|
"name": "carne"
|
||||||
},
|
},
|
||||||
"milk": {
|
"milk": {
|
||||||
"name": "leite"
|
"name": "leite"
|
||||||
},
|
},
|
||||||
"mortadella": {
|
"mortadella": {
|
||||||
"name": "mortadella"
|
"name": "mortadela"
|
||||||
},
|
},
|
||||||
"mushroom": {
|
"mushroom": {
|
||||||
"name": "mushroom",
|
"name": "cogumelo",
|
||||||
"plural_name": "mushrooms"
|
"plural_name": "cogumelos"
|
||||||
},
|
},
|
||||||
"mussels": {
|
"mussels": {
|
||||||
"name": "mussels"
|
"name": "mexillón"
|
||||||
},
|
},
|
||||||
"nanaimo-bar-mix": {
|
"nanaimo-bar-mix": {
|
||||||
"name": "nanaimo bar mix"
|
"name": "nanaimo bar mix"
|
||||||
|
@ -424,8 +424,8 @@
|
||||||
"name": "nuts"
|
"name": "nuts"
|
||||||
},
|
},
|
||||||
"octopuses": {
|
"octopuses": {
|
||||||
"name": "octopus",
|
"name": "polbo",
|
||||||
"plural_name": "octopuses"
|
"plural_name": "polbos"
|
||||||
},
|
},
|
||||||
"oils": {
|
"oils": {
|
||||||
"name": "oils"
|
"name": "oils"
|
||||||
|
@ -440,7 +440,7 @@
|
||||||
"name": "olive oil"
|
"name": "olive oil"
|
||||||
},
|
},
|
||||||
"onion": {
|
"onion": {
|
||||||
"name": "onion"
|
"name": "cebola"
|
||||||
},
|
},
|
||||||
"onion-family": {
|
"onion-family": {
|
||||||
"name": "onion family"
|
"name": "onion family"
|
||||||
|
@ -450,13 +450,13 @@
|
||||||
},
|
},
|
||||||
"oranges": {
|
"oranges": {
|
||||||
"name": "laranxas",
|
"name": "laranxas",
|
||||||
"plural_name": "oranges"
|
"plural_name": "laranxas"
|
||||||
},
|
},
|
||||||
"oregano": {
|
"oregano": {
|
||||||
"name": "oregano"
|
"name": "oregano"
|
||||||
},
|
},
|
||||||
"oysters": {
|
"oysters": {
|
||||||
"name": "oysters"
|
"name": "ostras"
|
||||||
},
|
},
|
||||||
"panch-puran": {
|
"panch-puran": {
|
||||||
"name": "panch puran"
|
"name": "panch puran"
|
||||||
|
@ -473,13 +473,13 @@
|
||||||
},
|
},
|
||||||
"pear": {
|
"pear": {
|
||||||
"name": "pera",
|
"name": "pera",
|
||||||
"plural_name": "pears"
|
"plural_name": "peras"
|
||||||
},
|
},
|
||||||
"peas": {
|
"peas": {
|
||||||
"name": "peas"
|
"name": "peas"
|
||||||
},
|
},
|
||||||
"pepper": {
|
"pepper": {
|
||||||
"name": "pepper",
|
"name": "",
|
||||||
"plural_name": "peppers"
|
"plural_name": "peppers"
|
||||||
},
|
},
|
||||||
"pineapple": {
|
"pineapple": {
|
||||||
|
@ -491,11 +491,11 @@
|
||||||
"plural_name": "plantains"
|
"plural_name": "plantains"
|
||||||
},
|
},
|
||||||
"poppy-seeds": {
|
"poppy-seeds": {
|
||||||
"name": "poppy seeds"
|
"name": "sementes de papoula"
|
||||||
},
|
},
|
||||||
"potato": {
|
"potato": {
|
||||||
"name": "potato",
|
"name": "pataca",
|
||||||
"plural_name": "potatoes"
|
"plural_name": "patacas"
|
||||||
},
|
},
|
||||||
"poultry": {
|
"poultry": {
|
||||||
"name": "poultry"
|
"name": "poultry"
|
||||||
|
@ -524,7 +524,7 @@
|
||||||
"name": "arroz"
|
"name": "arroz"
|
||||||
},
|
},
|
||||||
"rice-flour": {
|
"rice-flour": {
|
||||||
"name": "rice flour"
|
"name": "fariña de arroz"
|
||||||
},
|
},
|
||||||
"rock-sugar": {
|
"rock-sugar": {
|
||||||
"name": "rock sugar"
|
"name": "rock sugar"
|
||||||
|
@ -536,7 +536,7 @@
|
||||||
"name": "salmón"
|
"name": "salmón"
|
||||||
},
|
},
|
||||||
"salt": {
|
"salt": {
|
||||||
"name": "salt"
|
"name": "sal"
|
||||||
},
|
},
|
||||||
"salt-cod": {
|
"salt-cod": {
|
||||||
"name": "bacallau en salgadura"
|
"name": "bacallau en salgadura"
|
||||||
|
@ -546,10 +546,10 @@
|
||||||
"plural_name": "scallions"
|
"plural_name": "scallions"
|
||||||
},
|
},
|
||||||
"seafood": {
|
"seafood": {
|
||||||
"name": "seafood"
|
"name": "marisco"
|
||||||
},
|
},
|
||||||
"seeds": {
|
"seeds": {
|
||||||
"name": "seeds"
|
"name": "sementes"
|
||||||
},
|
},
|
||||||
"sesame-seeds": {
|
"sesame-seeds": {
|
||||||
"name": "sesame seeds"
|
"name": "sesame seeds"
|
||||||
|
@ -633,7 +633,7 @@
|
||||||
},
|
},
|
||||||
"tomato": {
|
"tomato": {
|
||||||
"name": "tomate",
|
"name": "tomate",
|
||||||
"plural_name": "tomatoes"
|
"plural_name": "tomates"
|
||||||
},
|
},
|
||||||
"trout": {
|
"trout": {
|
||||||
"name": "troita"
|
"name": "troita"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"apples": {
|
"apples": {
|
||||||
"name": "maçãs",
|
"name": "maçãs",
|
||||||
"plural_name": "apples"
|
"plural_name": "maçãs"
|
||||||
},
|
},
|
||||||
"artichoke": {
|
"artichoke": {
|
||||||
"name": "alcachofra"
|
"name": "alcachofra"
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
},
|
},
|
||||||
"bell-peppers": {
|
"bell-peppers": {
|
||||||
"name": "pimentões",
|
"name": "pimentões",
|
||||||
"plural_name": "bell peppers"
|
"plural_name": "pimentões"
|
||||||
},
|
},
|
||||||
"blackberries": {
|
"blackberries": {
|
||||||
"name": "amoras silvestres"
|
"name": "amoras silvestres"
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
},
|
},
|
||||||
"cabbage": {
|
"cabbage": {
|
||||||
"name": "repolho",
|
"name": "repolho",
|
||||||
"plural_name": "cabbages"
|
"plural_name": "repolhos"
|
||||||
},
|
},
|
||||||
"cactus-edible": {
|
"cactus-edible": {
|
||||||
"name": "cacto, comestível"
|
"name": "cacto, comestível"
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
},
|
},
|
||||||
"carrot": {
|
"carrot": {
|
||||||
"name": "cenoura",
|
"name": "cenoura",
|
||||||
"plural_name": "carrots"
|
"plural_name": "cenouras"
|
||||||
},
|
},
|
||||||
"caster-sugar": {
|
"caster-sugar": {
|
||||||
"name": "açúcar refinado"
|
"name": "açúcar refinado"
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
},
|
},
|
||||||
"cauliflower": {
|
"cauliflower": {
|
||||||
"name": "couve-flor",
|
"name": "couve-flor",
|
||||||
"plural_name": "cauliflowers"
|
"plural_name": "couve-flor"
|
||||||
},
|
},
|
||||||
"cayenne-pepper": {
|
"cayenne-pepper": {
|
||||||
"name": "pimenta caiena"
|
"name": "pimenta caiena"
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
},
|
},
|
||||||
"chilli-peppers": {
|
"chilli-peppers": {
|
||||||
"name": "pimenta picante",
|
"name": "pimenta picante",
|
||||||
"plural_name": "chilli peppers"
|
"plural_name": "pimenta em pó"
|
||||||
},
|
},
|
||||||
"chinese-leaves": {
|
"chinese-leaves": {
|
||||||
"name": "couve-china"
|
"name": "couve-china"
|
||||||
|
@ -176,7 +176,7 @@
|
||||||
},
|
},
|
||||||
"coconut": {
|
"coconut": {
|
||||||
"name": "coco",
|
"name": "coco",
|
||||||
"plural_name": "coconuts"
|
"plural_name": "cocos"
|
||||||
},
|
},
|
||||||
"coconut-milk": {
|
"coconut-milk": {
|
||||||
"name": "leite de coco"
|
"name": "leite de coco"
|
||||||
|
@ -198,7 +198,7 @@
|
||||||
},
|
},
|
||||||
"corn": {
|
"corn": {
|
||||||
"name": "milho",
|
"name": "milho",
|
||||||
"plural_name": "corns"
|
"plural_name": "milhos"
|
||||||
},
|
},
|
||||||
"corn-syrup": {
|
"corn-syrup": {
|
||||||
"name": "xarope de milho"
|
"name": "xarope de milho"
|
||||||
|
@ -214,14 +214,14 @@
|
||||||
},
|
},
|
||||||
"cucumber": {
|
"cucumber": {
|
||||||
"name": "pepino",
|
"name": "pepino",
|
||||||
"plural_name": "cucumbers"
|
"plural_name": "pepinos"
|
||||||
},
|
},
|
||||||
"cumin": {
|
"cumin": {
|
||||||
"name": "cominho"
|
"name": "cominho"
|
||||||
},
|
},
|
||||||
"daikon": {
|
"daikon": {
|
||||||
"name": "rabanete",
|
"name": "rabanete",
|
||||||
"plural_name": "daikons"
|
"plural_name": "rabanetes"
|
||||||
},
|
},
|
||||||
"dairy-products-and-dairy-substitutes": {
|
"dairy-products-and-dairy-substitutes": {
|
||||||
"name": "produtos lácteos e substitutos de leite"
|
"name": "produtos lácteos e substitutos de leite"
|
||||||
|
@ -240,15 +240,15 @@
|
||||||
},
|
},
|
||||||
"eggplant": {
|
"eggplant": {
|
||||||
"name": "berinjela",
|
"name": "berinjela",
|
||||||
"plural_name": "eggplants"
|
"plural_name": "berinjelas"
|
||||||
},
|
},
|
||||||
"eggs": {
|
"eggs": {
|
||||||
"name": "ovos",
|
"name": "ovos",
|
||||||
"plural_name": "eggs"
|
"plural_name": "ovos"
|
||||||
},
|
},
|
||||||
"endive": {
|
"endive": {
|
||||||
"name": "endívia",
|
"name": "endívia",
|
||||||
"plural_name": "endives"
|
"plural_name": "endívias"
|
||||||
},
|
},
|
||||||
"fats": {
|
"fats": {
|
||||||
"name": "gorduras"
|
"name": "gorduras"
|
||||||
|
@ -292,7 +292,7 @@
|
||||||
},
|
},
|
||||||
"garlic": {
|
"garlic": {
|
||||||
"name": "alho",
|
"name": "alho",
|
||||||
"plural_name": "garlics"
|
"plural_name": "alhos"
|
||||||
},
|
},
|
||||||
"gem-squash": {
|
"gem-squash": {
|
||||||
"name": "abóbora coroa"
|
"name": "abóbora coroa"
|
||||||
|
@ -317,11 +317,11 @@
|
||||||
},
|
},
|
||||||
"green-onion": {
|
"green-onion": {
|
||||||
"name": "Cebola Verde",
|
"name": "Cebola Verde",
|
||||||
"plural_name": "green onions"
|
"plural_name": "cebolinha"
|
||||||
},
|
},
|
||||||
"heart-of-palm": {
|
"heart-of-palm": {
|
||||||
"name": "palmito",
|
"name": "palmito",
|
||||||
"plural_name": "heart of palms"
|
"plural_name": "palmito"
|
||||||
},
|
},
|
||||||
"hemp": {
|
"hemp": {
|
||||||
"name": "cânhamo"
|
"name": "cânhamo"
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
},
|
},
|
||||||
"jackfruit": {
|
"jackfruit": {
|
||||||
"name": "jaca",
|
"name": "jaca",
|
||||||
"plural_name": "jackfruits"
|
"plural_name": "jaca"
|
||||||
},
|
},
|
||||||
"jaggery": {
|
"jaggery": {
|
||||||
"name": "açúcar mascavo"
|
"name": "açúcar mascavo"
|
||||||
|
@ -368,7 +368,7 @@
|
||||||
},
|
},
|
||||||
"leek": {
|
"leek": {
|
||||||
"name": "alho-porró",
|
"name": "alho-porró",
|
||||||
"plural_name": "leeks"
|
"plural_name": "alhos-porró"
|
||||||
},
|
},
|
||||||
"legumes": {
|
"legumes": {
|
||||||
"name": "leguminosas"
|
"name": "leguminosas"
|
||||||
|
@ -384,7 +384,7 @@
|
||||||
},
|
},
|
||||||
"liver": {
|
"liver": {
|
||||||
"name": "fígado",
|
"name": "fígado",
|
||||||
"plural_name": "livers"
|
"plural_name": "fígados"
|
||||||
},
|
},
|
||||||
"maize": {
|
"maize": {
|
||||||
"name": "milho"
|
"name": "milho"
|
||||||
|
@ -403,7 +403,7 @@
|
||||||
},
|
},
|
||||||
"mushroom": {
|
"mushroom": {
|
||||||
"name": "cogumelo",
|
"name": "cogumelo",
|
||||||
"plural_name": "mushrooms"
|
"plural_name": "cogumelos"
|
||||||
},
|
},
|
||||||
"mussels": {
|
"mussels": {
|
||||||
"name": "mexilhões"
|
"name": "mexilhões"
|
||||||
|
@ -425,7 +425,7 @@
|
||||||
},
|
},
|
||||||
"octopuses": {
|
"octopuses": {
|
||||||
"name": "polvos",
|
"name": "polvos",
|
||||||
"plural_name": "octopuses"
|
"plural_name": "polvos"
|
||||||
},
|
},
|
||||||
"oils": {
|
"oils": {
|
||||||
"name": "óleos"
|
"name": "óleos"
|
||||||
|
@ -450,7 +450,7 @@
|
||||||
},
|
},
|
||||||
"oranges": {
|
"oranges": {
|
||||||
"name": "laranjas",
|
"name": "laranjas",
|
||||||
"plural_name": "oranges"
|
"plural_name": "laranjas"
|
||||||
},
|
},
|
||||||
"oregano": {
|
"oregano": {
|
||||||
"name": "orégano"
|
"name": "orégano"
|
||||||
|
@ -473,29 +473,29 @@
|
||||||
},
|
},
|
||||||
"pear": {
|
"pear": {
|
||||||
"name": "pêra",
|
"name": "pêra",
|
||||||
"plural_name": "pears"
|
"plural_name": "peras"
|
||||||
},
|
},
|
||||||
"peas": {
|
"peas": {
|
||||||
"name": "ervilha"
|
"name": "ervilha"
|
||||||
},
|
},
|
||||||
"pepper": {
|
"pepper": {
|
||||||
"name": "pimenta",
|
"name": "pimenta",
|
||||||
"plural_name": "peppers"
|
"plural_name": "pimentas"
|
||||||
},
|
},
|
||||||
"pineapple": {
|
"pineapple": {
|
||||||
"name": "abacaxi",
|
"name": "abacaxi",
|
||||||
"plural_name": "pineapples"
|
"plural_name": "abacaxis"
|
||||||
},
|
},
|
||||||
"plantain": {
|
"plantain": {
|
||||||
"name": "banana-da-terra",
|
"name": "banana-da-terra",
|
||||||
"plural_name": "plantains"
|
"plural_name": "bananas-da-terra"
|
||||||
},
|
},
|
||||||
"poppy-seeds": {
|
"poppy-seeds": {
|
||||||
"name": "sementes de papoula"
|
"name": "sementes de papoula"
|
||||||
},
|
},
|
||||||
"potato": {
|
"potato": {
|
||||||
"name": "batata",
|
"name": "batata",
|
||||||
"plural_name": "potatoes"
|
"plural_name": "batatas"
|
||||||
},
|
},
|
||||||
"poultry": {
|
"poultry": {
|
||||||
"name": "carne de frango"
|
"name": "carne de frango"
|
||||||
|
@ -505,14 +505,14 @@
|
||||||
},
|
},
|
||||||
"pumpkin": {
|
"pumpkin": {
|
||||||
"name": "abóbora",
|
"name": "abóbora",
|
||||||
"plural_name": "pumpkins"
|
"plural_name": "abóboras"
|
||||||
},
|
},
|
||||||
"pumpkin-seeds": {
|
"pumpkin-seeds": {
|
||||||
"name": "sementes de abóbora"
|
"name": "sementes de abóbora"
|
||||||
},
|
},
|
||||||
"radish": {
|
"radish": {
|
||||||
"name": "rabanete",
|
"name": "rabanete",
|
||||||
"plural_name": "radishes"
|
"plural_name": "rabanetes"
|
||||||
},
|
},
|
||||||
"raw-sugar": {
|
"raw-sugar": {
|
||||||
"name": "açúcar mascavo"
|
"name": "açúcar mascavo"
|
||||||
|
@ -543,7 +543,7 @@
|
||||||
},
|
},
|
||||||
"scallion": {
|
"scallion": {
|
||||||
"name": "cebolinha",
|
"name": "cebolinha",
|
||||||
"plural_name": "scallions"
|
"plural_name": "cebolinhas"
|
||||||
},
|
},
|
||||||
"seafood": {
|
"seafood": {
|
||||||
"name": "frutos do mar"
|
"name": "frutos do mar"
|
||||||
|
@ -556,7 +556,7 @@
|
||||||
},
|
},
|
||||||
"shallot": {
|
"shallot": {
|
||||||
"name": "chalota",
|
"name": "chalota",
|
||||||
"plural_name": "shallots"
|
"plural_name": "chalota"
|
||||||
},
|
},
|
||||||
"skate": {
|
"skate": {
|
||||||
"name": "raia"
|
"name": "raia"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"plural_name": "abacate"
|
"plural_name": "abacate"
|
||||||
},
|
},
|
||||||
"bacon": {
|
"bacon": {
|
||||||
"name": "bacon"
|
"name": "Carne fumada"
|
||||||
},
|
},
|
||||||
"baking-powder": {
|
"baking-powder": {
|
||||||
"name": "fermento em pó"
|
"name": "fermento em pó"
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
"name": "canábis"
|
"name": "canábis"
|
||||||
},
|
},
|
||||||
"capsicum": {
|
"capsicum": {
|
||||||
"name": "capsicum"
|
"name": "pimentão"
|
||||||
},
|
},
|
||||||
"caraway": {
|
"caraway": {
|
||||||
"name": "alcarávia"
|
"name": "alcarávia"
|
||||||
|
|
|
@ -361,7 +361,7 @@
|
||||||
"name": "kolerabe"
|
"name": "kolerabe"
|
||||||
},
|
},
|
||||||
"kumara": {
|
"kumara": {
|
||||||
"name": "kumara"
|
"name": "sladek krompir"
|
||||||
},
|
},
|
||||||
"leavening-agents": {
|
"leavening-agents": {
|
||||||
"name": "kvas"
|
"name": "kvas"
|
||||||
|
@ -377,7 +377,7 @@
|
||||||
"name": "limonina trava"
|
"name": "limonina trava"
|
||||||
},
|
},
|
||||||
"lentils": {
|
"lentils": {
|
||||||
"name": "lentils"
|
"name": "leča"
|
||||||
},
|
},
|
||||||
"lettuce": {
|
"lettuce": {
|
||||||
"name": "solata"
|
"name": "solata"
|
||||||
|
@ -434,7 +434,7 @@
|
||||||
"name": "jedilni oslez"
|
"name": "jedilni oslez"
|
||||||
},
|
},
|
||||||
"olive": {
|
"olive": {
|
||||||
"name": "olive"
|
"name": "oliva"
|
||||||
},
|
},
|
||||||
"olive-oil": {
|
"olive-oil": {
|
||||||
"name": "olivno olje"
|
"name": "olivno olje"
|
||||||
|
|
|
@ -616,7 +616,7 @@
|
||||||
},
|
},
|
||||||
"sweetcorn": {
|
"sweetcorn": {
|
||||||
"name": "sockermajs",
|
"name": "sockermajs",
|
||||||
"plural_name": "sweetcorns"
|
"plural_name": "majs"
|
||||||
},
|
},
|
||||||
"sweeteners": {
|
"sweeteners": {
|
||||||
"name": "sötningsmedel"
|
"name": "sötningsmedel"
|
||||||
|
@ -680,7 +680,7 @@
|
||||||
},
|
},
|
||||||
"yam": {
|
"yam": {
|
||||||
"name": "jams",
|
"name": "jams",
|
||||||
"plural_name": "yams"
|
"plural_name": "sötpotatisar"
|
||||||
},
|
},
|
||||||
"yeast": {
|
"yeast": {
|
||||||
"name": "jäst"
|
"name": "jäst"
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
"name": "Drycker"
|
"name": "Drycker"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Bakade varor"
|
"name": "Bakverk"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Konserverade varor"
|
"name": "Konserver"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Smaktillsatser"
|
"name": "Smaktillsatser"
|
||||||
|
|
|
@ -91,8 +91,8 @@
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"dash": {
|
"dash": {
|
||||||
"name": "1/8 de cuillère à café",
|
"name": "goutte",
|
||||||
"plural_name": "1/8 de cuillères à café",
|
"plural_name": "gouttes",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
|
@ -103,8 +103,8 @@
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"head": {
|
"head": {
|
||||||
"name": "tête",
|
"name": "personne",
|
||||||
"plural_name": "têtes",
|
"plural_name": "personnes",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
"name": "teaspoon",
|
"name": "teaspoon",
|
||||||
"plural_name": "teaspoons",
|
"plural_name": "teaspoons",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "culleradiña"
|
"abbreviation": "culleriña"
|
||||||
},
|
},
|
||||||
"tablespoon": {
|
"tablespoon": {
|
||||||
"name": "tablespoon",
|
"name": "culler de sopa",
|
||||||
"plural_name": "tablespoons",
|
"plural_name": "culleres de sopa",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "culleradas sopeiras"
|
"abbreviation": "culleradas sopeiras"
|
||||||
},
|
},
|
||||||
|
@ -36,33 +36,33 @@
|
||||||
"abbreviation": "qt"
|
"abbreviation": "qt"
|
||||||
},
|
},
|
||||||
"gallon": {
|
"gallon": {
|
||||||
"name": "gallon",
|
"name": "galón",
|
||||||
"plural_name": "gallons",
|
"plural_name": "galóns",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "gal"
|
"abbreviation": "gal"
|
||||||
},
|
},
|
||||||
"milliliter": {
|
"milliliter": {
|
||||||
"name": "milliliter",
|
"name": "mililitro",
|
||||||
"plural_name": "milliliters",
|
"plural_name": "mililitros",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "ml"
|
"abbreviation": "ml"
|
||||||
},
|
},
|
||||||
"liter": {
|
"liter": {
|
||||||
"name": "liter",
|
"name": "litro",
|
||||||
"plural_name": "liters",
|
"plural_name": "litros",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "l"
|
"abbreviation": "l"
|
||||||
},
|
},
|
||||||
"pound": {
|
"pound": {
|
||||||
"name": "pound",
|
"name": "libra",
|
||||||
"plural_name": "pounds",
|
"plural_name": "libras",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "lb",
|
"abbreviation": "lb",
|
||||||
"plural_abbreviation": "lbs"
|
"plural_abbreviation": "lbs"
|
||||||
},
|
},
|
||||||
"ounce": {
|
"ounce": {
|
||||||
"name": "ounce",
|
"name": "onza",
|
||||||
"plural_name": "ounces",
|
"plural_name": "onzas",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "oz"
|
"abbreviation": "oz"
|
||||||
},
|
},
|
||||||
|
@ -109,14 +109,14 @@
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"clove": {
|
"clove": {
|
||||||
"name": "clove",
|
"name": "dente",
|
||||||
"plural_name": "cloves",
|
"plural_name": "dentes",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"can": {
|
"can": {
|
||||||
"name": "can",
|
"name": "lata",
|
||||||
"plural_name": "cans",
|
"plural_name": "latas",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -104,13 +104,13 @@
|
||||||
},
|
},
|
||||||
"head": {
|
"head": {
|
||||||
"name": "cabeça",
|
"name": "cabeça",
|
||||||
"plural_name": "heads",
|
"plural_name": "cabeças",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"clove": {
|
"clove": {
|
||||||
"name": "cravo",
|
"name": "cravo",
|
||||||
"plural_name": "cloves",
|
"plural_name": "cravos",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
|
@ -127,8 +127,8 @@
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"pack": {
|
"pack": {
|
||||||
"name": "pack",
|
"name": "pacote",
|
||||||
"plural_name": "packs",
|
"plural_name": "pacotes",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
},
|
},
|
||||||
"quart": {
|
"quart": {
|
||||||
"name": "quart",
|
"name": "quart",
|
||||||
"plural_name": "quarts",
|
"plural_name": "quart",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": "qt"
|
"abbreviation": "qt"
|
||||||
},
|
},
|
||||||
|
|
|
@ -86,13 +86,13 @@
|
||||||
},
|
},
|
||||||
"splash": {
|
"splash": {
|
||||||
"name": "трохи",
|
"name": "трохи",
|
||||||
"plural_name": "splashes",
|
"plural_name": "трохи",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
"dash": {
|
"dash": {
|
||||||
"name": "трохи",
|
"name": "трохи",
|
||||||
"plural_name": "dashes",
|
"plural_name": "трохи",
|
||||||
"description": "",
|
"description": "",
|
||||||
"abbreviation": ""
|
"abbreviation": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,7 @@ from fastapi import APIRouter, Depends, HTTPException
|
||||||
from pydantic import UUID4
|
from pydantic import UUID4
|
||||||
from sqlalchemy.orm.session import Session
|
from sqlalchemy.orm.session import Session
|
||||||
|
|
||||||
|
from mealie.core.root_logger import get_logger
|
||||||
from mealie.db.db_setup import generate_session
|
from mealie.db.db_setup import generate_session
|
||||||
from mealie.repos.all_repositories import get_repositories
|
from mealie.repos.all_repositories import get_repositories
|
||||||
from mealie.schema.recipe import Recipe
|
from mealie.schema.recipe import Recipe
|
||||||
|
@ -9,12 +10,22 @@ from mealie.schema.response import ErrorResponse
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
logger = get_logger()
|
||||||
|
|
||||||
|
|
||||||
@router.get("/shared/{token_id}", response_model=Recipe)
|
@router.get("/shared/{token_id}", response_model=Recipe)
|
||||||
def get_shared_recipe(token_id: UUID4, session: Session = Depends(generate_session)):
|
def get_shared_recipe(token_id: UUID4, session: Session = Depends(generate_session)):
|
||||||
db = get_repositories(session, group_id=None, household_id=None)
|
db = get_repositories(session, group_id=None, household_id=None)
|
||||||
|
|
||||||
token_summary = db.recipe_share_tokens.get_one(token_id)
|
token_summary = db.recipe_share_tokens.get_one(token_id)
|
||||||
|
if token_summary and token_summary.is_expired:
|
||||||
|
try:
|
||||||
|
db.recipe_share_tokens.delete(token_id)
|
||||||
|
session.commit()
|
||||||
|
except Exception:
|
||||||
|
logger.exception(f"Failed to delete expired token {token_id}")
|
||||||
|
session.rollback()
|
||||||
|
token_summary = None
|
||||||
|
|
||||||
if token_summary is None:
|
if token_summary is None:
|
||||||
raise HTTPException(status_code=404, detail=ErrorResponse.respond("Token Not Found"))
|
raise HTTPException(status_code=404, detail=ErrorResponse.respond("Token Not Found"))
|
||||||
|
|
|
@ -3,6 +3,7 @@ from functools import cached_property
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
from pydantic import UUID4
|
from pydantic import UUID4
|
||||||
|
|
||||||
|
from mealie.repos.all_repositories import get_repositories
|
||||||
from mealie.routes._base import BaseUserController, controller
|
from mealie.routes._base import BaseUserController, controller
|
||||||
from mealie.routes._base.mixins import HttpRepo
|
from mealie.routes._base.mixins import HttpRepo
|
||||||
from mealie.routes._base.routers import UserAPIRouter
|
from mealie.routes._base.routers import UserAPIRouter
|
||||||
|
@ -32,7 +33,8 @@ class RecipeSharedController(BaseUserController):
|
||||||
@router.post("", response_model=RecipeShareToken, status_code=201)
|
@router.post("", response_model=RecipeShareToken, status_code=201)
|
||||||
def create_one(self, data: RecipeShareTokenCreate) -> RecipeShareToken:
|
def create_one(self, data: RecipeShareTokenCreate) -> RecipeShareToken:
|
||||||
# check if recipe group id is the same as the user group id
|
# check if recipe group id is the same as the user group id
|
||||||
recipe = self.repos.recipes.get_one(data.recipe_id, "id")
|
group_repos = get_repositories(self.repos.session, group_id=self.group_id, household_id=None)
|
||||||
|
recipe = group_repos.recipes.get_one(data.recipe_id, "id")
|
||||||
if recipe is None or recipe.group_id != self.group_id:
|
if recipe is None or recipe.group_id != self.group_id:
|
||||||
raise HTTPException(status_code=404, detail="Recipe not found in your group")
|
raise HTTPException(status_code=404, detail="Recipe not found in your group")
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,10 @@ class RecipeShareTokenCreate(MealieModel):
|
||||||
recipe_id: UUID4
|
recipe_id: UUID4
|
||||||
expires_at: datetime = Field(default_factory=defaut_expires_at_time)
|
expires_at: datetime = Field(default_factory=defaut_expires_at_time)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_expired(self) -> bool:
|
||||||
|
return self.expires_at < datetime.now(UTC)
|
||||||
|
|
||||||
|
|
||||||
class RecipeShareTokenSave(RecipeShareTokenCreate):
|
class RecipeShareTokenSave(RecipeShareTokenCreate):
|
||||||
group_id: UUID4
|
group_id: UUID4
|
||||||
|
|
|
@ -7,7 +7,7 @@ from pathlib import Path
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from openai import NOT_GIVEN, AsyncOpenAI
|
from openai import NOT_GIVEN, AsyncOpenAI
|
||||||
from openai.resources.chat.completions import ChatCompletion
|
from openai.types.chat import ChatCompletion
|
||||||
from pydantic import BaseModel, field_validator
|
from pydantic import BaseModel, field_validator
|
||||||
|
|
||||||
from mealie.core.config import get_app_settings
|
from mealie.core.config import get_app_settings
|
||||||
|
|
|
@ -9,13 +9,7 @@ from mealie.pkgs import img, safehttp
|
||||||
from mealie.pkgs.safehttp.transport import AsyncSafeTransport
|
from mealie.pkgs.safehttp.transport import AsyncSafeTransport
|
||||||
from mealie.schema.recipe.recipe import Recipe
|
from mealie.schema.recipe.recipe import Recipe
|
||||||
from mealie.services._base_service import BaseService
|
from mealie.services._base_service import BaseService
|
||||||
|
from mealie.services.scraper.user_agents_manager import get_user_agents_manager
|
||||||
try:
|
|
||||||
from recipe_scrapers._abstract import HEADERS
|
|
||||||
|
|
||||||
_FIREFOX_UA = HEADERS["User-Agent"]
|
|
||||||
except (ImportError, KeyError):
|
|
||||||
_FIREFOX_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/128.0"
|
|
||||||
|
|
||||||
|
|
||||||
async def gather_with_concurrency(n, *coros, ignore_exceptions=False):
|
async def gather_with_concurrency(n, *coros, ignore_exceptions=False):
|
||||||
|
@ -32,13 +26,15 @@ async def gather_with_concurrency(n, *coros, ignore_exceptions=False):
|
||||||
|
|
||||||
|
|
||||||
async def largest_content_len(urls: list[str]) -> tuple[str, int]:
|
async def largest_content_len(urls: list[str]) -> tuple[str, int]:
|
||||||
|
user_agent_manager = get_user_agents_manager()
|
||||||
|
|
||||||
largest_url = ""
|
largest_url = ""
|
||||||
largest_len = 0
|
largest_len = 0
|
||||||
|
|
||||||
max_concurrency = 10
|
max_concurrency = 10
|
||||||
|
|
||||||
async def do(client: AsyncClient, url: str) -> Response:
|
async def do(client: AsyncClient, url: str) -> Response:
|
||||||
return await client.head(url, headers={"User-Agent": _FIREFOX_UA})
|
return await client.head(url, headers=user_agent_manager.get_scrape_headers())
|
||||||
|
|
||||||
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
||||||
tasks = [do(client, url) for url in urls]
|
tasks = [do(client, url) for url in urls]
|
||||||
|
@ -110,6 +106,7 @@ class RecipeDataService(BaseService):
|
||||||
|
|
||||||
async def scrape_image(self, image_url: str | dict[str, str] | list[str]) -> None:
|
async def scrape_image(self, image_url: str | dict[str, str] | list[str]) -> None:
|
||||||
self.logger.info(f"Image URL: {image_url}")
|
self.logger.info(f"Image URL: {image_url}")
|
||||||
|
user_agent = get_user_agents_manager().user_agents[0]
|
||||||
|
|
||||||
image_url_str = ""
|
image_url_str = ""
|
||||||
|
|
||||||
|
@ -140,7 +137,7 @@ class RecipeDataService(BaseService):
|
||||||
|
|
||||||
async with AsyncClient(transport=AsyncSafeTransport()) as client:
|
async with AsyncClient(transport=AsyncSafeTransport()) as client:
|
||||||
try:
|
try:
|
||||||
r = await client.get(image_url_str, headers={"User-Agent": _FIREFOX_UA})
|
r = await client.get(image_url_str, headers={"User-Agent": user_agent})
|
||||||
except Exception:
|
except Exception:
|
||||||
self.logger.exception("Fatal Image Request Exception")
|
self.logger.exception("Fatal Image Request Exception")
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from .create_timeline_events import create_mealplan_timeline_events
|
from .create_timeline_events import create_mealplan_timeline_events
|
||||||
from .delete_old_checked_shopping_list_items import delete_old_checked_list_items
|
from .delete_old_checked_shopping_list_items import delete_old_checked_list_items
|
||||||
from .post_webhooks import post_group_webhooks
|
from .post_webhooks import post_group_webhooks
|
||||||
|
from .purge_expired_share_tokens import purge_expired_tokens
|
||||||
from .purge_group_exports import purge_group_data_exports
|
from .purge_group_exports import purge_group_data_exports
|
||||||
from .purge_password_reset import purge_password_reset_tokens
|
from .purge_password_reset import purge_password_reset_tokens
|
||||||
from .purge_registration import purge_group_registration
|
from .purge_registration import purge_group_registration
|
||||||
|
@ -10,6 +11,7 @@ __all__ = [
|
||||||
"create_mealplan_timeline_events",
|
"create_mealplan_timeline_events",
|
||||||
"delete_old_checked_list_items",
|
"delete_old_checked_list_items",
|
||||||
"post_group_webhooks",
|
"post_group_webhooks",
|
||||||
|
"purge_expired_tokens",
|
||||||
"purge_password_reset_tokens",
|
"purge_password_reset_tokens",
|
||||||
"purge_group_data_exports",
|
"purge_group_data_exports",
|
||||||
"purge_group_registration",
|
"purge_group_registration",
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
from datetime import UTC, datetime
|
||||||
|
|
||||||
|
from mealie.db.db_setup import session_context
|
||||||
|
from mealie.repos.all_repositories import get_repositories
|
||||||
|
from mealie.schema.response.pagination import PaginationQuery
|
||||||
|
|
||||||
|
|
||||||
|
def purge_expired_tokens() -> None:
|
||||||
|
current_time = datetime.now(UTC)
|
||||||
|
|
||||||
|
with session_context() as session:
|
||||||
|
db = get_repositories(session, group_id=None)
|
||||||
|
tokens_response = db.recipe_share_tokens.page_all(
|
||||||
|
PaginationQuery(page=1, per_page=-1, query_filter=f"expiresAt < {current_time}")
|
||||||
|
)
|
||||||
|
if not (tokens := tokens_response.items):
|
||||||
|
return
|
||||||
|
|
||||||
|
db.recipe_share_tokens.delete_many([token.id for token in tokens])
|
|
@ -6,7 +6,7 @@ from typing import Any
|
||||||
import bs4
|
import bs4
|
||||||
import extruct
|
import extruct
|
||||||
from fastapi import HTTPException, status
|
from fastapi import HTTPException, status
|
||||||
from httpx import AsyncClient
|
from httpx import AsyncClient, Response
|
||||||
from recipe_scrapers import NoSchemaFoundInWildMode, SchemaScraperFactory, scrape_html
|
from recipe_scrapers import NoSchemaFoundInWildMode, SchemaScraperFactory, scrape_html
|
||||||
from slugify import slugify
|
from slugify import slugify
|
||||||
from w3lib.html import get_base_url
|
from w3lib.html import get_base_url
|
||||||
|
@ -20,16 +20,10 @@ from mealie.services.openai import OpenAIService
|
||||||
from mealie.services.scraper.scraped_extras import ScrapedExtras
|
from mealie.services.scraper.scraped_extras import ScrapedExtras
|
||||||
|
|
||||||
from . import cleaner
|
from . import cleaner
|
||||||
|
from .user_agents_manager import get_user_agents_manager
|
||||||
try:
|
|
||||||
from recipe_scrapers._abstract import HEADERS
|
|
||||||
|
|
||||||
_FIREFOX_UA = HEADERS["User-Agent"]
|
|
||||||
except (ImportError, KeyError):
|
|
||||||
_FIREFOX_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/128.0"
|
|
||||||
|
|
||||||
|
|
||||||
SCRAPER_TIMEOUT = 15
|
SCRAPER_TIMEOUT = 15
|
||||||
|
logger = get_logger()
|
||||||
|
|
||||||
|
|
||||||
class ForceTimeoutException(Exception):
|
class ForceTimeoutException(Exception):
|
||||||
|
@ -42,32 +36,50 @@ async def safe_scrape_html(url: str) -> str:
|
||||||
if the request takes longer than 15 seconds. This is used to mitigate
|
if the request takes longer than 15 seconds. This is used to mitigate
|
||||||
DDOS attacks from users providing a url with arbitrary large content.
|
DDOS attacks from users providing a url with arbitrary large content.
|
||||||
"""
|
"""
|
||||||
|
user_agents_manager = get_user_agents_manager()
|
||||||
|
|
||||||
|
logger.debug(f"Scraping URL: {url}")
|
||||||
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
||||||
html_bytes = b""
|
for user_agent in user_agents_manager.user_agents:
|
||||||
async with client.stream(
|
logger.debug(f'Trying User-Agent: "{user_agent}"')
|
||||||
"GET", url, timeout=SCRAPER_TIMEOUT, headers={"User-Agent": _FIREFOX_UA}, follow_redirects=True
|
|
||||||
) as resp:
|
|
||||||
start_time = time.time()
|
|
||||||
|
|
||||||
async for chunk in resp.aiter_bytes(chunk_size=1024):
|
response: Response | None = None
|
||||||
html_bytes += chunk
|
html_bytes = b""
|
||||||
|
async with client.stream(
|
||||||
|
"GET",
|
||||||
|
url,
|
||||||
|
timeout=SCRAPER_TIMEOUT,
|
||||||
|
headers=user_agents_manager.get_scrape_headers(user_agent),
|
||||||
|
follow_redirects=True,
|
||||||
|
) as resp:
|
||||||
|
if resp.status_code == status.HTTP_403_FORBIDDEN:
|
||||||
|
logger.debug(f'403 Forbidden with User-Agent: "{user_agent}"')
|
||||||
|
continue
|
||||||
|
|
||||||
if time.time() - start_time > SCRAPER_TIMEOUT:
|
start_time = time.time()
|
||||||
raise ForceTimeoutException()
|
|
||||||
|
async for chunk in resp.aiter_bytes(chunk_size=1024):
|
||||||
|
html_bytes += chunk
|
||||||
|
|
||||||
|
if time.time() - start_time > SCRAPER_TIMEOUT:
|
||||||
|
raise ForceTimeoutException()
|
||||||
|
|
||||||
|
response = resp
|
||||||
|
break
|
||||||
|
|
||||||
|
if not (response and html_bytes):
|
||||||
|
return ""
|
||||||
|
|
||||||
# =====================================
|
# =====================================
|
||||||
# Copied from requests text property
|
# Copied from requests text property
|
||||||
|
|
||||||
# Try charset from content-type
|
# Try charset from content-type
|
||||||
content = None
|
content = None
|
||||||
encoding = resp.encoding
|
encoding = response.encoding
|
||||||
|
|
||||||
if not html_bytes:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
# Fallback to auto-detected encoding.
|
# Fallback to auto-detected encoding.
|
||||||
if encoding is None:
|
if encoding is None:
|
||||||
encoding = resp.apparent_encoding
|
encoding = response.apparent_encoding
|
||||||
|
|
||||||
# Decode unicode from given encoding.
|
# Decode unicode from given encoding.
|
||||||
try:
|
try:
|
||||||
|
|
3
mealie/services/scraper/user-agents.txt
Normal file
3
mealie/services/scraper/user-agents.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.
|
||||||
|
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.
|
||||||
|
Mozilla/5.0 (Linux; Android 10; HD1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.6834.164 Mobile Safari/537.36 EdgA/131.0.2903.87
|
65
mealie/services/scraper/user_agents_manager.py
Normal file
65
mealie/services/scraper/user_agents_manager.py
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
|
||||||
|
_USER_AGENTS_MANAGER: UserAgentsManager | None = None
|
||||||
|
|
||||||
|
|
||||||
|
def get_user_agents_manager() -> UserAgentsManager:
|
||||||
|
global _USER_AGENTS_MANAGER
|
||||||
|
|
||||||
|
if not _USER_AGENTS_MANAGER:
|
||||||
|
_USER_AGENTS_MANAGER = UserAgentsManager()
|
||||||
|
|
||||||
|
return _USER_AGENTS_MANAGER
|
||||||
|
|
||||||
|
|
||||||
|
class UserAgentsManager:
|
||||||
|
def __init__(self) -> None:
|
||||||
|
self._user_agents: list[str] | None = None
|
||||||
|
self._user_agents_text_path = os.path.join(os.path.dirname(__file__), "user-agents.txt")
|
||||||
|
|
||||||
|
def get_scrape_headers(self, user_agent: str | None = None) -> dict[str, str]:
|
||||||
|
# From: https://scrapeops.io/web-scraping-playbook/403-forbidden-error-web-scraping/#optimize-request-headers
|
||||||
|
if user_agent is None:
|
||||||
|
user_agent = random.choice(self.user_agents)
|
||||||
|
|
||||||
|
return {
|
||||||
|
"User-Agent": user_agent,
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
|
||||||
|
"Accept-Language": "en-US,en;q=0.5",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br",
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Upgrade-Insecure-Requests": "1",
|
||||||
|
"Sec-Fetch-Dest": "document",
|
||||||
|
"Sec-Fetch-Mode": "navigate",
|
||||||
|
"Sec-Fetch-Site": "none",
|
||||||
|
"Sec-Fetch-User": "?1",
|
||||||
|
"Cache-Control": "max-age=0",
|
||||||
|
}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_agents(self) -> list[str]:
|
||||||
|
if not self._user_agents:
|
||||||
|
self._user_agents = self._fetch_user_agents()
|
||||||
|
|
||||||
|
return self._user_agents
|
||||||
|
|
||||||
|
def _fetch_user_agents(self) -> list[str]:
|
||||||
|
user_agents: list[str] = []
|
||||||
|
|
||||||
|
try:
|
||||||
|
from recipe_scrapers._abstract import HEADERS
|
||||||
|
|
||||||
|
user_agents.append(HEADERS["User-Agent"])
|
||||||
|
except (ImportError, KeyError):
|
||||||
|
user_agents.append("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/128.0")
|
||||||
|
|
||||||
|
with open(self._user_agents_text_path) as f:
|
||||||
|
for line in f:
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
user_agents.append(line.strip())
|
||||||
|
|
||||||
|
return user_agents
|
799
poetry.lock
generated
799
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -3,10 +3,14 @@ authors = ["Hayden <hay-kot@pm.me>"]
|
||||||
description = "A Recipe Manager"
|
description = "A Recipe Manager"
|
||||||
license = "AGPL"
|
license = "AGPL"
|
||||||
name = "mealie"
|
name = "mealie"
|
||||||
version = "2.5.0"
|
version = "2.6.0"
|
||||||
|
include = [
|
||||||
|
# Explicit include to override .gitignore when packaging the frontend
|
||||||
|
{ path = "mealie/frontend/**/*", format = ["sdist", "wheel"] }
|
||||||
|
]
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
start = "mealie.app:main"
|
mealie = "mealie.main:main"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
Jinja2 = "^3.1.2"
|
Jinja2 = "^3.1.2"
|
||||||
|
@ -47,7 +51,7 @@ paho-mqtt = "^1.6.1"
|
||||||
pydantic-settings = "^2.1.0"
|
pydantic-settings = "^2.1.0"
|
||||||
pillow-heif = "^0.21.0"
|
pillow-heif = "^0.21.0"
|
||||||
pyjwt = "^2.8.0"
|
pyjwt = "^2.8.0"
|
||||||
openai = "^1.27.0"
|
openai = "^1.63.0"
|
||||||
typing-extensions = "^4.12.2"
|
typing-extensions = "^4.12.2"
|
||||||
itsdangerous = "^2.2.0"
|
itsdangerous = "^2.2.0"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
|
from datetime import UTC, datetime, timedelta
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
|
@ -119,3 +120,52 @@ def test_share_recipe_from_different_group(api_client: TestClient, unique_user:
|
||||||
|
|
||||||
response = api_client.post(api_routes.shared_recipes, json={"recipeId": str(recipe.id)}, headers=g2_user.token)
|
response = api_client.post(api_routes.shared_recipes, json={"recipeId": str(recipe.id)}, headers=g2_user.token)
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
|
|
||||||
|
|
||||||
|
def test_share_recipe_from_different_household(
|
||||||
|
api_client: TestClient, unique_user: TestUser, h2_user: TestUser, slug: str
|
||||||
|
):
|
||||||
|
database = unique_user.repos
|
||||||
|
recipe = database.recipes.get_one(slug)
|
||||||
|
assert recipe
|
||||||
|
|
||||||
|
response = api_client.post(api_routes.shared_recipes, json={"recipeId": str(recipe.id)}, headers=h2_user.token)
|
||||||
|
assert response.status_code == 201
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_recipe_from_token(api_client: TestClient, unique_user: TestUser, slug: str):
|
||||||
|
database = unique_user.repos
|
||||||
|
recipe = database.recipes.get_one(slug)
|
||||||
|
assert recipe
|
||||||
|
|
||||||
|
token = database.recipe_share_tokens.create(
|
||||||
|
RecipeShareTokenSave(recipe_id=recipe.id, group_id=unique_user.group_id)
|
||||||
|
)
|
||||||
|
|
||||||
|
response = api_client.get(api_routes.recipes_shared_token_id(token.id))
|
||||||
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
response_data = response.json()
|
||||||
|
assert response_data["id"] == str(recipe.id)
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_recipe_from_expired_token_deletes_token_and_returns_404(
|
||||||
|
api_client: TestClient, unique_user: TestUser, slug: str
|
||||||
|
):
|
||||||
|
database = unique_user.repos
|
||||||
|
recipe = database.recipes.get_one(slug)
|
||||||
|
assert recipe
|
||||||
|
|
||||||
|
token = database.recipe_share_tokens.create(
|
||||||
|
RecipeShareTokenSave(
|
||||||
|
recipe_id=recipe.id, group_id=unique_user.group_id, expiresAt=datetime.now(UTC) - timedelta(minutes=1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
fetch_token = database.recipe_share_tokens.get_one(token.id)
|
||||||
|
assert fetch_token
|
||||||
|
|
||||||
|
response = api_client.get(api_routes.recipes_shared_token_id(token.id), headers=unique_user.token)
|
||||||
|
assert response.status_code == 404
|
||||||
|
|
||||||
|
fetch_token = database.recipe_share_tokens.get_one(token.id)
|
||||||
|
assert fetch_token is None
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
from datetime import UTC, datetime, timedelta
|
||||||
|
|
||||||
|
from mealie.schema.recipe.recipe import Recipe
|
||||||
|
from mealie.schema.recipe.recipe_share_token import RecipeShareTokenSave
|
||||||
|
from mealie.services.scheduler.tasks.purge_expired_share_tokens import purge_expired_tokens
|
||||||
|
from tests.utils.factories import random_string
|
||||||
|
from tests.utils.fixture_schemas import TestUser
|
||||||
|
|
||||||
|
|
||||||
|
def test_no_expired_tokens():
|
||||||
|
# make sure this task runs successfully even if there are no expired tokens
|
||||||
|
purge_expired_tokens()
|
||||||
|
|
||||||
|
|
||||||
|
def test_delete_expired_tokens(unique_user: TestUser):
|
||||||
|
db = unique_user.repos
|
||||||
|
recipe = db.recipes.create(
|
||||||
|
Recipe(user_id=unique_user.user_id, group_id=unique_user.group_id, name=random_string(20))
|
||||||
|
)
|
||||||
|
assert recipe and recipe.id
|
||||||
|
good_token = db.recipe_share_tokens.create(
|
||||||
|
RecipeShareTokenSave(
|
||||||
|
recipe_id=recipe.id, group_id=unique_user.group_id, expires_at=datetime.now(UTC) + timedelta(hours=1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
bad_token = db.recipe_share_tokens.create(
|
||||||
|
RecipeShareTokenSave(
|
||||||
|
recipe_id=recipe.id, group_id=unique_user.group_id, expires_at=datetime.now(UTC) - timedelta(hours=1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
assert db.recipe_share_tokens.get_one(good_token.id)
|
||||||
|
assert db.recipe_share_tokens.get_one(bad_token.id)
|
||||||
|
|
||||||
|
purge_expired_tokens()
|
||||||
|
|
||||||
|
assert db.recipe_share_tokens.get_one(good_token.id)
|
||||||
|
assert not db.recipe_share_tokens.get_one(bad_token.id)
|
Loading…
Add table
Add a link
Reference in a new issue