[SUPPORT] Tandoor Recipes - CorneliousJD Repo


Recommended Posts

 About

Tandoor Recipes is a Django application to manage, tag and search recipes using either built in models or external storage providers hosting PDF's, Images or other files.

 

This application is meant for people with a collection of recipes they want to share with family and friends or simply store them in a nicely organized way. A basic permission system exists but this application is not meant to be run as a public page.

 

Please note that I did not develop, and am not involved with the development of Recipes.

There was simply a number of requests to get a working container on unRAID so I took the lead on creating the teimplate and publishing it into Community Applications.

GitHub: https://github.com/vabene1111/recipes

Project Page: https://docs.tandoor.dev/

 

Requirements

Nothing else other than the container, it is all self-contained.

However you do have the option to use a PostgreSQL to add the Trigram similarity search function.

Simply show the hidden/advanced variables when installing or editing the container to enter PostgreSQL information if you wish to use that.

 

Variables

ALLOWED_HOST: This will default to * (all), however to be more restrictive you can list your IP address of your unRAID server (allows local LAN access), along with any reverse-proxy domain you want to access from (for access over the Internet), e.g. it may look like this: 192.168.1.10, recipes.yourdomain.com

 

SECRET_KEY: This needs to be a long randomly genrated string for cryptography. See here for more information.

 

Other Variables: A list of other variables is available here

 

Reverse Proxy

This should work just fine with a reverse proxy (like LinuxServer's SWAG container, or Nginx Proxy Manager).

I would recommend setting this up as a subdomain, such as https://recipes.yourdomain.com

A basic example would be as follows. Note that I have currently not tested this.

#RECIPES
Was noted that this config is not working for SWAG.
If someone has a working config please let me know and I will post it here.

Nginx Proxy Manager works just fine to reverse proxy this app.

 

Known Issues

All media is served directly by Gunicorn instead of NGINX, this isn't recommended, but works. -- See screenshot below.

If you would like to change this and serve images via another container (such as Nginx, or SWAG, etc) see discussion on how users got it working here: https://github.com/vabene1111/recipes/discussions/341

 

By default this will use a SQLite database, which removes the  Trigram similarity search function. -- This is likely not an issue for most people, but something to note. 

I chose to let this run with SQLite by default so that everything is self-contained and you do not need another PostgreSQL container, unless you choose to set one up in order to gain the Trigram similarity search features.

 

If there are any container-specific issues please post here, otherwise if it's an application issue or request, you're better of posting on the Github page for Recipes here: https://github.com/vabene1111/recipes/issues

 

 

image.thumb.png.4b467c9b65a2ce2120af7f5bec9588a2.png

Edited by CorneliousJD
Fromatting and adding information.
  • Like 1
Link to comment
Just now, Abigel said:

Thanks for the great Container!

I have been looking for something like this for a long time. I have a question that you might be able to answer.
I can create cookbooks but where and how do I assign recipes to a cookbook ?
Can't find an option for it

You're welcome, glad people are finding good uses for it. I plan on using it instead of OpenEats moving forward as well, although there's still some things about OE I like better ;)

 

In regards to adding a recipe to the cookbook, you have to go into the recipe itself first, and then in the top right there's a little "..." icon that you can click to add it to a specific cookbook. 

 

If you're still stuck let me know and I can get some example screenshots for you later.

  • Thanks 1
Link to comment
10 hours ago, itlists said:

Thanks for this!!

 

Can MariaDB be used instead of postgreSQL?

I believe so, however you won't see much of a benefit in using MariaDB over SQLite because you'll still lose out on the Trigram similarity search without PostgreSQL, so I would still recommend Postgres if you're going to ditch the SQLite, however if you edit the DB Backend to be 'django.db.backends.mysql' then it should work, just enter your MySQL user/pass/database where it asks for Postgres info, and that should take it. 

  • Thanks 1
Link to comment
2 hours ago, CorneliousJD said:

I believe so, however you won't see much of a benefit in using MariaDB over SQLite because you'll still lose out on the Trigram similarity search without PostgreSQL, so I would still recommend Postgres if you're going to ditch the SQLite, however if you edit the DB Backend to be 'django.db.backends.mysql' then it should work, just enter your MySQL user/pass/database where it asks for Postgres info, and that should take it. 

Thanks for the reply. I'm not too handy with DB commands. Is there a particular postgresql docker and a DB management docker you recommend to setup the user and DB in postgresql?

Link to comment
9 hours ago, itlists said:

Thanks for the reply. I'm not too handy with DB commands. Is there a particular postgresql docker and a DB management docker you recommend to setup the user and DB in postgresql?

 

Yep! This one here.

image.png.c4657959490ab2fdf85f7b90732439ab.png

 

When you install it you can install the latest verison which is :13 instead of :11 if you want.

Or leave it at latest, but warning it will auto-update to 13.x or 14 when those are released which may include breaking changes. 

 

console into the container (click it, choose console)

Here's the commands to run.

This is from memory, 

 

su - postgres
createuser --interactive --pwprompt

Pick a username for the database.
No to all, superuser, DB create permission, create new roles.

createdb recipes
psql
GRANT all privileges ON DATABASE recipes to (username you made);

(BE SURE TO END WITH SEMICOLON)
Once it confirms GRANT then 

\q
exit

 

NOTE: If it commplains about the word "privileges" try leaving it out, so just GRANT all ON...

  • Thanks 1
