Tandoor Recipe installieren
-
- Debian 11|12
- Ubuntu 22.04
-
Foxly -
15. März 2024 um 09:45 -
0 Kommentare -
1.874 Mal gelesen
Im Zeitraum vom 09.04.2024 - 28.03.2025 ist der Support eingeschränkt. In dem genannten Zeitraum, befinde ich mich auf einer Weiterbildung.
Tandoor Recipe
Links, Zettel und PDFs sammeln macht auf Dauer keinen Spaß. Tandoor erlaubt dir deine Rezepte schnell und einfach, aber durchdacht strukturiert zu sammeln und zu teilen.
Fangen Sie am besten direkt an und kochen Sie sich etwas Schönes!
Zitat von Tandoor.devTandoor wird von einer Gruppe von Kochbegeisterten entwickelt um eine durchdachte Lösung zum digitalisieren, verwalten und teilen von Rezepten zu schaffen.
Die Evolution des traditionellen Kochbuchs:
Deine Daten gehen niemanden etwas an!
Wir bieten dir einfach eine Platform um deine Rezepte zu verwalten.
Ein Update von Tandoor auf eine neuere Version ist nur durch eine Neuinstallation möglich. Hierfür ist es notwendig, ein Backup der Rezepte anzufertigen.
Backup erstellen
Es gibt mehrere Möglichkeiten, ein Backup eurer Rezepte anzulegen. Ich zeige euch hier zwei schnelle Wege, um einen evtl. Datenverlust beim Upgrade vorzubeugen.
Methode 1
Über eine funktionierende Weboberfläche von Tandoor, können alle Rezepte exportiert werden. Es ist also kein großes Know-how notwendig, um eine schnelle Datensicherung anzufertigen. Navigiert in Tandoor einfach auf euren Werkzeugkasten und klickt Exportieren an. Anschließend lasst Ihr das Dropdown Menü auf default und wählt alle Rezepte aus.
Die Wiederherstellung lässt sich auch über die Weboberfläche anstoßen. Hierfür nutzen wir die Option Rezept importieren. Wählt im oberen Tabmenü App aus und klickt auf Tandoor. Im Anschluss müsst Ihr lediglich die Datei auswählen und alle Rezepte wieder Importieren.
Methode 2
Methode zwei beschränkt sich auf ein Datenbankbackup aus dem Docker Container. Hierfür benötigt Ihr das Terminal. Verbindet euch also mit eurem Server und navigiert in euren Tandoor Ordner cd /home/tandoor .
Jetzt benötigen wir nur noch den Containernamen, welchen wir über diesen Befehl suchen können:
docker ps | grep recipes
Die Ausgabe gibt alle Container mit dem Inhalt recipes aus. Hier benötigen wir den Namen des Datenbank-Containers. Bei mir lautet dieser tandoor-db_recipes-1, dieser könnte bei euch auch anders benannt sein.
Jetzt fertigen wir einen Datenbank dump mit folgendem Befehl an:
sudo docker exec -t tandoor-db_recipes-1 pg_dumpall -U djangouser > pgdump.sql
Für die Wiederherstellung des dumps benötigen wir diesen:
cat pgdump.sql | sudo docker exec -i tandoor-db_recipes-1 psql postgres -U djangouser
Installation
Verbinden Sie sich mit Ihrem Server via SSH. Navigieren Sie in das Tandoor Verzeichnis.
Editieren Sie die Docker Compose Datei mit nano docker-compose.yaml
version: "3"
services:
db_recipes:
restart: always
image: postgres:16-alpine
volumes:
- ./postgresql:/var/lib/postgresql/data
env_file:
- ./.env
web_recipes:
restart: always
image: vabene1111/recipes
env_file:
- ./.env
volumes:
- staticfiles:/opt/recipes/staticfiles
# Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
- nginx_config:/opt/recipes/nginx/conf.d
- ./mediafiles:/opt/recipes/mediafiles
depends_on:
- db_recipes
nginx_recipes:
image: nginx:mainline-alpine
restart: always
ports:
- 8090:80
env_file:
- ./.env
depends_on:
- web_recipes
volumes:
# Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
- nginx_config:/etc/nginx/conf.d:ro
- staticfiles:/static:ro
- ./mediafiles:/media:ro
volumes:
nginx_config:
staticfiles:
Alles anzeigen
Der verwendete Port unter welcher Tandoor verfügbar sein wird, ist Port 8090. Sollte dieser bereits bei Ihnen belegt sein, müssen Sie einen anderen Port wählen. Speichern Sie die Datei mit CTRL + X und Y.
Nun benötigen Sie noch die .env für einige Variablen. Erstellen Sie deshalb mit nano .env eine weitere Datei und kopieren Sie Folgendes hinein:
# only set this to true when testing/debugging
# when unset: 1 (true) - dont unset this, just for development
DEBUG=0
SQL_DEBUG=0
DEBUG_TOOLBAR=0
# Gunicorn log level for debugging (default value is "info" when unset)
# (see https://docs.gunicorn.org/en/stable/settings.html#loglevel for available settings)
# GUNICORN_LOG_LEVEL="debug"
# HTTP port to bind to
# TANDOOR_PORT=8080
# hosts the application can run under e.g. recipes.mydomain.com,cooking.mydomain.com,...
ALLOWED_HOSTS=*
# Cross Site Request Forgery protection
# (https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS)
# CSRF_TRUSTED_ORIGINS = []
# Cross Origin Resource Sharing
# (https://github.com/adamchainz/django-cors-header)
# CORS_ALLOW_ALL_ORIGINS = True
# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
# ---------------------------- AT LEAST ONE REQUIRED -------------------------
SECRET_KEY=
SECRET_KEY_FILE=
# ---------------------------------------------------------------
# your default timezone See https://timezonedb.com/time-zones for a list of timezones
TZ=Europe/Berlin
# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql
# DB_OPTIONS= {} # e.g. {"sslmode":"require"} to enable ssl
POSTGRES_HOST=db_recipes
POSTGRES_PORT=5432
POSTGRES_USER=djangouser
# ---------------------------- AT LEAST ONE REQUIRED -------------------------
POSTGRES_PASSWORD=P@ssW0rd
POSTGRES_PASSWORD_FILE=
# ---------------------------------------------------------------
POSTGRES_DB=djangodb
# database connection string, when used overrides other database settings.
# format might vary depending on backend
# DATABASE_URL = engine://username:password@host:port/dbname
# the default value for the user preference 'fractions' (enable/disable fraction support)
# default: disabled=0
FRACTION_PREF_DEFAULT=0
# the default value for the user preference 'comments' (enable/disable commenting system)
# default comments enabled=1
COMMENT_PREF_DEFAULT=1
# Users can set a amount of time after which the shopping list is refreshed when they are in viewing mode
# This is the minimum interval users can set. Setting this to low will allow users to refresh very frequently which
# might cause high load on the server. (Technically they can obviously refresh as often as they want with their own scripts)
SHOPPING_MIN_AUTOSYNC_INTERVAL=5
# Default for user setting sticky navbar
# STICKY_NAV_PREF_DEFAULT=1
# If base URL is something other than just / (you are serving a subfolder in your proxy for instance http://recipe_app/recipes/)
# Be sure to not have a trailing slash: e.g. '/recipes' instead of '/recipes/'
# SCRIPT_NAME=/recipes
# If staticfiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
# STATIC_URL=/static/
# If mediafiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
# MEDIA_URL=/media/
# Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. Please use any of the examples
# provided that include an additional nxginx container to handle media file serving.
# If you know what you are doing turn this back on (1) to serve media files using djangos serve() method.
# when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate
GUNICORN_MEDIA=0
# GUNICORN SERVER RELATED SETTINGS (see https://docs.gunicorn.org/en/stable/design.html#how-many-workers for recommended settings)
# GUNICORN_WORKERS=1
# GUNICORN_THREADS=1
# S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio)
# as long as S3_ACCESS_KEY is not set S3 features are disabled
# S3_ACCESS_KEY=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION_NAME= # default none, set your region might be required
# S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls
# S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for
# S3_ENDPOINT_URL= # when using a custom endpoint like minio
# S3_CUSTOM_DOMAIN= # when using a CDN/proxy to S3 (see https://github.com/TandoorRecipes/recipes/issues/1943)
# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=1
# EMAIL_USE_SSL=0
# email sender address (default 'webmaster@localhost')
# DEFAULT_FROM_EMAIL=
# prefix used for account related emails (default "[Tandoor Recipes] ")
ACCOUNT_EMAIL_SUBJECT_PREFIX=[Tandoor Recipes]
# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# email sender address (default 'webmaster@localhost')
# DEFAULT_FROM_EMAIL=
# prefix used for account related emails (default "[Tandoor Recipes] ")
# ACCOUNT_EMAIL_SUBJECT_PREFIX=
# allow authentication via the REMOTE-USER header (can be used for e.g. authelia).
# ATTENTION: Leave off if you don't know what you are doing! Enabling this without proper configuration will enable anybody
# to login with any username!
# See docs for additional information: https://docs.tandoor.dev/features/authentication/#reverse-proxy-authentication
# when unset: 0 (false)
REMOTE_USER_AUTH=0
# Default settings for spaces, apply per space and can be changed in the admin view
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
# SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space
# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
# SPACE_DEFAULT_ALLOW_SHARING=1 # Allow users to share recipes with public links
# allow people to create local accounts on your application instance (without an invite link)
# social accounts will always be able to sign up
# when unset: 0 (false)
# ENABLE_SIGNUP=0
# If signup is enabled you might want to add a captcha to it to prevent spam
# HCAPTCHA_SITEKEY=
# HCAPTCHA_SECRET=
# if signup is enabled you might want to provide urls to data protection policies or terms and conditions
# TERMS_URL=
# PRIVACY_URL=
# IMPRINT_URL=
# enable serving of prometheus metrics under the /metrics path
# ATTENTION: view is not secured (as per the prometheus default way) so make sure to secure it
# trough your web server (or leave it open of you dont care if the stats are exposed)
# ENABLE_METRICS=0
# allows you to setup OAuth providers
# see docs for more information https://docs.tandoor.dev/features/authentication/
# SOCIAL_PROVIDERS = allauth.socialaccount.providers.github, allauth.socialaccount.providers.nextcloud,
# Should a newly created user from a social provider get assigned to the default space and given permission by default ?
# ATTENTION: This feature might be deprecated in favor of a space join and public viewing system in the future
# default 0 (false), when 1 (true) users will be assigned space and group
# SOCIAL_DEFAULT_ACCESS = 1
# if SOCIAL_DEFAULT_ACCESS is used, which group should be added
# SOCIAL_DEFAULT_GROUP=guest
# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications
# when running under the same database
# SESSION_COOKIE_DOMAIN=.example.com
# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain
# by default SORT_TREE_BY_NAME is disabled this will store all Keywords and Food in the order they are created
# enabling this setting makes saving new keywords and foods very slow, which doesn't matter in most usecases.
# however, when doing large imports of recipes that will create new objects, can increase total run time by 10-15x
# Keywords and Food can be manually sorted by name in Admin
# This value can also be temporarily changed in Admin, it will revert the next time the application is started
# This will be fixed/changed in the future by changing the implementation or finding a better workaround for sorting
# SORT_TREE_BY_NAME=0
# LDAP authentication
# default 0 (false), when 1 (true) list of allowed users will be fetched from LDAP server
#LDAP_AUTH=
#AUTH_LDAP_SERVER_URI=
#AUTH_LDAP_BIND_DN=
#AUTH_LDAP_BIND_PASSWORD=
#AUTH_LDAP_USER_SEARCH_BASE_DN=
#AUTH_LDAP_TLS_CACERTFILE=
#AUTH_LDAP_START_TLS=
# Enables exporting PDF (see export docs)
# Disabled by default, uncomment to enable
# ENABLE_PDF_EXPORT=1
# Recipe exports are cached for a certain time by default, adjust time if needed
# EXPORT_FILE_CACHE_DURATION=600
# if you want to do many requests to the FDC API you need to get a (free) API key. Demo key is limited to 30 requests / hour or 50 requests / day
#FDC_API_KEY=DEMO_KEY
Alles anzeigen
Um einen Secret Key zu erstellen, nutzen Sie unten angegebenen Befehl und fügen diesen in Ihre .env unter SECRET_KEY= hinzu.
base64 /dev/urandom | head -c50
Anschließend vergeben Sie noch ein sicheres Passwort für die Datenbank und fügen diese ebenso in die .env ein.
Jetzt können Sie Tandoor starten. Führen Sie hierzu untenstehenden Befehl aus:
docker compose up -d
Alle Daten werden jetzt heruntergeladen und anschließend in drei Containern ausgeführt. Sind alle Container am Laufen, können Sie unter http://localhost:8090 auf Tandoor zugreifen.
Installations Tutorial vor dem 26. Jan 2024
Installation <ALT>
Verbinden Sie sich mit Ihrem Server via SSH. Navigieren Sie am besten in das Home Verzeichnis und hier erstellen Sie ein neues Verzeichnis.
cd /home && mkdir tandoor && cd tandoor
Nun erstellen Sie die Docker Compose Datei mit nano docker-compose.yaml
version: "3"
services:
db_recipes:
restart: always
image: postgres:11-alpine
volumes:
- ./postgresql:/var/lib/postgresql/data
env_file:
- ./.env
web_recipes:
image: vabene1111/recipes
restart: always
env_file:
- ./.env
volumes:
- staticfiles:/opt/recipes/staticfiles
- nginx_config:/opt/recipes/nginx/conf.d
- ./mediafiles:/opt/recipes/mediafiles
depends_on:
- db_recipes
nginx_recipes:
image: nginx:mainline-alpine
restart: always
ports:
- 8080:80
env_file:
- ./.env
depends_on:
- web_recipes
volumes:
- nginx_config:/etc/nginx/conf.d:ro
- staticfiles:/static
- ./mediafiles:/media
volumes:
nginx_config:
staticfiles:
Alles anzeigen
Der verwendete Port unter welcher Tandoor verfügbar sein wird, ist Port 8080. Sollte dieser bereits bei Ihnen belegt sein, müssen Sie einen anderen Port wählen. Speichern Sie die Datei mit CTRL + X und Y.
Nun benötigen Sie noch die .env für einige Variablen. Erstellen Sie deshalb mit nano .env eine weitere Datei und kopieren folgendes hinein:
DEBUG=0
SQL_DEBUG=0
ALLOWED_HOSTS=*
SECRET_KEY=secretKey
TIMEZONE=Europe/Berlin
DB_ENGINE=django.db.backends.postgresql
POSTGRES_HOST=db_recipes
POSTGRES_PORT=5432
POSTGRES_USER=djangouser
POSTGRES_PASSWORD=P@ssw0rd
POSTGRES_DB=djangodb
FRACTION_PREF_DEFAULT=0
COMMENT_PREF_DEFAULT=1
SHOPPING_MIN_AUTOSYNC_INTERVAL=5
GUNICORN_MEDIA=0
REVERSE_PROXY_AUTH=0
# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# email sender address (default 'webmaster@localhost')
# DEFAULT_FROM_EMAIL=
# prefix used for account related emails (default "[Tandoor Recipes] ")
# ACCOUNT_EMAIL_SUBJECT_PREFIX=[Tandoor Recipes]
Alles anzeigen
Um einen Secret Key zu erstellen, nutzen Sie unten angegebenen Befehl und fügen diesen in Ihre .env unter SECRET_KEY= hinzu.
base64 /dev/urandom | head -c50
Anschließend vergeben Sie noch ein sicheres Passwort für die Datenbank und fügen diese ebenso in die .env ein.
Jetzt können Sie Tandoor starten. Führen Sie hierzu untenstehenden Befehl aus:
docker compose up -d
Alle Daten werden jetzt heruntergeladen und anschließend in drei Containern ausgeführt. Sind alle Container am Laufen, können Sie unter http://localhost:8080 auf Tandoor zugreifen.
Über den Autor
Ich bin IT-Spezialist im Fachbereich der IT-Administratoren. Neben Beruf und Familie, erstelle ich als, Teil meines Hobbys, gerne Tutorials, sowie WoltLab Stile. Aktuell befinde ich mich auf meinem Informationstechnikermeister.
Kommentare
Neu erstellte Kommentare unterliegen der Moderation und werden erst sichtbar, wenn sie durch einen Moderator geprüft und freigeschaltet wurden.
Neu erstellte Kommentare unterliegen der Moderation und werden erst sichtbar, wenn sie durch einen Moderator geprüft und freigeschaltet wurden.