diff --git a/.dockerignore b/.dockerignore index 8d23634e124b..e89ac3deb7d9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ */node_modules */dist -*/data/db \ No newline at end of file +*/data/db +*/mealie/test +*/mealie/.temp \ No newline at end of file diff --git a/.github/workflows/dockerbuild.release.yml b/.github/workflows/dockerbuild.release.yml new file mode 100644 index 000000000000..bb0bfdc6d23d --- /dev/null +++ b/.github/workflows/dockerbuild.release.yml @@ -0,0 +1,56 @@ +name: Docker Build Production + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + # + # Get Release Version + # + - uses: oprypin/find-latest-tag@v1 + with: + repository: hay-kot/mealie # The repository to scan. + releases-only: true # We know that all relevant tags have a GitHub release for them. + id: mealie_version # The step ID to refer to later. + # + # Checkout + # + - name: checkout code + uses: actions/checkout@v2 + # + # Setup QEMU + # + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all + # + # Setup Buildx + # + - name: install buildx + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + # + # Login to Docker Hub + # + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + # + # Build + # + - name: build the image + run: | + docker build --push \ + --tag hkotel/mealie:${{ steps.mealie_version.outputs.tag }} \ + --platform linux/amd64,linux/arm/v7,linux/arm64 . diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 210e84fbc38e..991da336c31b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -21,7 +21,7 @@ jobs: - name: Set up python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 #---------------------------------------------- # ----- install & configure poetry ----- #---------------------------------------------- diff --git a/.vscode/settings.json b/.vscode/settings.json index be59f4b7ee15..b2cd9fb84dcd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,5 +17,6 @@ "i18n-ally.keystyle": "nested", "cSpell.words": [ "performant" - ] + ], + "search.mode": "reuseEditor" } diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 000000000000..a24ecb85ffad --- /dev/null +++ b/Caddyfile @@ -0,0 +1,21 @@ +{ + auto_https off +} + +:80 { + @proxied path /api/* /docs /openapi.json + + root * /app/dist + encode gzip + uri strip_suffix / + + handle @proxied { + reverse_proxy http://127.0.0.1:9000 + } + + handle { + try_files {path}.html {path} / + file_server + } + +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ad18c37d4408..ac6c1a061811 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN npm run build FROM python:3.9-alpine -RUN apk add --no-cache libxml2-dev libxslt-dev libxml2 +RUN apk add --no-cache libxml2-dev libxslt-dev libxml2 caddy ENV ENV prod EXPOSE 80 WORKDIR /app @@ -30,9 +30,11 @@ RUN apk add --update --no-cache --virtual .build-deps \ COPY ./mealie /app +COPY ./Caddyfile /app +COPY ./app_data/templates /app/data/templates +RUN rm -rf /app/tests /app/.temp COPY --from=build-stage /app/dist /app/dist -RUN rm -rf /app/test /app/.temp - VOLUME [ "/app/data/" ] -CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"] +RUN chmod +x /app/run.sh +CMD /app/run.sh \ No newline at end of file diff --git a/README.md b/README.md index 3fb695f21f13..2b630a07a32d 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Mealie also provides a secure API for interactions from 3rd party applications. #### 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 + - Shopping Lists #### Database Import / Export - Easily Import / Export your recipes from the UI - Export recipes in into custom files using Jinja2 templates @@ -82,7 +83,7 @@ Contributions are what make the open source community such an amazing place to b If you are not a coder, you can still contribute financially. financial contributions help me prioritize working on this project over others and helps me know that there is a real demand for project development. -Buy Me A Coffee +Buy Me A Coffee ## License diff --git a/app_data/backups/dev_sample_data_2021-Jan-12.zip b/app_data/backups/dev_sample_data_2021-Feb-13.zip similarity index 82% rename from app_data/backups/dev_sample_data_2021-Jan-12.zip rename to app_data/backups/dev_sample_data_2021-Feb-13.zip index ee5da95ccc71..7a79d98bc3b0 100644 Binary files a/app_data/backups/dev_sample_data_2021-Jan-12.zip and b/app_data/backups/dev_sample_data_2021-Feb-13.zip differ diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index 4d982d00dd7a..7e2248dcdc04 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -1,15 +1,45 @@ # Release Notes -## v0.3.0 - Draft! +## 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 - - Recipe Viewer - - Categories, Tags, and Notes will not be displayed below the steps on smaller screens - - Recipe Editor + - 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. + +## 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. diff --git a/docs/docs/getting-started/meal-planner.md b/docs/docs/getting-started/meal-planner.md index d58005308f29..f8dbdc72dd9b 100644 --- a/docs/docs/getting-started/meal-planner.md +++ b/docs/docs/getting-started/meal-planner.md @@ -1,11 +1,13 @@ # Meal Planner ## Working with Meal Plans -In Mealie you can create a mealplan based off the calendar inputs on the meal planner page. There is no limit to how long or how short a meal plan is. You may also create duplicate meal plans for the same date range. After selecting your date range, click on the card for each day and search through recipes to find your choice. After selecting a recipe for all meals save the plan. You can also randomly generate meal plans. +In Mealie you can create a meal plan based off the calendar inputs on the meal planner page. There is no limit to how long or how short a meal plan is. You may also create duplicate meal plans for the same date range. After selecting your date range, click on the card for each day and search through recipes to find your choice. After selecting a recipe for all meals save the plan. You can also randomly generate meal plans. -To edit the meal in a meal plan simply select the edit button on the card in the timeline. Similarly, to delete a mealplan click the delete button on the card in the timeline. Currently there is no support to change the date range in a meal plan. +To edit the meal in a meal plan simply select the edit button on the card in the timeline. Similarly, to delete a meal plan click the delete button on the card in the timeline. Currently there is no support to change the date range in a meal plan. -!!! warning - In coming a future release recipes for meals will be restricted to specific categories. + +## Shopping Lists +For any meal plan created you can view a breakdown of all the ingredients and use an experimental sort function to sort similarly ingredients. This is a very new feature and results of the auto sort may vary. ![](../gifs/meal-plan-demo-v2.gif) + diff --git a/docs/docs/getting-started/site-settings.md b/docs/docs/getting-started/site-settings.md index e349f40197bc..51fe5a688fa2 100644 --- a/docs/docs/getting-started/site-settings.md +++ b/docs/docs/getting-started/site-settings.md @@ -19,7 +19,9 @@ Color themes can be created and set from the UI in the settings page. You can se ## Backups Site backups can easily be taken and download from the UI. To import, simply select the backup you'd like to restore and check which items you'd like to import. -## Meal Planner Webhooks +## Meal Planner +In the meal planner section you can select categories to be used as apart of the random recipe selector in the meal plan creator. + Meal planner webhooks are post requests sent from Mealie to an external endpoint. The body of the message is the Recipe JSON of the scheduled meal. If no meal is schedule, no request is sent. The webhook functionality can be enabled or disabled as well as scheduled. Note that you must "Save Webhooks" prior to any changes taking affect server side. diff --git a/docs/docs/html/api.html b/docs/docs/html/api.html index 36f3bba3d362..7c6d0eba3315 100644 --- a/docs/docs/html/api.html +++ b/docs/docs/html/api.html @@ -18,7 +18,7 @@
diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1f26196a03f2..9a665fe1ab6f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -5585,10 +5585,17 @@ "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=" }, "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-3.0.0.tgz", + "integrity": "sha512-hKKNajm46uNmTlhHSyZkmToAc56uZJwYq7yrciZjqOxnlfQwERDQJmHPUp7m1m9wx8vgOe8IaCKZ5Kv2k1DdCQ==", + "requires": { + "fastest-levenshtein": "^1.0.7" + } + }, + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==" }, "faye-websocket": { "version": "0.11.3", @@ -8334,6 +8341,14 @@ "prelude-ls": "~1.1.2", "type-check": "~0.3.2", "word-wrap": "~1.2.3" + }, + "dependencies": { + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + } } }, "ora": { diff --git a/frontend/package.json b/frontend/package.json index 35b4ca1734c9..1b2d0f597cd5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,6 +13,7 @@ "@smartweb/vue-flash-message": "^0.6.10", "axios": "^0.21.1", "core-js": "^3.8.2", + "fast-levenshtein": "^3.0.0", "fuse.js": "^6.4.6", "qs": "^6.9.6", "v-jsoneditor": "^1.4.2", diff --git a/frontend/public/index.html b/frontend/public/index.html index a28fe4e63a9c..59b9ff16619e 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -8,7 +8,6 @@ Mealie -