Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f25de4b
Author: vabene1111 <[email protected]>
Date:   Sun Jan 5 11:38:35 2025 +0100

    remove healthcheck

commit 6444680
Merge: fd42366 c604369
Author: vabene1111 <[email protected]>
Date:   Wed Jan 1 08:16:19 2025 +0100

    Merge pull request TandoorRecipes#3475 from TandoorRecipes/dependabot/pip/cryptography-44.0.0

    Bump cryptography from 43.0.1 to 44.0.0

commit c604369
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jan 1 00:33:49 2025 +0000

    Bump cryptography from 43.0.1 to 44.0.0

    Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.1 to 44.0.0.
    - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
    - [Commits](pyca/cryptography@43.0.1...44.0.0)

    ---
    updated-dependencies:
    - dependency-name: cryptography
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

commit fd42366
Author: vabene1111 <[email protected]>
Date:   Sun Dec 29 13:46:17 2024 +0100

    update gitignore like vue3 branch

commit 00148a2
Author: vabene1111 <[email protected]>
Date:   Sun Dec 29 13:44:43 2024 +0100

    made shopping list compatible with SLR entries without a recipe

commit 359fcb2
Author: vabene1111 <[email protected]>
Date:   Sun Dec 29 13:42:12 2024 +0100

    fixed social signup form

commit f5d7919
Merge: 86c4278 432dfa9
Author: vabene1111 <[email protected]>
Date:   Sat Dec 28 08:26:53 2024 +0100

    Merge pull request TandoorRecipes#3448 from igorsantos07/patch-1

    Update system.html: Django Recipes > Tandoor

commit 86c4278
Merge: f61a837 2a5c0bb
Author: vabene1111 <[email protected]>
Date:   Sat Dec 28 08:26:44 2024 +0100

    Merge pull request TandoorRecipes#3454 from TandoorRecipes/dependabot/pip/jinja2-3.1.5

    Bump jinja2 from 3.1.4 to 3.1.5

commit 2a5c0bb
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sat Dec 28 07:25:33 2024 +0000

    Bump jinja2 from 3.1.4 to 3.1.5

    Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5.
    - [Release notes](https://github.com/pallets/jinja/releases)
    - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
    - [Commits](pallets/jinja@3.1.4...3.1.5)

    ---
    updated-dependencies:
    - dependency-name: jinja2
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

commit 432dfa9
Author: Igor Santos <[email protected]>
Date:   Tue Dec 24 02:28:21 2024 -0300

    Update system.html: Django Recipes > Tandoor

commit f61a837
Author: vabene1111 <[email protected]>
Date:   Sun Dec 22 12:12:37 2024 +0100

    Revert "added user filkes to recipe and added is_image flag to user file"

    This reverts commit 0bcdf5e.

commit 0bcdf5e
Author: vabene1111 <[email protected]>
Date:   Sun Dec 22 12:05:47 2024 +0100

    added user filkes to recipe and added is_image flag to user file

commit 169f799
Merge: 942d113 375174e
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:19:59 2024 +0100

    Merge pull request TandoorRecipes#3428 from hawthorc/develop

    Add note about Python 3.12 dependency to manual.md

commit 942d113
Merge: 64cc20a 103daf0
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:17:28 2024 +0100

    Merge pull request TandoorRecipes#3416 from zodac/develop

    Adding healthcheck to docker image

commit 64cc20a
Merge: 3a6731e f19beba
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:12:09 2024 +0100

    Merge pull request TandoorRecipes#3426 from TandoorRecipes/dependabot/pip/icalendar-6.1.0

    Bump icalendar from 5.0.11 to 6.1.0

commit 3a6731e
Merge: e6f11a1 865756e
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:11:32 2024 +0100

    Merge pull request TandoorRecipes#3425 from TandoorRecipes/dependabot/pip/pytest-factoryboy-2.7.0

    Bump pytest-factoryboy from 2.6.0 to 2.7.0

commit e6f11a1
Merge: cc1cd61 2c94753
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:11:17 2024 +0100

    Merge pull request TandoorRecipes#3423 from TandoorRecipes/dependabot/pip/pytest-django-4.9.0

    Bump pytest-django from 4.8.0 to 4.9.0

commit cc1cd61
Merge: 6a3b5ee 41f834d
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:10:19 2024 +0100

    Merge pull request TandoorRecipes#3424 from TandoorRecipes/dependabot/pip/crispy-bootstrap4-2024.10

    Bump crispy-bootstrap4 from 2024.1 to 2024.10

commit 6a3b5ee
Merge: 49b1195 7ccedb5
Author: vabene1111 <[email protected]>
Date:   Wed Dec 11 15:09:46 2024 +0100

    Merge pull request TandoorRecipes#3431 from TandoorRecipes/dependabot/pip/django-4.2.17

    Bump django from 4.2.16 to 4.2.17

commit 7ccedb5
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Dec 6 18:57:23 2024 +0000

    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](django/django@4.2.16...4.2.17)

    ---
    updated-dependencies:
    - dependency-name: django
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

commit 103daf0
Author: zodac <[email protected]>
Date:   Mon Dec 2 20:44:12 2024 +1300

    Using --spider for healthcheck, which performs a HEAD request instead of a GET request

commit 375174e
Author: Carter Hawthorne <[email protected]>
Date:   Sun Dec 1 18:38:38 2024 -0800

    Add note about Python 3.12 dependency to manual.md

commit f19beba
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Dec 1 00:39:31 2024 +0000

    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](collective/icalendar@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] <[email protected]>

commit 865756e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Dec 1 00:39:28 2024 +0000

    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](pytest-dev/pytest-factoryboy@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] <[email protected]>

commit 41f834d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Dec 1 00:39:26 2024 +0000

    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](django-crispy-forms/crispy-bootstrap4@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] <[email protected]>

commit 2c94753
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Dec 1 00:39:23 2024 +0000

    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](pytest-dev/pytest-django@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] <[email protected]>

commit 0e05c77
Author: zodac <[email protected]>
Date:   Fri Nov 29 14:15:24 2024 +1300

    Adding healthcheck to docker image
  • Loading branch information
smilerz committed Jan 14, 2025
1 parent 087f444 commit cb5ef96
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ vue3/.vite
# Configs
vetur.config.js
venv/
.idea/easy-i18n.xml
cookbook/static/vue3
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-de
#Copy project and execute it.
COPY . ./

# commented for now https://github.com/TandoorRecipes/recipes/issues/3478
#HEALTHCHECK --interval=30s \
# --timeout=5s \
# --start-period=10s \
# --retries=3 \
# 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
# delete git repositories to reduce image size
Expand Down
38 changes: 25 additions & 13 deletions cookbook/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from datetime import datetime


from allauth.account.forms import ResetPasswordForm, SignupForm
from allauth.socialaccount.forms import SignupForm as SocialSignupForm
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
Expand All @@ -14,15 +16,13 @@


class SelectWidget(widgets.Select):

class Media:
js = ('custom/js/form_select.js', )
js = ('custom/js/form_select.js',)


class MultiSelectWidget(widgets.SelectMultiple):

class Media:
js = ('custom/js/form_multiselect.js', )
js = ('custom/js/form_multiselect.js',)


# Yes there are some stupid browsers that still dont support this but
Expand Down Expand Up @@ -139,7 +139,7 @@ class CommentForm(forms.ModelForm):

class Meta:
model = Comment
fields = ('text', )
fields = ('text',)

labels = {'text': _('Add your comment: '), }
widgets = {'text': forms.Textarea(attrs={'rows': 2, 'cols': 15}), }
Expand All @@ -161,7 +161,6 @@ class Meta:
help_texts = {'url': _('Leave empty for dropbox and enter only base url for nextcloud (<code>/remote.php/webdav/</code> is added automatically)'), }



class ConnectorConfigForm(forms.ModelForm):
enabled = forms.BooleanField(
help_text="Is the connector enabled",
Expand Down Expand Up @@ -315,6 +314,18 @@ def signup(self, request, user):
pass


class AllAuthSocialSignupForm(SocialSignupForm):
terms = forms.BooleanField(label=_('Accept Terms and Privacy'))

def __init__(self, **kwargs):
super().__init__(**kwargs)
if settings.PRIVACY_URL == '' and settings.TERMS_URL == '':
self.fields.pop('terms')

def signup(self, request, user):
pass


class CustomPasswordResetForm(ResetPasswordForm):
captcha = hCaptchaField()

Expand Down Expand Up @@ -345,12 +356,13 @@ class Meta:

help_texts = {
'search': _('Select type method of search. Click <a href="/docs/search/">here</a> for full description of choices.'), 'lookup':
_('Use fuzzy matching on units, keywords and ingredients when editing and importing recipes.'), 'unaccent':
_('Fields to search ignoring accents. Selecting this option can improve or degrade search quality depending on language'), 'icontains':
_("Fields to search for partial matches. (e.g. searching for 'Pie' will return 'pie' and 'piece' and 'soapie')"), 'istartswith':
_("Fields to search for beginning of word matches. (e.g. searching for 'sa' will return 'salad' and 'sandwich')"), 'trigram':
_("Fields to 'fuzzy' search. (e.g. searching for 'recpie' will find 'recipe'.) Note: this option will conflict with 'web' and 'raw' methods of search."), 'fulltext':
_("Fields to full text search. Note: 'web', 'phrase', and 'raw' search methods only function with fulltext fields."),
_('Use fuzzy matching on units, keywords and ingredients when editing and importing recipes.'), 'unaccent':
_('Fields to search ignoring accents. Selecting this option can improve or degrade search quality depending on language'), 'icontains':
_("Fields to search for partial matches. (e.g. searching for 'Pie' will return 'pie' and 'piece' and 'soapie')"), 'istartswith':
_("Fields to search for beginning of word matches. (e.g. searching for 'sa' will return 'salad' and 'sandwich')"), 'trigram':
_("Fields to 'fuzzy' search. (e.g. searching for 'recpie' will find 'recipe'.) Note: this option will conflict with 'web' and 'raw' methods of search."),
'fulltext':
_("Fields to full text search. Note: 'web', 'phrase', and 'raw' search methods only function with fulltext fields."),
}

labels = {
Expand All @@ -360,5 +372,5 @@ class Meta:

widgets = {
'search': SelectWidget, 'unaccent': MultiSelectWidget, 'icontains': MultiSelectWidget, 'istartswith': MultiSelectWidget, 'trigram': MultiSelectWidget, 'fulltext':
MultiSelectWidget,
MultiSelectWidget,
}
1 change: 0 additions & 1 deletion cookbook/templates/account/signup.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load crispy_forms_filters %}
{% load i18n %}

{% block title %}{% trans 'Register' %}{% endblock %}
Expand Down
3 changes: 1 addition & 2 deletions cookbook/templates/socialaccount/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ <h1>{% trans "Sign Up" %}</h1>
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}

