@@ -32,28 +32,10 @@ msg_ok "Installed Dependencies"
3232
3333NODE_VERSION=" 22" NODE_MODULE=" yarn" setup_nodejs
3434fetch_and_deploy_gh_release " tandoor" " TandoorRecipes/recipes" " tarball" " latest" " /opt/tandoor"
35- PG_VERSION=" 17" PG_MODULES= " contrib " setup_postgresql
35+ PG_VERSION=" 17" setup_postgresql
3636PYTHON_VERSION=" 3.13" setup_uv
37-
38- msg_info " Set up PostgreSQL Database"
39- DB_NAME=db_recipes
40- DB_USER=tandoor
37+ PG_DB_USER=" tandoor" PG_DB_NAME=" db_recipes" PG_DB_EXTENSIONS=" unaccent,pg_trgm" setup_postgresql_db
4138SECRET_KEY=$( openssl rand -base64 45 | sed ' s/\//\\\//g' )
42- DB_PASS=" $( openssl rand -base64 18 | cut -c1-13) "
43- $STD sudo -u postgres psql -c " CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS ';"
44- $STD sudo -u postgres psql -c " CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
45- $STD sudo -u postgres psql -c " ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
46- $STD sudo -u postgres psql -c " ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
47- $STD sudo -u postgres psql -c " ALTER ROLE $DB_USER SET timezone TO 'UTC'"
48- $STD sudo -u postgres psql -d " $DB_NAME " -c " CREATE EXTENSION IF NOT EXISTS unaccent;"
49- $STD sudo -u postgres psql -d " $DB_NAME " -c " CREATE EXTENSION IF NOT EXISTS pg_trgm;"
50- {
51- echo " Tandoor-Credentials"
52- echo " Tandoor Database Name: $DB_NAME "
53- echo " Tandoor Database User: $DB_USER "
54- echo " Tandoor Database Password: $DB_PASS "
55- } >> ~/tandoor.creds
56- msg_ok " Set up PostgreSQL Database"
5739
5840msg_info " Setup Tandoor"
5941mkdir -p /opt/tandoor/{config,api,mediafiles,staticfiles}
@@ -69,16 +51,16 @@ TZ=Europe/Berlin
6951
7052DB_ENGINE=django.db.backends.postgresql
7153POSTGRES_HOST=localhost
72- POSTGRES_DB=$DB_NAME
54+ POSTGRES_DB=$PG_DB_NAME
7355POSTGRES_PORT=5432
74- POSTGRES_USER=$DB_USER
75- POSTGRES_PASSWORD=$DB_PASS
56+ POSTGRES_USER=$PG_DB_USER
57+ POSTGRES_PASSWORD=$PG_DB_PASS
7658
7759STATIC_URL=/staticfiles/
7860MEDIA_URL=/media/
7961EOF
8062
81- TANDOOR_VERSION=" $( curl -s https://api.github.com/repos/ TandoorRecipes/recipes/releases/latest | jq -r .tag_name ) "
63+ TANDOOR_VERSION=$( get_latest_github_release " TandoorRecipes/recipes" )
8264cat << EOF >/opt/tandoor/cookbook/version_info.py
8365TANDOOR_VERSION = "$TANDOOR_VERSION "
8466TANDOOR_REF = "bare-metal"
0 commit comments