From 8bc361ee7c47676858d0f4e9590dc7dd47e089f7 Mon Sep 17 00:00:00 2001 From: MaxJa4 <74194322+MaxJa4@users.noreply.github.com> Date: Fri, 11 Mar 2022 10:16:55 +0100 Subject: [PATCH 01/12] Updated dependencies of manual setup - apt install of nodejs installs an unsupported (V10.X) version - dependencies for python-ldap were missing --- docs/install/manual.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/install/manual.md b/docs/install/manual.md index e37334dda..6ebadcf97 100644 --- a/docs/install/manual.md +++ b/docs/install/manual.md @@ -19,9 +19,25 @@ Give the user permissions: `chown -R recipes:www-data /var/www/recipes` Create virtual env: `python3.9 -m venv /var/www/recipes` -Install Javascript Tools +Install Javascript Tools (nodejs >= 12 required) +```shell +### Just use one of these possibilites! +# Using Ubuntu +curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - +sudo apt-get install -y nodejs + +# Using Debian, as root +curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - +apt-get install -y nodejs + +# Using a RPM based distro +## ... as root +curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash - + +## ... no root privileges +curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - +``` ```shell -sudo apt install nodejs sudo npm install --global yarn ``` @@ -31,6 +47,12 @@ sudo npm install --global yarn sudo apt install libpq-dev postgresql ``` +### Install LDAP requirements + +```shell +sudo apt install libsasl2-dev python-dev libldap2-dev libssl-dev +``` + ###Install project requirements !!! warning "Update" From 34f70e4ba7aef7c0f64a421cab0ba75910b74bf5 Mon Sep 17 00:00:00 2001 From: MaxJa4 <74194322+MaxJa4@users.noreply.github.com> Date: Fri, 11 Mar 2022 10:18:51 +0100 Subject: [PATCH 02/12] Fixed formatting --- 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 6ebadcf97..2a7bdb080 100644 --- a/docs/install/manual.md +++ b/docs/install/manual.md @@ -53,7 +53,7 @@ sudo apt install libpq-dev postgresql sudo apt install libsasl2-dev python-dev libldap2-dev libssl-dev ``` -###Install project requirements +### Install project requirements !!! warning "Update" Dependencies change with most updates so the following steps need to be re-run with every update or else the application might stop working. From 36fbbed1b0321f27e6b2fb048c4afb22805b6477 Mon Sep 17 00:00:00 2001 From: MaxJa4 <74194322+MaxJa4@users.noreply.github.com> Date: Fri, 11 Mar 2022 10:21:50 +0100 Subject: [PATCH 03/12] Added link to docs of nodejs installation --- docs/install/manual.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/install/manual.md b/docs/install/manual.md index 2a7bdb080..3d6231dc6 100644 --- a/docs/install/manual.md +++ b/docs/install/manual.md @@ -41,6 +41,9 @@ curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - sudo npm install --global yarn ``` +!!! info "NodeJS installation issues" + If you run into problems with the NodeJS installation, please refer to the [official documentation](https://github.com/nodesource/distributions/blob/master/README.md). + ### Install postgresql requirements ```shell From c0bd0d49ae346ec0823c1d0c404da7e13fc1ab1f Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 11 Mar 2022 13:40:59 +0100 Subject: [PATCH 04/12] Update bind mounts to use absolute paths Docker bind mounts have to use absolute paths, so the docker run command fails when using the relative mounts ./staticfiles and ./mediafiles. This may be supported again (https://github.com/docker/cli/issues/1203) --- docs/install/docker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/install/docker.md b/docs/install/docker.md index dea392b38..b31c8a8f2 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -14,8 +14,8 @@ It can be run and accessed on port 80 using: ```shell docker run -d \ - -v ./staticfiles:/opt/recipes/staticfiles \ - -v ./mediafiles:/opt/recipes/mediafiles \ + -v "$(pwd)"/staticfiles:/opt/recipes/staticfiles \ + -v "$(pwd)"/mediafiles:/opt/recipes/mediafiles \ -p 80:8080 \ -e SECRET_KEY=YOUR_SECRET_KEY \ -e DB_ENGINE=django.db.backends.postgresql \ From b9289e2685cf683a47a1367daae8d1609eee6332 Mon Sep 17 00:00:00 2001 From: smilerz Date: Fri, 11 Mar 2022 07:27:42 -0600 Subject: [PATCH 05/12] fix sql debug button in search --- vue/src/apps/RecipeSearchView/RecipeSearchView.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue index 72e97f7d3..4224b0d96 100644 --- a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue +++ b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue @@ -1148,7 +1148,10 @@ export default { }, showSQL: function () { let params = this.buildParams() - this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params).then((result) => {}) + params.options.query.debug = true + this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params).then((result) => { + console.log(result.data) + }) }, // TODO refactor to combine with load KeywordChildren loadFoodChildren({ action, parentNode, callback }) { From cb835b033c0ba7029f3d1560384fc319618bb67e Mon Sep 17 00:00:00 2001 From: brad Date: Fri, 11 Mar 2022 18:16:32 -0700 Subject: [PATCH 06/12] Updates Docker installation docs Adds warning that the jwilder nginx-proxy reduces file size upload to 1 MB. --- docs/install/docker.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/install/docker.md b/docs/install/docker.md index dea392b38..674b68c76 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -109,6 +109,9 @@ in combination with [jrcs's letsencrypt companion](https://hub.docker.com/r/jrcs Please refer to the appropriate documentation on how to setup the reverse proxy and networks. +!!!!!!warning "Adjust client_max_body_size" + By using jwilder's Nginx-proxy, you will be restricted to 1 MB file size uploads. This can be resolved by adjusting the `client_max_body_size` variable in the jwilder nginx configuration. + Remember to add the appropriate environment variables to the `.env` file: ``` From a95688835575bcaf41476ee3521355e36f5b4457 Mon Sep 17 00:00:00 2001 From: brad Date: Fri, 11 Mar 2022 18:18:09 -0700 Subject: [PATCH 07/12] Fixes wording --- docs/install/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/docker.md b/docs/install/docker.md index 674b68c76..8d0d5a348 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -110,7 +110,7 @@ in combination with [jrcs's letsencrypt companion](https://hub.docker.com/r/jrcs Please refer to the appropriate documentation on how to setup the reverse proxy and networks. !!!!!!warning "Adjust client_max_body_size" - By using jwilder's Nginx-proxy, you will be restricted to 1 MB file size uploads. This can be resolved by adjusting the `client_max_body_size` variable in the jwilder nginx configuration. + By using jwilder's Nginx-proxy, uploads will be restricted to 1 MB file size. This can be resolved by adjusting the `client_max_body_size` variable in the jwilder nginx configuration. Remember to add the appropriate environment variables to the `.env` file: From 5cf58a32dcdc93a2e0f5aa2fdbd21e59448a4414 Mon Sep 17 00:00:00 2001 From: brad Date: Fri, 11 Mar 2022 18:19:48 -0700 Subject: [PATCH 08/12] Updates formating --- docs/install/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/docker.md b/docs/install/docker.md index 8d0d5a348..835347dd3 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -110,7 +110,7 @@ in combination with [jrcs's letsencrypt companion](https://hub.docker.com/r/jrcs Please refer to the appropriate documentation on how to setup the reverse proxy and networks. !!!!!!warning "Adjust client_max_body_size" - By using jwilder's Nginx-proxy, uploads will be restricted to 1 MB file size. This can be resolved by adjusting the `client_max_body_size` variable in the jwilder nginx configuration. + By using jwilder's Nginx-proxy, uploads will be restricted to 1 MB file size. This can be resolved by adjusting the ```client_max_body_size``` variable in the jwilder nginx configuration. Remember to add the appropriate environment variables to the `.env` file: From 4a5af48f33f3cd83edff5e0356e6bfe4a62bc488 Mon Sep 17 00:00:00 2001 From: ivo Date: Mon, 14 Mar 2022 18:51:12 +0000 Subject: [PATCH 09/12] Added translation using Weblate (Portuguese) --- vue/src/locales/pt.json | 380 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 380 insertions(+) create mode 100644 vue/src/locales/pt.json diff --git a/vue/src/locales/pt.json b/vue/src/locales/pt.json new file mode 100644 index 000000000..737bb6d57 --- /dev/null +++ b/vue/src/locales/pt.json @@ -0,0 +1,380 @@ +{ + "warning_feature_beta": "", + "err_fetching_resource": "", + "err_creating_resource": "", + "err_updating_resource": "", + "err_deleting_resource": "", + "err_moving_resource": "", + "err_merging_resource": "", + "success_fetching_resource": "", + "success_creating_resource": "", + "success_updating_resource": "", + "success_deleting_resource": "", + "success_moving_resource": "", + "success_merging_resource": "", + "file_upload_disabled": "", + "step_time_minutes": "", + "confirm_delete": "", + "import_running": "", + "all_fields_optional": "", + "convert_internal": "", + "show_only_internal": "", + "show_split_screen": "", + "Log_Recipe_Cooking": "", + "External_Recipe_Image": "", + "Add_to_Shopping": "", + "Add_to_Plan": "", + "Step_start_time": "", + "Sort_by_new": "", + "Table_of_Contents": "", + "Recipes_per_page": "", + "Show_as_header": "", + "Hide_as_header": "", + "Add_nutrition_recipe": "", + "Remove_nutrition_recipe": "", + "Copy_template_reference": "", + "Save_and_View": "", + "Manage_Books": "", + "Meal_Plan": "", + "Select_Book": "", + "Select_File": "", + "Recipe_Image": "", + "Import_finished": "", + "View_Recipes": "", + "Log_Cooking": "", + "New_Recipe": "", + "Url_Import": "", + "Reset_Search": "", + "Recently_Viewed": "", + "Load_More": "", + "New_Keyword": "", + "Delete_Keyword": "", + "Edit_Keyword": "", + "Edit_Recipe": "", + "Move_Keyword": "", + "Merge_Keyword": "", + "Hide_Keywords": "", + "Hide_Recipes": "", + "Move_Up": "", + "Move_Down": "", + "Step_Name": "", + "Step_Type": "", + "Make_Header": "", + "Make_Ingredient": "", + "Enable_Amount": "", + "Disable_Amount": "", + "Add_Step": "", + "Keywords": "", + "Books": "", + "Proteins": "", + "Fats": "", + "Carbohydrates": "", + "Calories": "", + "Energy": "", + "Nutrition": "", + "Date": "", + "Share": "", + "Automation": "", + "Parameter": "", + "Export": "", + "Copy": "", + "Rating": "", + "Close": "", + "Cancel": "", + "Link": "", + "Add": "", + "New": "", + "Note": "", + "Success": "", + "Failure": "", + "Ingredients": "", + "Supermarket": "", + "Categories": "", + "Category": "", + "Selected": "", + "min": "", + "Servings": "", + "Waiting": "", + "Preparation": "", + "External": "", + "Size": "", + "Files": "", + "File": "", + "Edit": "", + "Image": "", + "Delete": "", + "Open": "", + "Ok": "", + "Save": "", + "Step": "", + "Search": "", + "Import": "", + "Print": "", + "Settings": "", + "or": "", + "and": "", + "Information": "", + "Download": "", + "Create": "", + "Search Settings": "", + "View": "", + "Recipes": "", + "Move": "", + "Merge": "", + "Parent": "", + "delete_confirmation": "", + "move_confirmation": "", + "merge_confirmation": "", + "create_rule": "", + "move_selection": "", + "merge_selection": "", + "Root": "", + "Ignore_Shopping": "", + "Shopping_Category": "", + "Shopping_Categories": "", + "Edit_Food": "", + "Move_Food": "", + "New_Food": "", + "Hide_Food": "", + "Food_Alias": "", + "Unit_Alias": "", + "Keyword_Alias": "", + "Delete_Food": "", + "No_ID": "", + "Meal_Plan_Days": "", + "merge_title": "", + "move_title": "", + "Food": "", + "Recipe_Book": "", + "del_confirmation_tree": "", + "delete_title": "", + "create_title": "", + "edit_title": "", + "Name": "", + "Type": "", + "Description": "", + "Recipe": "", + "tree_root": "", + "Icon": "", + "Unit": "", + "No_Results": "", + "New_Unit": "", + "Create_New_Shopping Category": "", + "Create_New_Food": "", + "Create_New_Keyword": "", + "Create_New_Unit": "", + "Create_New_Meal_Type": "", + "and_up": "", + "and_down": "", + "Instructions": "", + "Unrated": "", + "Automate": "", + "Empty": "", + "Key_Ctrl": "", + "Key_Shift": "", + "Time": "", + "Text": "", + "Shopping_list": "", + "Added_by": "", + "Added_on": "", + "AddToShopping": "", + "IngredientInShopping": "", + "NotInShopping": "", + "OnHand": "", + "FoodOnHand": "", + "FoodNotOnHand": "", + "Undefined": "", + "Create_Meal_Plan_Entry": "", + "Edit_Meal_Plan_Entry": "", + "Title": "", + "Week": "", + "Month": "", + "Year": "", + "Planner": "", + "Planner_Settings": "", + "Period": "", + "Plan_Period_To_Show": "", + "Periods": "", + "Plan_Show_How_Many_Periods": "", + "Starting_Day": "", + "Meal_Types": "", + "Meal_Type": "", + "Clone": "", + "Drag_Here_To_Delete": "", + "Meal_Type_Required": "", + "Title_or_Recipe_Required": "", + "Color": "", + "New_Meal_Type": "", + "AddFoodToShopping": "", + "RemoveFoodFromShopping": "", + "DeleteShoppingConfirm": "", + "IgnoredFood": "", + "Add_Servings_to_Shopping": "", + "Week_Numbers": "", + "Show_Week_Numbers": "", + "Export_As_ICal": "", + "Export_To_ICal": "", + "Cannot_Add_Notes_To_Shopping": "", + "Added_To_Shopping_List": "", + "Shopping_List_Empty": "", + "Next_Period": "", + "Previous_Period": "", + "Current_Period": "", + "Next_Day": "", + "Previous_Day": "", + "Inherit": "", + "InheritFields": "", + "FoodInherit": "", + "ShowUncategorizedFood": "", + "GroupBy": "", + "SupermarketCategoriesOnly": "", + "MoveCategory": "", + "CountMore": "", + "IgnoreThis": "", + "DelayFor": "", + "Warning": "", + "NoCategory": "", + "InheritWarning": "", + "ShowDelayed": "", + "Completed": "", + "OfflineAlert": "", + "shopping_share": "", + "shopping_auto_sync": "", + "mealplan_autoadd_shopping": "", + "mealplan_autoexclude_onhand": "", + "mealplan_autoinclude_related": "", + "default_delay": "", + "shopping_share_desc": "", + "shopping_auto_sync_desc": "", + "mealplan_autoadd_shopping_desc": "", + "mealplan_autoexclude_onhand_desc": "", + "mealplan_autoinclude_related_desc": "", + "default_delay_desc": "", + "filter_to_supermarket": "", + "Coming_Soon": "", + "Auto_Planner": "", + "New_Cookbook": "", + "Hide_Keyword": "", + "Clear": "", + "err_move_self": "", + "nothing": "", + "err_merge_self": "", + "show_sql": "", + "filter_to_supermarket_desc": "", + "CategoryName": "", + "SupermarketName": "", + "CategoryInstruction": "", + "shopping_recent_days_desc": "", + "shopping_recent_days": "", + "create_shopping_new": "", + "download_pdf": "", + "download_csv": "", + "csv_delim_help": "", + "csv_delim_label": "", + "SuccessClipboard": "", + "copy_to_clipboard": "", + "csv_prefix_help": "", + "csv_prefix_label": "", + "copy_markdown_table": "", + "in_shopping": "", + "DelayUntil": "", + "Pin": "", + "mark_complete": "", + "QuickEntry": "", + "shopping_add_onhand_desc": "", + "shopping_add_onhand": "", + "related_recipes": "", + "today_recipes": "", + "sql_debug": "", + "remember_search": "", + "remember_hours": "", + "tree_select": "", + "OnHand_help": "", + "ignore_shopping_help": "", + "shopping_category_help": "", + "food_recipe_help": "", + "Foods": "", + "enable_expert": "", + "expert_mode": "", + "simple_mode": "", + "advanced": "", + "fields": "", + "show_keywords": "", + "show_foods": "", + "show_books": "", + "show_rating": "", + "show_units": "", + "show_filters": "", + "not": "", + "save_filter": "", + "filter_name": "", + "left_handed": "", + "left_handed_help": "", + "Custom Filter": "", + "shared_with": "", + "sort_by": "", + "asc": "", + "desc": "", + "date_viewed": "", + "last_cooked": "", + "times_cooked": "", + "date_created": "", + "show_sortby": "", + "search_rank": "", + "make_now": "", + "recipe_filter": "", + "book_filter_help": "", + "review_shopping": "", + "view_recipe": "", + "copy_to_new": "", + "recipe_name": "", + "paste_ingredients_placeholder": "", + "paste_ingredients": "", + "ingredient_list": "", + "explain": "", + "filter": "", + "search_no_recipes": "", + "search_import_help_text": "", + "search_create_help_text": "", + "warning_duplicate_filter": "", + "reset_children": "", + "reset_children_help": "", + "substitute_help": "", + "substitute_siblings_help": "", + "substitute_children_help": "", + "substitute_siblings": "", + "substitute_children": "", + "SubstituteOnHand": "", + "ChildInheritFields": "", + "ChildInheritFields_help": "", + "InheritFields_help": "", + "last_viewed": "", + "created_on": "", + "updatedon": "", + "advanced_search_settings": "", + "nothing_planned_today": "", + "no_pinned_recipes": "", + "Planned": "", + "Pinned": "", + "Quick actions": "", + "Ratings": "", + "Internal": "", + "Units": "", + "Random Recipes": "", + "parameter_count": "", + "select_keyword": "", + "add_keyword": "", + "select_file": "", + "select_recipe": "", + "select_unit": "", + "select_food": "", + "remove_selection": "", + "empty_list": "", + "Select": "", + "Supermarkets": "", + "User": "", + "Keyword": "", + "Advanced": "", + "Page": "", + "Reset": "" +} From 96bd66f9e6646ae6706a5effdab814c640308128 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 15 Mar 2022 11:48:12 +0100 Subject: [PATCH 10/12] fixed telegram bot --- cookbook/views/telegram.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cookbook/views/telegram.py b/cookbook/views/telegram.py index ae04215de..0775bacc4 100644 --- a/cookbook/views/telegram.py +++ b/cookbook/views/telegram.py @@ -1,4 +1,5 @@ import json +import traceback import requests from django.db.models import Q @@ -52,10 +53,10 @@ def hook(request, token): f = ingredient_parser.get_food(food) u = ingredient_parser.get_unit(unit) - ShoppingListEntry.objects.create(food=f, unit=u, amount=amount, original_text=ingredient, created_by=request.user, space=request.space) + ShoppingListEntry.objects.create(food=f, unit=u, amount=amount, original_text=data['message']['text'], created_by=request.user, space=request.space) return JsonResponse({'data': data['message']['text']}) except Exception: - pass + traceback.print_exc() return JsonResponse({}) From 4dd3ba29b6da8163a91dd54b31ee3789be5d3580 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 15 Mar 2022 12:35:13 +0100 Subject: [PATCH 11/12] improved shopping v2 layout a little bit --- .../apps/ShoppingListView/ShoppingListView.vue | 4 ++-- vue/src/components/ShoppingLineItem.vue | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vue/src/apps/ShoppingListView/ShoppingListView.vue b/vue/src/apps/ShoppingListView/ShoppingListView.vue index 087bda807..27767d7c7 100644 --- a/vue/src/apps/ShoppingListView/ShoppingListView.vue +++ b/vue/src/apps/ShoppingListView/ShoppingListView.vue @@ -105,7 +105,7 @@ class="btn dropdown-toggle btn-link text-decoration-none text-dark pr-2 dropdown-toggle-no-caret" @click.stop="openContextMenu($event, s, true)" > - + - {{ i }} + {{ i }} diff --git a/vue/src/components/ShoppingLineItem.vue b/vue/src/components/ShoppingLineItem.vue index 2a92f42d9..cb3b2366b 100644 --- a/vue/src/components/ShoppingLineItem.vue +++ b/vue/src/components/ShoppingLineItem.vue @@ -7,35 +7,35 @@
- + - + - + {{ Object.entries(formatAmount)[0][1] }} {{ Object.entries(formatAmount)[0][0] }} - +
{{ x[1] }}   {{ x[0] }}
- + {{ formatFood }} @@ -179,7 +179,7 @@ export default { formatAmount: function () { let amount = {} this.entries.forEach((entry) => { - let unit = entry?.unit?.name ?? "----" + let unit = entry?.unit?.name ?? "---" if (entry.amount) { if (amount[unit]) { amount[unit] += entry.amount From 4cf8b72e3f865cd0755aff412e0fdf65fe312c14 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 15 Mar 2022 12:50:41 +0100 Subject: [PATCH 12/12] removed OT from sle --- cookbook/views/telegram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/views/telegram.py b/cookbook/views/telegram.py index 0775bacc4..43c4b5d0c 100644 --- a/cookbook/views/telegram.py +++ b/cookbook/views/telegram.py @@ -53,7 +53,7 @@ def hook(request, token): f = ingredient_parser.get_food(food) u = ingredient_parser.get_unit(unit) - ShoppingListEntry.objects.create(food=f, unit=u, amount=amount, original_text=data['message']['text'], created_by=request.user, space=request.space) + ShoppingListEntry.objects.create(food=f, unit=u, amount=amount, created_by=request.user, space=request.space) return JsonResponse({'data': data['message']['text']}) except Exception: