Commit Graph

863 Commits

Author SHA1 Message Date
Hayden
ef481a6a9c New Crowdin updates (#1672)
* New translations en-US.json (Turkish)

* New translations en-US.json (Serbian (Cyrillic))

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Polish)

* New translations en-US.json (Portuguese)

* New translations en-US.json (Russian)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Swedish)

* New translations en-US.json (Japanese)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (Chinese Simplified)

* New translations en-US.json (Chinese Traditional)

* New translations en-US.json (Vietnamese)

* New translations en-US.json (Portuguese, Brazilian)

* New translations en-US.json (English, United Kingdom)

* New translations en-US.json (Korean)

* New translations en-US.json (Italian)

* New translations en-US.json (French)

* New translations en-US.json (Bulgarian)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Dutch)

* New translations en-US.json (Romanian)

* New translations en-US.json (Spanish)

* New translations en-US.json (Afrikaans)

* New translations en-US.json (Arabic)

* New translations en-US.json (Catalan)

* New translations en-US.json (Hungarian)

* New translations en-US.json (Czech)

* New translations en-US.json (Danish)

* New translations en-US.json (German)

* New translations en-US.json (Greek)

* New translations en-US.json (Finnish)

* New translations en-US.json (Hebrew)

* New translations en-US.json (French, Canada)

* New translations en-US.json (German)

* New translations en-US.json (German)

* New translations en-US.json (Turkish)

* New translations en-US.json (French, Canada)

* New translations en-US.json (French, Canada)

* New translations en-US.json (Danish)

