diff --git a/Dockerfile b/Dockerfile index c58cf28ea..15e8ca852 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.13-alpine3.21 #Install all dependencies. -RUN apk add --no-cache postgresql-libs postgresql-client gettext zlib libjpeg libwebp libxml2-dev libxslt-dev openldap git +RUN apk add --no-cache postgresql-libs postgresql-client gettext zlib libjpeg libwebp libxml2-dev libxslt-dev openldap git libgcc libstdc++ #Print all logs without buffering it. ENV PYTHONUNBUFFERED 1 @@ -24,7 +24,7 @@ RUN \ # remove Development dependencies from requirements.txt RUN sed -i '/# Development/,$d' requirements.txt -RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev libgcc libstdc++ cargo openldap-dev python3-dev xmlsec-dev xmlsec build-base g++ curl && \ +RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev cargo openldap-dev python3-dev xmlsec-dev xmlsec build-base g++ curl && \ echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so && \ python -m venv venv && \ /opt/recipes/venv/bin/python -m pip install --upgrade pip && \ diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 32560fafc..4b543e359 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -491,7 +491,11 @@ def get_images_from_soup(soup, url): u = u.split('?')[0] filename = re.search(r'/([\w_-]+[.](jpg|jpeg|gif|png))$', u) if filename: - if (('http' not in u) and (url)): + if u.startswith('//'): + # urls from e.g. ottolenghi.co.uk start with // + u = 'https:' + u + if ('http' not in u) and url: + print(f'rewriting URL {u}') # sometimes an image source can be relative # if it is provide the base url u = '{}://{}{}'.format(prot, site, u) diff --git a/docs/system/configuration.md b/docs/system/configuration.md index 5ac6afd9e..2dacc1049 100644 --- a/docs/system/configuration.md +++ b/docs/system/configuration.md @@ -300,6 +300,12 @@ PRIVACY_URL= IMPRINT_URL= ``` +#### Rate Limits + +There are some rate limits that can be configured. + +- RATELIMIT_URL_IMPORT_REQUESTS: limit the number of external URL import requests. Useful to prevent your server from being abused for malicious requests. + ### Authentication All configurable variables regarding authentication. diff --git a/recipes/settings.py b/recipes/settings.py index 1540abfda..b33747ffc 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -141,7 +141,7 @@ AI_RATELIMIT = os.getenv('AI_RATELIMIT', '60/hour') SHARING_ABUSE = extract_bool('SHARING_ABUSE', False) SHARING_LIMIT = int(os.getenv('SHARING_LIMIT', 0)) -DRF_THROTTLE_RECIPE_URL_IMPORT = os.getenv('DRF_THROTTLE_RECIPE_URL_IMPORT', '60/hour') +DRF_THROTTLE_RECIPE_URL_IMPORT = os.getenv('DRF_THROTTLE_RECIPE_URL_IMPORT', os.getenv('RATELIMIT_URL_IMPORT_REQUESTS', '60/hour')) TERMS_URL = os.getenv('TERMS_URL', '') PRIVACY_URL = os.getenv('PRIVACY_URL', '') diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue index ea163dadb..87952890a 100644 --- a/vue3/src/apps/tandoor/Tandoor.vue +++ b/vue3/src/apps/tandoor/Tandoor.vue @@ -4,7 +4,7 @@ - + @@ -120,7 +120,7 @@ {{ useUserPreferenceStore().activeSpace.name }} - + @@ -144,7 +144,7 @@ - + @@ -163,6 +163,7 @@ + diff --git a/vue3/src/apps/tandoor/main.ts b/vue3/src/apps/tandoor/main.ts index e68c7b506..7d315a4b9 100644 --- a/vue3/src/apps/tandoor/main.ts +++ b/vue3/src/apps/tandoor/main.ts @@ -14,8 +14,8 @@ import {setupI18n} from "@/i18n"; import MealPlanPage from "@/pages/MealPlanPage.vue"; const routes = [ - {path: '/', component: () => import("@/pages/StartPage.vue"), name: 'view_home'}, - {path: '/search', redirect: {name: 'view_home'}}, + {path: '/', component: () => import("@/pages/StartPage.vue"), name: 'StartPage'}, + {path: '/search', redirect: {name: 'StartPage'}}, {path: '/test', component: () => import("@/pages/TestPage.vue"), name: 'view_test'}, {path: '/help', component: () => import("@/pages/HelpPage.vue"), name: 'HelpPage'}, { diff --git a/vue3/src/components/dialogs/MessageListDialog.vue b/vue3/src/components/dialogs/MessageListDialog.vue index 201b1816c..9a408e840 100644 --- a/vue3/src/components/dialogs/MessageListDialog.vue +++ b/vue3/src/components/dialogs/MessageListDialog.vue @@ -165,7 +165,7 @@ const showDetailDialog = ref(false) */ function addTestMessage() { let types = [MessageType.SUCCESS, MessageType.ERROR, MessageType.INFO, MessageType.WARNING] - useMessageStore().addMessage(types[Math.floor(Math.random() * types.length)], {title: 'Test', text: `Lorem Ipsum ${Math.random() * 1000}`}, 5000, {json: "data", 'msg': 'whatever', data: 1}) + useMessageStore().addMessage(types[Math.floor(Math.random() * types.length)], {title: 'Test', text: `Lorem Ipsum Lorem Ipsum Lorem Ipsum LINEBREAK \n Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum ${Math.random() * 1000}`}, 5000, {json: "data", 'msg': 'whatever', data: 1}) } diff --git a/vue3/src/components/dialogs/StepIngredientSorterDialog.vue b/vue3/src/components/dialogs/StepIngredientSorterDialog.vue index 5d9ee212a..eba616a58 100644 --- a/vue3/src/components/dialogs/StepIngredientSorterDialog.vue +++ b/vue3/src/components/dialogs/StepIngredientSorterDialog.vue @@ -8,6 +8,7 @@ :sub-title="ingredientToString(step.ingredients[editingIngredientIndex])"> - {{ $t('Step') }} + {{ $t('MoveToStep') }} {{ i + 1 }} {{ s.name }} diff --git a/vue3/src/components/display/VSnackbarQueued.vue b/vue3/src/components/display/VSnackbarQueued.vue index 819ee140c..b8f62ac5f 100644 --- a/vue3/src/components/display/VSnackbarQueued.vue +++ b/vue3/src/components/display/VSnackbarQueued.vue @@ -12,7 +12,7 @@ >

{{ visibleMessage.msg.title }}

- {{ visibleMessage.msg.text }} + {{ visibleMessage.msg.text }}