<div class="form-group">
{{ form.username |as_crispy_field }}
</div>
Expand All @@ -30,7 +29,7 @@ <h1>{% trans "Sign Up" %}</h1>
<div class="form-group">
{{ form.terms |as_crispy_field }}
<small>
{% trans 'I accept the follwoing' %}
{% trans 'I accept the following' %}
{% if TERMS_URL != '' %}
<a href="{{ TERMS_URL }}" target="_blank"
rel="noreferrer nofollow">{% trans 'Terms and Conditions' %}</a>
Expand Down
6 changes: 3 additions & 3 deletions cookbook/templates/system.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<h1>{% trans 'System' %}</h1>
{% blocktrans %}
Django Recipes is an open source free software application. It can be found on
<a href="https://github.com/vabene1111/recipes">GitHub</a>.
Changelogs can be found <a href="https://github.com/vabene1111/recipes/releases">here</a>.
Tandoor Recipes is an open source free software application. It can be found on
<a href="https://github.com/TandoorRecipes/recipes">GitHub</a>.
Changelogs can be found <a href="https://github.com/TandoorRecipes/recipes/releases">here</a>.
{% endblocktrans %}

<h3 class="mt-5">{% trans 'System Information' %}</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/install/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions recipes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
},
}


# allow djangos wsgi server to server mediafiles
GUNICORN_MEDIA = bool(int(os.getenv('GUNICORN_MEDIA', False)))

Expand Down Expand Up @@ -247,14 +246,14 @@
]

if DEBUG_TOOLBAR:
MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar',)

SORT_TREE_BY_NAME = bool(int(os.getenv('SORT_TREE_BY_NAME', False)))
DISABLE_TREE_FIX_STARTUP = bool(int(os.getenv('DISABLE_TREE_FIX_STARTUP', False)))

if bool(int(os.getenv('SQL_DEBUG', False))):
MIDDLEWARE += ('recipes.middleware.SqlPrintingMiddleware', )
MIDDLEWARE += ('recipes.middleware.SqlPrintingMiddleware',)

if ENABLE_METRICS:
MIDDLEWARE += 'django_prometheus.middleware.PrometheusAfterMiddleware',
Expand Down Expand Up @@ -294,7 +293,6 @@
"handlers": ["console"]
}


AUTHENTICATION_BACKENDS += [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
Expand Down Expand Up @@ -566,6 +564,9 @@ def setup_database(db_url=None, db_options=None, db_engine=None, pg_host=None, p

# ACCOUNT_SIGNUP_FORM_CLASS = 'cookbook.forms.AllAuthSignupForm'
ACCOUNT_FORMS = {'signup': 'cookbook.forms.AllAuthSignupForm', 'reset_password': 'cookbook.forms.CustomPasswordResetForm'}
SOCIALACCOUNT_FORMS = {
'signup': 'cookbook.forms.AllAuthSocialSignupForm',
}

ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS = False
ACCOUNT_RATE_LIMITS = {
Expand Down
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Django==4.2.16
cryptography===43.0.1
Django==4.2.17
cryptography===44.0.0
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
Expand All @@ -20,17 +20,17 @@ 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
microdata==0.8.0
mock==5.1.0
Jinja2==3.1.4
Jinja2==3.1.5
django-webpack-loader==3.0.1
git+https://github.com/BITSOLVER/django-js-reverse@071e304fd600107bc64bbde6f2491f1fe049ec82
django-allauth==0.61.1
recipe-scrapers==15.3.2
recipe-scrapers==15.4.0
django-scopes==2.0.0
django-treebeard==4.7
django-cors-headers==4.6.0
Expand All @@ -48,9 +48,9 @@ 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-factoryboy==2.7.0
pytest-html==4.1.1
pytest-asyncio==0.23.5
pytest-xdist==3.6.1
Expand Down
2 changes: 1 addition & 1 deletion vue/src/components/ShoppingLineItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default {
if (e.recipe_mealplan !== null) {
let recipe_name = e.recipe_mealplan.recipe_name
if (recipes.indexOf(recipe_name) === -1) {
if (recipes.indexOf(recipe_name) === -1 && recipe_name !== undefined) {
recipes.push(recipe_name.substring(0, 14) + (recipe_name.length > 14 ? '..' : ''))
}
Expand Down

0 comments on commit cb5ef96

Please sign in to comment.