Link to comment
7 hours ago, itlists said:

Got this installed with PostgreSQL container as well. However, when connecting to the webui, I get Server Error (500) on http://192.168.x.x:8154/setup/

I see that the tables have been created in db.

 

Check the logs of the container to see what errors it shows, it should shed some light as to why.

I also ran into this once and it's because i didn't grant all permissions on the database for that user so it was failing. (I had missed the semicolon at the end of the grant statement the first time, whoops!)

 

7 hours ago, Abigel said:

Is it possible to import the recipes from nextcloud cookbook?

That's a question for the developer on the github page, that I don't know off hand, sorry!

Link to comment

Start up log:

 

Updating database
Operations to perform:
Apply all migrations: admin, auth, authtoken, contenttypes, cookbook, sessions
Running migrations:
Traceback (most recent call last):
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.InsufficientPrivilege: permission denied to create extension "pg_trgm"
HINT: Must be superuser to create this extension.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/opt/recipes/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/core/management/base.py", line 85, in wrapped
res = handle_func(*args, **kwargs)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 243, in handle
post_migrate_state = executor.migrate(
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/migrations/migration.py", line 124, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/contrib/postgres/operations.py", line 24, in database_forwards
schema_editor.execute("CREATE EXTENSION IF NOT EXISTS %s" % schema_editor.quote_name(self.name))
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/backends/base/schema.py", line 142, in execute
cursor.execute(sql, params)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/recipes/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: permission denied to create extension "pg_trgm"
HINT: Must be superuser to create this extension.

Applying cookbook.0003_enable_pgtrm...
0 static files copied to '/opt/recipes/staticfiles', 675 unmodified, 1300 post-processed.
Done
[2020-10-28 20:16:53 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2020-10-28 20:16:53 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2020-10-28 20:16:53 +0000] [1] [INFO] Using worker: sync
[2020-10-28 20:16:53 +0000] [12] [INFO] Booting worker with pid: 12

 

Edited by itlists
Link to comment
11 minutes ago, itlists said:

Start up log:


django.db.utils.ProgrammingError: permission denied to create extension "pg_trgm"
HINT: Must be superuser to create this extension.

 

There's why right there, not enough permissions. Try the GRANT statement again, if that doesn't seem to work then just use the postgres user and password you have defined in the postgres container, if you want. That's similar to the root user/pass for MariaDB/MySQL

Link to comment
5 hours ago, CorneliousJD said:

There's why right there, not enough permissions. Try the GRANT statement again, if that doesn't seem to work then just use the postgres user and password you have defined in the postgres container, if you want. That's similar to the root user/pass for MariaDB/MySQL

The grant statement is correct. Looks like it needs the DB root/admin account credentials. Will try with that next

 

Using the root credentials worked. I can login to recipes docker now.

However, in System settings, the database warning still shows up:

 

Database Info

This application is not running with a Postgres database backend. This is ok but not recommended as some features only work with postgres databases.

 

This is setup to use postgres, so why?

 

Edited by itlists
Link to comment
On 10/28/2020 at 4:42 PM, itlists said:

Database Info

This application is not running with a Postgres database backend. This is ok but not recommended as some features only work with postgres databases.

 

This is setup to use postgres, so why?

 

This is an issue in the app - it has to do with the developer looking for a legacy string about how it's connecting to postgres, which I left out because it's depreciated. See here: https://github.com/vabene1111/recipes/issues/204

 

EDIT: He will fix it soon :) 

Edited by CorneliousJD
  • Thanks 1
Link to comment
8 hours ago, Blairwin said:

I just installed this docker tonight to use it.  I imported a recipe from URL to test it out.  The empty spots on the left are because I tried to use fractions.  At the bottom I tested a period and it worked.

 

I'm guessing this is a known bug?

Yep, you'll need to verify evertyhing when importing anyways as the import from URL parser doesn't always get everything perfect anyways, but for now you'll need to convert manually for fractions. 

 

This is an ehancement/feature request to support fractions. I'd suggest logging a comment to show your support for wanting fractions as well.

https://github.com/vabene1111/recipes/issues/142

  • Thanks 1
Link to comment
  • 3 weeks later...
On 11/1/2020 at 10:54 PM, Blairwin said:

 I imported a recipe from URL to test it out. 

This may be a silly question, but where are you finding the option to import from URL? The only option I'm seeing for importing recipes is via JSON, and I've been having trouble finding an easy way to format recipes from common websites (e.g. Allrecipes, Serious Eats, etc.) into JSON format without configuring some sort of scraper. I'm happy to do that if necessary, but wanted to check whether I was missing something first.

 

image.thumb.png.25079632b1a20c4ac3de16d3f4bd9dd8.png

Link to comment
3 hours ago, Theok said:

This may be a silly question, but where are you finding the option to import from URL? The only option I'm seeing for importing recipes is via JSON, and I've been having trouble finding an easy way to format recipes from common websites (e.g. Allrecipes, Serious Eats, etc.) into JSON format without configuring some sort of scraper. I'm happy to do that if necessary, but wanted to check whether I was missing something first.

So from the main Cookbook page, click the three "..." icons next to search page and you can import from webiste there.

 

image.thumb.png.3773eb7d9a5c100280245958f3857181.png

Link to comment
  • CorneliousJD changed the title to [SUPPORT] Tandoor Recipes - CorneliousJD Repo

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.