* New translations en-US.json (Danish)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)
2022-09-27 18:55:35 -08:00
Michael Genson
796e55b7d5 refactor: webhook events (#1661)
* refactored EventBusService to work outside FastAPI

* extended event models

* refactored webhooks to run through event bus

* added basic webhook test route

* changed get_all to page_all

* fixed incorrectly implemented Vue variables

* fixed broken webhook test

* changed factory from staticmethod to classmethod

* made query boundary definitions easier to read
2022-09-27 18:55:20 -08:00
Michael Genson
8271c3001e feat: add support for API extras on shopping lists, shopping list items, and food data (#1619)
* added api extras to other tables
genericized api extras model from recipes
added extras column to ingredient foods
added extras column to shopping lists
added extras column to shopping list items

* updated alembic version test

* made mypy happy

* added TODO on test that does nothing

* added extras tests for lists, items, and foods

* added docs for new extras

* modified alembic versions to eliminate branching
2022-09-27 18:53:22 -08:00
Hayden
124ec3743a New Crowdin updates (#1667)
* New translations en-US.json (Norwegian)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Dutch)
2022-09-25 15:17:56 -08:00
Ben Boeckel
2e6b877ba9 docs: fix typos (#1665)
* docs: fix typos

* typos: fix typos found by `codespell` across the codebase

* docs: fix `macOS` spelling

* docs: fix `authentification` terminology

"Authentification" is not a thing.

* docs: fix `localhost` typo in example link

* typos: fix in-code typos

These are potentially higher risk, but no other mentions of these typos
show up in the codebase.
2022-09-25 15:17:27 -08:00
Hayden
39adea4ee3 feat (WIP): bring png OCR scanning support (#1670)
* Add pytesseract

* Add simple ocr endpoint

replace extension argument

* feat/ocr-editor gui

* fix frontend linting issues

* Add service unit tests

* Add split text modes & single ingredient/instruction editing

* make split mode really reactive

* Remove default step and ingredient

* make the linter haappy

* Accept only image uploads

* Add automatic recipe title suggestion

* Correct regex

* fix incorrect array.map method usage

* make the linter happy again

* Swap route to use asset name

* Rearange buttons

* fix test data

* feat: Allow making image the recipe image

* Add translation

* Make the linter happy

* Restrict function setPropertyValueByPath generic

* Restrict template literal type

* Add a more friendly icon to creation page

* update poetry lock file

* Correct sloppy ocr classes

* Make MyPy happy

* Rewrite safer tests

* Add tesseract to backend test CI container dependencies

* Make canvas element a component global

* Remove unwanted spaces in selected text

* Add way to know if recipe was created with ocr

* Access to ocr-editor for ocr recipes

* Update Alembic revision

* Make the frontend build

* Fix scrolling offset bug

* Allow creation of recipes with custom settings

* Fix rebasing mistakes

* Add format_tsv_output test

* Exclude the tests data directory only

* Enforce camelCase for frontend functions

* Remove import of unused component

* Fix type and class initialization

* Add multi-language support

* Highlight words in mount

* Fix image ratio bug

* Better ocr creation page

* Revert awkward feature to scroll in Selection mode

* Rebasing alembic migrations sux

* Remove obsolete getShared function

* Add function docstring

* Move down ocr creation option

* Make toolbar icons more generic

* Show help at the bottom of the page

* move ocr types to own file

* Use template ref for the canvas

* Use i18n.tc to get strings directly

* Correct naming mistake

* Move Ocr editor to own directory

* Create Ocr Editor parts

* Safeguard recipe properties access

* Add loading frontend animation due to longer request time

* minor cleanup chores

Co-authored-by: Miroito <alban.vachette@gmail.com>
2022-09-25 15:00:45 -08:00
Elegant
11eeab1b51 feat: LDAP improvements (#1487)
* Use Base DN for LDAP and fetch user attrs

Requires that a Base DN be set for LDAP
Set `full_name` and `email` based on LDAP attributes when creating user

* Add support for secure LDAP

Allow insecure LDAP connection (disabled by default)
Use CA when connecting to secure LDAP server

* Added missing quotes to example

* Update security.py

* Update security.py formatting

* Update security.py

Switched to f-String formatting

* formatting

* Update test_security.py

Added at attributes for testing

* Update test_security.py

Modified tests for base DN

* Update test_security.py

Set proper base DN for testing

* Update test_security.py

Corrected testing for LDAP

* Update test_security.py

Defined base_dn

* Authenticated user not in base DN

Add check for when user can authenticate but is not in base DN

* Update test_security.py

LDAP user cannot exist as it is searched before it is created and the list returns False

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-09-15 19:33:36 -08:00
Hayden
1488b75b65 New Crowdin updates (#1645)
* New translations en-US.json (French)

* New translations en-US.json (Turkish)

* New translations en-US.json (Turkish)

* New translations en-US.json (Turkish)
2022-09-15 15:53:39 -08:00
Hayden
b56b987f5a chore: fix demo links (#1639)
* remove matrix builds

* replace beta.mealie.io w/ demo.mealie.io
2022-09-12 13:07:51 -08:00
Hayden
5829ebec91 New Crowdin updates (#1618)
* New translations en-US.json (Czech)

* New translations en-US.json (Swedish)

* New translations en-US.json (Polish)

* New translations en-US.json (Portuguese)

* New translations en-US.json (Russian)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Serbian (Cyrillic))

* New translations en-US.json (Turkish)

* New translations en-US.json (Dutch)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (Chinese Simplified)

* New translations en-US.json (Chinese Traditional)

* New translations en-US.json (Vietnamese)

* New translations en-US.json (Portuguese, Brazilian)

* New translations en-US.json (English, United Kingdom)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Romanian)

* New translations en-US.json (Danish)

* New translations en-US.json (French)

* New translations en-US.json (Spanish)

* New translations en-US.json (Afrikaans)

* New translations en-US.json (Arabic)

* New translations en-US.json (Bulgarian)

* New translations en-US.json (Catalan)

* New translations en-US.json (German)

* New translations en-US.json (Korean)

* New translations en-US.json (Greek)

* New translations en-US.json (Finnish)

* New translations en-US.json (Hebrew)

* New translations en-US.json (Hungarian)

* New translations en-US.json (Italian)

* New translations en-US.json (Japanese)

* New translations en-US.json (French, Canada)

* New translations en-US.json (German)

* New translations en-US.json (Swedish)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (Czech)

* New translations en-US.json (Catalan)

* New translations en-US.json (Catalan)

* New translations en-US.json (Czech)

* New translations en-US.json (Catalan)

* New translations en-US.json (Catalan)

* New translations en-US.json (Catalan)

* New translations en-US.json (Czech)

* New translations en-US.json (Spanish)

* New translations en-US.json (Catalan)

* New translations en-US.json (Spanish)

* New translations en-US.json (Catalan)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (Catalan)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (Catalan)

* New translations en-US.json (Catalan)

* New translations en-US.json (Catalan)

* New translations en-US.json (Danish)

* New translations en-US.json (Catalan)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (Turkish)

* New translations en-US.json (Turkish)

* New translations en-US.json (Turkish)
2022-09-10 09:14:22 -08:00
Michael Genson
2007bcfe28 feat: added "cookbook" filter to recipe pagination to serve frontend (#1609)
* added cookbook filter to recipe pagination

* fixed wrong filter var

* restored cookbook sorting

* reverted unnecessary var change
2022-09-10 08:59:30 -08:00
Hayden
18b2c92a76 feat: public recipe access (#1610)
* initial public explorer API endpoint

* public API endpoint

* cleanup recipe page

* wip: init explorer page

* use public URLs for shared recipes

* refactor private share tokens to use shared page
2022-08-28 20:08:33 -08:00
Hayden
9ea5e6584f perf: use HEAD method to determine best image (#1614) 2022-08-28 14:14:02 -08:00
Michael Genson
23c039b42d refactor: event bus refactor (#1574)
* refactored event dispatching
added EventDocumentType and EventOperation to Event
added event listeners to bulk recipe changes
overhauled shopping list item events to be more useful
modified shopping list item repo to return more information

* added internal documentation for event types

* renamed message_types.py to event_types.py

* added unique event id and fixed instantiation

* generalized event listeners and publishers
moved apprise publisher to new apprise event listener
fixed duplicate message bug with apprise publisher

* added JWT field for user-specified integration id

* removed obselete test notification route

* tuned up existing notification tests

* added dependency to get integration_id from jwt

* added base crud controller to facilitate events

* simplified event publishing

* temporarily fixed test notification
2022-08-27 10:52:45 -08:00
Hayden
2865bcbb04 fix: missing user agent for scraper (#1586)
* set user agent for requests.get

* bump scraper version
2022-08-20 17:54:06 -08:00
Michael Genson
aaeb162dd5 feat: unify recipe card sections (#1560)
* removed unused import

* moved categories/tags to new recipe card section

* nuked old frontend sort code
minor refactoring

* bug fixes

* added backend recipes filter for tools

* removed debug log

* removed unusued props

* fixed sort for recipes by tool

* added tests for getting recipes by tool
2022-08-20 10:59:49 -08:00
Hayden
85448b8a18 New Crowdin updates (#1581)
* New translations en-US.json (Dutch)

* New translations en-US.json (Dutch)

* New translations en-US.json (Dutch)

* New translations en-US.json (Dutch)

* New translations en-US.json (Dutch)

* New translations en-US.json (Dutch)
2022-08-20 10:46:43 -08:00
Hayden
692d91e338 New Crowdin updates (#1566)
* New translations en-US.json (Czech)

* New translations en-US.json (Swedish)

* New translations en-US.json (Polish)

* New translations en-US.json (Portuguese)

* New translations en-US.json (Russian)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Serbian (Cyrillic))

* New translations en-US.json (Turkish)

* New translations en-US.json (Dutch)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (Chinese Simplified)

* New translations en-US.json (Chinese Traditional)

* New translations en-US.json (Vietnamese)

* New translations en-US.json (Portuguese, Brazilian)

* New translations en-US.json (English, United Kingdom)

* New translations en-US.json (Norwegian)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Romanian)

* New translations en-US.json (Danish)

* New translations en-US.json (French)

* New translations en-US.json (Spanish)

* New translations en-US.json (Afrikaans)

* New translations en-US.json (Arabic)

* New translations en-US.json (Bulgarian)

* New translations en-US.json (Catalan)

* New translations en-US.json (German)

* New translations en-US.json (Korean)

* New translations en-US.json (Greek)

* New translations en-US.json (Finnish)

* New translations en-US.json (Hebrew)

* New translations en-US.json (Hungarian)

* New translations en-US.json (Italian)

* New translations en-US.json (Japanese)

* New translations en-US.json (French, Canada)

* New translations en-US.json (German)

* New translations en-US.json (Danish)

* New translations en-US.json (Danish)

* New translations en-US.json (German)

* New translations en-US.json (Danish)

* New translations en-US.json (German)

* New translations en-US.json (German)

* New translations en-US.json (German)

* New translations en-US.json (German)

* New translations en-US.json (German)

* New translations en-US.json (Arabic)

* New translations en-US.json (German)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (Ukrainian)

* New translations en-US.json (German)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (Spanish)

* New translations en-US.json (French)
2022-08-19 11:43:31 -08:00
Hayden
ad9ede20a2 fix: remove Config.get_attr config and use defaults for tags (#1559) 2022-08-14 11:31:29 -08:00
Hayden
3985713cbd fix: user-feedback-on-schema-mismatch (#1558)
* validate schema version on restore

* show user error on backup failure
2022-08-14 11:06:35 -08:00
Hayden
7adcc86d03 feat: bulk recipe settings update (#1557)
* extract switches from menu component

* implement bulk updater for settings

* fix browser cache api calls issue

* add frontend for bulk settings modifications
2022-08-14 10:37:44 -08:00
Hayden
54c4f19a5c security: enforce min length for user password (#1555)
* fix typing on auth context

* extract user password strength meter

* fix broken useToggle method

* extend form to accept arguments for validators

* enforce password length on update

* fix user password change form
2022-08-13 21:38:26 -08:00
Hayden
b3c41a4bd0 security: implement user lockout (#1552)
* add data-types required for login security

* implement user lockout checking at login

* cleanup legacy patterns

* expose passwords in test_user

* test user lockout after bad attempts

* test user service

* bump alembic version

* save increment to database

* add locked_at to datetime transformer on import

* do proper test cleanup

* implement scheduled task

* spelling

* document env variables

* implement context manager for session

* use context manager

* implement reset script

* cleanup generator

* run generator

* implement API endpoint for resetting locked users

* add button to reset all locked users

* add info when account is locked

* use ignore instead of expect-error
2022-08-13 13:18:12 -08:00
Ryan Quinn
ff2334a489 fix: email typos (#1549)
* "your" -> "you're" in invitation email

* "below" -> "above" in all emails
2022-08-12 08:54:41 -08:00
Hayden
71d3db7aef refactor: move dependencies to controllers (#1550)
* Moves dependencies directly to controllers
* Reduces use of @cached_property - (I have a suspicion that this is a factor in memory usage)
* reduce duplicate ways to access the same property on a controller.
2022-08-11 20:13:22 -08:00
Hayden
e5bf7bce17 fix: case-sensitive-password-reset (#1545)
* make password reset case insensitive

* update test to check for case insensitive
2022-08-09 21:10:00 -08:00
Michael Genson
f45e2587a0 feat: category and tag filters to recipe pagination route (#1508)
* fixed incorrect response model

* added category and tag filters

* moved categories and tags params to route and
changed to query array param

* type fixes

* added category and tag tests
2022-08-09 14:01:59 -08:00
Hayden
e82e7d0fb3 New Crowdin updates (#1527)
* New translations en-US.json (Swedish)

* New translations en-US.json (Swedish)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)

* New translations en-US.json (Dutch)

* New translations en-US.json (Dutch)
2022-08-08 18:42:09 -08:00
Maka0
a7c6e89dfa feat: added gosu & updated run.sh to switch to the dedicated user (#1395)
Co-authored-by: Maka0 <360614-Maka0@users.noreply.gitlab.com>
2022-08-08 18:39:59 -08:00
Philipp Fischbeck
34cd6eb687 fix: validate OpenAPI spec (#1528)
* init api check test

* Fix openAPI issues

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-08-06 16:54:29 -08:00
Hayden
11478134a1 security: restrict backup file upload (#1522) 2022-08-02 12:53:58 -08:00
Hayden
5fca94dd45 New Crowdin updates (#1519)
* New translations en-US.json (French, Canada)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)

* New translations en-US.json (Slovak)
2022-08-02 10:29:45 -08:00
Hayden
13850cda1f security: multiple reported CVE fixes (#1515)
* update out of date license

* update typing / refactor

* fix arbitrarty path injection

* use markdown sanatizer to prevent XSS CWE-79

* fix CWE-918 SSRF by validating url and mime type

* add security docs

* update recipe-scrapers

* resolve DOS from arbitrary url

* update changelog

* bump version

* add ref to #1506

* add #1511 to changelog

* use requests decoder

* actually fix encoding issue
2022-07-31 13:10:20 -08:00
Michael Genson
3d4e5441dd chore: backend page_all route cleanup (#1483)
* refactored to remove duplicate code

* refactored meal plan slice to use a query filter
2022-07-26 17:43:25 -08:00
Hayden
f00280e32b New Crowdin updates (#1480)
* New translations en-US.json (Dutch)

* New translations en-US.json (Czech)

* New translations en-US.json (German)
2022-07-26 17:41:33 -08:00
Hayden
9e6a720cf1 New Crowdin updates (#1455)
* New translations en-US.json (Swedish)

* New translations en-US.json (Swedish)

* New translations en-US.json (Swedish)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Lithuanian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Swedish)

* New translations en-US.json (Swedish)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (Slovenian)

* New translations en-US.json (French, Canada)

* New translations en-US.json (French, Canada)

* New translations en-US.json (French, Canada)
2022-07-09 21:17:34 -08:00
Michael Genson
7f50071312 feat: advanced filtering API (#1468)
* created query filter classes

* extended pagination to include query filtering

* added filtering tests

* type improvements

* move type help to dev depedency

* minor type and perf fixes

* breakup test cases

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-07-09 20:57:09 -08:00
Michael Genson
2809cef3b1 fix: mealplan pagination (#1464)
* added pagination to get_slice route

* updated mealplan tests

* renamed vars to match pagination query
2022-07-02 09:44:01 -08:00
Benjamin Pabst
2f7ff6d178 fix: use mtime instead of ctime for backup dates (#1461) 2022-06-27 07:57:09 -08:00
Hayden
157bad0e29 fix: use == operator instead of is_ for sql queries (#1453) 2022-06-26 12:42:13 -08:00
Hayden
f96a584a5d New Crowdin updates (#1452)
* New translations en-US.json (French)

* New translations en-US.json (French)

* New translations en-US.json (French)

* New translations en-US.json (French)

* New translations en-US.json (Danish)

* New translations en-US.json (Italian)

* New translations en-US.json (Italian)

* New translations en-US.json (Italian)

* New translations en-US.json (Greek)

* New translations en-US.json (Greek)
2022-06-26 11:21:57 -08:00
Hayden
7dbb0858bd New Crowdin updates (#1439)
* New translations en-US.json (Dutch)

* New translations en-US.json (Czech)

* New translations en-US.json (Czech)

* New translations en-US.json (Czech)
2022-06-25 12:20:44 -08:00
Michael Genson
cb15db2d27 feat: re-write get all routes to use pagination (#1424)
rewrite get_all routes to use a pagination pattern to allow for better implementations of search, filter, and sorting on the frontend or by any client without fetching all the data. Additionally we added a CI check for running the Nuxt built to confirm that no TS errors were present. Finally, I had to remove the header support for the Shopping lists as the browser caching based off last_updated header was not allowing it to read recent updates due to how we're handling the updated_at property in the database with nested fields. This will have to be looked at in the future to reimplement. I'm unsure how many other routes have a similar issue. 

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-06-25 11:39:38 -08:00
Philipp Fischbeck
c158672d12 fix: add missing types for API token deletion (#1428) 2022-06-21 09:42:03 -08:00
Michael Genson
292bf7068a feat: added "last-modified" header to supported record types (#1379)
* fixed type error

* exposed created/updated timestamps to shopping list schema

* added custom route to mix in "last-modified" header when available in CRUD routes

* mixed in MealieCrudRoute to APIRouters

* added HEAD route for shopping lists/list-items

* replaced default serializer with FastAPI's
2022-06-21 09:41:14 -08:00
Michael Genson
efffe26a19 fix: sort recent recipes by created_at instead of date_added (#1417)
* added staticmethod decorators to avoid mypy error

* exposed created and updated timestamps to schema

* changed default sort from date_added to created_at

* explicitely sort recent recipes by created_at

* removed static method and replaced w/ type: ignore
2022-06-19 10:08:26 -08:00
Hayden
8b054fd945 New Crowdin updates (#1406)
* New translations en-US.json (Polish)

* New translations en-US.json (Polish)

* New translations en-US.json (Polish)

* New translations en-US.json (Polish)
2022-06-19 10:03:39 -08:00
Hayden
5a053cdcd6 feat: mealplan-webhooks (#1403)
* fix type errors on event bus

* webhooks fields required for new implementation

* db migration

* wip: webhook query + tests and stub function

* ignore type checker error

* type and method cleanup

* datetime and time utc validator

* update testing code for utc scheduled time

* fix file cmp function call

* update version_number

* add support for translating "time" objects when restoring backup

* bump recipe-scrapers

* use specific import syntax

* generate frontend types

* utilize names exports

* use utc times

* add task to scheduler

* implement new scheduler functionality

* stub for type annotation

* implement meal-plan data getter

* add experimental banner
2022-06-17 13:25:47 -08:00
Hayden
b1256f4ad2 fix: fast fail of bulk importer (#1394)
* use continue instead of break

* catch additional error case

* spelling is hard
2022-06-15 18:19:52 -08:00
Hayden
525842e9a1 New Crowdin updates (#1392)
* New translations en-US.json (Ukrainian)

* New translations en-US.json (French)

* New translations en-US.json (Italian)

* New translations en-US.json (German)

* New translations en-US.json (Danish)

* New translations en-US.json (French, Canada)

* New translations en-US.json (Ukrainian)
2022-06-15 18:19:36 -08:00