From 0e05c77fa76395453a5877b2250600a0773c247b Mon Sep 17 00:00:00 2001 From: zodac Date: Fri, 29 Nov 2024 14:15:24 +1300 Subject: [PATCH 01/12] Adding healthcheck to docker image --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4b52f246da..08edfa5a46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,12 @@ RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-de #Copy project and execute it. COPY . ./ +HEALTHCHECK --interval=30s \ + --timeout=5s \ + --start-period=10s \ + --retries=3 \ + CMD [ "/usr/bin/wget", "--no-verbose", "--tries=1", "-O", "-", "http://127.0.0.1:8080/openapi" ] + # collect information from git repositories RUN /opt/recipes/venv/bin/python version.py # delete git repositories to reduce image size From 2c94753a5a902d8383b71c9ea571432daff43fc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:39:23 +0000 Subject: [PATCH 02/12] Bump pytest-django from 4.8.0 to 4.9.0 Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.8.0 to 4.9.0. - [Release notes](https://github.com/pytest-dev/pytest-django/releases) - [Changelog](https://github.com/pytest-dev/pytest-django/blob/main/docs/changelog.rst) - [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.8.0...v4.9.0) --- updated-dependencies: - dependency-name: pytest-django dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5273135cb3..98bdf9a094 100644 --- a/requirements.txt +++ b/requirements.txt @@ -48,7 +48,7 @@ redis==5.2.0 # Development pytest==8.0.0 -pytest-django==4.8.0 +pytest-django==4.9.0 pytest-cov===5.0.0 pytest-factoryboy==2.6.0 pytest-html==4.1.1 From 41f834db08ba32521adefbf693b84ca3326f9b96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:39:26 +0000 Subject: [PATCH 03/12] Bump crispy-bootstrap4 from 2024.1 to 2024.10 Bumps [crispy-bootstrap4](https://github.com/django-crispy-forms/crispy-bootstrap4) from 2024.1 to 2024.10. - [Release notes](https://github.com/django-crispy-forms/crispy-bootstrap4/releases) - [Changelog](https://github.com/django-crispy-forms/crispy-bootstrap4/blob/main/CHANGELOG.md) - [Commits](https://github.com/django-crispy-forms/crispy-bootstrap4/compare/2024.1...2024.10) --- updated-dependencies: - dependency-name: crispy-bootstrap4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5273135cb3..d5488f6c03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ cryptography===43.0.1 django-annoying==0.10.6 django-cleanup==8.0.0 django-crispy-forms==2.3 -crispy-bootstrap4==2024.1 +crispy-bootstrap4==2024.10 django-tables2==2.7.0 djangorestframework==3.15.2 drf-writable-nested==0.7.0 From 865756e4b203be8e4b0395f0a010754f5fce9b6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:39:28 +0000 Subject: [PATCH 04/12] Bump pytest-factoryboy from 2.6.0 to 2.7.0 Bumps [pytest-factoryboy](https://github.com/pytest-dev/pytest-factoryboy) from 2.6.0 to 2.7.0. - [Changelog](https://github.com/pytest-dev/pytest-factoryboy/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-factoryboy/compare/2.6.0...2.7.0) --- updated-dependencies: - dependency-name: pytest-factoryboy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5273135cb3..27bb24d1e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -50,7 +50,7 @@ redis==5.2.0 pytest==8.0.0 pytest-django==4.8.0 pytest-cov===5.0.0 -pytest-factoryboy==2.6.0 +pytest-factoryboy==2.7.0 pytest-html==4.1.1 pytest-asyncio==0.23.5 pytest-xdist==3.6.1 From f19beba014301804d00e498fe4ec2eecdd1b7505 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:39:31 +0000 Subject: [PATCH 05/12] Bump icalendar from 5.0.11 to 6.1.0 Bumps [icalendar](https://github.com/collective/icalendar) from 5.0.11 to 6.1.0. - [Release notes](https://github.com/collective/icalendar/releases) - [Changelog](https://github.com/collective/icalendar/blob/main/CHANGES.rst) - [Commits](https://github.com/collective/icalendar/compare/v5.0.11...v6.1.0) --- updated-dependencies: - dependency-name: icalendar dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5273135cb3..599b1735c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ requests==2.32.3 six==1.16.0 webdavclient3==3.14.6 whitenoise==6.7.0 -icalendar==5.0.11 +icalendar==6.1.0 pyyaml==6.0.2 uritemplate==4.1.1 beautifulsoup4==4.12.3 From 375174ee41e8829809d02b73114ce44349eddbc6 Mon Sep 17 00:00:00 2001 From: Carter Hawthorne <122405782+hawthorc@users.noreply.github.com> Date: Sun, 1 Dec 2024 18:38:38 -0800 Subject: [PATCH 06/12] Add note about Python 3.12 dependency to manual.md --- docs/install/manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/manual.md b/docs/install/manual.md index c6ec34abab..c5cd7412bb 100644 --- a/docs/install/manual.md +++ b/docs/install/manual.md @@ -3,7 +3,7 @@ These instructions are inspired from a standard django/gunicorn/postgresql instructions ([for example](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04)) !!! warning - Make sure to use Python 3.10 or higher, and ensure that `pip` is associated with Python 3. Depending on your system configuration, using `python` or `pip` might default to Python 2. Make sure your machine has at least 2048 MB of memory; otherwise, the `yarn build` process may fail with the error: `FATAL ERROR: Reached heap limit - Allocation failed: JavaScript heap out of memory`. + Make sure to use at least Python 3.10 (although 3.12 is preferred) or higher, and ensure that `pip` is associated with Python 3. Depending on your system configuration, using `python` or `pip` might default to Python 2. Make sure your machine has at least 2048 MB of memory; otherwise, the `yarn build` process may fail with the error: `FATAL ERROR: Reached heap limit - Allocation failed: JavaScript heap out of memory`. ## Prerequisites From 70df4563076a6ddd5daab2817fb5a930a0cfa782 Mon Sep 17 00:00:00 2001 From: Vincenzo Reale Date: Sun, 1 Dec 2024 11:07:43 +0000 Subject: [PATCH 07/12] Translated using Weblate (Italian) Currently translated at 100.0% (488 of 488 strings) Translation: Tandoor/Recipes Backend Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/ --- cookbook/locale/it/LC_MESSAGES/django.po | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cookbook/locale/it/LC_MESSAGES/django.po b/cookbook/locale/it/LC_MESSAGES/django.po index cc06bd4ae6..96761579d8 100644 --- a/cookbook/locale/it/LC_MESSAGES/django.po +++ b/cookbook/locale/it/LC_MESSAGES/django.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-08-01 15:04+0200\n" -"PO-Revision-Date: 2024-11-01 06:58+0000\n" +"PO-Revision-Date: 2024-12-02 04:53+0000\n" "Last-Translator: Vincenzo Reale \n" "Language-Team: Italian \n" @@ -21,7 +21,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.6.2\n" +"X-Generator: Weblate 5.8.4\n" #: .\cookbook\forms.py:45 msgid "" @@ -1440,8 +1440,9 @@ msgid "" "\"noreferrer noopener\" target=\"_blank\">this one." msgstr "" "Le tabelle in markdown sono difficili da creare a mano. Si raccomanda " -"l'utilizzo di un editor di come questo." +"l'utilizzo di un editor di tabelle come questo." #: .\cookbook\templates\markdown_info.html:155 #: .\cookbook\templates\markdown_info.html:157 @@ -2203,8 +2204,8 @@ msgstr "" " Le migrazioni non andate a buon fine probabilmente causeranno il " "malfunzionamento di parti importanti dell'applicazione.\n" " Se una migrazione non riesce, assicurati di avere la versione " -"più recente e, in tal caso, pubblica il registro della migrazione e la " -"panoramica di seguito in una segnalazione di problema su GitHub.\n" +"più recente e, in tal caso, pubblica il registro della migrazione e il " +"riepilogo che segue in una segnalazione di problema su GitHub.\n" " " #: .\cookbook\templates\system.html:182 @@ -2765,7 +2766,7 @@ msgid "" "but not recommended as some features only work with postgres databases." msgstr "" "Questa applicazione non è in esecuzione con un database Postgres. Va bene, " -"ma non è consigliato perché alcune funzionalità sono disponibili solo con un " +"ma non è consigliato perché alcune funzionalità sono disponibili solo con " "database Postgres." #: .\cookbook\views\views.py:360 From 103daf000d4b6b793d30b6571ddc46997e26ba4f Mon Sep 17 00:00:00 2001 From: zodac Date: Mon, 2 Dec 2024 20:44:12 +1300 Subject: [PATCH 08/12] Using --spider for healthcheck, which performs a HEAD request instead of a GET request --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 08edfa5a46..d2b92c1a5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ HEALTHCHECK --interval=30s \ --timeout=5s \ --start-period=10s \ --retries=3 \ - CMD [ "/usr/bin/wget", "--no-verbose", "--tries=1", "-O", "-", "http://127.0.0.1:8080/openapi" ] + CMD [ "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8080/openapi" ] # collect information from git repositories RUN /opt/recipes/venv/bin/python version.py From 7ccedb559da2fcb7459057d41e3fe81b48be491b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 18:57:23 +0000 Subject: [PATCH 09/12] Bump django from 4.2.16 to 4.2.17 Bumps [django](https://github.com/django/django) from 4.2.16 to 4.2.17. - [Commits](https://github.com/django/django/compare/4.2.16...4.2.17) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5273135cb3..509397d35f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==4.2.16 +Django==4.2.17 cryptography===43.0.1 django-annoying==0.10.6 django-cleanup==8.0.0 From e024e3deb0f752248488f60116ec1767013ab574 Mon Sep 17 00:00:00 2001 From: Vincenzo Reale Date: Sun, 8 Dec 2024 00:45:12 +0000 Subject: [PATCH 10/12] Translated using Weblate (Italian) Currently translated at 100.0% (488 of 488 strings) Translation: Tandoor/Recipes Backend Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/it/ --- cookbook/locale/it/LC_MESSAGES/django.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/locale/it/LC_MESSAGES/django.po b/cookbook/locale/it/LC_MESSAGES/django.po index 96761579d8..e66531254f 100644 --- a/cookbook/locale/it/LC_MESSAGES/django.po +++ b/cookbook/locale/it/LC_MESSAGES/django.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-08-01 15:04+0200\n" -"PO-Revision-Date: 2024-12-02 04:53+0000\n" +"PO-Revision-Date: 2024-12-09 00:58+0000\n" "Last-Translator: Vincenzo Reale \n" "Language-Team: Italian \n" @@ -520,7 +520,7 @@ msgstr "Web" #: .\cookbook\models.py:1411 .\cookbook\templates\search_info.html:47 msgid "Raw" -msgstr "Raw" +msgstr "Crudo" #: .\cookbook\models.py:1467 msgid "Food Alias" From 49b119571e77ad1e857403eed0145f21f33c7b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matja=C5=BE=20T?= Date: Mon, 9 Dec 2024 07:17:07 +0000 Subject: [PATCH 11/12] Translated using Weblate (Slovenian) Currently translated at 100.0% (570 of 570 strings) Translation: Tandoor/Recipes Frontend Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-frontend/sl/ --- vue/src/locales/sl.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vue/src/locales/sl.json b/vue/src/locales/sl.json index 44ea4174ed..a94d80da68 100644 --- a/vue/src/locales/sl.json +++ b/vue/src/locales/sl.json @@ -203,7 +203,7 @@ "Next_Day": "Naslednji Dan", "Previous_Day": "Prejšnji Dan", "Coming_Soon": "Kmalu", - "Auto_Planner": "Avto-planer", + "Auto_Planner": "Samodejni planer", "New_Cookbook": "Nova kuharska knjiga", "Hide_Keyword": "Skrij ključne besede", "Clear": "Počisti", @@ -215,7 +215,7 @@ "RemoveFoodFromShopping": "Odstrani {food} iz nakupovalnega listka", "SupermarketCategoriesOnly": "Prikaži samo trgovinske kategorije", "DelayFor": "Zamakni za {hours} ur", - "OfflineAlert": "Si v offline načinu, nakupovalni listek se mogoče ne bo sinhroniziral.", + "OfflineAlert": "Si v načinu brez povezave, nakupovalni listek se mogoče ne bo sinhroniziral.", "shopping_share_desc": "Uporabniki bodo videli vse elemente, ki si jih dodal v nakupovalni listek. Morajo te dodati, da vidiš njihove elemente na listku.", "shopping_auto_sync_desc": "Nastavitev na 0 bo onemogoča avtomatsko sinhronizacijo. Pri ogledu nakupovalnega seznama se seznam posodablja vsakih nekaj sekund za sinhronizacijo sprememb, ki jih je morda naredil nekdo drug. Uporabno pri nakupovanju z več ljudmi, vendar bo uporabljalo mobilne podatke.", "filter_to_supermarket_desc": "Privzeto, razvrsti nakupovalni listek, da vključi samo označene trgovine.", @@ -225,7 +225,7 @@ "success_moving_resource": "Premikanje vira je bilo uspešno!", "success_merging_resource": "Združevanje vira je bilo uspešno!", "Added_by": "Dodano s strani", - "AddToShopping": "Dodaj nakupovlanemu listku", + "AddToShopping": "Dodaj nakupovalnemu listku", "NotInShopping": "{food} ni v tvojem nakupovalnem listku.", "OnHand": "Trenutno imam v roki", "FoodOnHand": "Imaš {food} v roki.", @@ -247,8 +247,8 @@ "ShowDelayed": "Pokaži odložene elemente", "Completed": "Končano", "shopping_share": "Deli nakupovalni listek", - "shopping_auto_sync": "Avtomatska sinhronizacija", - "mealplan_autoadd_shopping": "Avtomatsko dodaj obrok v načrt", + "shopping_auto_sync": "Samodejna sinhronizacija", + "mealplan_autoadd_shopping": "Samodejno dodaj obrok v načrt", "mealplan_autoexclude_onhand": "Izključi hrano v roki", "mealplan_autoinclude_related": "Dodaj povezane recepte", "default_delay": "Privzete ure za zamik", @@ -275,7 +275,7 @@ "copy_markdown_table": "Kopiraj kot Markdown tabela", "in_shopping": "V nakupovalnem listku", "DelayUntil": "Zamakni do", - "shopping_add_onhand": "Avtomatsko v roki", + "shopping_add_onhand": "Samodejno v roki", "related_recipes": "Povezani recepti", "today_recipes": "Današnji recepti", "mark_complete": "Označi končano", From 0bcdf5e0a3342e103c1d7a31aa2a457c3bb170c2 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 22 Dec 2024 12:05:47 +0100 Subject: [PATCH 12/12] added user filkes to recipe and added is_image flag to user file --- cookbook/migrations/0220_recipe_images.py | 18 ++++++++++++++++++ cookbook/models.py | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 cookbook/migrations/0220_recipe_images.py diff --git a/cookbook/migrations/0220_recipe_images.py b/cookbook/migrations/0220_recipe_images.py new file mode 100644 index 0000000000..7e03a9763f --- /dev/null +++ b/cookbook/migrations/0220_recipe_images.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.17 on 2024-12-22 11:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0219_connectorconfig_supports_description_field'), + ] + + operations = [ + migrations.AddField( + model_name='recipe', + name='images', + field=models.ManyToManyField(blank=True, to='cookbook.userfile'), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index e415609924..aa14fe941c 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -1000,6 +1000,7 @@ class Recipe(ExportModelOperationsMixin('recipe'), models.Model, PermissionModel servings = models.IntegerField(default=1) servings_text = models.CharField(default='', blank=True, max_length=32) image = models.ImageField(upload_to='recipes/', blank=True, null=True) + images = models.ManyToManyField("UserFile", blank=True) storage = models.ForeignKey(Storage, on_delete=models.PROTECT, blank=True, null=True) file_uid = models.CharField(max_length=256, default="", blank=True) file_path = models.CharField(max_length=512, default="", blank=True) @@ -1428,6 +1429,7 @@ class UserFile(ExportModelOperationsMixin('user_files'), models.Model, Permissio name = models.CharField(max_length=128) file = models.FileField(upload_to='files/') file_size_kb = models.IntegerField(default=0, blank=True) + is_image = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) created_by = models.ForeignKey(User, on_delete=models.CASCADE)