mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-24 08:43:11 -05:00
Compare commits
497 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7931e383b2 | ||
|
|
7bfb8c78a6 | ||
|
|
9a2b2a59a2 | ||
|
|
0c0ff8f19d | ||
|
|
6bbd9a162e | ||
|
|
4d6fc9a4c9 | ||
|
|
53c89b340a | ||
|
|
dc64484b8e | ||
|
|
aabab73310 | ||
|
|
542d0e5218 | ||
|
|
a3a21eb533 | ||
|
|
b0cc7c4c25 | ||
|
|
e80ba7dff3 | ||
|
|
bdac51bae2 | ||
|
|
f4827abc1d | ||
|
|
63a180ef2c | ||
|
|
a062a4beaa | ||
|
|
4831adb0f3 | ||
|
|
97550899d0 | ||
|
|
da11204cd7 | ||
|
|
9795b4c553 | ||
|
|
3e1adfa65d | ||
|
|
88214cd61f | ||
|
|
f1b53483da | ||
|
|
5ccac83d08 | ||
|
|
5594b303bc | ||
|
|
58100d0515 | ||
|
|
e2033b2d67 | ||
|
|
5e0f8a4bf7 | ||
|
|
477899fce3 | ||
|
|
04d481fcbf | ||
|
|
5572e51933 | ||
|
|
44915ace12 | ||
|
|
906a143363 | ||
|
|
c41bfbab1e | ||
|
|
69fca013d8 | ||
|
|
24a17e4001 | ||
|
|
6cbd004fb9 | ||
|
|
5d8210d570 | ||
|
|
8d6dc1c6ee | ||
|
|
0e520ba43c | ||
|
|
a9b40cd862 | ||
|
|
ba48e9414c | ||
|
|
72aa1b2514 | ||
|
|
b4f07f9d62 | ||
|
|
eb36912e5c | ||
|
|
d923b4c7fa | ||
|
|
4ecf88379c | ||
|
|
857c8d42e2 | ||
|
|
982802c427 | ||
|
|
4d1381c055 | ||
|
|
adab596683 | ||
|
|
e08fc4e25e | ||
|
|
e8ee37fd43 | ||
|
|
bfe249dc42 | ||
|
|
15989e0c93 | ||
|
|
9af06ce442 | ||
|
|
22fc29742a | ||
|
|
20b1b3de35 | ||
|
|
82d930e645 | ||
|
|
d96c36333b | ||
|
|
b220cd6431 | ||
|
|
598b0f3707 | ||
|
|
c18b9d3184 | ||
|
|
e64d070603 | ||
|
|
d843370c07 | ||
|
|
269be953ce | ||
|
|
9f7d74aecf | ||
|
|
4a0a8e8a5e | ||
|
|
75895cab79 | ||
|
|
be0cdee8b7 | ||
|
|
6024c8bc05 | ||
|
|
b3241d3e8b | ||
|
|
01b9987812 | ||
|
|
4e613e15f0 | ||
|
|
5298bdc90f | ||
|
|
2a6bb7d444 | ||
|
|
21f1d46b6d | ||
|
|
df15a9e74e | ||
|
|
f53cae7c7b | ||
|
|
219138fce1 | ||
|
|
4634ad5666 | ||
|
|
eab7c0d9e5 | ||
|
|
4afb767375 | ||
|
|
a49c32e663 | ||
|
|
5d55e4b4ff | ||
|
|
98c5d142eb | ||
|
|
c0db6ff3d1 | ||
|
|
b71310cdaf | ||
|
|
91fb750768 | ||
|
|
7f1139618d | ||
|
|
42b2bc7c15 | ||
|
|
583bd742fb | ||
|
|
af86ed2028 | ||
|
|
80dc1dcaad | ||
|
|
90e184c0fc | ||
|
|
393103662f | ||
|
|
6e2957fb1e | ||
|
|
e7a668e64e | ||
|
|
88577b696b | ||
|
|
289038ba17 | ||
|
|
4aec294c26 | ||
|
|
99a13bd0c4 | ||
|
|
3bd4353685 | ||
|
|
109ec651cc | ||
|
|
166582acf4 | ||
|
|
4bc88e653f | ||
|
|
94e91d3602 | ||
|
|
d6ce607a4e | ||
|
|
9e8822fabe | ||
|
|
0734ec9ce8 | ||
|
|
f4f2b863e0 | ||
|
|
a7fcb6c84d | ||
|
|
abcee51d0c | ||
|
|
8b61f95c8c | ||
|
|
e01bb60aab | ||
|
|
bf5340b902 | ||
|
|
985041e61f | ||
|
|
70edf36073 | ||
|
|
15a0d25caa | ||
|
|
445754c5d8 | ||
|
|
831cd9c543 | ||
|
|
abaf6062c6 | ||
|
|
125c3914b3 | ||
|
|
93cb6bf341 | ||
|
|
46fb2b2c5a | ||
|
|
ac2a77b3b0 | ||
|
|
66a6426d15 | ||
|
|
508ae30133 | ||
|
|
e3c642debf | ||
|
|
af9e0f27a3 | ||
|
|
e07467df57 | ||
|
|
55b91bf847 | ||
|
|
58fc46af9f | ||
|
|
8e4fe55df1 | ||
|
|
f150c3f41e | ||
|
|
36c7ae5b4b | ||
|
|
d1c5a6ed8c | ||
|
|
ca26639525 | ||
|
|
89982f3e5f | ||
|
|
8485b17490 | ||
|
|
5c57b3dd1a | ||
|
|
4c8bbdcde2 | ||
|
|
2607066570 | ||
|
|
8b7c8be51d | ||
|
|
c70a5cb72c | ||
|
|
c610ec1344 | ||
|
|
61becdbec7 | ||
|
|
78d2a3b8aa | ||
|
|
a4c3b0da71 | ||
|
|
3d3279738b | ||
|
|
495d643ed9 | ||
|
|
9094d24e50 | ||
|
|
aa4d0f9958 | ||
|
|
cb821994ae | ||
|
|
b07a3a31f7 | ||
|
|
68ff5f4b1c | ||
|
|
cde9d166a4 | ||
|
|
041145423f | ||
|
|
c227519fb7 | ||
|
|
94223d2903 | ||
|
|
e015c65d92 | ||
|
|
53916badf3 | ||
|
|
c82549ccb4 | ||
|
|
554b3fa749 | ||
|
|
3f263281e7 | ||
|
|
dc47145af6 | ||
|
|
0ccee3584c | ||
|
|
dc8aadc327 | ||
|
|
efbb571bc2 | ||
|
|
1df75328d7 | ||
|
|
85e402ccc3 | ||
|
|
53a1f04562 | ||
|
|
418a8ec72b | ||
|
|
770630bf73 | ||
|
|
89ee7475a6 | ||
|
|
bca5dd8282 | ||
|
|
dabd93c919 | ||
|
|
6991dff3e6 | ||
|
|
b0eece789d | ||
|
|
9fad4a9dce | ||
|
|
22d8c4d5dc | ||
|
|
7be24d3479 | ||
|
|
fbceb61b9a | ||
|
|
1be5bfaef1 | ||
|
|
fac1df31d3 | ||
|
|
6957e2fa74 | ||
|
|
4f02fae284 | ||
|
|
f2615c97e9 | ||
|
|
6b4c9a400d | ||
|
|
cca11b5a12 | ||
|
|
f697a7ee34 | ||
|
|
0d73338e12 | ||
|
|
2f4c6bd500 | ||
|
|
3807778e2f | ||
|
|
ee87a14401 | ||
|
|
ec458a0a08 | ||
|
|
2ff37c86d6 | ||
|
|
b7da3c0f73 | ||
|
|
d799136f0d | ||
|
|
d1d5754c6d | ||
|
|
52662fdce2 | ||
|
|
8df6033c19 | ||
|
|
c23660007e | ||
|
|
786aa2279c | ||
|
|
ab8c3be367 | ||
|
|
8bf8dfd3ed | ||
|
|
b3aa7aeb1a | ||
|
|
0f2b1d8d3a | ||
|
|
4de6391684 | ||
|
|
c3e68b7d8a | ||
|
|
7557d2e818 | ||
|
|
c22a2fc4a8 | ||
|
|
ad94a4f42f | ||
|
|
e6bf3b3acd | ||
|
|
711dd93851 | ||
|
|
2b6d7811ca | ||
|
|
3373abf787 | ||
|
|
741d37f59e | ||
|
|
b38c19ce71 | ||
|
|
1a385e941c | ||
|
|
c6f5b62ad0 | ||
|
|
84dad84326 | ||
|
|
f369c8fd6e | ||
|
|
467cf46c6d | ||
|
|
360b8e21d9 | ||
|
|
0b851e79ec | ||
|
|
faf716cb7e | ||
|
|
46f1ad7941 | ||
|
|
6e1112c73e | ||
|
|
6bd5a82b92 | ||
|
|
cba076b6a4 | ||
|
|
2ff1135b00 | ||
|
|
467b9c6d65 | ||
|
|
176e471276 | ||
|
|
193888fb30 | ||
|
|
13edefbf41 | ||
|
|
fd33468fda | ||
|
|
2a541f081a | ||
|
|
8ab09cf03b | ||
|
|
9e6ae2e514 | ||
|
|
94678fe6e0 | ||
|
|
ed533c8fad | ||
|
|
93f7d15917 | ||
|
|
53aa4dab51 | ||
|
|
92659c64eb | ||
|
|
6f871c6bdb | ||
|
|
f4f511aad6 | ||
|
|
03d384f3a5 | ||
|
|
0c2917a112 | ||
|
|
606a8f03a3 | ||
|
|
2d31c0abf2 | ||
|
|
15c752d428 | ||
|
|
b254cf3833 | ||
|
|
0bd023d8a8 | ||
|
|
aad50f2267 | ||
|
|
fcbc57b392 | ||
|
|
a62299e6ef | ||
|
|
82563fa948 | ||
|
|
7583c56b35 | ||
|
|
b9cc2dc257 | ||
|
|
0dcf81e764 | ||
|
|
3d3763d4b9 | ||
|
|
517727a4b6 | ||
|
|
1c26dff1e9 | ||
|
|
ed1834d945 | ||
|
|
bf8bc88ffb | ||
|
|
6c48eba5f7 | ||
|
|
dc7df0d4aa | ||
|
|
45d5194f19 | ||
|
|
8ad1a15bf1 | ||
|
|
57aeb401b8 | ||
|
|
e15a2f35e2 | ||
|
|
b28e135ceb | ||
|
|
148aca5e85 | ||
|
|
1ac7f90c28 | ||
|
|
413a8a82fc | ||
|
|
72c414bf94 | ||
|
|
b67263e63f | ||
|
|
1673eedff7 | ||
|
|
d3ee5f34f8 | ||
|
|
683f1ac69e | ||
|
|
d6d0f7de71 | ||
|
|
dd0eaac45f | ||
|
|
f8e672c7ac | ||
|
|
2aa9d84d6c | ||
|
|
2c13c4760e | ||
|
|
62bf733548 | ||
|
|
2c72ea17a2 | ||
|
|
06406c86f5 | ||
|
|
b7f7712011 | ||
|
|
4b13686261 | ||
|
|
9fade36014 | ||
|
|
eb1d569e95 | ||
|
|
1099e30a1d | ||
|
|
fa9a2d64f7 | ||
|
|
de142c47df | ||
|
|
c990420a87 | ||
|
|
d772e3bb4f | ||
|
|
bb8080475c | ||
|
|
c1e05f57db | ||
|
|
9ad68542e0 | ||
|
|
83997dbb47 | ||
|
|
b5f3c5bef7 | ||
|
|
ddd97cce10 | ||
|
|
0ecd57a50b | ||
|
|
e4efcee0df | ||
|
|
a6920f057e | ||
|
|
dbb212ceda | ||
|
|
5d5805459a | ||
|
|
3e68920e69 | ||
|
|
91c978a309 | ||
|
|
e7c101c96b | ||
|
|
004f3552c0 | ||
|
|
cd56149371 | ||
|
|
8edea0a7e0 | ||
|
|
df15e97026 | ||
|
|
760462e12f | ||
|
|
60793bb560 | ||
|
|
7c84d3dea5 | ||
|
|
eee1c5733d | ||
|
|
cf0a7ae9c9 | ||
|
|
be80d3e74c | ||
|
|
db1fabf5c8 | ||
|
|
e7e73772e0 | ||
|
|
e5cab0e4d0 | ||
|
|
6a14d5b7db | ||
|
|
57106c4cce | ||
|
|
61c6a991f3 | ||
|
|
6824b3c269 | ||
|
|
6b13166880 | ||
|
|
b2747d77e1 | ||
|
|
fc4d1b88d0 | ||
|
|
8798bd6e55 | ||
|
|
cef61ae29f | ||
|
|
e304d48e84 | ||
|
|
4f1a7c55b9 | ||
|
|
bae7acbc3b | ||
|
|
c0cf6a9aca | ||
|
|
f4570faf1a | ||
|
|
9548a7eb70 | ||
|
|
d5e3a1dacb | ||
|
|
1ce760ec7e | ||
|
|
9e23ed1a07 | ||
|
|
b3885cc3f8 | ||
|
|
5da990abd4 | ||
|
|
f709d11952 | ||
|
|
2a3463b746 | ||
|
|
cb7302d2d9 | ||
|
|
a30084a199 | ||
|
|
c0654a5d95 | ||
|
|
737a370874 | ||
|
|
2a2b6f312b | ||
|
|
96d220acbd | ||
|
|
b9a9b8695d | ||
|
|
e80c8a50e6 | ||
|
|
41795799e6 | ||
|
|
9980e49eef | ||
|
|
945810c47a | ||
|
|
a283828461 | ||
|
|
7c365b7c03 | ||
|
|
16da55f58b | ||
|
|
35f6b0e80e | ||
|
|
ab37c2e8c0 | ||
|
|
d1f82df936 | ||
|
|
6c7cb7e795 | ||
|
|
ecf80b8e9c | ||
|
|
e280734e33 | ||
|
|
24d8854723 | ||
|
|
2f9b711973 | ||
|
|
2b09495e87 | ||
|
|
ae5a1a9af2 | ||
|
|
a312c4dbf3 | ||
|
|
79fb1fb299 | ||
|
|
b7c1cdfd46 | ||
|
|
09873d4814 | ||
|
|
7f596c653b | ||
|
|
bb06b0414b | ||
|
|
6b720bafd6 | ||
|
|
6449591143 | ||
|
|
8fb43246b2 | ||
|
|
95d3fd4958 | ||
|
|
dfbc890f2c | ||
|
|
21886ab4b8 | ||
|
|
4b0df3ace8 | ||
|
|
7505b5cf65 | ||
|
|
45e71da402 | ||
|
|
3ded63dfdf | ||
|
|
735c3e3146 | ||
|
|
83861cfcb8 | ||
|
|
c22ff8ccad | ||
|
|
9a17a484f3 | ||
|
|
bc6734399f | ||
|
|
8e6f2a3d61 | ||
|
|
20fa3a25f2 | ||
|
|
1a9f5470ca | ||
|
|
2254d114be | ||
|
|
ef22d29ef1 | ||
|
|
ef165cd276 | ||
|
|
e6477920ce | ||
|
|
c49584d027 | ||
|
|
e56eabf1e2 | ||
|
|
a35f2ae56a | ||
|
|
2a4a195dcb | ||
|
|
6318e8d1c6 | ||
|
|
b7a4899302 | ||
|
|
7fe6ef4da5 | ||
|
|
0391763d18 | ||
|
|
3250384862 | ||
|
|
1bf496751c | ||
|
|
580700458c | ||
|
|
6c6276cb79 | ||
|
|
787f9293fb | ||
|
|
aa0547ae69 | ||
|
|
1c6b0f1122 | ||
|
|
014721b6f7 | ||
|
|
692d8a5681 | ||
|
|
120d4cfc5a | ||
|
|
e3b3f70621 | ||
|
|
c5e55a2207 | ||
|
|
f6d508af92 | ||
|
|
516a732b12 | ||
|
|
dfd4943304 | ||
|
|
511e08e7e9 | ||
|
|
ed50dfc145 | ||
|
|
ee542255a5 | ||
|
|
32fa9d4439 | ||
|
|
f2be3383ac | ||
|
|
fd6874e8dd | ||
|
|
09e514fa84 | ||
|
|
f4678f99ed | ||
|
|
4e9670acf6 | ||
|
|
fb097ca095 | ||
|
|
8f40d13f20 | ||
|
|
2aaef9ae54 | ||
|
|
a6d31638e2 | ||
|
|
f73aefce4e | ||
|
|
ff5131018b | ||
|
|
1c6c5042ae | ||
|
|
d770009e0d | ||
|
|
4a0b211f27 | ||
|
|
7dcf2ca33d | ||
|
|
95c15504d0 | ||
|
|
4e38625bde | ||
|
|
4a411f0483 | ||
|
|
95b6d901bf | ||
|
|
c9d74e25ac | ||
|
|
54aef24caf | ||
|
|
6050b1e25a | ||
|
|
b54cef2702 | ||
|
|
abb2c8110c | ||
|
|
f1e8d633fc | ||
|
|
c4f60942b5 | ||
|
|
abbaf12e9e | ||
|
|
04e6601d5b | ||
|
|
1ebc7d27d4 | ||
|
|
59d53a02b3 | ||
|
|
370da5aee3 | ||
|
|
af2992eee9 | ||
|
|
e17b8b813c | ||
|
|
9b4e0dd0d9 | ||
|
|
d7bc1c75da | ||
|
|
b963b99a4c | ||
|
|
9270e22f19 | ||
|
|
7df34890d4 | ||
|
|
36b0661e1d | ||
|
|
6da50b576f | ||
|
|
517491e507 | ||
|
|
82aca1f77f | ||
|
|
8c4f657aa7 | ||
|
|
4352762e93 | ||
|
|
ad0ea09be9 | ||
|
|
52c6fe34b2 | ||
|
|
b6ccb9fbdb | ||
|
|
f83ab6ecc1 | ||
|
|
1af0f426ae | ||
|
|
d960947258 | ||
|
|
f2735ba22b | ||
|
|
aa4c02ef30 | ||
|
|
f1fbf0d120 | ||
|
|
63a362a48a | ||
|
|
e0d7341139 | ||
|
|
5f5b06683a | ||
|
|
42523bbfc9 | ||
|
|
0a344731c8 | ||
|
|
e83fa89ec4 | ||
|
|
13cd7a1c0f | ||
|
|
0e23a41bdb | ||
|
|
e17b320dc8 | ||
|
|
403038a5b2 | ||
|
|
430e1d7d4e | ||
|
|
c44cd7ffab | ||
|
|
73dfb523ec | ||
|
|
21d57735c9 | ||
|
|
05e13e6078 | ||
|
|
5f6844eceb | ||
|
|
bea1a592d7 |
@@ -30,7 +30,6 @@
|
||||
"dbaeumer.vscode-eslint",
|
||||
"matangover.mypy",
|
||||
"ms-python.black-formatter",
|
||||
"ms-python.isort",
|
||||
"ms-python.pylint",
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
@@ -42,6 +41,7 @@
|
||||
"forwardPorts": [
|
||||
3000,
|
||||
9000,
|
||||
9091, // used by docker production
|
||||
24678 // used by nuxt when hot-reloading using polling
|
||||
],
|
||||
// Use 'onCreateCommand' to run commands at the end of container creation.
|
||||
|
||||
9
.github/DISCUSSION_TEMPLATE/oauth-provider-example.yaml
vendored
Normal file
9
.github/DISCUSSION_TEMPLATE/oauth-provider-example.yaml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: OAuth setup with <PROVIDER>
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Configuration Example
|
||||
description: Add your example configuration. You can provide code blocks, screenshots, and links.
|
||||
validations:
|
||||
required: true
|
||||
12
.github/ISSUE_TEMPLATE/task.yaml
vendored
12
.github/ISSUE_TEMPLATE/task.yaml
vendored
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: v1.0.0b Task
|
||||
name: Task
|
||||
description: "CONTRIBUTORS ONLY: Submit a Task that needs to be completed"
|
||||
title: "[v1.0.0b] [Task] - TASK DESCRIPTION"
|
||||
title: "[Task] - TASK DESCRIPTION"
|
||||
labels:
|
||||
- task
|
||||
- v1
|
||||
@@ -11,17 +11,17 @@ body:
|
||||
value: |
|
||||
Thanks for your interest in Mealie! 🚀
|
||||
|
||||
This is a place for Mealie contributors to find tasks that need to get done around the repository. Tasks are different than issues as they are generally related to providing a new feature or improve an existing feature. They are _generally_ not related to an issue.
|
||||
This is a place for Mealie contributors to find tasks that need to get done around the repository. Tasks are different than issues as they are generally related to providing a new feature or improving an existing feature. They are _generally_ not related to an issue.
|
||||
|
||||
**DO NOT** create a task unless
|
||||
- You are a contributors who has prior approval via discord/discussions
|
||||
- You are a contributor who has prior approval via discord/discussions
|
||||
- You have otherwise been given approval to post the tasks
|
||||
|
||||
Otherwise, your post will be closed/deleted.
|
||||
|
||||
**Interested in Taking This?**
|
||||
|
||||
If you're interested in completing this tasks and it hasn't already been taken, comment below and to let others know you're working on it. As you work through the task, I ask that you submit a draft pull request as soon as possible, and tag this issue so we can all collaborate as best as possible.
|
||||
If you're interested in completing this task and it hasn't already been taken, comment below and to let others know you're working on it. As you work through the task, I ask that you submit a draft pull request as soon as possible, and tag this issue so we can all collaborate as best as possible.
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
@@ -33,6 +33,6 @@ body:
|
||||
id: solution
|
||||
attributes:
|
||||
label: Proposed/Possible Solution(s)?
|
||||
placeholder: Provide as much context around the idea as possible with potential files and roadblocks that may come up
|
||||
placeholder: Provide as much context around the idea as possible with potential files and roadblocks that may come up.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
12
.github/pull_request_template.md
vendored
12
.github/pull_request_template.md
vendored
@@ -1,6 +1,12 @@
|
||||
<!--
|
||||
This template provides some ideas of things to include in your PR description.
|
||||
To start, try providing a short summary of your changes in the Title above.
|
||||
|
||||
To start, try providing a short summary of your changes in the Title above. We follow Conventional Commits syntax, please ensure your title is prefixed with one of:
|
||||
- `feat: `
|
||||
- `fix: `
|
||||
- `docs: `
|
||||
- `chore: `
|
||||
|
||||
If a section of the PR template does not apply to this PR, then delete that section.
|
||||
|
||||
PLEASE READ:
|
||||
@@ -36,6 +42,8 @@ _(REQUIRED)_
|
||||
Briefly explain any decisions you made with respect to the changes.
|
||||
Include anything here that you didn't include in *Release Notes*
|
||||
above, such as changes to CI or changes to internal methods.
|
||||
|
||||
If there is a UI component to the change, please include before/after images.
|
||||
-->
|
||||
|
||||
## Which issue(s) this PR fixes:
|
||||
@@ -44,7 +52,7 @@ _(REQUIRED)_
|
||||
|
||||
<!--
|
||||
If this PR fixes one of more issues, list them here.
|
||||
One line each, like so:
|
||||
One per line, like so:
|
||||
Fixes #123
|
||||
Fixes #39
|
||||
-->
|
||||
|
||||
6
.github/workflows/codeql.yml
vendored
6
.github/workflows/codeql.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -76,6 +76,6 @@ jobs:
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
||||
46
.github/workflows/e2e.yml
vendored
Normal file
46
.github/workflows/e2e.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: E2E Tests
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- mealie-next
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./tests/e2e
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: ./tests/e2e/yarn.lock
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
file: ./docker/Dockerfile
|
||||
context: .
|
||||
push: false
|
||||
load: true
|
||||
tags: mealie:e2e
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
- name: Deploy E2E Test Environment
|
||||
run: docker compose up -d
|
||||
working-directory: ./tests/e2e/docker
|
||||
- name: Install dependencies
|
||||
run: npm install -g yarn && yarn
|
||||
- name: Install Playwright Browsers
|
||||
run: yarn playwright install --with-deps
|
||||
- name: Check test environment
|
||||
run: docker ps
|
||||
- name: Run Playwright tests
|
||||
run: yarn playwright test
|
||||
- name: Destroy Test Environment
|
||||
if: always()
|
||||
run: docker compose down --volumes
|
||||
working-directory: ./tests/e2e/docker
|
||||
6
.github/workflows/partial-backend.yml
vendored
6
.github/workflows/partial-backend.yml
vendored
@@ -66,7 +66,7 @@ jobs:
|
||||
id: cache-validate
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
echo "import black;print('venv good?')" > test.py && poetry run python test.py && echo "cache-hit-success=true" >> $GITHUB_OUTPUT
|
||||
echo "import fastapi;print('venv good?')" > test.py && poetry run python test.py && echo "cache-hit-success=true" >> $GITHUB_OUTPUT
|
||||
rm test.py
|
||||
continue-on-error: true
|
||||
|
||||
@@ -78,9 +78,9 @@ jobs:
|
||||
poetry add "psycopg2-binary==2.9.9"
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' || steps.cache-validate.outputs.cache-hit-success != 'true'
|
||||
|
||||
- name: Formatting (Black)
|
||||
- name: Formatting (Ruff)
|
||||
run: |
|
||||
poetry run black . --check
|
||||
poetry run ruff format . --check
|
||||
|
||||
- name: Lint (Ruff)
|
||||
run: |
|
||||
|
||||
41
.github/workflows/pull-request-lint.yml
vendored
Normal file
41
.github/workflows/pull-request-lint.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Pull Request Linter
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
pull_request:
|
||||
types: [edited] # This captures the PR title changing
|
||||
branches:
|
||||
- mealie-next
|
||||
|
||||
jobs:
|
||||
validate-title:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# https://github.com/amannn/action-semantic-pull-request
|
||||
- uses: amannn/action-semantic-pull-request@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
# Configure which types are allowed (newline-delimited).
|
||||
# Default: https://github.com/commitizen/conventional-commit-types
|
||||
types: |
|
||||
fix
|
||||
feat
|
||||
docs
|
||||
chore
|
||||
# Configure which scopes are allowed (newline-delimited).
|
||||
# These are regex patterns auto-wrapped in `^ $`.
|
||||
scopes: |
|
||||
deps
|
||||
auto
|
||||
l10n
|
||||
# Configure that a scope must always be provided.
|
||||
requireScope: false
|
||||
# If the PR contains one of these newline-delimited labels, the
|
||||
# validation is skipped. If you want to rerun the validation when
|
||||
# labels change, you might want to use the `labeled` and `unlabeled`
|
||||
# event triggers in your workflow.
|
||||
ignoreLabels: |
|
||||
bot
|
||||
ignore-semantic-pull-request
|
||||
4
.github/workflows/pull-requests.yml
vendored
4
.github/workflows/pull-requests.yml
vendored
@@ -6,6 +6,10 @@ on:
|
||||
- mealie-next
|
||||
|
||||
jobs:
|
||||
pull-request-lint:
|
||||
name: "Lint PR"
|
||||
uses: ./.github/workflows/pull-request-lint.yml
|
||||
|
||||
backend-tests:
|
||||
name: "Backend Server Tests"
|
||||
uses: ./.github/workflows/partial-backend.yml
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
exclude: "mkdocs.yml"
|
||||
@@ -10,7 +10,8 @@ repos:
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
exclude: ^tests/data/
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 24.1.0
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: v0.5.0
|
||||
hooks:
|
||||
- id: black
|
||||
- id: ruff-format
|
||||
|
||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -60,8 +60,5 @@
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.formatOnSave": false
|
||||
},
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.black-formatter",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
10
.vscode/tasks.json
vendored
10
.vscode/tasks.json
vendored
@@ -24,16 +24,6 @@
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Init Database",
|
||||
"command": "poetry run python mealie/db/init_db.py",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"group": "groupA"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Dev: Start Frontend",
|
||||
"command": "task ui",
|
||||
|
||||
31
README.md
31
README.md
@@ -1,10 +1,10 @@
|
||||
[![Latest Release][latest-release-shield]][latest-release-url]
|
||||
[![Contributors][contributors-shield]][contributors-url]
|
||||
[![Forks][forks-shield]][forks-url]
|
||||
[![Stargazers][stars-shield]][stars-url]
|
||||
[![Issues][issues-shield]][issues-url]
|
||||
[![AGPL License][license-shield]][license-url]
|
||||
[![Docker Pulls][docker-pull]][docker-pull]
|
||||
[![Docker Pulls][docker-pull]][docker-url]
|
||||
[![GHCR Pulls][ghcr-pulls]][ghcr-url]
|
||||
|
||||
<!-- PROJECT LOGO -->
|
||||
<br />
|
||||
@@ -18,9 +18,9 @@
|
||||
<h3 align="center">Mealie</h3>
|
||||
|
||||
<p align="center">
|
||||
A Place for All Your Recipes
|
||||
A Place For All Your Recipes
|
||||
<br />
|
||||
<a href="https://nightly.mealie.io"><strong>Explore the docs »</strong></a>
|
||||
<a href="https://docs.mealie.io/"><strong>Explore the docs »</strong></a>
|
||||
<a href="https://github.com/mealie-recipes/mealie">
|
||||
</a>
|
||||
<br />
|
||||
@@ -38,12 +38,20 @@
|
||||
|
||||
# About The Project
|
||||
|
||||
Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the URL and Mealie will automatically import the relevant data, or add a family recipe with the UI editor. Mealie also provides an API for interactions from 3rd party applications.
|
||||
Mealie is a self hosted recipe manager, meal planner and shopping list with a RestAPI backend and a reactive frontend built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the URL and Mealie will automatically import the relevant data, or add a family recipe with the UI editor. Mealie also provides an API for interactions from 3rd party applications.
|
||||
|
||||
- [Remember to join the Discord](https://discord.gg/QuStdQGSGK)!
|
||||
- [Documentation](https://nightly.mealie.io)
|
||||
- [Documentation](https://docs.mealie.io/)
|
||||
|
||||
|
||||
## Key Features
|
||||
- Recipe imports: Create recipes, by **importing from a URL** or entering data manually
|
||||
- Meal Planner: Use the **Meal Planner** to plan your what you'll cook for the next week
|
||||
- Shopping List: Put the necessary ingredients on your **Shopping List**, organised into sections of your local supermarket
|
||||
- Cookbooks: Group recipes into **Cookbooks** based on your own criteria
|
||||
- Docker: Easy **Docker** deployment
|
||||
- Localisation: **Translations** for 35+ languages
|
||||
|
||||
<!-- CONTRIBUTING -->
|
||||
## Contributing
|
||||
|
||||
@@ -58,7 +66,7 @@ If you are not a coder, you can still contribute financially. Financial contribu
|
||||
|
||||
### Translations
|
||||
|
||||
Translations can be a great way for **non-coders** to contribute to project. We use [Crowdin](https://crowdin.com/project/mealie) to allow several contributors to work on translating Mealie. You can simply help by voting for your preferred translations, or even by completely translating Mealie into a new language.
|
||||
Translations can be a great way for **non-coders** to contribute to the project. We use [Crowdin](https://crowdin.com/project/mealie) to allow several contributors to work on translating Mealie. You can simply help by voting for your preferred translations, or even by completely translating Mealie into a new language.
|
||||
|
||||
For more information, check out the translation page on the [contributor's guide](https://nightly.mealie.io/contributors/translating/).
|
||||
|
||||
@@ -80,16 +88,17 @@ Thanks to Depot for providing build instances for our Docker image builds.
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/mealie-recipes/mealie.svg?style=flat-square
|
||||
[docker-pull]: https://img.shields.io/docker/pulls/hkotel/mealie
|
||||
[docker-pull]: https://img.shields.io/docker/pulls/hkotel/mealie?style=flat-square
|
||||
[docker-url]: https://hub.docker.com/r/hkotel/mealie
|
||||
[ghcr-pulls]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fipitio%2Fghcr-pulls%2Fmaster%2Findex.json&query=%24%5B%3F(%40.owner%3D%3D%22mealie-recipes%22%20%26%26%20%40.repo%3D%3D%22mealie%22%20%26%26%20%40.image%3D%3D%22mealie%22)%5D.pulls&style=flat-square&label=ghcr%20pulls
|
||||
[ghcr-url]: https://github.com/mealie-recipes/mealie/pkgs/container/mealie
|
||||
[contributors-url]: https://github.com/mealie-recipes/mealie/graphs/contributors
|
||||
[forks-shield]: https://img.shields.io/github/forks/mealie-recipes/mealie.svg?style=flat-square
|
||||
[forks-url]: https://github.com/mealie-recipes/mealie/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/mealie-recipes/mealie.svg?style=flat-square
|
||||
[stars-url]: https://github.com/mealie-recipes/mealie/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/mealie-recipes/mealie.svg?style=flat-square
|
||||
[issues-url]: https://github.com/mealie-recipes/mealie/issues
|
||||
[latest-release-shield]: https://img.shields.io/github/v/release/mealie-recipes/mealie?style=flat-square&label=latest%20release
|
||||
[latest-release-url]: https://img.shields.io/github/v/release/mealie-recipes/mealie
|
||||
[latest-release-url]: https://github.com/mealie-recipes/mealie/releases
|
||||
[license-shield]: https://img.shields.io/github/license/mealie-recipes/mealie.svg?style=flat-square
|
||||
[license-url]: https://github.com/mealie-recipes/mealie/blob/mealie-next/LICENSE
|
||||
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
|
||||
|
||||
11
Taskfile.yml
11
Taskfile.yml
@@ -74,6 +74,7 @@ tasks:
|
||||
desc: run code generators
|
||||
cmds:
|
||||
- poetry run python dev/code-generation/main.py
|
||||
- task: py:format
|
||||
|
||||
dev:services:
|
||||
desc: starts postgres and mailpit containers
|
||||
@@ -105,7 +106,7 @@ tasks:
|
||||
py:format:
|
||||
desc: runs python code formatter
|
||||
cmds:
|
||||
- poetry run black mealie
|
||||
- poetry run ruff format .
|
||||
|
||||
py:lint:
|
||||
desc: runs python linter
|
||||
@@ -132,7 +133,6 @@ tasks:
|
||||
py:
|
||||
desc: runs the backend server
|
||||
cmds:
|
||||
- poetry run python mealie/db/init_db.py
|
||||
- poetry run python mealie/app.py
|
||||
|
||||
py:postgres:
|
||||
@@ -145,9 +145,14 @@ tasks:
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_DB: mealie
|
||||
cmds:
|
||||
- poetry run python mealie/db/init_db.py
|
||||
- poetry run python mealie/app.py
|
||||
|
||||
py:migrate:
|
||||
desc: generates a new database migration file e.g. task py:migrate "add new column"
|
||||
cmds:
|
||||
- poetry run alembic revision --autogenerate -m "{{ .CLI_ARGS }}"
|
||||
- task: py:format
|
||||
|
||||
ui:build:
|
||||
desc: builds the frontend in frontend/dist
|
||||
dir: frontend
|
||||
|
||||
12
alembic.ini
12
alembic.ini
@@ -58,15 +58,3 @@ sqlalchemy.url =
|
||||
# post_write_hooks defines scripts or Python functions that are run
|
||||
# on newly generated revision scripts. See the documentation for further
|
||||
# detail and examples
|
||||
|
||||
hooks = isort, black
|
||||
|
||||
# format using "isort" - use the console_scripts runner, against the "isort" entrypoint
|
||||
isort.type = console_scripts
|
||||
isort.entrypoint = isort
|
||||
isort.options = REVISION_SCRIPT_FILENAME
|
||||
|
||||
# format using "black" - use the console_scripts runner, against the "black" entrypoint
|
||||
black.type = console_scripts
|
||||
black.entrypoint = black
|
||||
black.options = REVISION_SCRIPT_FILENAME
|
||||
|
||||
@@ -22,7 +22,11 @@ target_metadata = SqlAlchemyBase.metadata
|
||||
|
||||
# Set DB url from config
|
||||
settings = get_app_settings()
|
||||
config.set_main_option("sqlalchemy.url", settings.DB_URL)
|
||||
|
||||
if not settings.DB_URL:
|
||||
raise Exception("DB URL not set in config")
|
||||
|
||||
config.set_main_option("sqlalchemy.url", settings.DB_URL.replace("%", "%%"))
|
||||
|
||||
|
||||
def run_migrations_offline():
|
||||
|
||||
@@ -13,6 +13,9 @@ from sqlalchemy import orm
|
||||
|
||||
import mealie.db.migration_types
|
||||
from alembic import op
|
||||
from mealie.core.root_logger import get_logger
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "2298bb460ffd"
|
||||
@@ -37,13 +40,20 @@ def find_user_id_for_group(group_id: UUID):
|
||||
with session:
|
||||
try:
|
||||
# try to find an admin user
|
||||
user_id = session.execute(sa.text(stmt).bindparams(group_id=group_id)).scalar_one()
|
||||
return session.execute(sa.text(stmt).bindparams(group_id=group_id)).scalar_one()
|
||||
except orm.exc.NoResultFound:
|
||||
pass
|
||||
|
||||
try:
|
||||
# fallback to any user
|
||||
user_id = session.execute(
|
||||
return session.execute(
|
||||
sa.text("SELECT id FROM users WHERE group_id=:group_id LIMIT 1").bindparams(group_id=group_id)
|
||||
).scalar_one()
|
||||
return user_id
|
||||
except orm.exc.NoResultFound:
|
||||
pass
|
||||
|
||||
# no user could be found
|
||||
return None
|
||||
|
||||
|
||||
def populate_shopping_list_users():
|
||||
@@ -54,11 +64,17 @@ def populate_shopping_list_users():
|
||||
list_ids_and_group_ids = session.execute(sa.text("SELECT id, group_id FROM shopping_lists")).all()
|
||||
for list_id, group_id in list_ids_and_group_ids:
|
||||
user_id = find_user_id_for_group(group_id)
|
||||
if user_id:
|
||||
session.execute(
|
||||
sa.text(f"UPDATE shopping_lists SET user_id=:user_id WHERE id=:id").bindparams(
|
||||
user_id=user_id, id=list_id
|
||||
)
|
||||
)
|
||||
else:
|
||||
logger.warning(
|
||||
f"No user found for shopping list {list_id} with group {group_id}; deleting shopping list"
|
||||
)
|
||||
session.execute(sa.text(f"DELETE FROM shopping_lists WHERE id=:id").bindparams(id=list_id))
|
||||
|
||||
|
||||
def upgrade():
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
"""add OIDC auth method
|
||||
|
||||
Revision ID: 09aba125b57a
|
||||
Revises: 2298bb460ffd
|
||||
Create Date: 2024-03-10 05:08:32.397027
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
import mealie.db.migration_types
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "09aba125b57a"
|
||||
down_revision = "2298bb460ffd"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def is_postgres():
|
||||
return op.get_context().dialect.name == "postgresql"
|
||||
|
||||
|
||||
def upgrade():
|
||||
if is_postgres():
|
||||
op.execute("ALTER TYPE authmethod ADD VALUE 'OIDC'")
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
@@ -0,0 +1,229 @@
|
||||
"""migrate favorites and ratings to user_ratings
|
||||
|
||||
Revision ID: d7c6efd2de42
|
||||
Revises: 09aba125b57a
|
||||
Create Date: 2024-03-18 02:28:15.896959
|
||||
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
from textwrap import dedent
|
||||
from typing import Any
|
||||
from uuid import uuid4
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
||||
import mealie.db.migration_types
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "d7c6efd2de42"
|
||||
down_revision = "09aba125b57a"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def is_postgres():
|
||||
return op.get_context().dialect.name == "postgresql"
|
||||
|
||||
|
||||
def new_user_rating(user_id: Any, recipe_id: Any, rating: float | None = None, is_favorite: bool = False):
|
||||
if is_postgres():
|
||||
id = str(uuid4())
|
||||
else:
|
||||
id = "%.32x" % uuid4().int
|
||||
|
||||
now = datetime.now().isoformat()
|
||||
return {
|
||||
"id": id,
|
||||
"user_id": user_id,
|
||||
"recipe_id": recipe_id,
|
||||
"rating": rating,
|
||||
"is_favorite": is_favorite,
|
||||
"created_at": now,
|
||||
"update_at": now,
|
||||
}
|
||||
|
||||
|
||||
def migrate_user_favorites_to_user_ratings():
|
||||
bind = op.get_bind()
|
||||
session = orm.Session(bind=bind)
|
||||
|
||||
with session:
|
||||
user_ids_and_recipe_ids = session.execute(sa.text("SELECT user_id, recipe_id FROM users_to_favorites")).all()
|
||||
rows = [
|
||||
new_user_rating(user_id, recipe_id, is_favorite=True)
|
||||
for user_id, recipe_id in user_ids_and_recipe_ids
|
||||
if user_id and recipe_id
|
||||
]
|
||||
|
||||
if is_postgres():
|
||||
query = dedent(
|
||||
"""
|
||||
INSERT INTO users_to_recipes (id, user_id, recipe_id, rating, is_favorite, created_at, update_at)
|
||||
VALUES (:id, :user_id, :recipe_id, :rating, :is_favorite, :created_at, :update_at)
|
||||
ON CONFLICT DO NOTHING
|
||||
"""
|
||||
)
|
||||
else:
|
||||
query = dedent(
|
||||
"""
|
||||
INSERT OR IGNORE INTO users_to_recipes
|
||||
(id, user_id, recipe_id, rating, is_favorite, created_at, update_at)
|
||||
VALUES (:id, :user_id, :recipe_id, :rating, :is_favorite, :created_at, :update_at)
|
||||
"""
|
||||
)
|
||||
|
||||
for row in rows:
|
||||
session.execute(sa.text(query), row)
|
||||
|
||||
|
||||
def migrate_group_to_user_ratings(group_id: Any):
|
||||
bind = op.get_bind()
|
||||
session = orm.Session(bind=bind)
|
||||
|
||||
with session:
|
||||
user_ids = (
|
||||
session.execute(sa.text("SELECT id FROM users WHERE group_id=:group_id").bindparams(group_id=group_id))
|
||||
.scalars()
|
||||
.all()
|
||||
)
|
||||
|
||||
recipe_ids_ratings = session.execute(
|
||||
sa.text(
|
||||
"SELECT id, rating FROM recipes WHERE group_id=:group_id AND rating > 0 AND rating IS NOT NULL"
|
||||
).bindparams(group_id=group_id)
|
||||
).all()
|
||||
|
||||
# Convert recipe ratings to user ratings. Since we don't know who
|
||||
# rated the recipe initially, we copy the rating to all users.
|
||||
rows: list[dict] = []
|
||||
for recipe_id, rating in recipe_ids_ratings:
|
||||
for user_id in user_ids:
|
||||
rows.append(new_user_rating(user_id, recipe_id, rating, is_favorite=False))
|
||||
|
||||
if is_postgres():
|
||||
insert_query = dedent(
|
||||
"""
|
||||
INSERT INTO users_to_recipes (id, user_id, recipe_id, rating, is_favorite, created_at, update_at)
|
||||
VALUES (:id, :user_id, :recipe_id, :rating, :is_favorite, :created_at, :update_at)
|
||||
ON CONFLICT (user_id, recipe_id) DO NOTHING;
|
||||
"""
|
||||
)
|
||||
else:
|
||||
insert_query = dedent(
|
||||
"""
|
||||
INSERT OR IGNORE INTO users_to_recipes
|
||||
(id, user_id, recipe_id, rating, is_favorite, created_at, update_at)
|
||||
VALUES (:id, :user_id, :recipe_id, :rating, :is_favorite, :created_at, :update_at);
|
||||
"""
|
||||
)
|
||||
|
||||
update_query = dedent(
|
||||
"""
|
||||
UPDATE users_to_recipes
|
||||
SET rating = :rating, update_at = :update_at
|
||||
WHERE user_id = :user_id AND recipe_id = :recipe_id;
|
||||
"""
|
||||
)
|
||||
|
||||
# Create new user ratings with is_favorite set to False
|
||||
for row in rows:
|
||||
session.execute(sa.text(insert_query), row)
|
||||
|
||||
# Update existing user ratings with the correct rating
|
||||
for row in rows:
|
||||
session.execute(sa.text(update_query), row)
|
||||
|
||||
|
||||
def migrate_to_user_ratings():
|
||||
migrate_user_favorites_to_user_ratings()
|
||||
|
||||
bind = op.get_bind()
|
||||
session = orm.Session(bind=bind)
|
||||
|
||||
with session:
|
||||
group_ids = session.execute(sa.text("SELECT id FROM groups")).scalars().all()
|
||||
|
||||
for group_id in group_ids:
|
||||
migrate_group_to_user_ratings(group_id)
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"users_to_recipes",
|
||||
sa.Column("user_id", mealie.db.migration_types.GUID(), nullable=False),
|
||||
sa.Column("recipe_id", mealie.db.migration_types.GUID(), nullable=False),
|
||||
sa.Column("rating", sa.Float(), nullable=True),
|
||||
sa.Column("is_favorite", sa.Boolean(), nullable=False),
|
||||
sa.Column("id", mealie.db.migration_types.GUID(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=True),
|
||||
sa.Column("update_at", sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(
|
||||
["recipe_id"],
|
||||
["recipes.id"],
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["user_id"],
|
||||
["users.id"],
|
||||
),
|
||||
sa.PrimaryKeyConstraint("user_id", "recipe_id", "id"),
|
||||
sa.UniqueConstraint("user_id", "recipe_id", name="user_id_recipe_id_rating_key"),
|
||||
)
|
||||
op.create_index(op.f("ix_users_to_recipes_created_at"), "users_to_recipes", ["created_at"], unique=False)
|
||||
op.create_index(op.f("ix_users_to_recipes_is_favorite"), "users_to_recipes", ["is_favorite"], unique=False)
|
||||
op.create_index(op.f("ix_users_to_recipes_rating"), "users_to_recipes", ["rating"], unique=False)
|
||||
op.create_index(op.f("ix_users_to_recipes_recipe_id"), "users_to_recipes", ["recipe_id"], unique=False)
|
||||
op.create_index(op.f("ix_users_to_recipes_user_id"), "users_to_recipes", ["user_id"], unique=False)
|
||||
|
||||
migrate_to_user_ratings()
|
||||
|
||||
if is_postgres():
|
||||
op.drop_index("ix_users_to_favorites_recipe_id", table_name="users_to_favorites")
|
||||
op.drop_index("ix_users_to_favorites_user_id", table_name="users_to_favorites")
|
||||
op.alter_column("recipes", "rating", existing_type=sa.INTEGER(), type_=sa.Float(), existing_nullable=True)
|
||||
else:
|
||||
op.execute("DROP INDEX IF EXISTS ix_users_to_favorites_recipe_id")
|
||||
op.execute("DROP INDEX IF EXISTS ix_users_to_favorites_user_id")
|
||||
with op.batch_alter_table("recipes") as batch_op:
|
||||
batch_op.alter_column("rating", existing_type=sa.INTEGER(), type_=sa.Float(), existing_nullable=True)
|
||||
|
||||
op.drop_table("users_to_favorites")
|
||||
op.create_index(op.f("ix_recipes_rating"), "recipes", ["rating"], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column(
|
||||
"recipes_ingredients", "quantity", existing_type=sa.Float(), type_=sa.INTEGER(), existing_nullable=True
|
||||
)
|
||||
op.drop_index(op.f("ix_recipes_rating"), table_name="recipes")
|
||||
op.alter_column("recipes", "rating", existing_type=sa.Float(), type_=sa.INTEGER(), existing_nullable=True)
|
||||
op.create_unique_constraint("ingredient_units_name_group_id_key", "ingredient_units", ["name", "group_id"])
|
||||
op.create_unique_constraint("ingredient_foods_name_group_id_key", "ingredient_foods", ["name", "group_id"])
|
||||
op.create_table(
|
||||
"users_to_favorites",
|
||||
sa.Column("user_id", sa.CHAR(length=32), nullable=True),
|
||||
sa.Column("recipe_id", sa.CHAR(length=32), nullable=True),
|
||||
sa.ForeignKeyConstraint(
|
||||
["recipe_id"],
|
||||
["recipes.id"],
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["user_id"],
|
||||
["users.id"],
|
||||
),
|
||||
sa.UniqueConstraint("user_id", "recipe_id", name="user_id_recipe_id_key"),
|
||||
)
|
||||
op.create_index("ix_users_to_favorites_user_id", "users_to_favorites", ["user_id"], unique=False)
|
||||
op.create_index("ix_users_to_favorites_recipe_id", "users_to_favorites", ["recipe_id"], unique=False)
|
||||
op.drop_index(op.f("ix_users_to_recipes_user_id"), table_name="users_to_recipes")
|
||||
op.drop_index(op.f("ix_users_to_recipes_recipe_id"), table_name="users_to_recipes")
|
||||
op.drop_index(op.f("ix_users_to_recipes_rating"), table_name="users_to_recipes")
|
||||
op.drop_index(op.f("ix_users_to_recipes_is_favorite"), table_name="users_to_recipes")
|
||||
op.drop_index(op.f("ix_users_to_recipes_created_at"), table_name="users_to_recipes")
|
||||
op.drop_table("users_to_recipes")
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,52 @@
|
||||
"""add group recipe actions
|
||||
|
||||
Revision ID: 7788478a0338
|
||||
Revises: d7c6efd2de42
|
||||
Create Date: 2024-04-07 01:05:20.816270
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
import mealie.db.migration_types
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "7788478a0338"
|
||||
down_revision = "d7c6efd2de42"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"recipe_actions",
|
||||
sa.Column("id", mealie.db.migration_types.GUID(), nullable=False),
|
||||
sa.Column("group_id", mealie.db.migration_types.GUID(), nullable=False),
|
||||
sa.Column("action_type", sa.String(), nullable=False),
|
||||
sa.Column("title", sa.String(), nullable=False),
|
||||
sa.Column("url", sa.String(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=True),
|
||||
sa.Column("update_at", sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(
|
||||
["group_id"],
|
||||
["groups.id"],
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.create_index(op.f("ix_recipe_actions_action_type"), "recipe_actions", ["action_type"], unique=False)
|
||||
op.create_index(op.f("ix_recipe_actions_created_at"), "recipe_actions", ["created_at"], unique=False)
|
||||
op.create_index(op.f("ix_recipe_actions_group_id"), "recipe_actions", ["group_id"], unique=False)
|
||||
op.create_index(op.f("ix_recipe_actions_title"), "recipe_actions", ["title"], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f("ix_recipe_actions_title"), table_name="recipe_actions")
|
||||
op.drop_index(op.f("ix_recipe_actions_group_id"), table_name="recipe_actions")
|
||||
op.drop_index(op.f("ix_recipe_actions_created_at"), table_name="recipe_actions")
|
||||
op.drop_index(op.f("ix_recipe_actions_action_type"), table_name="recipe_actions")
|
||||
op.drop_table("recipe_actions")
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,48 @@
|
||||
"""Add staple flag to foods
|
||||
|
||||
Revision ID: 32d69327997b
|
||||
Revises: 7788478a0338
|
||||
Create Date: 2024-06-22 10:17:03.323966
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "32d69327997b"
|
||||
down_revision = "7788478a0338"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def is_postgres():
|
||||
return op.get_context().dialect.name == "postgresql"
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table("ingredient_foods") as batch_op:
|
||||
batch_op.add_column(sa.Column("on_hand", sa.Boolean(), nullable=True, default=False))
|
||||
|
||||
bind = op.get_bind()
|
||||
session = orm.Session(bind=bind)
|
||||
|
||||
with session:
|
||||
if is_postgres():
|
||||
stmt = "UPDATE ingredient_foods SET on_hand = FALSE;"
|
||||
else:
|
||||
stmt = "UPDATE ingredient_foods SET on_hand = 0;"
|
||||
|
||||
session.execute(sa.text(stmt))
|
||||
|
||||
# forbid nulls after migration
|
||||
with op.batch_alter_table("ingredient_foods") as batch_op:
|
||||
batch_op.alter_column("on_hand", nullable=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("ingredient_foods") as batch_op:
|
||||
batch_op.drop_column("on_hand")
|
||||
@@ -1,4 +1,8 @@
|
||||
preserve_hierarchy: false
|
||||
pull_request_title: "chore(l10n): New Crowdin updates"
|
||||
pull_request_labels: [
|
||||
"l10n"
|
||||
]
|
||||
files:
|
||||
- source: /frontend/lang/messages/en-US.json
|
||||
translation: /frontend/lang/messages/%locale%.json
|
||||
|
||||
@@ -35,18 +35,24 @@ LOCALE_DATA: dict[str, LocaleData] = {
|
||||
"es-ES": LocaleData(name="Español (Spanish)"),
|
||||
"fi-FI": LocaleData(name="Suomi (Finnish)"),
|
||||
"fr-FR": LocaleData(name="Français (French)"),
|
||||
"gl-ES": LocaleData(name="Galego (Galician)"),
|
||||
"he-IL": LocaleData(name="עברית (Hebrew)", dir="rtl"),
|
||||
"hr-HR": LocaleData(name="Hrvatski (Croatian)"),
|
||||
"hu-HU": LocaleData(name="Magyar (Hungarian)"),
|
||||
"is-IS": LocaleData(name="Íslenska (Icelandic)"),
|
||||
"it-IT": LocaleData(name="Italiano (Italian)"),
|
||||
"ja-JP": LocaleData(name="日本語 (Japanese)"),
|
||||
"ko-KR": LocaleData(name="한국어 (Korean)"),
|
||||
"no-NO": LocaleData(name="Norsk (Norwegian)"),
|
||||
"lt-LT": LocaleData(name="Lietuvių (Lithuanian)"),
|
||||
"lv-LV": LocaleData(name="Latviešu (Latvian)"),
|
||||
"nl-NL": LocaleData(name="Nederlands (Dutch)"),
|
||||
"no-NO": LocaleData(name="Norsk (Norwegian)"),
|
||||
"pl-PL": LocaleData(name="Polski (Polish)"),
|
||||
"pt-BR": LocaleData(name="Português do Brasil (Brazilian Portuguese)"),
|
||||
"pt-PT": LocaleData(name="Português (Portuguese)"),
|
||||
"ro-RO": LocaleData(name="Română (Romanian)"),
|
||||
"ru-RU": LocaleData(name="Pусский (Russian)"),
|
||||
"sl-SI": LocaleData(name="Slovenščina (Slovenian)"),
|
||||
"sr-SP": LocaleData(name="српски (Serbian)"),
|
||||
"sv-SE": LocaleData(name="Svenska (Swedish)"),
|
||||
"tr-TR": LocaleData(name="Türkçe (Turkish)"),
|
||||
|
||||
@@ -3,8 +3,6 @@ import re
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
import black
|
||||
import isort
|
||||
from jinja2 import Template
|
||||
from rich.logging import RichHandler
|
||||
|
||||
@@ -23,10 +21,7 @@ def render_python_template(template_file: Path | str, dest: Path, data: dict):
|
||||
|
||||
text = tplt.render(data=data)
|
||||
|
||||
text = black.format_str(text, mode=black.FileMode())
|
||||
|
||||
dest.write_text(text)
|
||||
isort.file(dest)
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -104,7 +104,6 @@ COPY --from=crfpp /usr/local/bin/crf_test /usr/local/bin/crf_test
|
||||
# copy backend
|
||||
COPY ./mealie $MEALIE_HOME/mealie
|
||||
COPY ./poetry.lock ./pyproject.toml $MEALIE_HOME/
|
||||
COPY ./gunicorn_conf.py $MEALIE_HOME
|
||||
|
||||
# Alembic
|
||||
COPY ./alembic $MEALIE_HOME/alembic
|
||||
|
||||
@@ -14,6 +14,7 @@ services:
|
||||
- 9091:9000
|
||||
environment:
|
||||
ALLOW_SIGNUP: "false"
|
||||
LOG_LEVEL: "DEBUG"
|
||||
|
||||
DB_ENGINE: sqlite # Optional: 'sqlite', 'postgres'
|
||||
# =====================================
|
||||
@@ -24,12 +25,6 @@ services:
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_DB: mealie
|
||||
|
||||
# =====================================
|
||||
# Web Concurrency
|
||||
WEB_GUNICORN: "false"
|
||||
WORKERS_PER_CORE: 0.5
|
||||
MAX_WORKERS: 1
|
||||
WEB_CONCURRENCY: 1
|
||||
# =====================================
|
||||
# Email Configuration
|
||||
# SMTP_HOST=
|
||||
|
||||
@@ -33,20 +33,12 @@ init() {
|
||||
|
||||
# Activate our virtual environment here
|
||||
. /opt/pysetup/.venv/bin/activate
|
||||
|
||||
# Initialize Database Prerun
|
||||
poetry run python /app/mealie/db/init_db.py
|
||||
}
|
||||
|
||||
change_user
|
||||
init
|
||||
GUNICORN_PORT=${API_PORT:-9000}
|
||||
|
||||
# Start API
|
||||
hostip=`/sbin/ip route|awk '/default/ { print $3 }'`
|
||||
if [ "$WEB_GUNICORN" = 'true' ]; then
|
||||
echo "Starting Gunicorn"
|
||||
exec gunicorn mealie.app:app -b 0.0.0.0:$GUNICORN_PORT --forwarded-allow-ips=$hostip -k uvicorn.workers.UvicornWorker -c /app/gunicorn_conf.py --preload
|
||||
else
|
||||
exec uvicorn mealie.app:app --host 0.0.0.0 --forwarded-allow-ips=$hostip --port $GUNICORN_PORT
|
||||
fi
|
||||
HOST_IP=`/sbin/ip route|awk '/default/ { print $3 }'`
|
||||
|
||||
exec python /app/mealie/main.py
|
||||
|
||||
BIN
docs/docs/assets/img/n8n/n8n-cred-app.png
Normal file
BIN
docs/docs/assets/img/n8n/n8n-cred-app.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
docs/docs/assets/img/n8n/n8n-cred-connection.png
Normal file
BIN
docs/docs/assets/img/n8n/n8n-cred-connection.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
docs/docs/assets/img/n8n/n8n-mealie-backup.png
Normal file
BIN
docs/docs/assets/img/n8n/n8n-mealie-backup.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
BIN
docs/docs/assets/img/n8n/n8n-workflow-auth.png
Normal file
BIN
docs/docs/assets/img/n8n/n8n-workflow-auth.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
docs/docs/assets/img/n8n/n8n-workflow-import.png
Normal file
BIN
docs/docs/assets/img/n8n/n8n-workflow-import.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
386
docs/docs/assets/other/n8n/n8n-mealie-backup.json
Normal file
386
docs/docs/assets/other/n8n/n8n-mealie-backup.json
Normal file
@@ -0,0 +1,386 @@
|
||||
{
|
||||
"name": "Mealie Backup",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "2ec440b4-0668-4bc0-aa66-4023d6379f28",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"typeVersion": 1.1,
|
||||
"position": [
|
||||
240,
|
||||
660
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "POST",
|
||||
"url": "https://mealie.example/api/admin/backups",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"options": {}
|
||||
},
|
||||
"id": "235f26f7-0f45-479e-a7e3-bf8cda7c8426",
|
||||
"name": "Run Backup ",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.1,
|
||||
"position": [
|
||||
520,
|
||||
520
|
||||
],
|
||||
"notesInFlow": false,
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "GSL12tNi3MPvTZux",
|
||||
"name": "Mealie API"
|
||||
}
|
||||
},
|
||||
"notes": "Send an API call to run the backup"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "POST",
|
||||
"url": "https://ntfy.example/backups",
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Title",
|
||||
"value": "Meale Backup Failure"
|
||||
},
|
||||
{
|
||||
"name": "Priority",
|
||||
"value": "urgent"
|
||||
},
|
||||
{
|
||||
"name": "Tags",
|
||||
"value": "warning"
|
||||
},
|
||||
{
|
||||
"name": "Actions",
|
||||
"value": "view, Open Mealie, https://mealie.example/admin/backups; view, Open n8n, https://n8n.example"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sendBody": true,
|
||||
"contentType": "raw",
|
||||
"body": "\"Full Panic!\"",
|
||||
"options": {}
|
||||
},
|
||||
"id": "40ba81a5-5741-4b15-98af-1a9e6b34f997",
|
||||
"name": "Ntfy Warning",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.1,
|
||||
"position": [
|
||||
1000,
|
||||
520
|
||||
],
|
||||
"onError": "continueRegularOutput"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "https://mealie.example/api/admin/backups",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"options": {}
|
||||
},
|
||||
"id": "b75571d0-d926-440c-897f-55b89c6a5080",
|
||||
"name": "Get all backups",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.1,
|
||||
"position": [
|
||||
520,
|
||||
820
|
||||
],
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "GSL12tNi3MPvTZux",
|
||||
"name": "Mealie API"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"fieldToSplitOut": "imports",
|
||||
"options": {}
|
||||
},
|
||||
"id": "943d0e83-682b-4500-9faf-53284cfb02c6",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
720,
|
||||
820
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "// Get input data\nconst inputData = items.map(item => item.json);\n\n// Sort the data based on the 'date' field in descending order\ninputData.sort((a, b) => new Date(b.date) - new Date(a.date));\n\n// Get all records except the latest 7\nconst allExceptLatest7 = inputData.slice(7);\n\n// Map the output data back to the required format\nreturn allExceptLatest7.map(record => ({ json: record }));\n"
|
||||
},
|
||||
"id": "64eae81d-fdb6-44f7-9a2d-eff8d1763281",
|
||||
"name": "Code",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
860,
|
||||
820
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "DELETE",
|
||||
"url": "=https://mealie.example/api/admin/backups/{{ $json.name }}",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"options": {}
|
||||
},
|
||||
"id": "1148eeb8-4860-46df-8f61-0e85ea1e0e89",
|
||||
"name": "Delete Oldies",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.1,
|
||||
"position": [
|
||||
1040,
|
||||
820
|
||||
],
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "GSL12tNi3MPvTZux",
|
||||
"name": "Mealie API"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Sends API Call to run backup",
|
||||
"height": 225,
|
||||
"width": 226,
|
||||
"color": 4
|
||||
},
|
||||
"id": "cd2cb5db-87c1-40d8-a746-e61ace231987",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
460,
|
||||
460
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Is there an error?",
|
||||
"height": 225,
|
||||
"width": 231,
|
||||
"color": 3
|
||||
},
|
||||
"id": "0bebecbe-903e-4a69-bb1a-35619e68b540",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
700,
|
||||
460
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Send alert to NTFY",
|
||||
"height": 225,
|
||||
"width": 229
|
||||
},
|
||||
"id": "0b732adb-8a84-456d-b26d-5fc5ee5a4cae",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
940,
|
||||
460
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Gets all backups in Mealie",
|
||||
"height": 225,
|
||||
"width": 226,
|
||||
"color": 4
|
||||
},
|
||||
"id": "99c6886b-6a07-4b51-b395-d4bbcbde7d18",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
460,
|
||||
760
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Splits the data, and parses the output",
|
||||
"height": 225,
|
||||
"width": 281
|
||||
},
|
||||
"id": "549555f8-0aed-42c0-9693-9c0d93902796",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
700,
|
||||
760
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Deletes all but the last 7 backups",
|
||||
"height": 225,
|
||||
"width": 229
|
||||
},
|
||||
"id": "bcc5f0ba-73e9-42d7-b01b-c32f9f69f2f7",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1000,
|
||||
760
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"content": "Run every day a 01:00",
|
||||
"height": 225,
|
||||
"width": 226,
|
||||
"color": 4
|
||||
},
|
||||
"id": "ce797062-d727-43e3-a27f-e29b13ad3c9a",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
180,
|
||||
600
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"options": {
|
||||
"caseSensitive": true,
|
||||
"leftValue": "",
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"id": "8b00bb85-827f-4f2f-813e-db0d25e927d3",
|
||||
"leftValue": "={{ $json.error }}",
|
||||
"rightValue": "",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"combinator": "and"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "fefd3e8b-9b71-490a-82e3-25e5468a4135",
|
||||
"name": "Error?",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
760,
|
||||
520
|
||||
]
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Run Backup ",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Get all backups",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Run Backup ": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Error?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get all backups": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Code": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Delete Oldies",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Error?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Ntfy Warning",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "68e3e469-3ddb-4838-b09d-3c69fdd851f5",
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": true,
|
||||
"instanceId": "630eefaa8c490b9c5221d83a182af6450c2c3efaf4b580b8ac348631abfe1aeb"
|
||||
},
|
||||
"id": "whloxeXkdBWWi2Uj",
|
||||
"tags": []
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
# v0.1.0 - Initial Beta
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed Can't delete recipe after changing name - Closes Closes #67
|
||||
- Fixed No image when added by URL, and can't add an image - Closes Closes #66
|
||||
- Fixed Images saved with no way to delete when add recipe via URL fails - Closes Closes #43
|
||||
|
||||
### Features
|
||||
- Additional Language Support
|
||||
- Improved deployment documentation
|
||||
- Additional database! SQlite is now supported! - Closes #48
|
||||
- All site data is now backed up.
|
||||
- Support for Prep Time, Total Time, and Cook Time field - Closes #63
|
||||
- New backup import process with support for themes and site settings
|
||||
- **BETA** ARM support! - Closes #69
|
||||
|
||||
### Code / Developer Improvements
|
||||
- Unified Database Access Layers
|
||||
- Poetry / pyproject.toml support over requirements.txt
|
||||
- Local development without database is now possible!
|
||||
- Local mkdocs server added to docker-compose.dev.yml
|
||||
- Major code refactoring to support new database layer
|
||||
- Global variable refactor
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- Internal docker port is now 80 instead of 9000. You MUST remap the internal port to connect to the UI.
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
As I've adopted the SQL database model I find that using 2 different types of databases will inevitably hinder development. As such after release v0.1.0 support for mongoDB will no longer be available. Prior to upgrading to v0.2.0 you will need to export your site and import after updating. This should be a painless process and require minimal intervention on the users part. Moving forward we will do our best to minimize changes that require user intervention like this and make updates a smooth process.
|
||||
|
||||
|
||||
## v0.0.2 - Pre-release Second Patch
|
||||
A quality update with major props to [zackbcom](https://github.com/zackbcom) for working hard on making the theming just that much better!
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed empty backup failure without markdown template
|
||||
- Fixed opacity issues with marked steps - [mtoohey31](https://github.com/mtoohey31)
|
||||
- Fixed hot-reloading development environment - [grssmnn](https://github.com/grssmnn)
|
||||
- Fixed recipe not saving without image - Closes #7 + Closes #54
|
||||
- Fixed parsing error on image property null - Closes #43
|
||||
|
||||
### General Improvements
|
||||
- Added Confirmation component to deleting recipes - [zackbcom](https://github.com/zackbcom)
|
||||
- Updated Theme backend - [zackbcom](https://github.com/zackbcom)
|
||||
- Added Persistent storage to vuex - [zackbcom](https://github.com/zackbcom)
|
||||
- General Color/Theme Improvements
|
||||
- More consistent UI
|
||||
- More minimalist coloring
|
||||
- Added API key extras to Recipe Data - [See Documentation](/api/api-usage/)
|
||||
- Users can now add custom json key/value pairs to all recipes via the editor for access in 3rd part applications. For example users can add a "message" field in the extras that can be accessed on API calls to play a message over google home.
|
||||
- Improved image rendering (nearly x2 speed)
|
||||
- Improved documentation + API Documentation
|
||||
- Improved recipe parsing - Closes #51
|
||||
- User feedback on backup importing
|
||||
|
||||
## v0.0.1 - Pre-release Patch
|
||||
### General
|
||||
- Updated Favicon
|
||||
- Renamed Frontend Window
|
||||
- Added Debug folder to dump scraper data prior to processing.
|
||||
|
||||
### Recipes
|
||||
- Added user feedback on bad URL
|
||||
- Better backend data validation for updating recipes, avoid small syntax errors corrupting database entry. [Closes #8](https://github.com/mealie-recipes/mealie/issues/8)
|
||||
- Fixed spacing Closes while editing new recipes in JSON
|
||||
|
||||
## v0.0.0 - Initial Pre-release
|
||||
The initial pre-release. It should be semi-functional but does not include a lot of user feedback You may notice errors that have no user feedback and have no idea what went wrong.
|
||||
|
||||
### Recipes
|
||||
- Automatic web scrapping for common recipe platforms
|
||||
- Interactive API Documentation thanks to [FastAPI](https://fastapi.tiangolo.com/) and [Swagger](https://petstore.swagger.io/)
|
||||
- UI Recipe Editor
|
||||
- JSON Recipe Editor in browser
|
||||
- Custom tags and categories
|
||||
- Rate recipes
|
||||
- Add notes to recipes
|
||||
- Migration From Other Platforms
|
||||
- Chowdown
|
||||
### Meal Planner
|
||||
- Random Meal plan generation based off categories
|
||||
- Expose notes in the API to allow external applications to access relevant information for meal plans
|
||||
|
||||
### Database Import / Export
|
||||
- Easily Import / Export your recipes from the UI
|
||||
- Export recipes in markdown format for universal access
|
||||
- Use the default or a custom jinja2 template
|
||||
@@ -1,72 +0,0 @@
|
||||
# v0.2.1 - Hot Fixes!
|
||||
|
||||
### Features and Improvements
|
||||
- Fixes upload image error when no photo was scrapped
|
||||
- Fixes no last_recipe.json not updating
|
||||
- Added markdown rendering for notes
|
||||
- New notifications
|
||||
- Minor UI improvements
|
||||
- Recipe editor refactor
|
||||
- Settings/Theme models refactor
|
||||
|
||||
### Development / Misc
|
||||
- Added async file response for images, downloading files.
|
||||
- Breakup recipe view component
|
||||
|
||||
# v0.2.0 - Now with Test!
|
||||
This is, what I think, is a big release! Tons of new features and some great quality of life improvements with some additional features. You may find that I made promises to include some fixes/features in v0.2.0. The short of is I greatly underestimated the work needed to refactor the database to a usable state and integrate categories in a way that is useful for users. This shouldn't be taken as a sign that I'm dropping those feature requests or ignoring them. I felt it was better to push a release in the current state rather than drag on development to try and fulfil all of the promises I made.
|
||||
|
||||
!!! warning "Upgrade Process"
|
||||
Database Breaks! I have not yet implemented a database migration service. As such, upgrades cannot be done by simply pulling the image. You must first export your recipes, update your deployment, and then import your recipes. This pattern is likely to be how upgrades take place prior to v1.0. After v1.0 migrations will be done automatically.
|
||||
|
||||
### Bug Fixes
|
||||
- Remove ability to save recipe with no name
|
||||
- Fixed data validation error on missing parameters
|
||||
- Fixed failed database initialization at startup - Closes #98
|
||||
- Fixed misaligned text on various cards
|
||||
- Fixed bug that blocked opening links in new tabs - Closes #122
|
||||
- Fixed router link bugs - Closes #122
|
||||
- Fixed navigation on keyboard selection - Closes #139
|
||||
|
||||
### Features and Improvements
|
||||
- 🐳 Dockerfile now 1/5 of the size!
|
||||
- 🌎 UI Language Selection + Additional Supported Language
|
||||
- **Home Page**
|
||||
- By default your homepage will display only the recently added recipes. You can configured sections to show on the home-screen based of categories on the settings page.
|
||||
- A new sidebar is now shown on the main page that lists all the categories in the database. Clicking on them navigates into a page that shows only recipes.
|
||||
- Basic Sort functionality has been added. More options are on the way!
|
||||
- **Meal Planner**
|
||||
- Improved Search (Fuzzy Search)
|
||||
- New Scheduled card support
|
||||
- **Recipe Editor**
|
||||
- Ingredients are now sortable via drag-and-drop
|
||||
- Known categories now show up in the dropdown - Closes 83
|
||||
- Initial code for data validation to prevent errors
|
||||
- **Migrations**
|
||||
- Card based redesign
|
||||
- Upload from the UI
|
||||
- Unified Chowdown / Nextcloud import process. (Removed Git as a dependency)
|
||||
- **API**
|
||||
- Category and Tag endpoints added
|
||||
- Major Endpoint refactor
|
||||
- Improved API documentation
|
||||
- Link to your Local API is now on your `/settings/site`. You can use it to explore your API.
|
||||
|
||||
- **Style**
|
||||
- Continued work on button/style unification
|
||||
- Adding icons to buttons
|
||||
- New Color Theme Picker UI
|
||||
|
||||
### Development
|
||||
- Fixed Vetur config file. Autocomplete in VSCode works!
|
||||
- File/Folder restructuring
|
||||
- Added Prettier config
|
||||
- Fixed incorrect layout code
|
||||
- FastAPI Route tests for major operations - WIP (shallow testing)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
- API endpoints have been refactored to adhere to a more consistent standard. This is a WIP and more changes are likely to occur.
|
||||
- Officially Dropped MongoDB Support
|
||||
- Database Breaks! We have not yet implemented a database migration service. As such, upgrades cannot be done by simply pulling the image. You must first export your recipes, update your deployment, and then import your recipes. This pattern is likely to be how upgrades take place prior to v1.0. After v1.0 migrations will be done automatically.
|
||||
@@ -1,29 +0,0 @@
|
||||
# v0.3.0
|
||||
|
||||
### Bug Fixes
|
||||
- Fixed open search on `/` when in input. - Closes #174
|
||||
- Error when importing recipe: KeyError: '@type' - Closes #145
|
||||
- Fixed Import Issue - bhg.com - Closes #138
|
||||
- Scraper not working with recipe containing HowToSection - Closes #73
|
||||
|
||||
### Features and Improvements
|
||||
- Improved Nextcloud Imports
|
||||
- Improved Recipe Parser!
|
||||
- Open search with `/` hotkey!
|
||||
- Database and App version are now split
|
||||
- Unified and improved snackbar notifications
|
||||
- New Category/Tag endpoints to filter all recipes by Category or Tag
|
||||
- Category sidebar now has show/hide behavior on mobile
|
||||
- Settings menu on mobile is improved
|
||||
- **Meal Planner**
|
||||
- You can now restrict recipe categories used for random meal-plan creation in the settings menu
|
||||
- Recipe picker dialog will now display recipes when the search bar is empty
|
||||
- Minor UI improvements
|
||||
- **Shopping lists!** Shopping list can now be generated from a meal plan. Currently ingredients are split by recipes or there is a beta feature that attempts to sort them by similarity.
|
||||
- **Recipe Viewer**
|
||||
- Categories, Tags, and Notes will now be displayed below the steps on smaller screens
|
||||
- **Recipe Editor**
|
||||
- Text areas now auto grow to fit content
|
||||
- Description, Steps, and Notes support Markdown! This includes inline html in Markdown.
|
||||
- **Imports**
|
||||
- A revamped dialog has been created to provide more information on restoring backups. Exceptions on the backend are now sent to the frontend and are easily viewable to see what went wrong when you restored a backup. This functionality will be ported over to the migrations in a future release.
|
||||
@@ -1,86 +0,0 @@
|
||||
# v0.4.0 Whoa, What a Release!
|
||||
|
||||
**App Version: v0.4.0**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Database
|
||||
A new database will be created. You must export your data and then import it after upgrading.
|
||||
|
||||
#### Site Settings
|
||||
With the addition of group settings and a re-write of the database layer of the application backend, there is no migration path for your current site settings. Webhooks Settings, Meal Plan Categories are now managed by groups. Site settings, mainly homepage settings, are now site specific and managed by administrators. When upgrading be sure to uncheck the settings when importing your old data.
|
||||
|
||||
#### ENV Variables
|
||||
Names have been changed to be more consistent with industry standards. See the [Installation Page](/mealie/getting-started/install/) for new parameters.
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed Search Results Limited to 100 - #198
|
||||
- Fixed recipes from marmiton.org not fully scrapped - #196
|
||||
- Fixed Unable to get a page to load - #194
|
||||
- Fixed Recipe's from Epicurious don't upload. - #193
|
||||
- Fixed Edited blank recipe in meal plan is not saved - #184
|
||||
- Fixed Create a new meal plan allows selection of an end date that is prior to the start date - #183
|
||||
- Fixed Original URL not saved to imported recipe in 0.3.0-dev - #183
|
||||
- Fixed "IndexError: list index out of range" when viewing shopping list for meal plan containing days without a recipe selected - #178
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### General
|
||||
- Documentation Rewrite
|
||||
- [New Demo Site!](https://mealie-demo.hay-kot.dev/)
|
||||
- New Documentation
|
||||
- Landing Page
|
||||
- Custom Caddy Configuration
|
||||
- User Management
|
||||
- Introduction
|
||||
- Updated Documentation
|
||||
- Everything!
|
||||
- The API Reference is now better embedded inside of the docs
|
||||
- New default external port in documentation (Port 9000 -> 9925). This is only the port exposed by the host to the docker image. It doesn't change any existing functionality.
|
||||
|
||||
### User Authentication
|
||||
- Authentication! Tons of stuff went into creating a flexible authentication platform for a lot of different use cases. Review the documentation for more information on how to use the authentication, and how everything works together. More complex management of recipes and user restrictions are in the works, but this is a great start! Some key features include
|
||||
- Sign Up Links
|
||||
- Admin and User Roles
|
||||
- Password Change
|
||||
- Group Management
|
||||
- Create/Edit/Delete Restrictions
|
||||
|
||||
### Custom Pages
|
||||
- You can now create custom pages that are displayed on the homepage sidebar to organize categories of recipes into pages. For example, if you have several categories that encompass "Entrée" you can group all those categories together under the "Entrée" page. See [Building Pages](/mealie/site-administration/building-pages/) for more information.
|
||||
!!! tip
|
||||
Note that this replaces the behavior of automatically adding categories to the sidebar.
|
||||
|
||||
### UI Improvements
|
||||
- Completed Redesign of the Admin Panel
|
||||
- Profile Pages
|
||||
- Side Panel Menu
|
||||
- Improved UI for Recipe Search
|
||||
- Language selector is now displayed on all pages and does not require an account
|
||||
|
||||
### Recipe Data
|
||||
- Recipe Database Refactoring. Tons of new information is now stored for recipes in the database. Not all is accessible via the UI, but it's coming.
|
||||
- Nutrition Information
|
||||
- calories
|
||||
- fatContent
|
||||
- fiberContent
|
||||
- proteinContent
|
||||
- sodiumContent
|
||||
- sugarContent
|
||||
- recipeCuisine has been added
|
||||
- "categories" has been migrated to "recipeCategory" to adhere closer to the standard schema
|
||||
- "tool" - a list of tools used for the recipe
|
||||
|
||||
### Behind the Scenes
|
||||
- Removed CDN dependencies
|
||||
- Database Model Refactoring
|
||||
- Import/Export refactoring
|
||||
- File/Folder Name Refactoring
|
||||
- Development is now easier with a makefile
|
||||
- Mealie is now a proper package using poetry
|
||||
- Test refactoring
|
||||
- Test Coverage 83% up from 75%!
|
||||
@@ -1,35 +0,0 @@
|
||||
# v0.4.1
|
||||
|
||||
**App Version: v0.4.1**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Recipe Images
|
||||
While it *shouldn't* be a breaking change, I feel it is important to note that you may experience issues with the new image migration. Recipe images are now minified, this is done on start-up, import, migration, and when a new recipe is created. The initial boot or load may be a bit slow if you have lots of recipes but you likely won't notice. What you may notice is that if your recipe slug and the image name do not match, you will encounter issues with your images showing up. This can be resolved by finding the image directory and rename it to the appropriate slug. I did fix multiple edge cases, but it is likely more exists. As always make a backup before you update!
|
||||
|
||||
On the plus side, this comes with a huge performance increase! 🎉
|
||||
|
||||
- Add markdown support for ingredients - Resolves #32
|
||||
- Ingredients editor improvements
|
||||
- Fix Tags/Categories render problems on recipes
|
||||
- Tags redirect to new tag pages
|
||||
- Categories redirect to category pages
|
||||
- Fix Backup download blocked by authentication
|
||||
- Random meal-planner will no longer duplicate recipes unless no other options
|
||||
- New Quick Week button to generate next 5 day week of recipe slots.
|
||||
- Minor UI tweaks
|
||||
- Recipe Cards now display 2 recipe tags
|
||||
- Recipe images are now minified. This comes with a serious performance improvement. On initial startup you may experience some delays. Images are migrated to the new structure on startup, depending on the size of your database this can take some time.
|
||||
- Note that original images are still kept for large displays like on the individual recipe pages.
|
||||
- A smaller image is used for recipe cards
|
||||
- A 'tiny' image is used for search images.
|
||||
- Advanced Search Page. You can now use the search page to filter recipes to include/exclude tags and categories as well as select And/Or matching criteria.
|
||||
- Added link to advanced search on quick search
|
||||
- Better support for NextCloud imports
|
||||
- Translate keywords to tags
|
||||
- Fix rollback on failure
|
||||
- Recipe Tag/Category Input components have been unified and now share a single way to interact. To add a new category in the recipe editor you need to click to '+' icon next to the input and fill out the form. This is the same for adding a Tag.
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# v0.4.2
|
||||
|
||||
**App Version: v0.4.2**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
1. With a recent refactor some users been experiencing issues with an environmental variable not being set correct. If you are experiencing issues, please provide your comments [Here](https://github.com/mealie-recipes/mealie/issues/281).
|
||||
|
||||
2. If you are a developer, you may experience issues with development as a new environmental variable has been introduced. Setting `PRODUCTION=false` will allow you to develop as normal.
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed Initialization script (v0.4.1a Hot Fix) - Closes #274
|
||||
- Fixed nested list error on recipe scrape - Closes #306
|
||||
- Fixed ingredient checkboxes - Closes #304
|
||||
- Removed link on recent - Closes #297
|
||||
- Categories sidebar is auto generated if no pages are created - Closes #291
|
||||
- Fix tag issues on creating custom pages - Closes #290
|
||||
- Validate paths on export - Closes #275
|
||||
- Walk Nextcloud import directory - Closes #254
|
||||
|
||||
## General Improvements
|
||||
- Improved Nextcloud Migration. Mealie will now walk the directories in a zip file looking for directories that match the pattern of a Nextcloud Recipe. Closes #254
|
||||
- Rewrite Keywords to Tag Fields
|
||||
- Rewrite url to orgURL
|
||||
- Improved Chowdown Migration
|
||||
- Migration report is now similar to the Backup report
|
||||
- Tags/Categories are now title cased on import "dinner" -> "Dinner"
|
||||
- Depreciate `ENV` variable to `PRODUCTION`
|
||||
- Set `PRODUCTION` env variable to default to true
|
||||
- Unify Logger across the backend
|
||||
- mealie.log and last_recipe.json are now downloadable from the frontend from the /admin/about
|
||||
- New download schema where you request a token and then use that token to hit a single endpoint to download a file. This is a notable change if you are using the API to download backups.
|
||||
- Recipe images can now be added directly from a URL - [See #117 for details](https://github.com/mealie-recipes/mealie/issues/117)
|
||||
@@ -1,14 +0,0 @@
|
||||
# v0.4.3
|
||||
|
||||
**App Version: v0.4.3**
|
||||
|
||||
**Database Version: v0.4.0**
|
||||
|
||||
## Bug Fixes
|
||||
- Fix Upload error for Migrations
|
||||
- Fixes #315 - Cannot select another language
|
||||
- Fixes #314 - case-sensitive emails
|
||||
- Fixes #312 - Profile Image Reload
|
||||
|
||||
## Improvements
|
||||
- New TOKEN_TIME and DEFAULT_EMAIL env variables
|
||||
@@ -1,129 +0,0 @@
|
||||
# v0.5.0 Too Many Changes!
|
||||
|
||||
**App Version: v0.5.0**
|
||||
|
||||
**Database Version: v0.5.0**
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
|
||||
#### Database
|
||||
Database version has been bumped from v0.4.x -> v0.5.0. You will need to export and import your data. Moving forward, we will be using database migrations (BETA) to do this automatically. Note that you still must backup your data. If you don't, it's entirely possible something may go wrong and you could lose your data on upgrade.
|
||||
|
||||
#### Image Directory
|
||||
the /data/img directory has been depreciated. All images are now stored in the /recipes/{slug}/image directory. Images should be migrated automatically, but you may experience issues related to this change.
|
||||
|
||||
#### API Usage
|
||||
If you have been using the API directly, many of the routes and status codes have changed. You may experience issues with directly consuming the API.
|
||||
|
||||
#### Arm/v7 Support
|
||||
Mealie will no longer build in CI/CD due to a issue with the rust compiler on 32 bit devices. You can reference [this issue on the matrix-org/synapse](https://github.com/matrix-org/synapse/issues/9403) Github page that are facing a similar issue. You may still be able to build the docker image you-self.
|
||||
|
||||
!!! warning "Potential Data Loss"
|
||||
With this release comes a major rework of how files are stored on disk and where things belong. Migration of files should be done automatically. We have tested extensively with many different backups and user bases and have found that no one experienced data-loss. HOWEVER, with all the major changes that have occurred, it is vital that to prevent any data-loss you must create a backup and store that backup outside of your mealie instance. If you do not do this, you may lose your data.
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed #25 - Allow changing rating without going into edit
|
||||
- Fixed #475 - trim whitespace on login
|
||||
- Fixes #435 - Better Email Regex
|
||||
- Fixed #428 - Meal Planner now works on iOS devices
|
||||
- Fixed #419 - Typos
|
||||
- Fixed #418 - You can now "export" shopping lists
|
||||
- Fixed #356 - Shopping List items are now grouped
|
||||
- Fixed #329 - Fixed profile image not loading
|
||||
- Fixed #461 - Proper JSON serialization on webhooks
|
||||
- Fixed #332 - Language settings are saved for one browser
|
||||
- Fixes #281 - Slow Handling of Large Sets of Recipes
|
||||
- Fixed #356 - Shopping lists generate duplicate items
|
||||
- Fixed #271 - Slow handling of larger data sets
|
||||
- Fixed #472, #469, #458, #456 - Improve Recipe Parser
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### Highlights
|
||||
- Recipe Parser
|
||||
- Recipes can now be imported with a bookmarklet!
|
||||
- Significant improvement in supported sites with the new [Recipe Scraper Library](https://github.com/hhursev/recipe-scrapers)
|
||||
- UI Debugging now available at `/recipes/debugger`
|
||||
- Better error messages on failure
|
||||
- ⚠️ last_recipe.json is now depreciated
|
||||
- Beta Support for Postgres! 🎉 See the getting started page for details
|
||||
- Recipe Features
|
||||
- New button bar for editors with improved accessibility and performance
|
||||
- Step Sections now supported
|
||||
- Recipe Assets
|
||||
- Add Asset image to recipe step
|
||||
- Additional View Settings.
|
||||
- Better print support
|
||||
- New Toolbox Page!
|
||||
- Bulk assign categories and tags by keyword search
|
||||
- Title case all Categories or Tags with 1 click
|
||||
- Create/Rename/Delete Operations for Tags/Categories
|
||||
- Remove Unused Categories or Tags with 1 click
|
||||
- Recipe Cards now have a menu button for quick actions!
|
||||
- Edit
|
||||
- Delete
|
||||
- Integrated Share with supported OS/Browsers
|
||||
- Print
|
||||
- New Profile Dashboard!
|
||||
- Edit Your Profile
|
||||
- Create/Edit Themes
|
||||
- View other users in your Group
|
||||
- See what's for dinner
|
||||
- Manage Long Live API Tokens (New)
|
||||
- New Admin Dashboard! 🎉
|
||||
- Now you can get some insight on your application with application statistics and events.
|
||||
- See uncategorized/untagged recipes and organize them!
|
||||
- Backup/Restore right from your dashboard
|
||||
- See server side events. Now you can know who deleted your favorite recipe!
|
||||
- New Event Notifications through the Apprise Library
|
||||
- Get notified when specific server side events occur
|
||||
|
||||
### Meal Planner
|
||||
- Multiple Recipes per day
|
||||
- Supports meals without recipes (Enter title and description)
|
||||
- Generate share-link from created meal-planners
|
||||
- Shopping lists can be directly generated from the meal plan
|
||||
|
||||
### General
|
||||
- User can now favorite recipes
|
||||
- New 'Dark' Color Theme Packaged with Mealie
|
||||
- Updated Recipe Card Sections Toolbar
|
||||
- New Sort Options (They work this time!)
|
||||
- Alphabetical
|
||||
- Rating
|
||||
- Created Date
|
||||
- Updated Date
|
||||
- Shuffle (Random Sort)
|
||||
- New 'Random' Recipe button on recipe sections. Random recipes are selected from the filtered results below. For example, on the "Cakes" category page, you will only get recipes in the "Cakes" category.
|
||||
- Rating can be updated without entering the editor - Closes #25
|
||||
- Updated recipe editor styles and moved notes to below the steps.
|
||||
- Redesigned search bar
|
||||
- 'Dinner this week' shows a warning when no meal is planned yet
|
||||
- 'Dinner today' shows a warning when no meal is planned yet
|
||||
- More localization
|
||||
- Start date for Week is now selectable
|
||||
- Languages are now managed through Crowdin
|
||||
- Application Bar was Rewritten
|
||||
- Sidebar can now be toggled everywhere.
|
||||
- New and improved mobile friendly bottom bar
|
||||
- Improved styling for search bar in desktop
|
||||
- Improved search layout on mobile
|
||||
- Profile image now shown on all sidebars
|
||||
- Switched from Flash Messages to Snackbar (Removed dependency)
|
||||
|
||||
### Performance
|
||||
- Images are now served up by the Caddy increase performance and offloading some loads from the API server
|
||||
- Requesting all recipes from the server has been rewritten to refresh less often and manage client side data better.
|
||||
- All images are now converted to .webp for better compression
|
||||
|
||||
### Behind the Scenes
|
||||
- The database layer has been added for future recipe scaling.
|
||||
- Black and Flake8 now run as CI/CD checks
|
||||
- New debian based docker image
|
||||
- Unified Sidebar Components
|
||||
- Refactor UI components to fit Vue best practices (WIP)
|
||||
- The API returns more consistent status codes
|
||||
- The API returns error code instead of error text when appropriate
|
||||
- ⚠️ May cause side-effects if you were directly consuming the API
|
||||
@@ -1,11 +0,0 @@
|
||||
# v0.5.1
|
||||
|
||||
**App Version: v0.5.1**
|
||||
|
||||
**Database Version: v0.5.0**
|
||||
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed #538 - Missing Ingredients on Editor
|
||||
- Fixed error on webhooks for new groups
|
||||
- Fixed various icons references
|
||||
@@ -1,65 +0,0 @@
|
||||
# v0.5.2 - DRAFT
|
||||
|
||||
**App Version: v0.5.2**
|
||||
|
||||
**Database Version: v0.5.0**
|
||||
|
||||
## Bug Fixes
|
||||
- Fixed #617 - Section behavior when adding a step
|
||||
- Fixed #615 - Recipe Settings are not available when creating new recipe
|
||||
- Fixed #625 - API of today's image returns strange characters
|
||||
- Fixed [#590](https://github.com/mealie-recipes/mealie/issues/590) - Duplicate Events when using Gunicorn Workers
|
||||
|
||||
## Features and Improvements
|
||||
|
||||
### General
|
||||
- Recipe Instructions now collapse when checked
|
||||
- Default recipe settings can be set through ENV variables
|
||||
- Recipe Ingredient lists can now container ingredient sections.
|
||||
- You can now download and upload individual recipes
|
||||
|
||||
|
||||
### Localization
|
||||
|
||||
Huge thanks to [@sephrat](https://github.com/sephrat) for all his work on the project. He's very consistent in his contributions to the project and nearly every release has had some of his code in it! Here's some highlights from this release
|
||||
|
||||
- Lazy Load Translations (Huge Performance Increase!)
|
||||
- Tons of localization additions all around the site.
|
||||
- All of the work that goes into managing and making Crowdin a great feature the application
|
||||
|
||||
#### Here a list of contributors on Crowding who make Mealie possible in different locals
|
||||
|
||||
| Name | Languages | Translated (Words) | Target Words |
|
||||
| ---------------------------- | ------------------ | :----------------: | :----------: |
|
||||
| retmas-gh | Polish | 550 | 625 |
|
||||
| startos | Italian | 310 | 322 |
|
||||
| CMBoii | Spanish | 256 | 291 |
|
||||
| sephrat | French | 255 | 296 |
|
||||
| Daniel Tildeman (tildeman) | Swedish | 233 | 228 |
|
||||
| Rourke | Dutch | 216 | 214 |
|
||||
| Andreas Waschinski (Wascha) | German | 207 | 202 |
|
||||
| wengtad | Chinese Simplified | 176 | 343 |
|
||||
| Matthias Borremans (MrBorri) | Dutch | 96 | 89 |
|
||||
| Adam Syndoman (pypckompsite) | Polish | 68 | 65 |
|
||||
| JonasSchubert | German | 22 | 23 |
|
||||
| ThrawnJL | Danish | 7 | 7 |
|
||||
| NicholasBrody | Dutch | 7 | 7 |
|
||||
| Giel Janssens (gieljnssns) | Dutch | 4 | 4 |
|
||||
| kentora | Danish | 3 | 2 |
|
||||
|
||||
|
||||
|
||||
### Docker
|
||||
|
||||
#### Huge thanks to [@wengtad](https://github.com/wengtad) for all his work on improving the deployment with docker.
|
||||
|
||||
- Optimize Docker Dev Size (Frontend: from ~1.52GB to ~429MB | API: from ~657MB to ~380MB)
|
||||
- Optimize Docker Prod Size (from ~542MB to ~373MB)
|
||||
- Add Gunicorn
|
||||
- Add Gunicorn and Webworkers to Dockerfile #550
|
||||
- Add Docs for Gunicorn
|
||||
- Add PUID/PGID to Docker. Fixes Initialization scripts fail to run when not executing as root user inside container #350,
|
||||
- Not able to run correctly in docker if user permissions are specified #429
|
||||
- Merge Dockerfile.dev into Dockerfile (dev shared same base together with prod)
|
||||
- Add Docs for PUID/PGID
|
||||
- Add Docker healthcheck (for this is not necessary, I could remove if you want)
|
||||
@@ -1,178 +0,0 @@
|
||||
## v1.0.0b - 2022-05-22
|
||||
|
||||
- Bump Dependencies
|
||||
- Recipe Scrapers to 13.28
|
||||
- Jinja2 to 3.1.2
|
||||
- FastAPI to 0.78.0
|
||||
|
||||
- Recipe Ingredient Editor
|
||||
- [#1140](https://github.com/mealie-recipes/mealie/issues/1140) - Error in processing the quantity of ingredients #1140 - UI Now prevents entering not-allowed characters in quantity field
|
||||
- UI now allows no value to be set in addition to a zero (0) value.
|
||||
- [#1237](https://github.com/mealie-recipes/mealie/issues/1237) - UI: Saving a 0 quantity ingredient displays 0 until the page is refreshed #1237 - UI Now properly reacts to changes in the quantity field.
|
||||
|
||||
- Fix Mealie v0.5.x migration issue [#1183](https://github.com/mealie-recipes/mealie/issues/1183)
|
||||
- Consolidated Frontend Types thanks to [@PFischbeck](https://github.com/Fischbeck)
|
||||
- Added support for SSL/No Auth Email [@nkringle](https://github.com/nkringle)
|
||||
- [Implement several notifications for server actions ](https://github.com/mealie-recipes/mealie/pull/1234)[@miroito](https://github.com/Miroito)
|
||||
- Fix display issue for shared recipe rendering on server [@PFischbeck](https://github.com/Fischbeck)
|
||||
|
||||
## v1.0.0b - 2022-05-09
|
||||
|
||||
- Change MIT license to AGPLv3
|
||||
|
||||
## v1.0.0b - 2022-05-08
|
||||
|
||||
- Rewrote the registration flow for new users.
|
||||
- Added support for seed data at anytime through the user interface.
|
||||
- Improved security for sanitizing HTML inputs for user input.
|
||||
- Added support for importing keywords as tags during scraping - [@miroito](https://github.com/Miroito)
|
||||
- Changed default recipe settings to "disable_amount=True" for new groups.
|
||||
- Add support for merging food, and units.
|
||||
- Allow tags, category, and tool creation - [@miroito](https://github.com/Miroito)
|
||||
- Added additional and more comprehensive filter options for cookbooks
|
||||
- Fixed bookmarklets error
|
||||
|
||||
## v1.0.0b - 2022-03-29
|
||||
|
||||
- Mealie now stores the original text from parsed ingredients, with the ability to peak at the original text from a recipe. [@miroito](https://github.com/Miroito)
|
||||
- Added some management / utility functions for administrators to manage data and cleanup artifacts from the file system.
|
||||
- Fix clear url action in recipe creation [#1101](https://github.com/mealie-recipes/mealie/pull/1101) [@miroito](https://github.com/Miroito)
|
||||
- Add group statistics calculations and data storage measurements
|
||||
- No hard limits are currently imposed on groups - though this may be implemented in the future.
|
||||
|
||||
## v1.0.0b - 2022-03-25
|
||||
|
||||
- Mealie now packages the last git commit as the build ID
|
||||
- Admin section now has a "Maintenance" page where you can check some health metrics like data directory size, logs file size, and if there are some non compliant directories or images. You can also perform clean-up operations to resolve some of these issues.
|
||||
- Dropped 2 dependencies and moved to using our own base model within the project
|
||||
- Removed lots of dead backup code
|
||||
- Recipe names will now be auto-incremented when a conflict is found. So if you're adding a recipe named "Tomato Soup" and that recipe name already exists in your database one will be created with the name "Tomato Soup (1)". Currently this is done in a loop until a suitable name is found, however it will error out after 10 attempts so it's best to find a more descriptive name for your recipe.
|
||||
- Fixed broken PWA where it wouldn't render any content
|
||||
- Added database connection retry loop to ensure that the database is available prior to starting
|
||||
- Reorganized group routes to be more consistent with the rest of the application
|
||||
|
||||
## v1.0.0b Beta Release!
|
||||
|
||||
!!! error "Breaking Changes"
|
||||
As you may have guessed, this release comes with some breaking changes. If you are/were consuming the API you will need to validate all endpoints as nearly all of them have changed.
|
||||
|
||||
To import your data into Mealie v1 from the most recent previous release, you'll need to export and import your data using the built in method. **Note that only your recipes will be usable in the migration**.
|
||||
|
||||
### ✨ What's New (What isn't?!?!)
|
||||
|
||||
#### 🥳 General
|
||||
|
||||
- Mealie will by default only be accessible to users. Future plans are to create spaces for non-users to access a specific group.
|
||||
- Mealie has gone through a big redesign and has tried to standardize it's look a feel a bit more across the board.
|
||||
- User/Group settings are now completely separated from the Administration page.
|
||||
- All settings and configurations pages now have some sort of self-documenting help text. Additional text or descriptions are welcome from PRs
|
||||
- New experimental banner for the site to give users a sense of what features are still "in development" and provide a link to a github issue that provides additional context.
|
||||
- Groups now offer full multi-tenant support so you can all groups have their own set of data.
|
||||
|
||||
##### ⚙️ Site Settings Page
|
||||
|
||||
- Site Settings has been completely revamped. All site-wide settings at defined on the server as ENV variables. The site settings page now only shows you the non-secret values for reference. It also has some helpers to let you know if something isn't configured correctly.
|
||||
- Server Side Bare URL will let you know if the BASE_URL env variable has been set
|
||||
- Secure Site let's you know if you're serving via HTTPS or accessing by localhost. Accessing without a secure site will render some of the features unusable.
|
||||
- Email Configuration Status will let you know if all the email settings have been provided and offer a way to send test emails.
|
||||
|
||||
#### 👨👩👧👦 Users and Groups
|
||||
|
||||
- All members of a group can generate invitation tokens for other users to join their group
|
||||
- Users now a have "Advanced" setting to enable/disable features like Webhooks and API tokens. This will also apply to future features that are deemed as advanced.
|
||||
- "Pages" have been dropped in favor of Cookbooks which are now group specific so each group can have it's own set of cookbooks
|
||||
- Default recipe settings can now be set by the group instead of environmental variables.
|
||||
- Password reset via email
|
||||
- Invitation to group by email
|
||||
- Manage group member permissions
|
||||
|
||||
#### 📦 Data Migrations
|
||||
|
||||
- Migrations have been moved from the Admin Page to a Group Migration page. Migrations from applications (or previous versions of Mealie) can now be imported into Mealie via the Group Migration pages where all recipes will be imported into the group.
|
||||
- **Supported Migrations**
|
||||
- Mealie Pre v1.0.0
|
||||
- Nextcloud Recipes
|
||||
- Chowdown
|
||||
|
||||
#### 🛒 Shopping Lists
|
||||
|
||||
- Shopping Lists has been completely revamped to be more flexible and user friendly.
|
||||
- Add recipe ingredients to a shopping list
|
||||
- Manually add item/ingredient to shopping list
|
||||
- Copy as markdown or plain text
|
||||
- Sort by food/item Labels
|
||||
- Checked items are now hidden
|
||||
- Uncheck all Items
|
||||
- Delete all checked items
|
||||
|
||||
#### 📢 Apprise Integration
|
||||
|
||||
- Server based Apprise notifications have been deprecated. An effort has been made to improve logging overall in the application and make it easier to monitor/debug through the logs.
|
||||
- The Apprise integration has been updated to the latest version and is now used asynchronously.
|
||||
- Notifiers now support a wider variety of events.
|
||||
- Notifiers can now be managed by-group instead of by the server.
|
||||
|
||||
#### 🗓 Meal Plans
|
||||
|
||||
- Meal plans have been completely redesigned to use a calendar approach so you'll be able to see what meals you have planned in a more traditional view
|
||||
- Drag and Drop meals between days
|
||||
- Add Recipes or Notes to a specific day
|
||||
- New context menu action for recipes to add a recipe to a specific day on the meal-plan
|
||||
- New rule based meal plan generator/selector. You can now create rules to restrict the addition of recipes for specific days or meal types (breakfast, lunch, dinner, side). You can also create rules that match against "all" days or "all" meal types to create global rules based around tags and categories. This gives you the most flexibility in creating meal plans.
|
||||
|
||||
#### 🥙 Recipes
|
||||
|
||||
##### 🔍 Search
|
||||
|
||||
- Search now includes the ability to fuzzy search ingredients
|
||||
- Search now includes an additional filter for "Foods" which will filter (Include/Exclude) matches based on your selection.
|
||||
|
||||
##### 🍴 Recipe General
|
||||
|
||||
- Recipe Pages now implement a screen lock on supported devices to keep the screen from going to sleep.
|
||||
- Recipes are now only viewable by group members
|
||||
- Recipes can be shared with share links
|
||||
- Shared recipes can now render previews for the recipe on sites like Twitter, Facebook, and Discord.
|
||||
- Recipes now have a `tools` attribute that contains a list of required tools/equipment for the recipe. Tools can be set with a state to determine if you have that tool or not. If it's marked as on hand it will show checked by default.
|
||||
- Recipe Extras now only show when advanced mode is toggled on
|
||||
- You can now import multiple URLs at a time pre-tagged using the bulk importer. This task runs in the background so no need to wait for it to finish.
|
||||
- Foods/Units for Ingredients are now supported (toggle inside your recipe settings)
|
||||
- Common Food and Units come pre-packaged with Mealie
|
||||
- Landscape and Portrait views are now available
|
||||
- Users with the advanced flag turned on will now be able to manage recipe data in bulk and perform the following actions:
|
||||
- Set Categories
|
||||
- Set Tags
|
||||
- Delete Recipes
|
||||
- Export Recipes
|
||||
- Recipes now have a `/cook` page for a simple view of the recipe where you can click through each step of a recipe and it's associated ingredients.
|
||||
- The Bulk Importer has received many additional upgrades.
|
||||
- Trim Whitespace: automatically removes leading and trailing whitespace
|
||||
- Trim Prefix: Removes the first character of each line. Useful for when you paste in a list of ingredients or instructions that have 1. or 2. in front of them.
|
||||
- Split By Numbered Line: Attempts to split a paragraph into multiple lines based on the patterns matching '1.', '1:' or '1)'.
|
||||
|
||||
##### 🍞 Recipe Ingredients
|
||||
|
||||
- Recipe ingredients can now be scaled when the food/unit is defined
|
||||
- Recipe ingredients can now be copied as markdown lists
|
||||
- example `- [ ] 1 cup of flour`
|
||||
- You can now use Natural Language Processing (NLP) to process ingredients and attempt to parse them into amounts, units, and foods. There is an additional "Brute Force" processor that can be used as pattern matching parser to try and determine ingredients. **Note** if you are processing a Non-English language you will have terrible results with the NLP and will likely need to use the Bruce Force processor.
|
||||
|
||||
##### 📜 Recipe Instructions
|
||||
|
||||
- Can now be merged with the above step automatically through the action menu
|
||||
- Recipe Ingredients can be linked directly to recipe instructions for improved display
|
||||
- There is an option in the linking dialog to automatically link ingredients. This works by using a key-word matching algorithm to find the ingredients. It's not perfect so you'll need to verify the links after use, additionally you will find that it doesn't work for non-english languages.
|
||||
- Recipe Instructions now have a preview tab to show the rendered markdown before saving.
|
||||
|
||||
#### ⚠️ Other things to know...
|
||||
|
||||
- Themes have been deprecated for specific users. You can still set specific themes for your site through ENV variables. This approach should yield much better results for performance and some weirdness users have experienced.
|
||||
- If you've experienced slowness in the past, you may notice a significant improvement in the "All Recipes" and "Search" pages, or wherever large payloads of recipes are being displayed. This is due to not validating responses from the database, as such if you are consuming these API's you may get extra values that are unexpected.
|
||||
|
||||
#### 👨💻 Backend/Development Goodies
|
||||
|
||||
- Codebase is significantly more organized both Frontend and Backend
|
||||
- We've moved to Nuxt for SSR and Typescript for better type safety and less bugs 🎉
|
||||
- Backend now using a Class based architecture to maximize code reuse
|
||||
- Tons of performance improvements across the board
|
||||
- Significant work was done by [@PFischbeck](https://github.com/PFischbeck) to improve type safety on the frontend server and fix many type related errors/bugs!
|
||||
@@ -1,29 +0,0 @@
|
||||
### Bug Fixes
|
||||
|
||||
- Bump isomorphic-dompurify from 0.18.0 to 0.19.0 in /frontend ([#1257](https://github.com/mealie-recipes/mealie/issues/1257))
|
||||
- Bump @nuxtjs/auth-next in /frontend ([#1265](https://github.com/mealie-recipes/mealie/issues/1265))
|
||||
- Bad dev dependency ([#1281](https://github.com/mealie-recipes/mealie/issues/1281))
|
||||
- Add touch support for mealplanner delete ([#1298](https://github.com/mealie-recipes/mealie/issues/1298))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Add references for VSCode dev containers ([#1299](https://github.com/mealie-recipes/mealie/issues/1299))
|
||||
- Docker-compose.dev.yml is currently not functional ([#1300](https://github.com/mealie-recipes/mealie/issues/1300))
|
||||
|
||||
### Features
|
||||
|
||||
- Add reports to bulk recipe import (url) ([#1294](https://github.com/mealie-recipes/mealie/issues/1294))
|
||||
- Rewrite print implementation to support new ing ([#1305](https://github.com/mealie-recipes/mealie/issues/1305))
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
- Github stalebot changes ([#1271](https://github.com/mealie-recipes/mealie/issues/1271))
|
||||
- Bump eslint-plugin-nuxt in /frontend ([#1258](https://github.com/mealie-recipes/mealie/issues/1258))
|
||||
- Bump @vue/runtime-dom in /frontend ([#1259](https://github.com/mealie-recipes/mealie/issues/1259))
|
||||
- Bump nuxt-vite from 0.1.3 to 0.3.5 in /frontend ([#1260](https://github.com/mealie-recipes/mealie/issues/1260))
|
||||
- Bump vue2-script-setup-transform in /frontend ([#1263](https://github.com/mealie-recipes/mealie/issues/1263))
|
||||
- Update dev dependencies ([#1282](https://github.com/mealie-recipes/mealie/issues/1282))
|
||||
|
||||
### Refactor
|
||||
|
||||
- Split up recipe create page ([#1283](https://github.com/mealie-recipes/mealie/issues/1283))
|
||||
@@ -1,36 +0,0 @@
|
||||
### Bug Fixes
|
||||
|
||||
- Update issue links in v1.0.0beta-2 changelog ([#1312](https://github.com/mealie-recipes/mealie/issues/1312))
|
||||
- Bad import path ([#1313](https://github.com/mealie-recipes/mealie/issues/1313))
|
||||
- Printer page refs ([#1314](https://github.com/mealie-recipes/mealie/issues/1314))
|
||||
- Consolidate stores to fix mismatched state
|
||||
- Bump @vue/composition-api from 1.6.1 to 1.6.2 in /frontend ([#1275](https://github.com/mealie-recipes/mealie/issues/1275))
|
||||
- Shopping list label editor ([#1333](https://github.com/mealie-recipes/mealie/issues/1333))
|
||||
|
||||
### Features
|
||||
|
||||
- Default unit fractions to True
|
||||
- Add unit abbreviation support ([#1332](https://github.com/mealie-recipes/mealie/issues/1332))
|
||||
- Attached images by drag and drop for recipe steps ([#1341](https://github.com/mealie-recipes/mealie/issues/1341))
|
||||
|
||||
### Docs
|
||||
|
||||
- Render homepage social media link images at 32x32 size ([#1310](https://github.com/mealie-recipes/mealie/issues/1310))
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
- Init git-cliff config
|
||||
- Bump @types/sortablejs in /frontend ([#1287](https://github.com/mealie-recipes/mealie/issues/1287))
|
||||
- Bump @babel/eslint-parser in /frontend ([#1290](https://github.com/mealie-recipes/mealie/issues/1290))
|
||||
|
||||
### Refactor
|
||||
|
||||
- Unify recipe-organizer components ([#1340](https://github.com/mealie-recipes/mealie/issues/1340))
|
||||
|
||||
### Security
|
||||
|
||||
- Delay server response whenever username is non existing ([#1338](https://github.com/mealie-recipes/mealie/issues/1338))
|
||||
|
||||
### Wip
|
||||
|
||||
- Pagination-repository ([#1316](https://github.com/mealie-recipes/mealie/issues/1316))
|
||||
@@ -1,126 +0,0 @@
|
||||
### Security
|
||||
|
||||
#### v1.0.0beta-3 and Under - Recipe Scraper: Server Side Request Forgery Lead To Denial Of Service
|
||||
|
||||
!!! error "CWE-918: Server-Side Request Forgery (SSRF)"
|
||||
In this case if a attacker try to load a huge file then server will try to load the file and eventually server use its all memory which will dos the server
|
||||
|
||||
##### Mitigation
|
||||
|
||||
HTML is now scraped via a Stream and canceled after a 15 second timeout to prevent arbitrary data from being loaded into the server.
|
||||
|
||||
#### v1.0.0beta-3 and Under - Recipe Assets: Remote Code Execution
|
||||
|
||||
!!! error "CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine"
|
||||
As a low privileged user, Create a new recipe and click on the "+" to add a New Asset.
|
||||
Select a file, then proxy the request that will create the asset.
|
||||
|
||||
Since mealie/routes/recipe/recipe_crud_routes.py:306 is calling slugify on the name POST parameter, we use $ which slugify() will remove completely.
|
||||
|
||||
Since mealie/routes/recipe/recipe_crud_routes.py:306 is concatenating raw user input from the extension POST parameter into the variable file_name, which ultimately gets used when writing to disk, we can use a directory traversal attack in the extension (e.g. ./../../../tmp/pwn.txt) to write the file to arbitrary location on the server.
|
||||
|
||||
As an attacker, now that we have a strong attack primitive, we can start getting creative to get RCE. Since the files were being created by root, we could add an entry to /etc/passwd, create a crontab, etc. but since there was templating functionality in the application that peaked my interest. The PoC in the HTTP request above creates a Jinja2 template at /app/data/template/pwn.html. Since Jinja2 templates execute Python code when rendered, all we have to do now to get code execution is render the malicious template. This was easy enough.
|
||||
|
||||
##### Mitigation
|
||||
|
||||
We've added proper path sanitization to ensure that the user is not allowed to write to arbitrary locations on the server.
|
||||
|
||||
!!! warning "Breaking Change Incoming"
|
||||
As this has shown a significant area of exposure in the templates that Mealie was provided for exporting recipes, we'll be removing this feature in the next Beta release and will instead rely on the community to provide tooling around transforming recipes using templates. This will significantly limit the possible exposure of users injecting malicious templates into the application. The template functionality will be completely removed in the next beta release v1.0.0beta-5
|
||||
|
||||
#### All version Markdown Editor: Cross Site Scripting
|
||||
|
||||
!!! error "CWE-79: Cross-site Scripting (XSS) - Stored"
|
||||
A low privilege user can insert malicious JavaScript code into the Recipe Instructions which will execute in another person's browser that visits the recipe.
|
||||
|
||||
`<img src=x onerror=alert(document.domain)>`
|
||||
|
||||
##### Mitigation
|
||||
|
||||
This issues is present on all pages that allow markdown input. This error has been mitigated by wrapping the 3rd Party Markdown component and using the `domPurify` library to strip out the dangerous HTML.
|
||||
|
||||
#### v1.0.0beta-3 and Under - Image Scraper: Server-Side Request Forgery
|
||||
|
||||
!!! error "CWE-918: Server-Side Request Forgery (SSRF)"
|
||||
In the recipe edit page, is possible to upload an image directly or via an URL provided by the user. The function that handles the fetching and saving of the image via the URL doesn't have any URL verification, which allows to fetch internal services.
|
||||
|
||||
Furthermore, after the resource is fetch, there is no MIME type validation, which would ensure that the resource is indeed an image. After this, because there is no extension in the provided URL, the application will fallback to jpg, and original for the image name.
|
||||
|
||||
Then the result is saved to disk with the original.jpg name, that can be retrieved from the following URL: http://<domain>/api/media/recipes/<recipe-uid>/images/original.jpg. This file will contain the full response of the provided URL.
|
||||
|
||||
**Impact**
|
||||
|
||||
An attacker can get sensitive information of any internal-only services running. For example, if the application is hosted on Amazon Web Services (AWS) platform, its possible to fetch the AWS API endpoint, https://169.254.169.254, which returns API keys and other sensitive metadata.
|
||||
|
||||
##### Mitigation
|
||||
|
||||
Two actions were taken to reduce exposure to SSRF in this case.
|
||||
|
||||
1. The application will not prevent requests being made to local resources by checking for localhost or 127.0.0.1 domain names.
|
||||
2. The mime-type of the response is now checked prior to writing to disk.
|
||||
|
||||
If either of the above actions prevent the user from uploading images, the application will alert the user of what error occurred.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- For erroneously-translated datetime config ([#1362](https://github.com/mealie-recipes/mealie/issues/1362))
|
||||
- Fixed text color on RecipeCard in RecipePrintView and implemented ingredient sections ([#1351](https://github.com/mealie-recipes/mealie/issues/1351))
|
||||
- Ingredient sections lost after parsing ([#1368](https://github.com/mealie-recipes/mealie/issues/1368))
|
||||
- Increased float rounding precision for CRF parser ([#1369](https://github.com/mealie-recipes/mealie/issues/1369))
|
||||
- Infinite scroll bug on all recipes page ([#1393](https://github.com/mealie-recipes/mealie/issues/1393))
|
||||
- Fast fail of bulk importer ([#1394](https://github.com/mealie-recipes/mealie/issues/1394))
|
||||
- Bump @mdi/js from 5.9.55 to 6.7.96 in /frontend ([#1279](https://github.com/mealie-recipes/mealie/issues/1279))
|
||||
- Bump @nuxtjs/i18n from 7.0.3 to 7.2.2 in /frontend ([#1288](https://github.com/mealie-recipes/mealie/issues/1288))
|
||||
- Bump date-fns from 2.23.0 to 2.28.0 in /frontend ([#1293](https://github.com/mealie-recipes/mealie/issues/1293))
|
||||
- Bump fuse.js from 6.5.3 to 6.6.2 in /frontend ([#1325](https://github.com/mealie-recipes/mealie/issues/1325))
|
||||
- Bump core-js from 3.17.2 to 3.23.1 in /frontend ([#1383](https://github.com/mealie-recipes/mealie/issues/1383))
|
||||
- All-recipes page now sorts alphabetically ([#1405](https://github.com/mealie-recipes/mealie/issues/1405))
|
||||
- Sort recent recipes by created_at instead of date_added ([#1417](https://github.com/mealie-recipes/mealie/issues/1417))
|
||||
- Only show scaler when ingredients amounts enabled ([#1426](https://github.com/mealie-recipes/mealie/issues/1426))
|
||||
- Add missing types for API token deletion ([#1428](https://github.com/mealie-recipes/mealie/issues/1428))
|
||||
- Entry nutrition checker ([#1448](https://github.com/mealie-recipes/mealie/issues/1448))
|
||||
- Use == operator instead of is_ for sql queries ([#1453](https://github.com/mealie-recipes/mealie/issues/1453))
|
||||
- Use `mtime` instead of `ctime` for backup dates ([#1461](https://github.com/mealie-recipes/mealie/issues/1461))
|
||||
- Mealplan pagination ([#1464](https://github.com/mealie-recipes/mealie/issues/1464))
|
||||
- Properly use pagination for group event notifies ([#1512](https://github.com/mealie-recipes/mealie/pull/1512))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Add go bulk import example ([#1388](https://github.com/mealie-recipes/mealie/issues/1388))
|
||||
- Fix old link
|
||||
- Pagination and filtering, and fixed a few broken links ([#1488](https://github.com/mealie-recipes/mealie/issues/1488))
|
||||
|
||||
### Features
|
||||
|
||||
- Toggle display of ingredient references in recipe instructions ([#1268](https://github.com/mealie-recipes/mealie/issues/1268))
|
||||
- Add custom scaling option ([#1345](https://github.com/mealie-recipes/mealie/issues/1345))
|
||||
- Implemented "order by" API parameters for recipe, food, and unit queries ([#1356](https://github.com/mealie-recipes/mealie/issues/1356))
|
||||
- Implement user favorites page ([#1376](https://github.com/mealie-recipes/mealie/issues/1376))
|
||||
- Extend Apprise JSON notification functionality with programmatic data ([#1355](https://github.com/mealie-recipes/mealie/issues/1355))
|
||||
- Mealplan-webhooks ([#1403](https://github.com/mealie-recipes/mealie/issues/1403))
|
||||
- Added "last-modified" header to supported record types ([#1379](https://github.com/mealie-recipes/mealie/issues/1379))
|
||||
- Re-write get all routes to use pagination ([#1424](https://github.com/mealie-recipes/mealie/issues/1424))
|
||||
- Advanced filtering API ([#1468](https://github.com/mealie-recipes/mealie/issues/1468))
|
||||
- Restore frontend sorting for all recipes ([#1497](https://github.com/mealie-recipes/mealie/issues/1497))
|
||||
- Implemented local storage for sorting and dynamic sort icons on the new recipe sort card ([1506](https://github.com/mealie-recipes/mealie/pull/1506))
|
||||
- create new foods and units from their Data Management pages ([#1511](https://github.com/mealie-recipes/mealie/pull/1511))
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
- Bump dev deps ([#1418](https://github.com/mealie-recipes/mealie/issues/1418))
|
||||
- Bump @vue/runtime-dom in /frontend ([#1423](https://github.com/mealie-recipes/mealie/issues/1423))
|
||||
- Backend page_all route cleanup ([#1483](https://github.com/mealie-recipes/mealie/issues/1483))
|
||||
|
||||
### Refactor
|
||||
|
||||
- Remove depreciated repo call ([#1370](https://github.com/mealie-recipes/mealie/issues/1370))
|
||||
|
||||
### Hotfix
|
||||
|
||||
- Tame typescript beast
|
||||
|
||||
### UI
|
||||
|
||||
- Improve parser ui text display ([#1437](https://github.com/mealie-recipes/mealie/issues/1437))
|
||||
|
||||
<!-- generated by git-cliff -->
|
||||
@@ -1,3 +0,0 @@
|
||||
### NOTICE:
|
||||
|
||||
Release changelogs are now published on github releases. This file is kept for historical purposes.
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
[Please Join the Discord](https://discord.gg/QuStdQGSGK). We are building a community of developers working on the project.
|
||||
|
||||
## We Develop with Github
|
||||
We use github to host code, to track issues and feature requests, as well as accept pull requests.
|
||||
## We Develop with GitHub
|
||||
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.
|
||||
|
||||
## We Use [Github Flow](https://docs.github.com/en/get-started/using-github/github-flow), So All Code Changes Happen Through Pull Requests
|
||||
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://docs.github.com/en/get-started/using-github/github-flow)). We actively welcome your pull requests:
|
||||
## We Use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow), So All Code Changes Happen Through Pull Requests
|
||||
Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)). We actively welcome your pull requests:
|
||||
|
||||
1. Fork the repo and create your branch from `mealie-next`.
|
||||
2. Checkout the Discord, the PRs page, or the Projects page to get an idea of what's already being worked on.
|
||||
@@ -14,13 +14,13 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu
|
||||
4. Once you've got an idea of what changes you want to make, create a draft PR as soon as you can to let us know what you're working on and how we can help!
|
||||
5. If you've changed APIs, update the documentation.
|
||||
6. Run tests, including `task py:check`.
|
||||
6. Issue that pull request! First make a draft PR, make sure that the automated github tests all pass, then mark as ready for review.
|
||||
7. Be sure to add release notes to the pull request.
|
||||
7. Issue that pull request! First make a draft PR, make sure that the automated GitHub tests all pass, then mark as ready for review. We follow Conventional Commits syntax; please title your PR as described in the PR template.
|
||||
8. Be sure to add release notes to the pull request.
|
||||
|
||||
## Any contributions you make will be under the AGPL Software License
|
||||
In short, when you submit code changes, your submissions are understood to be under the same [AGPL License](https://choosealicense.com/licenses/agpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern.
|
||||
|
||||
## Report bugs using Github's [issues](https://github.com/mealie-recipes/mealie/issues)
|
||||
## Report bugs using GitHub's [issues](https://github.com/mealie-recipes/mealie/issues)
|
||||
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/mealie-recipes/mealie/issues/new); it's that easy!
|
||||
|
||||
## Write bug reports with detail, background, and sample code
|
||||
|
||||
85
docs/docs/contributors/developers-guide/database-changes.md
Normal file
85
docs/docs/contributors/developers-guide/database-changes.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# Development: Database Changes
|
||||
|
||||
This document is open to improvement; please share any insights you have/develop.
|
||||
|
||||
## Overview
|
||||
|
||||
When modifying the database, you will most likely need to change the files under `/mealie/db/models/`.
|
||||
How exactly you need to modify it is of course highly contextual to the change you're making.
|
||||
|
||||
## Using Alembic to generate upgrade script
|
||||
|
||||
In your dev container you can run something like (change the message) `task py:migrate "Add creation tag to group preferences"` to have Alembic generate an upgrade script for you.
|
||||
|
||||
The script Alembic generates, will be limited! (Perhaps there's a way to resolve that? Haven't looked into it yet)
|
||||
For example, Alembic generated a script _similar_ to this (it has been modified already to have accurate foreign key names, for instance):
|
||||
|
||||
```Python
|
||||
"""Add creation tag to group preferences
|
||||
|
||||
Revision ID: 0ea6eb8eaa44
|
||||
Revises: ba1e4a6cfe99
|
||||
Create Date: 2024-01-04 12:40:03.062671
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
import mealie.db.migration_types
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "0ea6eb8eaa44"
|
||||
down_revision = "ba1e4a6cfe99"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column(
|
||||
"group_preferences", sa.Column("recipe_creation_tag", mealie.db.migration_types.GUID(), nullable=True)
|
||||
)
|
||||
op.create_foreign_key("fk_groupprefs_tags", "group_preferences", "tags", ["recipe_creation_tag"], ["id"])
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint("fk_groupprefs_tags", "group_preferences", type_="foreignkey")
|
||||
op.drop_column("group_preferences", "recipe_creation_tag")
|
||||
### end Alembic commands ###
|
||||
```
|
||||
|
||||
But when trying to actually use that upgrade script, it becomes clear that our SQLite database doesn't like them. The minor modification needed looks like:
|
||||
|
||||
```Python
|
||||
"""Add creation tag to group preferences
|
||||
|
||||
Revision ID: 0ea6eb8eaa44
|
||||
Revises: ba1e4a6cfe99
|
||||
Create Date: 2024-01-04 12:40:03.062671
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
import mealie.db.migration_types
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "0ea6eb8eaa44"
|
||||
down_revision = "ba1e4a6cfe99"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table("group_preferences", schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column("recipe_creation_tag", mealie.db.migration_types.GUID(), nullable=True))
|
||||
batch_op.create_foreign_key("fk_groupprefs_tags", "tags", ["recipe_creation_tag"], ["id"])
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("group_preferences", schema=None) as batch_op:
|
||||
batch_op.drop_constraint("fk_groupprefs_tags", type_="foreignkey")
|
||||
batch_op.drop_column("recipe_creation_tag")
|
||||
```
|
||||
@@ -6,7 +6,7 @@ This is the start of the maintainers guide for Mealie developers. Those who have
|
||||
|
||||
If you are working on issues, it can be helpful to understand the workflow for our repository. When an issue comes in it is tagged with the `bug` and `triage` flags. This is to indicate that they need to be reviewed by a maintainer to determine validity.
|
||||
|
||||
After you've reviered an issue it will generally move into one of two states:
|
||||
After you've reviewed an issue it will generally move into one of two states:
|
||||
|
||||
`bug:confirmed`
|
||||
: Your were able to verify the issue and we determined we need to fix it
|
||||
|
||||
@@ -17,4 +17,3 @@ Alternatively, you can register a new parser by fulfilling the `ABCIngredientPar
|
||||
## Links
|
||||
- [Pretrained Model](https://github.com/mealie-recipes/mealie-nlp-model)
|
||||
- [CRF++ (Forked)](https://github.com/hay-kot/crfpp)
|
||||
|
||||
|
||||
@@ -93,4 +93,3 @@ mealie_url="http://localhost:9000"
|
||||
token = authentication(mail, password, mealie_url)
|
||||
import_from_file(input_file, token, mealie_url)
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# Automating Backups with n8n
|
||||
|
||||
!!! info
|
||||
This guide was submitted by a community member. Find something wrong? Submit a PR to get it fixed!
|
||||
|
||||
> [n8n](https://github.com/n8n-io/n8n) is a free and source-available fair-code licensed workflow automation tool. Alternative to Zapier or Make, allowing you to use a UI to create automated workflows.
|
||||
|
||||
This example workflow:
|
||||
|
||||
1. Backups Mealie every morning via an API call
|
||||
2. Deletes all but the last 7 backups
|
||||
|
||||
> [!CAUTION]
|
||||
> This only automates the backup function, this does not backup your data to anywhere except your local instance. Please make sure you are backing up your data to an external source.
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
# Setup
|
||||
|
||||
## Deploying n8n
|
||||
|
||||
Follow the relevant guide in the [n8n Documentation](https://docs.n8n.io/)
|
||||
|
||||
## Importing n8n workflow
|
||||
|
||||
1. In n8n, add a new workflow
|
||||
2. In the top right hit the 3 dot menu and select 'Import from URL...'
|
||||
|
||||

|
||||
|
||||
3. Paste `https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/assets/other/n8n/n8n-mealie-backup.json` and click Import
|
||||
4. Click through the nodes and update the URLs for your environment
|
||||
|
||||
## API Credentials
|
||||
|
||||
#### Generate Mealie API Token
|
||||
|
||||
1. Head to https://mealie.example.com/user/profile/api-tokens
|
||||
> If you dont see this screen make sure that "Show advanced features" is checked under https://mealie.example.com/user/profile/edit
|
||||
2. Under token name, enter the name of the token i.e. 'n8n' and hit Generate
|
||||
3. Copy and keep this API Token somewhere safe, this is like your password!
|
||||
|
||||
> You can use your normal user for this, but assuming you're an admin you could also choose to create a user named n8n and generate the API key against that user.
|
||||
|
||||
#### Setup Credentials in n8n
|
||||
|
||||
> [n8n Docs](https://docs.n8n.io/credentials/add-edit-credentials/)
|
||||
|
||||
1. Create a new "Header Auth" Credential
|
||||
|
||||

|
||||
|
||||
2. In the connection screen set - Name as `Authorization` - Value as `Bearer {INSERT MEALIE API KEY}`
|
||||
|
||||

|
||||
|
||||
3. In the workflow you created, for the "Run Backup", "Get All backups", and "Delete Oldies" nodes, update:
|
||||
- Authentication to `Generic Credential Type`
|
||||
- Generic Auth Type to `Header Auth`
|
||||
- Header Auth to `Mealie API` or whatever you named your credentials
|
||||
|
||||

|
||||
|
||||
## Notification Node
|
||||
|
||||
> Please use error notifications of some kind. It's very easy to set and forget an automation, then have the worst happen and lose data.
|
||||
|
||||
[ntfy](https://github.com/binwiederhier/ntfy) is a great open source, self-hostable tool for sending notifications.
|
||||
|
||||
If you want to use ntfy, you will need to install it on your environment, or sign up for their service, and configure it with the webhook URL.
|
||||
|
||||
If you want to use another notification service, you can create a new node in n8n that sends the notification using whatever method you like.
|
||||
|
||||
- For example, if you want to send a push notification via [Pushover](https:/pushover.net/) you could create a new node that uses the Pushover API and sends the notification.
|
||||
- You can use the [Send Email](https://docs.n8n.io/integrations/builtincore-nodes/n8n-nodes-base.sendemail/) node in n8n as an example of how to create your own custom node.
|
||||
- You can send it off to InfluxDB, Slack, Discord etc. Go nuts.
|
||||
|
||||
If you're using another method for backups we'd love to hear about it. Pop in [Discord](https://discord.gg/QuStdQGSGK) and say hi!
|
||||
@@ -0,0 +1,65 @@
|
||||
# OpenID Connect (OIDC) Authentication
|
||||
|
||||
:octicons-tag-24: v1.4.0
|
||||
|
||||
Mealie supports 3rd party authentication via [OpenID Connect (OIDC)](https://openid.net/connect/), an identity layer built on top of OAuth2. OIDC is supported by many Identity Providers (IdP), including:
|
||||
|
||||
- [Authentik](https://goauthentik.io/integrations/sources/oauth/#openid-connect)
|
||||
- [Authelia](https://www.authelia.com/configuration/identity-providers/open-id-connect/)
|
||||
- [Keycloak](https://www.keycloak.org/docs/latest/securing_apps/#_oidc)
|
||||
- [Okta](https://www.okta.com/openid-connect/)
|
||||
|
||||
## Account Linking
|
||||
|
||||
Signing in with OAuth will automatically find your account in Mealie and link to it. If a user does not exist in Mealie, then one will be created (if enabled), but will be unable to log in with any other authentication method. An admin can configure another authentication method for such a user.
|
||||
|
||||
## Provider Setup
|
||||
|
||||
Before you can start using OIDC Authentication, you must first configure a new client application in your identity provider. Your identity provider must support the OAuth **Authorization Code flow with PKCE**. The steps will vary by provider, but generally, the steps are as follows.
|
||||
|
||||
1. Create a new client application
|
||||
- The Provider type should be OIDC or OAuth2
|
||||
- The Grant type should be `Authorization Code`
|
||||
- The Application type should be `Web` or `SPA`
|
||||
- The Client type should be `public`
|
||||
|
||||
2. Configure redirect URI
|
||||
|
||||
The redirect URI(s) that are needed:
|
||||
|
||||
1. `http(s)://DOMAIN:PORT/login`
|
||||
2. `https(s)://DOMAIN:PORT/login?direct=1`
|
||||
1. This URI is only required if your IdP supports [RP-Initiated Logout](https://openid.net/specs/openid-connect-rpinitiated-1_0.html) such as Keycloak. You may also be able to combine this into the previous URI by using a wildcard: `http(s)://DOMAIN:PORT/login*`
|
||||
|
||||
The redirect URI(s) should include any URL that Mealie is accessible from. Some examples include
|
||||
|
||||
http://localhost:9091/login
|
||||
https://mealie.example.com/login
|
||||
|
||||
3. Configure origins
|
||||
|
||||
If your identity provider enforces CORS on any endpoints, you will need to specify your Mealie URL as an Allowed Origin.
|
||||
|
||||
4. Configure allowed scopes
|
||||
|
||||
The scopes required are `openid profile email`
|
||||
|
||||
If you plan to use the [groups](#groups) to configure access within Mealie, you will need to also add the scope defined by the `OIDC_GROUPS_CLAIM` environment variable. The default claim is `groups`
|
||||
|
||||
## Mealie Setup
|
||||
|
||||
Take the client id and your discovery URL and update your environment variables to include the required OIDC variables described in [Installation - Backend Configuration](../installation/backend-config.md#openid-connect-oidc).
|
||||
|
||||
### Groups
|
||||
|
||||
There are two (optional) [environment variables](../installation/backend-config.md#openid-connect-oidc) that can control which of the users in your IdP can log in to Mealie and what permissions they will have. Keep in mind that these groups **do not necessarily correspond to groups in Mealie**. The groups claim is configurable via the `OIDC_GROUPS_CLAIM` environment variable. The groups should be **defined in your IdP** and be returned in the configured claim value.
|
||||
|
||||
`OIDC_USER_GROUP`: Users must be a part of this group (within your IdP) to be able to log in.
|
||||
|
||||
`OIDC_ADMIN_GROUP`: Users that are in this group (within your IdP) will be made an **admin** in Mealie.
|
||||
|
||||
## Examples
|
||||
|
||||
Example configurations for several Identity Providers have been provided by the Community in the [GitHub Discussions](https://github.com/mealie-recipes/mealie/discussions/categories/oauth-provider-example).
|
||||
|
||||
If you don't see your provider and have successfully set it up, please consider [creating your own example](https://github.com/mealie-recipes/mealie/discussions/new?category=oauth-provider-example) so that others can have a smoother setup.
|
||||
@@ -26,7 +26,7 @@ Do the following for each recipe you want to intelligently handle ingredients.
|
||||
6. Click the Edit button/icon again
|
||||
7. Scroll to the ingredients and you should see new fields for Amount, Unit, Food, and Note. The Note in particular will contain the original text of the Recipe.
|
||||
8. Click `Parse` and you will be taken to the ingredient parsing page.
|
||||
9. Choose your parser. The `Natural Language Parser` works very well, but you can also use the `Brute Parser`.
|
||||
9. Choose your parser. The `Natural Language Parser` works very well, but you can also use the `Brute Parser`, or the `OpenAI Parser` if you've [enabled OpenAI support](./installation/backend-config.md#openai).
|
||||
10. Click `Parse All`, and your ingredients should be separated out into Units and Foods based on your seeding in Step 1 above.
|
||||
11. For ingredients where the Unit or Food was not found, you can click a button to accept an automatically suggested Food to add to the database. Or, manually enter the Unit/Food and hit `Enter` (or click `Create`) to add it to the database
|
||||
12. When done, click `Save All` and you will be taken back to the recipe. Now the Unit and Food fields of the recipe should be filled out.
|
||||
@@ -94,6 +94,10 @@ docker exec -it mealie-next bash
|
||||
python /app/mealie/scripts/change_password.py
|
||||
```
|
||||
|
||||
## I can't log in with external auth. How can I change my authentication method?
|
||||
|
||||
Follow the [steps above](#how-can-i-change-my-password) for changing your password. You will be prompted if you would like to switch your authentication method back to local auth so you can log in again.
|
||||
|
||||
## How do private groups and recipes work?
|
||||
|
||||
Managing private groups and recipes can be confusing. The following diagram and notes should help explain how they work to determine if a recipe can be shared publicly.
|
||||
|
||||
@@ -14,10 +14,14 @@ Mealie offers two main ways to create recipes. You can use the integrated recipe
|
||||
|
||||
Mealie supports importing recipes from a few other sources besides websites. Currently the following sources are supported:
|
||||
|
||||
- Mealie Pre v1
|
||||
- Tandoor
|
||||
- Nextcloud Cookbooks
|
||||
- Paprika
|
||||
- Chowdown
|
||||
- Plan to Eat
|
||||
- Recipe Keeper
|
||||
- Copy Me That
|
||||
- My Recipe Box
|
||||
|
||||
You can access these options on your installation at the `/group/migrations` page on your installation. If you'd like to see another source added, feel free to request so on Github.
|
||||
|
||||
@@ -81,12 +85,63 @@ The meal planner has the concept of plan rules. These offer a flexible way to us
|
||||
|
||||
The shopping lists feature is a great way to keep track of what you need to buy for your next meal. You can add items directly to the shopping list or link a recipe and all of it's ingredients to track meals during the week.
|
||||
|
||||
!!! warning
|
||||
At this time there isn't a tight integration between meal-plans and shopping lists; however, it's something we have planned for the future.
|
||||
|
||||
|
||||
[Shopping List Demo](https://demo.mealie.io/shopping-lists){ .md-button .md-button--primary }
|
||||
|
||||
## Integrations
|
||||
|
||||
Mealie is designed to integrate with many different external services. There are several ways you can integrate with Mealie to achieve custom IoT automations, data synchronization, and anything else you can think of. [You can work directly with Mealie through the API](./api-usage.md), or leverage other services to make seamless integrations.
|
||||
|
||||
### Notifiers
|
||||
|
||||
Notifiers are event-driven notifications sent when specific actions are performed within Mealie. Some actions include:
|
||||
- creating a recipe
|
||||
- adding items to a shopping list
|
||||
- creating a new mealplan
|
||||
|
||||
Notifiers use the [Apprise library](https://github.com/caronc/apprise/wiki), which integrates with a large number of notification services. In addition, certain custom notifiers send basic event data to the consumer (e.g. the `id` of the resource). These include:
|
||||
|
||||
- `form` and `forms`
|
||||
- `json` and `jsons`
|
||||
- `xml` and `xmls`
|
||||
|
||||
[Notifiers Demo](https://demo.mealie.io/group/notifiers){ .md-button .md-button--primary }
|
||||
|
||||
### Webhooks
|
||||
|
||||
Unlike notifiers, which are event-driven notifications, Webhooks allow you to send scheduled notifications to your desired endpoint. Webhooks are sent on the day of a scheduled mealplan, at the specified time, and contain the mealplan data in the request.
|
||||
|
||||
[Webhooks Demo](https://demo.mealie.io/group/webhooks){ .md-button .md-button--primary }
|
||||
|
||||
### Recipe Actions
|
||||
|
||||
Recipe Actions are custom actions you can add to all recipes in Mealie. This is a great way to add custom integrations that are fired manually. There are two types of recipe actions:
|
||||
|
||||
1. link - these actions will take you directly to an external page
|
||||
2. post - these actions will send a `POST` request to the specified URL, with the recipe JSON in the request body. These can be used, for instance, to manually trigger a webhook in Home Assistant
|
||||
|
||||
Recipe Action URLs can include merge fields to inject the current recipe's data. For instance, you can use the following URL to include a Google search with the recipe's slug:
|
||||
```
|
||||
https://www.google.com/search?q=${slug}
|
||||
```
|
||||
|
||||
When the action is clicked on, the `${slug}` field is replaced with the recipe's slug value. So, for example, it might take you to this URL on one of your recipes:
|
||||
```
|
||||
https://www.google.com/search?q=pasta-fagioli
|
||||
```
|
||||
|
||||
A common use case for "link" recipe actions is to integrate with the Bring! shopping list. Simply add a Recipe Action with the following URL:
|
||||
```
|
||||
https://api.getbring.com/rest/bringrecipes/deeplink?url=${url}&source=web
|
||||
```
|
||||
|
||||
Below is a list of all valid merge fields:
|
||||
|
||||
- ${id}
|
||||
- ${slug}
|
||||
- ${url}
|
||||
|
||||
To add, modify, or delete Recipe Actions, visit the Data Management page (more on that below).
|
||||
|
||||
## Data Management
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
### General
|
||||
|
||||
| Variables | Default | Description |
|
||||
| ------------- | :-------------------: | ----------------------------------------------------------------------------------- |
|
||||
| ----------------------------- | :-------------------: | ----------------------------------------------------------------------------------- |
|
||||
| PUID | 911 | UserID permissions between host OS and container |
|
||||
| PGID | 911 | GroupID permissions between host OS and container |
|
||||
| DEFAULT_GROUP | Home | The default group for users |
|
||||
@@ -14,7 +14,12 @@
|
||||
| API_PORT | 9000 | The port exposed by backend API. **Do not change this if you're running in Docker** |
|
||||
| API_DOCS | True | Turns on/off access to the API documentation locally. |
|
||||
| TZ | UTC | Must be set to get correct date/time on the server |
|
||||
| ALLOW_SIGNUP | true | Allow user sign-up without token |
|
||||
| ALLOW_SIGNUP<super>\*</super> | false | Allow user sign-up without token |
|
||||
| LOG_CONFIG_OVERRIDE | | Override the config for logging with a custom path |
|
||||
| LOG_LEVEL | info | Logging level (e.g. critical, error, warning, info, debug, trace) |
|
||||
| DAILY_SCHEDULE_TIME | 23:45 | The time of day to run the daily tasks. |
|
||||
|
||||
<super>\*</super> Starting in v1.4.0 this was changed to default to `false` as apart of a security review of the application.
|
||||
|
||||
### Security
|
||||
|
||||
@@ -26,13 +31,14 @@
|
||||
### Database
|
||||
|
||||
| Variables | Default | Description |
|
||||
| ----------------- | :------: | -------------------------------- |
|
||||
| --------------------- | :------: | ----------------------------------------------------------------------- |
|
||||
| DB_ENGINE | sqlite | Optional: 'sqlite', 'postgres' |
|
||||
| POSTGRES_USER | mealie | Postgres database user |
|
||||
| POSTGRES_PASSWORD | mealie | Postgres database password |
|
||||
| POSTGRES_SERVER | postgres | Postgres database server address |
|
||||
| POSTGRES_PORT | 5432 | Postgres database port |
|
||||
| POSTGRES_DB | mealie | Postgres database name |
|
||||
| POSTGRES_URL_OVERRIDE | None | Optional Postgres URL override to use instead of POSTGRES\_\* variables |
|
||||
|
||||
### Email
|
||||
|
||||
@@ -51,11 +57,8 @@
|
||||
Changing the webworker settings may cause unforeseen memory leak issues with Mealie. It's best to leave these at the defaults unless you begin to experience issues with multiple users. Exercise caution when changing these settings
|
||||
|
||||
| Variables | Default | Description |
|
||||
| ---------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| WEB_GUNICORN | false | Enables Gunicorn to manage Uvicorn web for multiple works |
|
||||
| WORKERS_PER_CORE | 1 | Set the number of workers to the number of CPU cores multiplied by this value (Value \* CPUs). More info [here][workers_per_core] |
|
||||
| MAX_WORKERS | None | Set the maximum number of workers to use. Default is not set meaning unlimited. More info [here][max_workers] |
|
||||
| WEB_CONCURRENCY | 2 | Override the automatic definition of number of workers. More info [here][web_concurrency] |
|
||||
| --------------- | :-----: | ----------------------------------------------------------------------------- |
|
||||
| UVICORN_WORKERS | 1 | Sets the number of works for the web server [more info here][unicorn_workers] |
|
||||
|
||||
### LDAP
|
||||
|
||||
@@ -75,6 +78,43 @@ Changing the webworker settings may cause unforeseen memory leak issues with Mea
|
||||
| LDAP_NAME_ATTRIBUTE | name | The LDAP attribute that maps to the user's name |
|
||||
| LDAP_MAIL_ATTRIBUTE | mail | The LDAP attribute that maps to the user's email |
|
||||
|
||||
### OpenID Connect (OIDC)
|
||||
|
||||
:octicons-tag-24: v1.4.0
|
||||
|
||||
For usage, see [Usage - OpenID Connect](../authentication/oidc.md)
|
||||
|
||||
| Variables | Default | Description |
|
||||
| ---------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| OIDC_AUTH_ENABLED | False | Enables authentication via OpenID Connect |
|
||||
| OIDC_SIGNUP_ENABLED | True | Enables new users to be created when signing in for the first time with OIDC |
|
||||
| OIDC_CONFIGURATION_URL | None | The URL to the OIDC configuration of your provider. This is usually something like https://auth.example.com/.well-known/openid-configuration |
|
||||
| OIDC_CLIENT_ID | None | The client id of your configured client in your provider |
|
||||
| OIDC_USER_GROUP | None | If specified, only users belonging to this group will be able to successfully authenticate, regardless of the `OIDC_ADMIN_GROUP`. For more information see [this page](../authentication/oidc.md#groups) |
|
||||
| OIDC_ADMIN_GROUP | None | If specified, users belonging to this group will be made an admin. For more information see [this page](../authentication/oidc.md#groups) |
|
||||
| OIDC_AUTO_REDIRECT | False | If `True`, then the login page will be bypassed an you will be sent directly to your Identity Provider. You can still get to the login page by adding `?direct=1` to the login URL |
|
||||
| OIDC_PROVIDER_NAME | OAuth | The provider name is shown in SSO login button. "Login with <OIDC_PROVIDER_NAME\>" |
|
||||
| OIDC_REMEMBER_ME | False | Because redirects bypass the login screen, you cant extend your session by clicking the "Remember Me" checkbox. By setting this value to true, a session will be extended as if "Remember Me" was checked |
|
||||
| OIDC_SIGNING_ALGORITHM | RS256 | The algorithm used to sign the id token (examples: RS256, HS256) |
|
||||
| OIDC_USER_CLAIM | email | This is the claim which Mealie will use to look up an existing user by (e.g. "email", "preferred_username") |
|
||||
| OIDC_GROUPS_CLAIM | groups | Optional if not using `OIDC_USER_GROUP` or `OIDC_ADMIN_GROUP`. This is the claim Mealie will request from your IdP and will use to compare to `OIDC_USER_GROUP` or `OIDC_ADMIN_GROUP` to allow the user to log in to Mealie or is set as an admin. **Your IdP must be configured to grant this claim** |
|
||||
| OIDC_TLS_CACERTFILE | None | File path to Certificate Authority used to verify server certificate (e.g. `/path/to/ca.crt`) |
|
||||
|
||||
### OpenAI
|
||||
|
||||
:octicons-tag-24: v1.7.0
|
||||
|
||||
Mealie supports various integrations using OpenAI. To enable OpenAI, [you must provide your OpenAI API key](https://platform.openai.com/api-keys). You can tweak how OpenAI is used using these backend settings. Please note that while OpenAI usage is optimized to reduce API costs, you're unlikely to be able to use OpenAI features with the free tier limits.
|
||||
|
||||
| Variables | Default | Description |
|
||||
| ------------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| OPENAI_BASE_URL | None | The base URL for the OpenAI API. If you're not sure, leave this empty to use the standard OpenAI platform |
|
||||
| OPENAI_API_KEY | None | Your OpenAI API Key. Enables OpenAI-related features |
|
||||
| OPENAI_MODEL | gpt-4o | Which OpenAI model to use. If you're not sure, leave this empty |
|
||||
| OPENAI_WORKERS | 2 | Number of OpenAI workers per request. Higher values may increase processing speed, but will incur additional API costs |
|
||||
| OPENAI_SEND_DATABASE_DATA | True | Whether to send Mealie data to OpenAI to improve request accuracy. This will incur additional API costs |
|
||||
| OPENAI_REQUEST_TIMEOUT | 10 | The number of seconds to wait for an OpenAI request to complete before cancelling the request. Leave this empty unless you're running into timeout issues on slower hardware |
|
||||
|
||||
### Themeing
|
||||
|
||||
Setting the following environmental variables will change the theme of the frontend. Note that the themes are the same for all users. This is a break-change when migration from v0.x.x -> 1.x.x.
|
||||
@@ -96,7 +136,26 @@ Setting the following environmental variables will change the theme of the front
|
||||
| THEME_DARK_WARNING | #FF6D00 | Dark Theme Config Variable |
|
||||
| THEME_DARK_ERROR | #EF5350 | Dark Theme Config Variable |
|
||||
|
||||
### Docker Secrets
|
||||
|
||||
[workers_per_core]: https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/2daa3e3873c837d5781feb4ff6a40a89f791f81b/README.md#workers_per_core
|
||||
[max_workers]: https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/2daa3e3873c837d5781feb4ff6a40a89f791f81b/README.md#max_workers
|
||||
[web_concurrency]: https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/2daa3e3873c837d5781feb4ff6a40a89f791f81b/README.md#web_concurrency
|
||||
Setting a credential can be done using secrets when running in a Docker container.
|
||||
This can be used to avoid leaking passwords through compose files, environment variables, or command-line history.
|
||||
For example, to configure the Postgres database password in Docker compose, create a file on the host that contains only the password, and expose that file to the Mealie service as a secret with the correct name.
|
||||
Note that environment variables take priority over secrets, so any previously defined environment variables should be removed when migrating to secrets.
|
||||
|
||||
```
|
||||
services:
|
||||
mealie:
|
||||
...
|
||||
environment:
|
||||
...
|
||||
POSTGRES_USER: postgres
|
||||
secrets:
|
||||
- POSTGRES_PASSWORD
|
||||
|
||||
secrets:
|
||||
POSTGRES_PASSWORD:
|
||||
file: postgrespassword.txt
|
||||
```
|
||||
|
||||
[unicorn_workers]: https://www.uvicorn.org/deployment/#built-in
|
||||
|
||||
16
docs/docs/documentation/getting-started/installation/logs.md
Normal file
16
docs/docs/documentation/getting-started/installation/logs.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Logs
|
||||
|
||||
:octicons-tag-24: v1.5.0
|
||||
|
||||
## Highlights
|
||||
|
||||
- Logs are written to `/app/data/mealie.log` by default in the container.
|
||||
- Logs are also written to stdout and stderr.
|
||||
- You can adjust the log level using the `LOG_LEVEL` environment variable.
|
||||
|
||||
## Configuration
|
||||
|
||||
Starting in v1.5.0 logging is now highly configurable. Using the `LOG_CONFIG_OVERRIDE` you can provide the application with a custom configuration to log however you'd like. This configuration file is based off the [Python Logging Config](https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig). It can be difficult to understand the configuration at first, so here are some resources to help get started.
|
||||
|
||||
- This [YouTube Video](https://www.youtube.com/watch?v=9L77QExPmI0) for a great walkthrough on the logging file format.
|
||||
- Our [Logging Config](https://github.com/mealie-recipes/mealie/blob/mealie-next/mealie/core/logger/logconf.prod.json).
|
||||
@@ -5,40 +5,39 @@ PostgreSQL might be considered if you need to support many concurrent users. In
|
||||
**For Environment Variable Configuration, see** [Backend Configuration](./backend-config.md)
|
||||
|
||||
```yaml
|
||||
---
|
||||
version: "3.7"
|
||||
services:
|
||||
mealie:
|
||||
image: ghcr.io/mealie-recipes/mealie:v1.3.1 # (3)
|
||||
image: ghcr.io/mealie-recipes/mealie:v1.9.0 # (3)
|
||||
container_name: mealie
|
||||
restart: always
|
||||
ports:
|
||||
- "9925:9000" # (1)
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 1000M # (2)
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- mealie-data:/app/data/
|
||||
environment:
|
||||
# Set Backend ENV Variables Here
|
||||
- ALLOW_SIGNUP=true
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=America/Anchorage
|
||||
- MAX_WORKERS=1
|
||||
- WEB_CONCURRENCY=1
|
||||
- BASE_URL=https://mealie.yourdomain.com
|
||||
|
||||
ALLOW_SIGNUP: true
|
||||
PUID: 1000
|
||||
PGID: 1000
|
||||
TZ: America/Anchorage
|
||||
MAX_WORKERS: 1
|
||||
WEB_CONCURRENCY: 1
|
||||
BASE_URL: https://mealie.yourdomain.com
|
||||
# Database Settings
|
||||
- DB_ENGINE=postgres
|
||||
- POSTGRES_USER=mealie
|
||||
- POSTGRES_PASSWORD=mealie
|
||||
- POSTGRES_SERVER=postgres
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_DB=mealie
|
||||
restart: always
|
||||
DB_ENGINE: postgres
|
||||
POSTGRES_USER: mealie
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_SERVER: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_DB: mealie
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres:15
|
||||
@@ -48,12 +47,15 @@ services:
|
||||
environment:
|
||||
POSTGRES_PASSWORD: mealie
|
||||
POSTGRES_USER: mealie
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready"]
|
||||
interval: 30s
|
||||
timeout: 20s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
mealie-data:
|
||||
driver: local
|
||||
mealie-pgdata:
|
||||
driver: local
|
||||
```
|
||||
|
||||
<!-- Updating This? Be Sure to also update the SQLite Annotations -->
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
tags:
|
||||
- Security
|
||||
---
|
||||
|
||||
# Security Considerations
|
||||
|
||||
This page is a collection of security considerations for Mealie. It mostly deals with reported issues and how it's possible to mitigate them. Note that this page is for you to use as a guide for how secure you want to make your deployment. It's important to note that most of these will not apply to you, if you:
|
||||
|
||||
1. Run behind a VPN
|
||||
2. Use a strong password
|
||||
3. Disable Sign-Ups
|
||||
4. Don't host for malicious users
|
||||
|
||||
Use your best judgement when deciding what to do.
|
||||
|
||||
## Denial of Service
|
||||
|
||||
By default, the API is **not** rate limited. This leaves Mealie open to a potential **Denial of Service Attack**. While it's possible to perform a **Denial of Service Attack** on any endpoint, there are a few key endpoints that are more vulnerable than others.
|
||||
|
||||
- `/api/recipes/create-url`
|
||||
- `/api/recipes/{id}/image`
|
||||
|
||||
These endpoints are used to scrape data based off a user provided URL. It is possible for a malicious user to issue multiple requests to download an arbitrarily large external file (e.g a Debian ISO) and sufficiently saturate a CPU assigned to the container. While we do implement some protections against this by chunking the response, and using a timeout strategy, it's still possible to overload the CPU if an attacker issues multiple requests concurrently.
|
||||
|
||||
### Mitigation
|
||||
|
||||
If you'd like to mitigate this risk, we suggest that you rate limit the API in general, and apply strict rate limits to these endpoints. You can do this by utilizing a reverse proxy. See the following links to get started:
|
||||
|
||||
- [Traefik](https://doc.traefik.io/traefik/middlewares/http/ratelimit/)
|
||||
- [Nginx](https://nginx.org/en/docs/http/ngx_http_limit_req_module.html)
|
||||
- [Caddy](https://caddyserver.com/docs/modules/http.handlers.rate_limit)
|
||||
|
||||
## Server Side Request Forgery
|
||||
|
||||
- `/api/recipes/create-url`
|
||||
- `/api/recipes/{id}/image`
|
||||
|
||||
Given the nature of these APIs it's possible to perform a **Server Side Request Forgery** attack. This is where a malicious user can issue a request to an internal network resource, and potentially exfiltrate data. We _do_ perform some checks to mitigate access to resources within your network but at the end of the day, users of Mealie are allowed to trigger HTTP requests on **your server**.
|
||||
|
||||
### Mitigation
|
||||
|
||||
If you'd like to mitigate this risk, we suggest that you isolate the container that Mealie is running in to ensure that it's access to internal resources is limited only to what is required. _Note that Mealie does require access to the internet for recipe imports._ You might consider isolating Mealie from your home network entirely and only allowing access to the external internet.
|
||||
@@ -9,12 +9,11 @@ SQLite is a popular, open source, self-contained, zero-configuration database th
|
||||
**For Environment Variable Configuration, see** [Backend Configuration](./backend-config.md)
|
||||
|
||||
```yaml
|
||||
---
|
||||
version: "3.7"
|
||||
services:
|
||||
mealie:
|
||||
image: ghcr.io/mealie-recipes/mealie:v1.3.1 # (3)
|
||||
image: ghcr.io/mealie-recipes/mealie:v1.9.0 # (3)
|
||||
container_name: mealie
|
||||
restart: always
|
||||
ports:
|
||||
- "9925:9000" # (1)
|
||||
deploy:
|
||||
@@ -25,18 +24,16 @@ services:
|
||||
- mealie-data:/app/data/
|
||||
environment:
|
||||
# Set Backend ENV Variables Here
|
||||
- ALLOW_SIGNUP=true
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=America/Anchorage
|
||||
- MAX_WORKERS=1
|
||||
- WEB_CONCURRENCY=1
|
||||
- BASE_URL=https://mealie.yourdomain.com
|
||||
restart: always
|
||||
ALLOW_SIGNUP: true
|
||||
PUID: 1000
|
||||
PGID: 1000
|
||||
TZ: America/Anchorage
|
||||
MAX_WORKERS: 1
|
||||
WEB_CONCURRENCY: 1
|
||||
BASE_URL: https://mealie.yourdomain.com
|
||||
|
||||
volumes:
|
||||
mealie-data:
|
||||
driver: local
|
||||
```
|
||||
|
||||
<!-- Updating This? Be Sure to also update the Postgres Annotations -->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Permissions and Public Access
|
||||
|
||||
Mealie provides various levels of user access and permissions. This includes:
|
||||
- Authentication and registration ([check out the LDAP guide](./ldap.md) for how to configure access using LDAP)
|
||||
- Authentication and registration ([LDAP](../authentication/ldap.md) and [OpenID Connect](../authentication/oidc.md) are both supported)
|
||||
- Customizable user permissions
|
||||
- Fine-tuned public access for non-users
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -41,7 +41,8 @@ markdown_extensions:
|
||||
custom_checkbox: true
|
||||
- admonition
|
||||
- attr_list
|
||||
- pymdownx.tabbed
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
- pymdownx.superfences:
|
||||
custom_fences:
|
||||
- name: mermaid
|
||||
@@ -71,9 +72,15 @@ nav:
|
||||
- SQLite (Recommended): "documentation/getting-started/installation/sqlite.md"
|
||||
- PostgreSQL: "documentation/getting-started/installation/postgres.md"
|
||||
- Backend Configuration: "documentation/getting-started/installation/backend-config.md"
|
||||
- Security: "documentation/getting-started/installation/security.md"
|
||||
- Logs: "documentation/getting-started/installation/logs.md"
|
||||
- Usage:
|
||||
- Backup and Restoring: "documentation/getting-started/usage/backups-and-restoring.md"
|
||||
- LDAP Authentication: "documentation/getting-started/usage/ldap.md"
|
||||
- Permissions and Public Access: "documentation/getting-started/usage/permissions-and-public-access.md"
|
||||
|
||||
- Authentication:
|
||||
- LDAP: "documentation/getting-started/authentication/ldap.md"
|
||||
- OpenID Connect: "documentation/getting-started/authentication/oidc.md"
|
||||
|
||||
- Community Guides:
|
||||
- iOS Shortcuts: "documentation/community-guide/ios.md"
|
||||
@@ -81,6 +88,7 @@ nav:
|
||||
- Home Assistant: "documentation/community-guide/home-assistant.md"
|
||||
- Bulk Url Import: "documentation/community-guide/bulk-url-import.md"
|
||||
- Import Bookmarklet: "documentation/community-guide/import-recipe-bookmarklet.md"
|
||||
- Automate Backups with n8n: "documentation/community-guide/n8n-backup-automation.md"
|
||||
|
||||
- API Reference: "api/redoc.md"
|
||||
|
||||
@@ -90,23 +98,7 @@ nav:
|
||||
- Developers Guide:
|
||||
- Code Contributions: "contributors/developers-guide/code-contributions.md"
|
||||
- Dev Getting Started: "contributors/developers-guide/starting-dev-server.md"
|
||||
- Database Changes: "contributors/developers-guide/database-changes.md"
|
||||
- Maintainers Guide: "contributors/developers-guide/maintainers.md"
|
||||
- Guides:
|
||||
- Improving Ingredient Parser: "contributors/guides/ingredient-parser.md"
|
||||
|
||||
- Change Log:
|
||||
- v1.0.0beta-5: "changelog/v1.0.0beta-5.md"
|
||||
- v1.0.0beta-4: "changelog/v1.0.0beta-4.md"
|
||||
- v1.0.0beta-3: "changelog/v1.0.0beta-3.md"
|
||||
- v1.0.0beta-2: "changelog/v1.0.0beta-2.md"
|
||||
- v1.0.0 Beta: "changelog/v1.0.0.md"
|
||||
- v0.5.2 Misc Updates: "changelog/v0.5.2.md"
|
||||
- v0.5.1 Bug Fixes: "changelog/v0.5.1.md"
|
||||
- v0.5.0 General Upgrades: "changelog/v0.5.0.md"
|
||||
- v0.4.3 Hot Fix: "changelog/v0.4.3.md"
|
||||
- v0.4.2 Backend/Migrations: "changelog/v0.4.2.md"
|
||||
- v0.4.1 Frontend/UI: "changelog/v0.4.1.md"
|
||||
- v0.4.0 Authentication: "changelog/v0.4.0.md"
|
||||
- v0.3.0 Improvements: "changelog/v0.3.0.md"
|
||||
- v0.2.0 Now With Tests!: "changelog/v0.2.0.md"
|
||||
- v0.1.0 Beta: "changelog/v0.1.0.md"
|
||||
|
||||
@@ -1,8 +1,33 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- Edit Dialog -->
|
||||
<BaseDialog
|
||||
v-if="editTarget"
|
||||
v-model="dialogStates.edit"
|
||||
:width="650"
|
||||
:icon="$globals.icons.pages"
|
||||
:title="$t('general.edit')"
|
||||
:submit-icon="$globals.icons.save"
|
||||
:submit-text="$tc('general.save')"
|
||||
@submit="editCookbook"
|
||||
>
|
||||
<v-card-text>
|
||||
<CookbookEditor :cookbook="editTarget" :actions="actions" />
|
||||
</v-card-text>
|
||||
</BaseDialog>
|
||||
|
||||
<!-- Page -->
|
||||
<v-container v-if="book" fluid>
|
||||
<v-app-bar color="transparent" flat class="mt-n1 rounded">
|
||||
<v-app-bar color="transparent" flat class="mt-n1">
|
||||
<v-icon large left> {{ $globals.icons.pages }} </v-icon>
|
||||
<v-toolbar-title class="headline"> {{ book.name }} </v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<BaseButton
|
||||
v-if="isOwnGroup"
|
||||
class="mx-1"
|
||||
:edit="true"
|
||||
@click="handleEditCookbook"
|
||||
/>
|
||||
</v-app-bar>
|
||||
<v-card flat>
|
||||
<v-card-text class="py-0">
|
||||
@@ -22,17 +47,20 @@
|
||||
/>
|
||||
</v-container>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, useRoute, ref, useContext, useMeta } from "@nuxtjs/composition-api";
|
||||
import { computed, defineComponent, useRoute, ref, useContext, useMeta, reactive, useRouter } from "@nuxtjs/composition-api";
|
||||
import { useLazyRecipes } from "~/composables/recipes";
|
||||
import RecipeCardSection from "@/components/Domain/Recipe/RecipeCardSection.vue";
|
||||
import { useCookbook } from "~/composables/use-group-cookbooks";
|
||||
import { useCookbook, useCookbooks } from "~/composables/use-group-cookbooks";
|
||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||
import { RecipeCookBook } from "~/lib/api/types/cookbook";
|
||||
import CookbookEditor from "~/components/Domain/Cookbook/CookbookEditor.vue";
|
||||
|
||||
export default defineComponent({
|
||||
components: { RecipeCardSection },
|
||||
components: { RecipeCardSection, CookbookEditor },
|
||||
setup() {
|
||||
const { $auth } = useContext();
|
||||
const { isOwnGroup } = useLoggedInState();
|
||||
@@ -43,10 +71,36 @@
|
||||
const { recipes, appendRecipes, assignSorted, removeRecipe, replaceRecipes } = useLazyRecipes(isOwnGroup.value ? null : groupSlug.value);
|
||||
const slug = route.value.params.slug;
|
||||
const { getOne } = useCookbook(isOwnGroup.value ? null : groupSlug.value);
|
||||
const { actions } = useCookbooks();
|
||||
const router = useRouter();
|
||||
|
||||
const tab = ref(null);
|
||||
const book = getOne(slug);
|
||||
|
||||
const dialogStates = reactive({
|
||||
edit: false,
|
||||
});
|
||||
|
||||
const editTarget = ref<RecipeCookBook | null>(null);
|
||||
function handleEditCookbook() {
|
||||
dialogStates.edit = true;
|
||||
editTarget.value = book.value;
|
||||
}
|
||||
|
||||
async function editCookbook() {
|
||||
if (!editTarget.value) {
|
||||
return;
|
||||
}
|
||||
const response = await actions.updateOne(editTarget.value);
|
||||
|
||||
// if name changed, redirect to new slug
|
||||
if (response?.slug && book.value?.slug !== response?.slug) {
|
||||
router.push(`/g/${route.value.params.groupSlug}/cookbooks/${response?.slug}`);
|
||||
}
|
||||
dialogStates.edit = false;
|
||||
editTarget.value = null;
|
||||
}
|
||||
|
||||
useMeta(() => {
|
||||
return {
|
||||
title: book?.value?.name || "Cookbook",
|
||||
@@ -62,6 +116,12 @@
|
||||
recipes,
|
||||
removeRecipe,
|
||||
replaceRecipes,
|
||||
isOwnGroup,
|
||||
dialogStates,
|
||||
editTarget,
|
||||
handleEditCookbook,
|
||||
editCookbook,
|
||||
actions,
|
||||
};
|
||||
},
|
||||
head: {}, // Must include for useMeta
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, computed, useContext } from "@nuxtjs/composition-api";
|
||||
import RecipeOrganizerSelector from "~/components/Domain/Recipe/RecipeOrganizerSelector.vue";
|
||||
import { RecipeTag, RecipeCategory } from "~/lib/api/types/group";
|
||||
import { RecipeTag, RecipeCategory } from "~/lib/api/types/recipe";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<div v-if="!open" class="custom-btn-group ma-1">
|
||||
<RecipeFavoriteBadge v-if="loggedIn" class="mx-1" color="info" button-style :slug="recipe.slug" show-always />
|
||||
<RecipeFavoriteBadge v-if="loggedIn" class="mx-1" color="info" button-style :recipe-id="recipe.id" show-always />
|
||||
<RecipeTimelineBadge v-if="loggedIn" button-style :slug="recipe.slug" :recipe-name="recipe.name" />
|
||||
<div v-if="loggedIn">
|
||||
<v-tooltip v-if="!locked" bottom color="info">
|
||||
@@ -70,6 +70,7 @@
|
||||
print: true,
|
||||
printPreferences: true,
|
||||
share: loggedIn,
|
||||
recipeActions: true,
|
||||
}"
|
||||
@print="$emit('print')"
|
||||
/>
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
|
||||
<slot name="actions">
|
||||
<v-card-actions v-if="showRecipeContent" class="px-1">
|
||||
<RecipeFavoriteBadge v-if="isOwnGroup" class="absolute" :slug="slug" show-always />
|
||||
<RecipeFavoriteBadge v-if="isOwnGroup" class="absolute" :recipe-id="recipeId" show-always />
|
||||
|
||||
<RecipeRating class="pb-1" :value="rating" :name="name" :slug="slug" :small="true" />
|
||||
<RecipeRating class="pb-1" :value="rating" :recipe-id="recipeId" :slug="slug" :small="true" />
|
||||
<v-spacer></v-spacer>
|
||||
<RecipeChips :truncate="true" :items="tags" :title="false" :limit="2" :small="true" url-prefix="tags" />
|
||||
|
||||
@@ -97,6 +97,10 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
ratingColor: {
|
||||
type: String,
|
||||
default: "secondary",
|
||||
},
|
||||
image: {
|
||||
type: String,
|
||||
required: false,
|
||||
|
||||
@@ -38,17 +38,14 @@
|
||||
</v-list-item-subtitle>
|
||||
<div class="d-flex flex-wrap justify-end align-center">
|
||||
<slot name="actions">
|
||||
<RecipeFavoriteBadge v-if="isOwnGroup && showRecipeContent" :slug="slug" show-always />
|
||||
<v-rating
|
||||
v-if="showRecipeContent"
|
||||
color="secondary"
|
||||
<RecipeFavoriteBadge v-if="isOwnGroup && showRecipeContent" :recipe-id="recipeId" show-always />
|
||||
<RecipeRating
|
||||
:class="isOwnGroup ? 'ml-auto' : 'ml-auto pb-2'"
|
||||
background-color="secondary lighten-3"
|
||||
dense
|
||||
length="5"
|
||||
size="15"
|
||||
:value="rating"
|
||||
></v-rating>
|
||||
:recipe-id="recipeId"
|
||||
:slug="slug"
|
||||
:small="true"
|
||||
/>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<!-- If we're not logged-in, no items display, so we hide this menu -->
|
||||
@@ -85,12 +82,14 @@ import { computed, defineComponent, useContext, useRoute } from "@nuxtjs/composi
|
||||
import RecipeFavoriteBadge from "./RecipeFavoriteBadge.vue";
|
||||
import RecipeContextMenu from "./RecipeContextMenu.vue";
|
||||
import RecipeCardImage from "./RecipeCardImage.vue";
|
||||
import RecipeRating from "./RecipeRating.vue";
|
||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
RecipeFavoriteBadge,
|
||||
RecipeContextMenu,
|
||||
RecipeRating,
|
||||
RecipeCardImage,
|
||||
},
|
||||
props: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
color="accent"
|
||||
:small="small"
|
||||
dark
|
||||
:to="isOwnGroup ? `${baseRecipeRoute}?${urlPrefix}=${category.id}` : undefined"
|
||||
:to="`${baseRecipeRoute}?${urlPrefix}=${category.id}`"
|
||||
>
|
||||
{{ truncateText(category.name) }}
|
||||
</v-chip>
|
||||
@@ -18,8 +18,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, useContext, useRoute } from "@nuxtjs/composition-api";
|
||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||
import { RecipeCategory, RecipeTag, RecipeTool } from "~/lib/api/types/user";
|
||||
import { RecipeCategory, RecipeTag, RecipeTool } from "~/lib/api/types/recipe";
|
||||
|
||||
export type UrlPrefixParam = "tags" | "categories" | "tools";
|
||||
|
||||
@@ -56,7 +55,6 @@ export default defineComponent({
|
||||
},
|
||||
setup(props) {
|
||||
const { $auth } = useContext();
|
||||
const { isOwnGroup } = useLoggedInState();
|
||||
|
||||
const route = useRoute();
|
||||
const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "")
|
||||
@@ -74,7 +72,6 @@ export default defineComponent({
|
||||
|
||||
return {
|
||||
baseRecipeRoute,
|
||||
isOwnGroup,
|
||||
truncateText,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -59,7 +59,13 @@
|
||||
v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="newMealdate" no-title @input="pickerMenu = false"></v-date-picker>
|
||||
<v-date-picker
|
||||
v-model="newMealdate"
|
||||
no-title
|
||||
:first-day-of-week="firstDayOfWeek"
|
||||
:local="$i18n.locale"
|
||||
@input="pickerMenu = false"
|
||||
/>
|
||||
</v-menu>
|
||||
<v-select
|
||||
v-model="newMealType"
|
||||
@@ -99,6 +105,26 @@
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ item.title }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<div v-if="useItems.recipeActions && recipeActions && recipeActions.length">
|
||||
<v-divider />
|
||||
<v-list-group @click.stop>
|
||||
<template #activator>
|
||||
<v-list-item-title>{{ $tc("recipe.recipe-actions") }}</v-list-item-title>
|
||||
</template>
|
||||
<v-list dense class="ma-0 pa-0">
|
||||
<v-list-item
|
||||
v-for="(action, index) in recipeActions"
|
||||
:key="index"
|
||||
class="pl-6"
|
||||
@click="executeRecipeAction(action)"
|
||||
>
|
||||
<v-list-item-title>
|
||||
{{ action.title }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-list-group>
|
||||
</div>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</div>
|
||||
@@ -111,10 +137,12 @@ import RecipeDialogPrintPreferences from "./RecipeDialogPrintPreferences.vue";
|
||||
import RecipeDialogShare from "./RecipeDialogShare.vue";
|
||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { useGroupRecipeActions } from "~/composables/use-group-recipe-actions";
|
||||
import { useGroupSelf } from "~/composables/use-groups";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
import { usePlanTypeOptions } from "~/composables/use-group-mealplan";
|
||||
import { Recipe } from "~/lib/api/types/recipe";
|
||||
import { ShoppingListSummary } from "~/lib/api/types/group";
|
||||
import { GroupRecipeActionOut, ShoppingListSummary } from "~/lib/api/types/group";
|
||||
import { PlanEntryType } from "~/lib/api/types/meal-plan";
|
||||
import { useAxiosDownloader } from "~/composables/api/use-axios-download";
|
||||
|
||||
@@ -127,6 +155,7 @@ export interface ContextMenuIncludes {
|
||||
print: boolean;
|
||||
printPreferences: boolean;
|
||||
share: boolean;
|
||||
recipeActions: boolean;
|
||||
}
|
||||
|
||||
export interface ContextMenuItem {
|
||||
@@ -156,6 +185,7 @@ export default defineComponent({
|
||||
print: true,
|
||||
printPreferences: true,
|
||||
share: true,
|
||||
recipeActions: true,
|
||||
}),
|
||||
},
|
||||
// Append items are added at the end of the useItems list
|
||||
@@ -224,11 +254,16 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
const { i18n, $auth, $globals } = useContext();
|
||||
const { group } = useGroupSelf();
|
||||
const { isOwnGroup } = useLoggedInState();
|
||||
|
||||
const route = useRoute();
|
||||
const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "");
|
||||
|
||||
const firstDayOfWeek = computed(() => {
|
||||
return group.value?.preferences?.firstDayOfWeek || 0;
|
||||
});
|
||||
|
||||
// ===========================================================================
|
||||
// Context Menu Setup
|
||||
|
||||
@@ -335,6 +370,19 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const groupRecipeActionsStore = useGroupRecipeActions();
|
||||
|
||||
async function executeRecipeAction(action: GroupRecipeActionOut) {
|
||||
const response = await groupRecipeActionsStore.execute(action, props.recipe);
|
||||
|
||||
if (action.actionType === "post") {
|
||||
if (!response || (response.status >= 200 && response.status < 300)) {
|
||||
alert.success(i18n.tc("events.message-sent"));
|
||||
} else {
|
||||
alert.error(i18n.tc("events.something-went-wrong"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteRecipe() {
|
||||
await api.recipes.deleteOne(props.slug);
|
||||
@@ -425,6 +473,8 @@ export default defineComponent({
|
||||
...toRefs(state),
|
||||
recipeRef,
|
||||
recipeRefWithScale,
|
||||
executeRecipeAction,
|
||||
recipeActions: groupRecipeActionsStore.recipeActions,
|
||||
shoppingLists,
|
||||
duplicateRecipe,
|
||||
contextMenuEventHandler,
|
||||
@@ -432,6 +482,7 @@ export default defineComponent({
|
||||
addRecipeToPlan,
|
||||
icon,
|
||||
planTypeOptions,
|
||||
firstDayOfWeek,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -231,7 +231,7 @@ export default defineComponent({
|
||||
|
||||
const shoppingListIngredients: ShoppingListIngredient[] = recipe.recipeIngredient.map((ing) => {
|
||||
return {
|
||||
checked: true,
|
||||
checked: !ing.food?.onHand,
|
||||
ingredient: ing,
|
||||
disableAmount: recipe.settings?.disableAmount || false,
|
||||
}
|
||||
|
||||
@@ -31,6 +31,13 @@
|
||||
<v-switch v-model="preferences.showNotes" hide-details :label="$tc('recipe.notes')" />
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col cols="auto" align-self="start">
|
||||
<v-row no-gutters>
|
||||
<v-switch v-model="preferences.showNutrition" hide-details :label="$tc('recipe.nutrition')" />
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<v-card
|
||||
|
||||
@@ -22,7 +22,13 @@
|
||||
v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="expirationDate" no-title @input="datePickerMenu = false"></v-date-picker>
|
||||
<v-date-picker
|
||||
v-model="expirationDate"
|
||||
no-title
|
||||
:first-day-of-week="firstDayOfWeek"
|
||||
:local="$i18n.locale"
|
||||
@input="datePickerMenu = false"
|
||||
/>
|
||||
</v-menu>
|
||||
</v-card-text>
|
||||
<v-card-actions class="justify-end">
|
||||
@@ -60,6 +66,7 @@ import { defineComponent, computed, toRefs, reactive, useContext, useRoute } fro
|
||||
import { useClipboard, useShare, whenever } from "@vueuse/core";
|
||||
import { RecipeShareToken } from "~/lib/api/types/recipe";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { useGroupSelf } from "~/composables/use-groups";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
|
||||
export default defineComponent({
|
||||
@@ -106,9 +113,14 @@ export default defineComponent({
|
||||
);
|
||||
|
||||
const { $auth, i18n } = useContext();
|
||||
const { group } = useGroupSelf();
|
||||
const route = useRoute();
|
||||
const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "");
|
||||
|
||||
const firstDayOfWeek = computed(() => {
|
||||
return group.value?.preferences?.firstDayOfWeek || 0;
|
||||
});
|
||||
|
||||
// ============================================================
|
||||
// Token Actions
|
||||
|
||||
@@ -185,6 +197,7 @@ export default defineComponent({
|
||||
dialog,
|
||||
createNewToken,
|
||||
deleteToken,
|
||||
firstDayOfWeek,
|
||||
shareRecipe,
|
||||
copyTokenLink,
|
||||
};
|
||||
|
||||
@@ -67,12 +67,16 @@
|
||||
<v-list>
|
||||
<v-list-item @click="toggleOrderDirection()">
|
||||
<v-icon left>
|
||||
{{ $globals.icons.sort }}
|
||||
{{
|
||||
state.orderDirection === "asc" ?
|
||||
$globals.icons.sortDescending : $globals.icons.sortAscending
|
||||
}}
|
||||
</v-icon>
|
||||
<v-list-item-title>
|
||||
{{ state.orderDirection === "asc" ? "Sort Descending" : "Sort Ascending" }}
|
||||
{{ state.orderDirection === "asc" ? $tc("general.sort-descending") : $tc("general.sort-ascending") }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-divider />
|
||||
<v-list-item
|
||||
v-for="v in sortable"
|
||||
:key="v.name"
|
||||
@@ -120,11 +124,12 @@
|
||||
<v-divider></v-divider>
|
||||
<v-container class="mt-6 px-md-6">
|
||||
<RecipeCardSection
|
||||
v-if="state.ready"
|
||||
class="mt-n5"
|
||||
:icon="$globals.icons.search"
|
||||
:title="$tc('search.results')"
|
||||
:recipes="recipes"
|
||||
:query="passedQuery"
|
||||
:query="passedQueryWithSeed"
|
||||
@replaceRecipes="replaceRecipes"
|
||||
@appendRecipes="appendRecipes"
|
||||
/>
|
||||
@@ -133,11 +138,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ref, defineComponent, useRouter, onMounted, useContext, computed, Ref, useRoute } from "@nuxtjs/composition-api";
|
||||
import { ref, defineComponent, useRouter, onMounted, useContext, computed, Ref, useRoute, watch } from "@nuxtjs/composition-api";
|
||||
import { watchDebounced } from "@vueuse/shared";
|
||||
import SearchFilter from "~/components/Domain/SearchFilter.vue";
|
||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||
import { useCategoryStore, useFoodStore, useTagStore, useToolStore } from "~/composables/store";
|
||||
import { useUserSearchQuerySession } from "~/composables/use-users/preferences";
|
||||
import RecipeCardSection from "~/components/Domain/Recipe/RecipeCardSection.vue";
|
||||
import { IngredientFood, RecipeCategory, RecipeTag, RecipeTool } from "~/lib/api/types/recipe";
|
||||
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
||||
@@ -157,6 +163,7 @@ export default defineComponent({
|
||||
const { isOwnGroup } = useLoggedInState();
|
||||
const state = ref({
|
||||
auto: true,
|
||||
ready: false,
|
||||
search: "",
|
||||
orderBy: "created_at",
|
||||
orderDirection: "desc" as "asc" | "desc",
|
||||
@@ -170,6 +177,7 @@ export default defineComponent({
|
||||
|
||||
const route = useRoute();
|
||||
const groupSlug = computed(() => route.value.params.groupSlug || $auth.user?.groupSlug || "");
|
||||
const searchQuerySession = useUserSearchQuerySession();
|
||||
|
||||
const { recipes, appendRecipes, assignSorted, removeRecipe, replaceRecipes } = useLazyRecipes(isOwnGroup.value ? null : groupSlug.value);
|
||||
const categories = isOwnGroup.value ? useCategoryStore() : usePublicCategoryStore(groupSlug.value);
|
||||
@@ -184,65 +192,11 @@ export default defineComponent({
|
||||
const tools = isOwnGroup.value ? useToolStore() : usePublicToolStore(groupSlug.value);
|
||||
const selectedTools = ref<NoUndefinedField<RecipeTool>[]>([]);
|
||||
|
||||
const passedQuery = ref<RecipeSearchQuery | null>(null);
|
||||
|
||||
function reset() {
|
||||
state.value.search = "";
|
||||
state.value.orderBy = "created_at";
|
||||
state.value.orderDirection = "desc";
|
||||
state.value.requireAllCategories = false;
|
||||
state.value.requireAllTags = false;
|
||||
state.value.requireAllTools = false;
|
||||
state.value.requireAllFoods = false;
|
||||
selectedCategories.value = [];
|
||||
selectedFoods.value = [];
|
||||
selectedTags.value = [];
|
||||
selectedTools.value = [];
|
||||
|
||||
router.push({
|
||||
query: {},
|
||||
});
|
||||
|
||||
search();
|
||||
}
|
||||
|
||||
function toggleOrderDirection() {
|
||||
state.value.orderDirection = state.value.orderDirection === "asc" ? "desc" : "asc";
|
||||
}
|
||||
|
||||
function toIDArray(array: { id: string }[]) {
|
||||
return array.map((item) => item.id);
|
||||
}
|
||||
|
||||
function hideKeyboard() {
|
||||
input.value.blur()
|
||||
}
|
||||
|
||||
const input: Ref<any> = ref(null);
|
||||
|
||||
async function search() {
|
||||
await router.push({
|
||||
query: {
|
||||
categories: toIDArray(selectedCategories.value),
|
||||
foods: toIDArray(selectedFoods.value),
|
||||
tags: toIDArray(selectedTags.value),
|
||||
tools: toIDArray(selectedTools.value),
|
||||
// Only add the query param if it's or not default
|
||||
...{
|
||||
auto: state.value.auto ? undefined : "false",
|
||||
search: state.value.search === "" ? undefined : state.value.search,
|
||||
orderBy: state.value.orderBy === "createdAt" ? undefined : state.value.orderBy,
|
||||
orderDirection: state.value.orderDirection === "desc" ? undefined : state.value.orderDirection,
|
||||
requireAllCategories: state.value.requireAllCategories ? "true" : undefined,
|
||||
requireAllTags: state.value.requireAllTags ? "true" : undefined,
|
||||
requireAllTools: state.value.requireAllTools ? "true" : undefined,
|
||||
requireAllFoods: state.value.requireAllFoods ? "true" : undefined,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
passedQuery.value = {
|
||||
search: state.value.search,
|
||||
function calcPassedQuery(): RecipeSearchQuery {
|
||||
return {
|
||||
// the search clear button sets search to null, which still renders the query param for a moment,
|
||||
// whereas an empty string is not rendered
|
||||
search: state.value.search ? state.value.search : "",
|
||||
categories: toIDArray(selectedCategories.value),
|
||||
foods: toIDArray(selectedFoods.value),
|
||||
tags: toIDArray(selectedTags.value),
|
||||
@@ -253,8 +207,87 @@ export default defineComponent({
|
||||
requireAllFoods: state.value.requireAllFoods,
|
||||
orderBy: state.value.orderBy,
|
||||
orderDirection: state.value.orderDirection,
|
||||
};
|
||||
}
|
||||
const passedQuery = ref<RecipeSearchQuery>(calcPassedQuery());
|
||||
|
||||
// we calculate this separately because otherwise we can't check for query changes
|
||||
const passedQueryWithSeed = computed(() => {
|
||||
return {
|
||||
...passedQuery.value,
|
||||
_searchSeed: Date.now().toString()
|
||||
};
|
||||
})
|
||||
|
||||
const queryDefaults = {
|
||||
search: "",
|
||||
orderBy: "created_at",
|
||||
orderDirection: "desc" as "asc" | "desc",
|
||||
requireAllCategories: false,
|
||||
requireAllTags: false,
|
||||
requireAllTools: false,
|
||||
requireAllFoods: false,
|
||||
}
|
||||
|
||||
function reset() {
|
||||
state.value.search = queryDefaults.search;
|
||||
state.value.orderBy = queryDefaults.orderBy;
|
||||
state.value.orderDirection = queryDefaults.orderDirection;
|
||||
state.value.requireAllCategories = queryDefaults.requireAllCategories;
|
||||
state.value.requireAllTags = queryDefaults.requireAllTags;
|
||||
state.value.requireAllTools = queryDefaults.requireAllTools;
|
||||
state.value.requireAllFoods = queryDefaults.requireAllFoods;
|
||||
selectedCategories.value = [];
|
||||
selectedFoods.value = [];
|
||||
selectedTags.value = [];
|
||||
selectedTools.value = [];
|
||||
|
||||
search();
|
||||
}
|
||||
|
||||
function toggleOrderDirection() {
|
||||
state.value.orderDirection = state.value.orderDirection === "asc" ? "desc" : "asc";
|
||||
}
|
||||
|
||||
function toIDArray(array: { id: string }[]) {
|
||||
// we sort the array to make sure the query is always the same
|
||||
return array.map((item) => item.id).sort();
|
||||
}
|
||||
|
||||
function hideKeyboard() {
|
||||
input.value.blur()
|
||||
}
|
||||
|
||||
const input: Ref<any> = ref(null);
|
||||
|
||||
async function search() {
|
||||
const oldQueryValueString = JSON.stringify(passedQuery.value);
|
||||
const newQueryValue = calcPassedQuery();
|
||||
const newQueryValueString = JSON.stringify(newQueryValue);
|
||||
if (oldQueryValueString === newQueryValueString) {
|
||||
return;
|
||||
}
|
||||
|
||||
passedQuery.value = newQueryValue;
|
||||
const query = {
|
||||
categories: passedQuery.value.categories,
|
||||
foods: passedQuery.value.foods,
|
||||
tags: passedQuery.value.tags,
|
||||
tools: passedQuery.value.tools,
|
||||
// Only add the query param if it's not the default value
|
||||
...{
|
||||
auto: state.value.auto ? undefined : "false",
|
||||
search: passedQuery.value.search === queryDefaults.search ? undefined : passedQuery.value.search,
|
||||
orderBy: passedQuery.value.orderBy === queryDefaults.orderBy ? undefined : passedQuery.value.orderBy,
|
||||
orderDirection: passedQuery.value.orderDirection === queryDefaults.orderDirection ? undefined : passedQuery.value.orderDirection,
|
||||
requireAllCategories: passedQuery.value.requireAllCategories ? "true" : undefined,
|
||||
requireAllTags: passedQuery.value.requireAllTags ? "true" : undefined,
|
||||
requireAllTools: passedQuery.value.requireAllTools ? "true" : undefined,
|
||||
requireAllFoods: passedQuery.value.requireAllFoods ? "true" : undefined,
|
||||
},
|
||||
}
|
||||
await router.push({ query });
|
||||
searchQuerySession.value.recipe = JSON.stringify(query);
|
||||
}
|
||||
|
||||
function waitUntilAndExecute(
|
||||
@@ -325,32 +358,69 @@ export default defineComponent({
|
||||
},
|
||||
];
|
||||
|
||||
onMounted(() => {
|
||||
// Hydrate Search
|
||||
// wait for stores to be hydrated
|
||||
watch(
|
||||
() => route.value.query,
|
||||
() => {
|
||||
if (state.value.ready) {
|
||||
hydrateSearch();
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
},
|
||||
)
|
||||
|
||||
// read query params
|
||||
async function hydrateSearch() {
|
||||
const query = router.currentRoute.query;
|
||||
|
||||
if (query.auto) {
|
||||
if (query.auto?.length) {
|
||||
state.value.auto = query.auto === "true";
|
||||
}
|
||||
|
||||
if (query.search) {
|
||||
if (query.search?.length) {
|
||||
state.value.search = query.search as string;
|
||||
} else {
|
||||
state.value.search = queryDefaults.search;
|
||||
}
|
||||
|
||||
if (query.orderBy) {
|
||||
if (query.orderBy?.length) {
|
||||
state.value.orderBy = query.orderBy as string;
|
||||
} else {
|
||||
state.value.orderBy = queryDefaults.orderBy;
|
||||
}
|
||||
|
||||
if (query.orderDirection) {
|
||||
if (query.orderDirection?.length) {
|
||||
state.value.orderDirection = query.orderDirection as "asc" | "desc";
|
||||
} else {
|
||||
state.value.orderDirection = queryDefaults.orderDirection;
|
||||
}
|
||||
|
||||
if (query.requireAllCategories?.length) {
|
||||
state.value.requireAllCategories = query.requireAllCategories === "true";
|
||||
} else {
|
||||
state.value.requireAllCategories = queryDefaults.requireAllCategories;
|
||||
}
|
||||
|
||||
if (query.requireAllTags?.length) {
|
||||
state.value.requireAllTags = query.requireAllTags === "true";
|
||||
} else {
|
||||
state.value.requireAllTags = queryDefaults.requireAllTags;
|
||||
}
|
||||
|
||||
if (query.requireAllTools?.length) {
|
||||
state.value.requireAllTools = query.requireAllTools === "true";
|
||||
} else {
|
||||
state.value.requireAllTools = queryDefaults.requireAllTools;
|
||||
}
|
||||
|
||||
if (query.requireAllFoods?.length) {
|
||||
state.value.requireAllFoods = query.requireAllFoods === "true";
|
||||
} else {
|
||||
state.value.requireAllFoods = queryDefaults.requireAllFoods;
|
||||
}
|
||||
|
||||
const promises: Promise<void>[] = [];
|
||||
|
||||
if (query.categories) {
|
||||
if (query.categories?.length) {
|
||||
promises.push(
|
||||
waitUntilAndExecute(
|
||||
() => categories.items.value.length > 0,
|
||||
@@ -363,9 +433,39 @@ export default defineComponent({
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
selectedCategories.value = [];
|
||||
}
|
||||
|
||||
if (query.foods) {
|
||||
if (query.tags?.length) {
|
||||
promises.push(
|
||||
waitUntilAndExecute(
|
||||
() => tags.items.value.length > 0,
|
||||
() => {
|
||||
const result = tags.items.value.filter((item) => (query.tags as string[]).includes(item.id as string));
|
||||
selectedTags.value = result as NoUndefinedField<RecipeTag>[];
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
selectedTags.value = [];
|
||||
}
|
||||
|
||||
if (query.tools?.length) {
|
||||
promises.push(
|
||||
waitUntilAndExecute(
|
||||
() => tools.items.value.length > 0,
|
||||
() => {
|
||||
const result = tools.items.value.filter((item) => (query.tools as string[]).includes(item.id));
|
||||
selectedTools.value = result as NoUndefinedField<RecipeTool>[];
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
selectedTools.value = [];
|
||||
}
|
||||
|
||||
if (query.foods?.length) {
|
||||
promises.push(
|
||||
waitUntilAndExecute(
|
||||
() => {
|
||||
@@ -380,35 +480,28 @@ export default defineComponent({
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
selectedFoods.value = [];
|
||||
}
|
||||
|
||||
if (query.tags) {
|
||||
promises.push(
|
||||
waitUntilAndExecute(
|
||||
() => tags.items.value.length > 0,
|
||||
() => {
|
||||
const result = tags.items.value.filter((item) => (query.tags as string[]).includes(item.id as string));
|
||||
selectedTags.value = result as NoUndefinedField<RecipeTag>[];
|
||||
await Promise.allSettled(promises);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
// restore the user's last search query
|
||||
if (searchQuerySession.value.recipe && !(Object.keys(route.value.query).length > 0)) {
|
||||
try {
|
||||
const query = JSON.parse(searchQuerySession.value.recipe);
|
||||
await router.replace({ query });
|
||||
} catch (error) {
|
||||
searchQuerySession.value.recipe = "";
|
||||
router.replace({ query: {} });
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (query.tools) {
|
||||
promises.push(
|
||||
waitUntilAndExecute(
|
||||
() => tools.items.value.length > 0,
|
||||
() => {
|
||||
const result = tools.items.value.filter((item) => (query.tools as string[]).includes(item.id));
|
||||
selectedTools.value = result as NoUndefinedField<RecipeTool>[];
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Promise.allSettled(promises).then(() => {
|
||||
search();
|
||||
});
|
||||
await hydrateSearch();
|
||||
await search();
|
||||
state.value.ready = true;
|
||||
});
|
||||
|
||||
watchDebounced(
|
||||
@@ -426,7 +519,7 @@ export default defineComponent({
|
||||
selectedTools,
|
||||
],
|
||||
async () => {
|
||||
if (state.value.auto) {
|
||||
if (state.value.ready && state.value.auto) {
|
||||
await search();
|
||||
}
|
||||
},
|
||||
@@ -459,7 +552,7 @@ export default defineComponent({
|
||||
recipes,
|
||||
removeRecipe,
|
||||
replaceRecipes,
|
||||
passedQuery,
|
||||
passedQueryWithSeed,
|
||||
};
|
||||
},
|
||||
head: {},
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, useContext } from "@nuxtjs/composition-api";
|
||||
import { useUserSelfRatings } from "~/composables/use-users";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { UserOut } from "~/lib/api/types/user";
|
||||
export default defineComponent({
|
||||
props: {
|
||||
slug: {
|
||||
recipeId: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
@@ -42,19 +43,23 @@ export default defineComponent({
|
||||
setup(props) {
|
||||
const api = useUserApi();
|
||||
const { $auth } = useContext();
|
||||
const { userRatings, refreshUserRatings } = useUserSelfRatings();
|
||||
|
||||
// TODO Setup the correct type for $auth.user
|
||||
// See https://github.com/nuxt-community/auth-module/issues/1097
|
||||
const user = computed(() => $auth.user as unknown as UserOut);
|
||||
const isFavorite = computed(() => user.value?.favoriteRecipes?.includes(props.slug));
|
||||
const isFavorite = computed(() => {
|
||||
const rating = userRatings.value.find((r) => r.recipeId === props.recipeId);
|
||||
return rating?.isFavorite || false;
|
||||
});
|
||||
|
||||
async function toggleFavorite() {
|
||||
if (!isFavorite.value) {
|
||||
await api.users.addFavorite(user.value?.id, props.slug);
|
||||
await api.users.addFavorite(user.value?.id, props.recipeId);
|
||||
} else {
|
||||
await api.users.removeFavorite(user.value?.id, props.slug);
|
||||
await api.users.removeFavorite(user.value?.id, props.recipeId);
|
||||
}
|
||||
$auth.fetchUser();
|
||||
await refreshUserRatings();
|
||||
}
|
||||
|
||||
return { isFavorite, toggleFavorite };
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
</v-col>
|
||||
<v-col v-if="!disableAmount" sm="12" md="3" cols="12">
|
||||
<v-autocomplete
|
||||
ref="unitAutocomplete"
|
||||
v-model="value.unit"
|
||||
:search-input.sync="unitSearch"
|
||||
auto-select-first
|
||||
@@ -57,6 +58,7 @@
|
||||
<!-- Foods Input -->
|
||||
<v-col v-if="!disableAmount" m="12" md="3" cols="12" class="">
|
||||
<v-autocomplete
|
||||
ref="foodAutocomplete"
|
||||
v-model="value.food"
|
||||
:search-input.sync="foodSearch"
|
||||
auto-select-first
|
||||
@@ -102,6 +104,8 @@
|
||||
:buttons="btns"
|
||||
@toggle-section="toggleTitle"
|
||||
@toggle-original="toggleOriginalText"
|
||||
@insert-above="$emit('insert-above')"
|
||||
@insert-below="$emit('insert-below')"
|
||||
@insert-ingredient="$emit('insert-ingredient')"
|
||||
@delete="$emit('delete')"
|
||||
/>
|
||||
@@ -146,6 +150,14 @@ export default defineComponent({
|
||||
text: i18n.tc("recipe.toggle-section"),
|
||||
event: "toggle-section",
|
||||
},
|
||||
{
|
||||
text: i18n.tc("recipe.insert-above"),
|
||||
event: "insert-above",
|
||||
},
|
||||
{
|
||||
text: i18n.tc("recipe.insert-below"),
|
||||
event: "insert-below",
|
||||
},
|
||||
];
|
||||
|
||||
if (props.allowInsertIngredient) {
|
||||
@@ -200,11 +212,13 @@ export default defineComponent({
|
||||
const foodStore = useFoodStore();
|
||||
const foodData = useFoodData();
|
||||
const foodSearch = ref("");
|
||||
const foodAutocomplete = ref<HTMLInputElement>();
|
||||
|
||||
async function createAssignFood() {
|
||||
foodData.data.name = foodSearch.value;
|
||||
props.value.food = await foodStore.actions.createOne(foodData.data) || undefined;
|
||||
foodData.reset();
|
||||
foodAutocomplete.value?.blur();
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
@@ -212,11 +226,13 @@ export default defineComponent({
|
||||
const unitStore = useUnitStore();
|
||||
const unitsData = useUnitData();
|
||||
const unitSearch = ref("");
|
||||
const unitAutocomplete = ref<HTMLInputElement>();
|
||||
|
||||
async function createAssignUnit() {
|
||||
unitsData.data.name = unitSearch.value;
|
||||
props.value.unit = await unitStore.actions.createOne(unitsData.data) || undefined;
|
||||
unitsData.reset();
|
||||
unitAutocomplete.value?.blur();
|
||||
}
|
||||
|
||||
const state = reactive({
|
||||
@@ -269,7 +285,9 @@ export default defineComponent({
|
||||
contextMenuOptions,
|
||||
handleUnitEnter,
|
||||
handleFoodEnter,
|
||||
foodAutocomplete,
|
||||
createAssignFood,
|
||||
unitAutocomplete,
|
||||
createAssignUnit,
|
||||
foods: foodStore.foods,
|
||||
foodSearch,
|
||||
|
||||
@@ -45,6 +45,22 @@ export default defineComponent({
|
||||
.d-inline {
|
||||
& > p {
|
||||
display: inline;
|
||||
&:has(>sub)>sup {
|
||||
letter-spacing: -0.05rem;
|
||||
}
|
||||
}
|
||||
&:has(sub) {
|
||||
&:after {
|
||||
letter-spacing: -0.2rem;
|
||||
}
|
||||
}
|
||||
sup {
|
||||
&+span{
|
||||
letter-spacing: -0.05rem;
|
||||
}
|
||||
&:before {
|
||||
letter-spacing: 0rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
<v-date-picker
|
||||
v-model="newTimelineEventTimestamp"
|
||||
no-title
|
||||
:first-day-of-week="firstDayOfWeek"
|
||||
:local="$i18n.locale"
|
||||
@input="datePickerMenu = false"
|
||||
/>
|
||||
@@ -109,10 +110,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, reactive, ref, toRefs, useContext } from "@nuxtjs/composition-api";
|
||||
import { computed, defineComponent, reactive, ref, toRefs, useContext } from "@nuxtjs/composition-api";
|
||||
import { whenever } from "@vueuse/core";
|
||||
import { VForm } from "~/types/vuetify";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { useGroupSelf } from "~/composables/use-groups";
|
||||
import { Recipe, RecipeTimelineEventIn } from "~/lib/api/types/recipe";
|
||||
|
||||
export default defineComponent({
|
||||
@@ -129,6 +131,7 @@ export default defineComponent({
|
||||
setup(props, context) {
|
||||
const madeThisDialog = ref(false);
|
||||
const userApi = useUserApi();
|
||||
const { group } = useGroupSelf();
|
||||
const { $auth, i18n } = useContext();
|
||||
const domMadeThisForm = ref<VForm>();
|
||||
const newTimelineEvent = ref<RecipeTimelineEventIn>({
|
||||
@@ -153,6 +156,10 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
|
||||
const firstDayOfWeek = computed(() => {
|
||||
return group.value?.preferences?.firstDayOfWeek || 0;
|
||||
});
|
||||
|
||||
function clearImage() {
|
||||
newTimelineEventImage.value = undefined;
|
||||
newTimelineEventImageName.value = "";
|
||||
@@ -226,6 +233,7 @@ export default defineComponent({
|
||||
...toRefs(state),
|
||||
domMadeThisForm,
|
||||
madeThisDialog,
|
||||
firstDayOfWeek,
|
||||
newTimelineEvent,
|
||||
newTimelineEventImage,
|
||||
newTimelineEventImagePreviewUrl,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
:class="attrs.class.sheet"
|
||||
:style="tile ? 'max-width: 100%; width: fit-content;' : 'width: 100%;'"
|
||||
>
|
||||
<v-list-item :to="'/g/' + groupSlug + '/r/' + recipe.slug" :class="attrs.class.listItem">
|
||||
<v-list-item :to="disabled ? '' : '/g/' + groupSlug + '/r/' + recipe.slug" :class="attrs.class.listItem">
|
||||
<v-list-item-avatar :class="attrs.class.avatar">
|
||||
<v-icon :class="attrs.class.icon" dark :small="small"> {{ $globals.icons.primary }} </v-icon>
|
||||
</v-list-item-avatar>
|
||||
@@ -56,6 +56,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
setup(props) {
|
||||
const { $auth } = useContext();
|
||||
|
||||
@@ -8,14 +8,8 @@
|
||||
<v-card-text v-if="edit">
|
||||
<div v-for="(item, key, index) in value" :key="index">
|
||||
<v-text-field
|
||||
dense
|
||||
:value="value[key]"
|
||||
:label="labels[key].label"
|
||||
:suffix="labels[key].suffix"
|
||||
type="number"
|
||||
autocomplete="off"
|
||||
@input="updateValue(key, $event)"
|
||||
></v-text-field>
|
||||
dense :value="value[key]" :label="labels[key].label" :suffix="labels[key].suffix" type="number"
|
||||
autocomplete="off" @input="updateValue(key, $event)"></v-text-field>
|
||||
</div>
|
||||
</v-card-text>
|
||||
<v-list v-if="showViewer" dense class="mt-0 pt-0">
|
||||
@@ -34,17 +28,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, useContext } from "@nuxtjs/composition-api";
|
||||
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||
import { useNutritionLabels } from "~/composables/recipes";
|
||||
import { Nutrition } from "~/lib/api/types/recipe";
|
||||
|
||||
type NutritionLabelType = {
|
||||
[key: string]: {
|
||||
label: string;
|
||||
suffix: string;
|
||||
value?: string;
|
||||
};
|
||||
};
|
||||
|
||||
import { NutritionLabelType } from "~/composables/recipes/use-recipe-nutrition";
|
||||
export default defineComponent({
|
||||
props: {
|
||||
value: {
|
||||
@@ -57,37 +44,7 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, context) {
|
||||
const { i18n } = useContext();
|
||||
const labels = <NutritionLabelType>{
|
||||
calories: {
|
||||
label: i18n.tc("recipe.calories"),
|
||||
suffix: i18n.tc("recipe.calories-suffix"),
|
||||
},
|
||||
fatContent: {
|
||||
label: i18n.tc("recipe.fat-content"),
|
||||
suffix: i18n.tc("recipe.grams"),
|
||||
},
|
||||
fiberContent: {
|
||||
label: i18n.tc("recipe.fiber-content"),
|
||||
suffix: i18n.tc("recipe.grams"),
|
||||
},
|
||||
proteinContent: {
|
||||
label: i18n.tc("recipe.protein-content"),
|
||||
suffix: i18n.tc("recipe.grams"),
|
||||
},
|
||||
sodiumContent: {
|
||||
label: i18n.tc("recipe.sodium-content"),
|
||||
suffix: i18n.tc("recipe.milligrams"),
|
||||
},
|
||||
sugarContent: {
|
||||
label: i18n.tc("recipe.sugar-content"),
|
||||
suffix: i18n.tc("recipe.grams"),
|
||||
},
|
||||
carbohydrateContent: {
|
||||
label: i18n.tc("recipe.carbohydrate-content"),
|
||||
suffix: i18n.tc("recipe.grams"),
|
||||
},
|
||||
};
|
||||
const { labels } = useNutritionLabels();
|
||||
const valueNotNull = computed(() => {
|
||||
let key: keyof Nutrition;
|
||||
for (key in props.value) {
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
$globals.icons.tags"
|
||||
return-object
|
||||
v-bind="inputAttrs"
|
||||
auto-select-first
|
||||
:search-input.sync="searchInput"
|
||||
@change="resetSearchInput"
|
||||
>
|
||||
<template #selection="data">
|
||||
<v-chip
|
||||
@@ -43,7 +46,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, useContext, computed, onMounted } from "@nuxtjs/composition-api";
|
||||
import RecipeOrganizerDialog from "./RecipeOrganizerDialog.vue";
|
||||
import { RecipeCategory, RecipeTag } from "~/lib/api/types/user";
|
||||
import { RecipeCategory, RecipeTag } from "~/lib/api/types/recipe";
|
||||
import { RecipeTool } from "~/lib/api/types/admin";
|
||||
import { useTagStore } from "~/composables/store/use-tag-store";
|
||||
import { useCategoryStore, useToolStore } from "~/composables/store";
|
||||
@@ -138,7 +141,6 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function appendCreated(item: RecipeTag | RecipeCategory | RecipeTool) {
|
||||
console.log(item);
|
||||
if (selected.value === undefined) {
|
||||
return;
|
||||
}
|
||||
@@ -148,6 +150,12 @@ export default defineComponent({
|
||||
|
||||
const dialog = ref(false);
|
||||
|
||||
const searchInput = ref("");
|
||||
|
||||
function resetSearchInput() {
|
||||
searchInput.value = "";
|
||||
}
|
||||
|
||||
return {
|
||||
Organizer,
|
||||
appendCreated,
|
||||
@@ -156,6 +164,8 @@ export default defineComponent({
|
||||
label,
|
||||
selected,
|
||||
removeByIndex,
|
||||
searchInput,
|
||||
resetSearchInput,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
|
||||
<RecipePageComments
|
||||
v-if="isOwnGroup && !recipe.settings.disableComments && !isEditForm && !isCookMode"
|
||||
v-if="!recipe.settings.disableComments && !isEditForm && !isCookMode"
|
||||
:recipe="recipe"
|
||||
class="px-1 my-4 d-print-none"
|
||||
/>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
<div v-for="comment in comments" :key="comment.id" class="d-flex my-2" style="gap: 10px">
|
||||
<div v-for="comment in recipe.comments" :key="comment.id" class="d-flex my-2" style="gap: 10px">
|
||||
<UserAvatar size="40" :user-id="comment.userId" />
|
||||
<v-card outlined class="flex-grow-1">
|
||||
<v-card-text class="pa-3 pb-0">
|
||||
@@ -54,9 +54,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, toRefs, onMounted, reactive } from "@nuxtjs/composition-api";
|
||||
import { defineComponent, toRefs, reactive } from "@nuxtjs/composition-api";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { Recipe, RecipeCommentOut } from "~/lib/api/types/recipe";
|
||||
import { Recipe } from "~/lib/api/types/recipe";
|
||||
import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
|
||||
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
||||
import { usePageUser } from "~/composables/recipe-page/shared-state";
|
||||
@@ -76,22 +76,12 @@ export default defineComponent({
|
||||
setup(props) {
|
||||
const api = useUserApi();
|
||||
|
||||
const comments = ref<RecipeCommentOut[]>([]);
|
||||
|
||||
const { user } = usePageUser();
|
||||
|
||||
const state = reactive({
|
||||
comment: "",
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const { data } = await api.recipes.comments.byRecipe(props.recipe.slug);
|
||||
|
||||
if (data) {
|
||||
comments.value = data;
|
||||
}
|
||||
});
|
||||
|
||||
async function submitComment() {
|
||||
const { data } = await api.recipes.comments.createOne({
|
||||
recipeId: props.recipe.id,
|
||||
@@ -99,7 +89,8 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
if (data) {
|
||||
comments.value.push(data);
|
||||
// @ts-ignore username is always populated here
|
||||
props.recipe.comments.push(data);
|
||||
}
|
||||
|
||||
state.comment = "";
|
||||
@@ -109,11 +100,11 @@ export default defineComponent({
|
||||
const { response } = await api.recipes.comments.deleteOne(id);
|
||||
|
||||
if (response?.status === 200) {
|
||||
comments.value = comments.value.filter((comment) => comment.id !== id);
|
||||
props.recipe.comments = props.recipe.comments.filter((comment) => comment.id !== id);
|
||||
}
|
||||
}
|
||||
|
||||
return { api, comments, ...toRefs(state), submitComment, deleteComment, user };
|
||||
return { api, ...toRefs(state), submitComment, deleteComment, user };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<v-card-text>
|
||||
<v-card-title class="headline pa-0 flex-column align-center">
|
||||
{{ recipe.name }}
|
||||
<RecipeRating :key="recipe.slug" v-model="recipe.rating" :name="recipe.name" :slug="recipe.slug" />
|
||||
<RecipeRating :key="recipe.slug" :value="recipe.rating" :recipe-id="recipe.id" :slug="recipe.slug" />
|
||||
</v-card-title>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<SafeMarkdown :source="recipe.description" />
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
handle=".handle"
|
||||
v-bind="{
|
||||
animation: 200,
|
||||
group: 'description',
|
||||
group: 'recipe-ingredients',
|
||||
disabled: false,
|
||||
ghostClass: 'ghost',
|
||||
}"
|
||||
@@ -22,6 +22,8 @@
|
||||
class="list-group-item"
|
||||
:disable-amount="recipe.settings.disableAmount"
|
||||
@delete="recipe.recipeIngredient.splice(index, 1)"
|
||||
@insert-above="insertNewIngredient(index)"
|
||||
@insert-below="insertNewIngredient(index+1)"
|
||||
/>
|
||||
</TransitionGroup>
|
||||
</draggable>
|
||||
@@ -140,6 +142,20 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function insertNewIngredient(dest: number) {
|
||||
props.recipe.recipeIngredient.splice(dest, 0, {
|
||||
referenceId: uuid4(),
|
||||
title: "",
|
||||
note: "",
|
||||
// @ts-expect-error - prop can be null-type by NoUndefinedField type forces it to be set
|
||||
unit: undefined,
|
||||
// @ts-expect-error - prop can be null-type by NoUndefinedField type forces it to be set
|
||||
food: undefined,
|
||||
disableAmount: true,
|
||||
quantity: 1,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
user,
|
||||
groupSlug,
|
||||
@@ -148,6 +164,7 @@ export default defineComponent({
|
||||
hasFoodOrUnit,
|
||||
imageKey,
|
||||
drag,
|
||||
insertNewIngredient,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
handle=".handle"
|
||||
v-bind="{
|
||||
animation: 200,
|
||||
group: 'description',
|
||||
group: 'recipe-instructions',
|
||||
ghostClass: 'ghost',
|
||||
}"
|
||||
@input="updateIndex"
|
||||
@@ -170,12 +170,22 @@
|
||||
text: $tc('recipe.move-to-bottom'),
|
||||
event: 'move-to-bottom',
|
||||
},
|
||||
{
|
||||
text: $tc('recipe.insert-above'),
|
||||
event: 'insert-above'
|
||||
},
|
||||
{
|
||||
text: $tc('recipe.insert-below'),
|
||||
event: 'insert-below'
|
||||
},
|
||||
],
|
||||
},
|
||||
]"
|
||||
@merge-above="mergeAbove(index - 1, index)"
|
||||
@move-to-top="moveTo('top', index)"
|
||||
@move-to-bottom="moveTo('bottom', index)"
|
||||
@insert-above="insert(index)"
|
||||
@insert-below="insert(index+1)"
|
||||
@toggle-section="toggleShowTitle(step.id)"
|
||||
@link-ingredients="openDialog(index, step.text, step.ingredientReferences)"
|
||||
@preview-step="togglePreviewState(index)"
|
||||
@@ -550,6 +560,10 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function insert(dest: number) {
|
||||
props.value.splice(dest, 0, { id: uuid4(), text: "", title: "", ingredientReferences: [] });
|
||||
}
|
||||
|
||||
const previewStates = ref<boolean[]>([]);
|
||||
|
||||
function togglePreviewState(index: number) {
|
||||
@@ -681,6 +695,7 @@ export default defineComponent({
|
||||
showCookMode,
|
||||
isCookMode,
|
||||
isEditForm,
|
||||
insert,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
v-if="landscape && $vuetify.breakpoint.smAndUp"
|
||||
:key="recipe.slug"
|
||||
v-model="recipe.rating"
|
||||
:name="recipe.name"
|
||||
:recipe-id="recipe.id"
|
||||
:slug="recipe.slug"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
v-if="$vuetify.breakpoint.smAndDown"
|
||||
:key="recipe.slug"
|
||||
v-model="recipe.rating"
|
||||
:name="recipe.name"
|
||||
:recipe-id="recipe.id"
|
||||
:slug="recipe.slug"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
<!-- Ingredients -->
|
||||
<section>
|
||||
<v-card-title class="headline pl-0"> {{ $t("recipe.ingredients") }} </v-card-title>
|
||||
<div class="font-italic px-0 py-0">
|
||||
<SafeMarkdown :source="recipe.recipeYield" />
|
||||
</div>
|
||||
<div
|
||||
v-for="(ingredientSection, sectionIndex) in ingredientSections"
|
||||
:key="`ingredient-section-${sectionIndex}`"
|
||||
@@ -83,19 +86,41 @@
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Nutrition -->
|
||||
<div v-if="preferences.showNutrition">
|
||||
<v-card-title class="headline pl-0"> {{ $t("recipe.nutrition") }} </v-card-title>
|
||||
|
||||
<section>
|
||||
<div class="print-section">
|
||||
<table class="nutrition-table">
|
||||
<tbody>
|
||||
<tr v-for="(value, key) in recipe.nutrition" :key="key">
|
||||
<template v-if="value">
|
||||
<td>{{ labels[key].label }}</td>
|
||||
<td>{{ value || '-' }}</td>
|
||||
</template>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, computed } from "@nuxtjs/composition-api";
|
||||
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||
import RecipeTimeCard from "~/components/Domain/Recipe/RecipeTimeCard.vue";
|
||||
import { useStaticRoutes } from "~/composables/api";
|
||||
import { Recipe, RecipeIngredient, RecipeStep} from "~/lib/api/types/recipe";
|
||||
import { NoUndefinedField } from "~/lib/api/types/non-generated";
|
||||
import { ImagePosition, useUserPrintPreferences } from "~/composables/use-users/preferences";
|
||||
import { parseIngredientText } from "~/composables/recipes";
|
||||
import { parseIngredientText, useNutritionLabels } from "~/composables/recipes";
|
||||
import { usePageState } from "~/composables/recipe-page/shared-state";
|
||||
|
||||
|
||||
type IngredientSection = {
|
||||
sectionName: string;
|
||||
ingredients: RecipeIngredient[];
|
||||
@@ -129,6 +154,10 @@ export default defineComponent({
|
||||
const preferences = useUserPrintPreferences();
|
||||
const { recipeImage } = useStaticRoutes();
|
||||
const { imageKey } = usePageState(props.recipe.slug);
|
||||
const {labels} = useNutritionLabels();
|
||||
|
||||
|
||||
|
||||
|
||||
const recipeImageUrl = computed(() => {
|
||||
return recipeImage(props.recipe.id, props.recipe.image, imageKey.value);
|
||||
@@ -221,6 +250,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
return {
|
||||
labels,
|
||||
hasNotes,
|
||||
imageKey,
|
||||
ImagePosition,
|
||||
@@ -290,4 +320,16 @@ li {
|
||||
list-style-type: none;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.nutrition-table {
|
||||
width: 25%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.nutrition-table td {
|
||||
padding: 2px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,34 +1,48 @@
|
||||
<template>
|
||||
<div @click.prevent>
|
||||
<!-- User Rating -->
|
||||
<v-hover v-slot="{ hover }">
|
||||
<v-rating
|
||||
v-model="rating"
|
||||
:readonly="!isOwnGroup"
|
||||
v-if="isOwnGroup && (userRating || hover || !ratingsLoaded)"
|
||||
:value="userRating"
|
||||
color="secondary"
|
||||
background-color="secondary lighten-3"
|
||||
length="5"
|
||||
:dense="small ? true : undefined"
|
||||
:size="small ? 15 : undefined"
|
||||
hover
|
||||
:value="value"
|
||||
clearable
|
||||
@input="updateRating"
|
||||
@click="updateRating"
|
||||
></v-rating>
|
||||
/>
|
||||
<!-- Group Rating -->
|
||||
<v-rating
|
||||
v-else
|
||||
:value="groupRating"
|
||||
:half-increments="true"
|
||||
:readonly="true"
|
||||
color="grey darken-1"
|
||||
background-color="secondary lighten-3"
|
||||
length="5"
|
||||
:dense="small ? true : undefined"
|
||||
:size="small ? 15 : undefined"
|
||||
hover
|
||||
/>
|
||||
</v-hover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "@nuxtjs/composition-api";
|
||||
import { computed, defineComponent, ref, watch } from "@nuxtjs/composition-api";
|
||||
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { useUserSelfRatings } from "~/composables/use-users";
|
||||
export default defineComponent({
|
||||
props: {
|
||||
emitOnly: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// TODO Remove name prop?
|
||||
name: {
|
||||
recipeId: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
@@ -47,23 +61,45 @@ export default defineComponent({
|
||||
},
|
||||
setup(props, context) {
|
||||
const { isOwnGroup } = useLoggedInState();
|
||||
const { userRatings, setRating, ready: ratingsLoaded } = useUserSelfRatings();
|
||||
|
||||
const rating = ref(props.value);
|
||||
|
||||
const api = useUserApi();
|
||||
function updateRating(val: number | null) {
|
||||
if (val === 0) {
|
||||
val = null;
|
||||
}
|
||||
if (!props.emitOnly) {
|
||||
api.recipes.patchOne(props.slug, {
|
||||
rating: val,
|
||||
const userRating = computed(() => {
|
||||
return userRatings.value.find((r) => r.recipeId === props.recipeId)?.rating;
|
||||
});
|
||||
|
||||
// if a user unsets their rating, we don't want to fall back to the group rating since it's out of sync
|
||||
const hideGroupRating = ref(!!userRating.value);
|
||||
watch(
|
||||
() => userRating.value,
|
||||
() => {
|
||||
if (userRating.value) {
|
||||
hideGroupRating.value = true;
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const groupRating = computed(() => {
|
||||
return hideGroupRating.value ? 0 : props.value;
|
||||
});
|
||||
|
||||
function updateRating(val: number | null) {
|
||||
if (!isOwnGroup.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!props.emitOnly) {
|
||||
setRating(props.slug, val || 0, null);
|
||||
}
|
||||
context.emit("input", val);
|
||||
}
|
||||
|
||||
return { isOwnGroup, rating, updateRating };
|
||||
return {
|
||||
isOwnGroup,
|
||||
ratingsLoaded,
|
||||
groupRating,
|
||||
userRating,
|
||||
updateRating,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -3,9 +3,53 @@
|
||||
<v-row class="my-0 mx-7">
|
||||
<v-spacer />
|
||||
<v-col class="text-right">
|
||||
<v-btn fab small color="info" @click="reverseSort">
|
||||
<v-icon> {{ preferences.orderDirection === "asc" ? $globals.icons.sortCalendarAscending : $globals.icons.sortCalendarDescending }} </v-icon>
|
||||
<!-- Filters -->
|
||||
<v-menu offset-y bottom left nudge-bottom="3" :close-on-content-click="false">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-badge :content="filterBadgeCount" :value="filterBadgeCount" bordered overlap>
|
||||
<v-btn fab small color="info" v-bind="attrs" v-on="on">
|
||||
<v-icon> {{ $globals.icons.filter }} </v-icon>
|
||||
</v-btn>
|
||||
</v-badge>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-item @click="reverseSort">
|
||||
<v-icon left>
|
||||
{{
|
||||
preferences.orderDirection === "asc" ?
|
||||
$globals.icons.sortCalendarDescending : $globals.icons.sortCalendarAscending
|
||||
}}
|
||||
</v-icon>
|
||||
<v-list-item-title>
|
||||
{{ preferences.orderDirection === "asc" ? $tc("general.sort-descending") : $tc("general.sort-ascending") }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-divider />
|
||||
<v-list-item class="pa-0">
|
||||
<v-list class="py-0" style="width: 100%;">
|
||||
<v-list-item
|
||||
v-for="option, idx in eventTypeFilterState"
|
||||
:key="idx"
|
||||
>
|
||||
<v-checkbox
|
||||
:input-value="option.checked"
|
||||
readonly
|
||||
@click="toggleEventTypeOption(option.value)"
|
||||
>
|
||||
<template #label>
|
||||
<v-icon left>
|
||||
{{ option.icon }}
|
||||
</v-icon>
|
||||
{{ option.label }}
|
||||
</template>
|
||||
</v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="mx-2"/>
|
||||
@@ -29,9 +73,9 @@
|
||||
/>
|
||||
</v-timeline>
|
||||
</div>
|
||||
<v-card v-else-if="!loading">
|
||||
<v-card v-else-if="!loading" class="mt-2">
|
||||
<v-card-title class="justify-center pa-9">
|
||||
{{ $t("recipe.timeline-is-empty") }}
|
||||
{{ $t("recipe.timeline-no-events-found-try-adjusting-filters") }}
|
||||
</v-card-title>
|
||||
</v-card>
|
||||
<div v-if="loading" class="mb-3 text-center">
|
||||
@@ -41,14 +85,15 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref, useAsync, useContext } from "@nuxtjs/composition-api";
|
||||
import { computed, defineComponent, onMounted, ref, useAsync, useContext } from "@nuxtjs/composition-api";
|
||||
import { useThrottleFn, whenever } from "@vueuse/core";
|
||||
import RecipeTimelineItem from "./RecipeTimelineItem.vue"
|
||||
import { useTimelinePreferences } from "~/composables/use-users/preferences";
|
||||
import { useTimelineEventTypes } from "~/composables/recipes/use-recipe-timeline-events";
|
||||
import { useAsyncKey } from "~/composables/use-utils";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { Recipe, RecipeTimelineEventOut, RecipeTimelineEventUpdate } from "~/lib/api/types/recipe"
|
||||
import { Recipe, RecipeTimelineEventOut, RecipeTimelineEventUpdate, TimelineEventType } from "~/lib/api/types/recipe";
|
||||
|
||||
export default defineComponent({
|
||||
components: { RecipeTimelineItem },
|
||||
@@ -76,6 +121,7 @@ export default defineComponent({
|
||||
const api = useUserApi();
|
||||
const { i18n } = useContext();
|
||||
const preferences = useTimelinePreferences();
|
||||
const { eventTypeOptions } = useTimelineEventTypes();
|
||||
const loading = ref(true);
|
||||
const ready = ref(false);
|
||||
|
||||
@@ -85,6 +131,15 @@ export default defineComponent({
|
||||
|
||||
const timelineEvents = ref([] as RecipeTimelineEventOut[]);
|
||||
const recipes = new Map<string, Recipe>();
|
||||
const filterBadgeCount = computed(() => eventTypeOptions.value.length - preferences.value.types.length);
|
||||
const eventTypeFilterState = computed(() => {
|
||||
return eventTypeOptions.value.map(option => {
|
||||
return {
|
||||
...option,
|
||||
checked: preferences.value.types.includes(option.value),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
interface ScrollEvent extends Event {
|
||||
target: HTMLInputElement;
|
||||
@@ -112,7 +167,7 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
|
||||
// Sorting
|
||||
// Preferences
|
||||
function reverseSort() {
|
||||
if (loading.value) {
|
||||
return;
|
||||
@@ -122,6 +177,21 @@ export default defineComponent({
|
||||
initializeTimelineEvents();
|
||||
}
|
||||
|
||||
function toggleEventTypeOption(option: TimelineEventType) {
|
||||
if (loading.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const index = preferences.value.types.indexOf(option);
|
||||
if (index === -1) {
|
||||
preferences.value.types.push(option);
|
||||
} else {
|
||||
preferences.value.types.splice(index, 1);
|
||||
}
|
||||
|
||||
initializeTimelineEvents();
|
||||
}
|
||||
|
||||
// Timeline Actions
|
||||
async function updateTimelineEvent(index: number) {
|
||||
const event = timelineEvents.value[index]
|
||||
@@ -179,8 +249,11 @@ export default defineComponent({
|
||||
async function scrollTimelineEvents() {
|
||||
const orderBy = "timestamp";
|
||||
const orderDirection = preferences.value.orderDirection === "asc" ? "asc" : "desc";
|
||||
// eslint-disable-next-line quotes
|
||||
const eventTypeValue = `["${preferences.value.types.join('", "')}"]`;
|
||||
const queryFilter = `(${props.queryFilter}) AND eventType IN ${eventTypeValue}`
|
||||
|
||||
const response = await api.recipes.getAllTimelineEvents(page.value, perPage, { orderBy, orderDirection, queryFilter: props.queryFilter });
|
||||
const response = await api.recipes.getAllTimelineEvents(page.value, perPage, { orderBy, orderDirection, queryFilter });
|
||||
page.value += 1;
|
||||
if (!response?.data) {
|
||||
return;
|
||||
@@ -256,11 +329,14 @@ export default defineComponent({
|
||||
|
||||
return {
|
||||
deleteTimelineEvent,
|
||||
filterBadgeCount,
|
||||
loading,
|
||||
onScroll,
|
||||
preferences,
|
||||
eventTypeFilterState,
|
||||
recipes,
|
||||
reverseSort,
|
||||
toggleEventTypeOption,
|
||||
timelineEvents,
|
||||
updateTimelineEvent,
|
||||
};
|
||||
|
||||
@@ -99,6 +99,7 @@ import { computed, defineComponent, ref, useContext, useRoute } from "@nuxtjs/co
|
||||
import RecipeCardMobile from "./RecipeCardMobile.vue";
|
||||
import RecipeTimelineContextMenu from "./RecipeTimelineContextMenu.vue";
|
||||
import { useStaticRoutes } from "~/composables/api";
|
||||
import { useTimelineEventTypes } from "~/composables/recipes/use-recipe-timeline-events";
|
||||
import { Recipe, RecipeTimelineEventOut } from "~/lib/api/types/recipe"
|
||||
import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
|
||||
import SafeMarkdown from "~/components/global/SafeMarkdown.vue";
|
||||
@@ -124,6 +125,7 @@ export default defineComponent({
|
||||
setup(props) {
|
||||
const { $auth, $globals, $vuetify } = useContext();
|
||||
const { recipeTimelineEventImage } = useStaticRoutes();
|
||||
const { eventTypeOptions } = useTimelineEventTypes();
|
||||
const timelineEvents = ref([] as RecipeTimelineEventOut[]);
|
||||
|
||||
const route = useRoute();
|
||||
@@ -165,20 +167,9 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const icon = computed(() => {
|
||||
switch (props.event.eventType) {
|
||||
case "comment":
|
||||
return $globals.icons.commentTextMultiple;
|
||||
|
||||
case "info":
|
||||
return $globals.icons.informationVariant;
|
||||
|
||||
case "system":
|
||||
return $globals.icons.cog;
|
||||
|
||||
default:
|
||||
return $globals.icons.informationVariant;
|
||||
};
|
||||
})
|
||||
const option = eventTypeOptions.value.find((option) => option.value === props.event.eventType);
|
||||
return option ? option.icon : $globals.icons.informationVariant;
|
||||
});
|
||||
|
||||
const hideImage = ref(false);
|
||||
const eventImageUrl = computed<string>( () => {
|
||||
|
||||
@@ -8,8 +8,11 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||
// @ts-ignore missing color types
|
||||
import Color from "@sphinxxxx/color-conversion";
|
||||
import { MultiPurposeLabelSummary } from "~/lib/api/types/recipe";
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
label: {
|
||||
@@ -34,11 +37,15 @@ export default defineComponent({
|
||||
const ACCESSIBILITY_THRESHOLD = 0.179;
|
||||
|
||||
function pickTextColorBasedOnBgColorAdvanced(bgColor: string, lightColor: string, darkColor: string) {
|
||||
const color = bgColor.charAt(0) === "#" ? bgColor.substring(1, 7) : bgColor;
|
||||
const r = parseInt(color.substring(0, 2), 16); // hexToR
|
||||
const g = parseInt(color.substring(2, 4), 16); // hexToG
|
||||
const b = parseInt(color.substring(4, 6), 16); // hexToB
|
||||
const uicolors = [r / 255, g / 255, b / 255];
|
||||
try {
|
||||
const color = new Color(bgColor);
|
||||
|
||||
// if opacity is less than 0.3 always return dark color
|
||||
if (color._rgba[3] < 0.3) {
|
||||
return darkColor;
|
||||
}
|
||||
|
||||
const uicolors = [color._rgba[0] / 255, color._rgba[1] / 255, color._rgba[2] / 255];
|
||||
const c = uicolors.map((col) => {
|
||||
if (col <= 0.03928) {
|
||||
return col / 12.92;
|
||||
@@ -47,6 +54,10 @@ export default defineComponent({
|
||||
});
|
||||
const L = 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
|
||||
return L > ACCESSIBILITY_THRESHOLD ? darkColor : lightColor;
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
return "black";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</v-row>
|
||||
<v-row v-if="!listItem.checked && recipeList && recipeList.length && displayRecipeRefs" no-gutters class="mb-2">
|
||||
<v-col cols="auto" style="width: 100%;">
|
||||
<RecipeList :recipes="recipeList" :list-item="listItem" small tile />
|
||||
<RecipeList :recipes="recipeList" :list-item="listItem" :disabled="isOffline" small tile />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="listItem.checked" no-gutters class="mb-2">
|
||||
@@ -135,7 +135,11 @@ export default defineComponent({
|
||||
recipes: {
|
||||
type: Map<string, RecipeSummary>,
|
||||
default: undefined,
|
||||
}
|
||||
},
|
||||
isOffline: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props, context) {
|
||||
const { i18n } = useContext();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
:item-id.sync="listItem.foodId"
|
||||
:label="$t('shopping-list.food')"
|
||||
:icon="$globals.icons.foods"
|
||||
@create="createAssignFood"
|
||||
/>
|
||||
<InputLabelType
|
||||
v-model="listItem.unit"
|
||||
@@ -16,6 +17,7 @@
|
||||
:item-id.sync="listItem.unitId"
|
||||
:label="$t('general.units')"
|
||||
:icon="$globals.icons.units"
|
||||
@create="createAssignUnit"
|
||||
/>
|
||||
</div>
|
||||
<div class="d-md-flex align-center" style="gap: 20px">
|
||||
@@ -28,7 +30,8 @@
|
||||
@keypress="handleNoteKeyPress"
|
||||
></v-textarea>
|
||||
</div>
|
||||
<div class="d-flex align-end" style="gap: 20px">
|
||||
<div class="d-flex flex-wrap align-end" style="gap: 20px">
|
||||
<div class="d-flex align-end">
|
||||
<div>
|
||||
<InputQuantity v-model="listItem.quantity" />
|
||||
</div>
|
||||
@@ -60,6 +63,17 @@
|
||||
</v-card>
|
||||
</v-menu>
|
||||
</div>
|
||||
<BaseButton
|
||||
v-if="listItem.labelId && listItem.food && listItem.labelId !== listItem.food.labelId"
|
||||
small
|
||||
color="info"
|
||||
:icon="$globals.icons.tagArrowRight"
|
||||
:text="$tc('shopping-list.save-label')"
|
||||
class="mt-2 align-items-flex-start"
|
||||
@click="assignLabelToFood"
|
||||
/>
|
||||
<v-spacer />
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-card-actions class="ma-0 pt-0 pb-1 justify-end">
|
||||
@@ -100,6 +114,7 @@ import { defineComponent, computed, watch } from "@nuxtjs/composition-api";
|
||||
import { ShoppingListItemCreate, ShoppingListItemOut } from "~/lib/api/types/group";
|
||||
import { MultiPurposeLabelOut } from "~/lib/api/types/labels";
|
||||
import { IngredientFood, IngredientUnit } from "~/lib/api/types/recipe";
|
||||
import { useFoodStore, useFoodData, useUnitStore, useUnitData } from "~/composables/store";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
@@ -121,6 +136,12 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, context) {
|
||||
const foodStore = useFoodStore();
|
||||
const foodData = useFoodData();
|
||||
|
||||
const unitStore = useUnitStore();
|
||||
const unitData = useUnitData();
|
||||
|
||||
const listItem = computed({
|
||||
get: () => {
|
||||
return props.value;
|
||||
@@ -139,8 +160,47 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
|
||||
async function createAssignFood(val: string) {
|
||||
// keep UI reactive
|
||||
listItem.value.food ? listItem.value.food.name = val : listItem.value.food = { name: val };
|
||||
|
||||
foodData.data.name = val;
|
||||
const newFood = await foodStore.actions.createOne(foodData.data);
|
||||
if (newFood) {
|
||||
listItem.value.food = newFood;
|
||||
listItem.value.foodId = newFood.id;
|
||||
}
|
||||
foodData.reset();
|
||||
}
|
||||
|
||||
async function createAssignUnit(val: string) {
|
||||
// keep UI reactive
|
||||
listItem.value.unit ? listItem.value.unit.name = val : listItem.value.unit = { name: val };
|
||||
|
||||
unitData.data.name = val;
|
||||
const newUnit = await unitStore.actions.createOne(unitData.data);
|
||||
if (newUnit) {
|
||||
listItem.value.unit = newUnit;
|
||||
listItem.value.unitId = newUnit.id;
|
||||
}
|
||||
unitData.reset();
|
||||
}
|
||||
|
||||
async function assignLabelToFood() {
|
||||
if (!(listItem.value.food && listItem.value.foodId && listItem.value.labelId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
listItem.value.food.labelId = listItem.value.labelId;
|
||||
// @ts-ignore the food will have an id, even though TS says it might not
|
||||
await foodStore.actions.updateOne(listItem.value.food);
|
||||
}
|
||||
|
||||
return {
|
||||
listItem,
|
||||
createAssignFood,
|
||||
createAssignUnit,
|
||||
assignLabelToFood,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -53,4 +53,3 @@ export default defineComponent({
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
160
frontend/components/Domain/User/UserRegistrationForm.vue
Normal file
160
frontend/components/Domain/User/UserRegistrationForm.vue
Normal file
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-card-title>
|
||||
<v-icon large class="mr-3"> {{ $globals.icons.user }}</v-icon>
|
||||
<span class="headline"> {{ $t("user-registration.account-details") }}</span>
|
||||
</v-card-title>
|
||||
<v-divider />
|
||||
<v-card-text>
|
||||
<v-form ref="domAccountForm" @submit.prevent>
|
||||
<v-text-field
|
||||
v-model="accountDetails.username.value"
|
||||
autofocus
|
||||
v-bind="inputAttrs"
|
||||
:label="$tc('user.username')"
|
||||
:prepend-icon="$globals.icons.user"
|
||||
:rules="[validators.required]"
|
||||
:error-messages="usernameErrorMessages"
|
||||
@blur="validateUsername"
|
||||
/>
|
||||
<v-text-field
|
||||
v-model="accountDetails.fullName.value"
|
||||
v-bind="inputAttrs"
|
||||
:label="$tc('user.full-name')"
|
||||
:prepend-icon="$globals.icons.user"
|
||||
:rules="[validators.required]"
|
||||
/>
|
||||
<v-text-field
|
||||
v-model="accountDetails.email.value"
|
||||
v-bind="inputAttrs"
|
||||
:prepend-icon="$globals.icons.email"
|
||||
:label="$tc('user.email')"
|
||||
:rules="[validators.required, validators.email]"
|
||||
:error-messages="emailErrorMessages"
|
||||
@blur="validateEmail"
|
||||
/>
|
||||
<v-text-field
|
||||
v-model="credentials.password1.value"
|
||||
v-bind="inputAttrs"
|
||||
:type="pwFields.inputType.value"
|
||||
:append-icon="pwFields.passwordIcon.value"
|
||||
:prepend-icon="$globals.icons.lock"
|
||||
:label="$tc('user.password')"
|
||||
:rules="[validators.required, validators.minLength(8), validators.maxLength(258)]"
|
||||
@click:append="pwFields.togglePasswordShow"
|
||||
/>
|
||||
|
||||
<UserPasswordStrength :value="credentials.password1.value" />
|
||||
|
||||
<v-text-field
|
||||
v-model="credentials.password2.value"
|
||||
v-bind="inputAttrs"
|
||||
:type="pwFields.inputType.value"
|
||||
:append-icon="pwFields.passwordIcon.value"
|
||||
:prepend-icon="$globals.icons.lock"
|
||||
:label="$tc('user.confirm-password')"
|
||||
:rules="[validators.required, credentials.passwordMatch]"
|
||||
@click:append="pwFields.togglePasswordShow"
|
||||
/>
|
||||
<div class="px-2">
|
||||
<v-checkbox
|
||||
v-model="accountDetails.advancedOptions.value"
|
||||
:label="$tc('user.enable-advanced-content')"
|
||||
/>
|
||||
<p class="text-caption mt-n4">
|
||||
{{ $tc("user.enable-advanced-content-description") }}
|
||||
</p>
|
||||
</div>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "@nuxtjs/composition-api";
|
||||
import { useDark } from "@vueuse/core";
|
||||
import { validators } from "~/composables/use-validators";
|
||||
import { useUserRegistrationForm } from "~/composables/use-users/user-registration-form";
|
||||
import { usePasswordField } from "~/composables/use-passwords";
|
||||
import UserPasswordStrength from "~/components/Domain/User/UserPasswordStrength.vue";
|
||||
|
||||
const inputAttrs = {
|
||||
filled: true,
|
||||
rounded: true,
|
||||
validateOnBlur: true,
|
||||
class: "rounded-lg",
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
components: { UserPasswordStrength },
|
||||
layout: "blank",
|
||||
setup() {
|
||||
const isDark = useDark();
|
||||
const langDialog = ref(false);
|
||||
|
||||
const pwFields = usePasswordField();
|
||||
const {
|
||||
accountDetails,
|
||||
credentials,
|
||||
emailErrorMessages,
|
||||
usernameErrorMessages,
|
||||
validateUsername,
|
||||
validateEmail,
|
||||
domAccountForm,
|
||||
} = useUserRegistrationForm();
|
||||
return {
|
||||
accountDetails,
|
||||
credentials,
|
||||
emailErrorMessages,
|
||||
inputAttrs,
|
||||
isDark,
|
||||
langDialog,
|
||||
pwFields,
|
||||
usernameErrorMessages,
|
||||
validators,
|
||||
// Validators
|
||||
validateUsername,
|
||||
validateEmail,
|
||||
// Dom Refs
|
||||
domAccountForm,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.icon-primary {
|
||||
fill: var(--v-primary-base);
|
||||
}
|
||||
|
||||
.icon-white {
|
||||
fill: white;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
|
||||
.icon-divider {
|
||||
width: 100%;
|
||||
margin-bottom: -2.5rem;
|
||||
}
|
||||
|
||||
.icon-avatar {
|
||||
border-color: rgba(0, 0, 0, 0.12);
|
||||
border: 2px;
|
||||
}
|
||||
|
||||
.bg-off-white {
|
||||
background: #f5f8fa;
|
||||
}
|
||||
|
||||
.preferred-width {
|
||||
width: 840px;
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user