From dc37aaa7b1cb86f55e53d2b87b086ebaadde4015 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 16 Nov 2022 12:27:49 +0100 Subject: [PATCH] optimized configuration --- .../templates/docker-compose.yml.j2 | 7 +--- roles/docker-pixelfed/templates/env.j2 | 41 +++++++------------ 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/roles/docker-pixelfed/templates/docker-compose.yml.j2 b/roles/docker-pixelfed/templates/docker-compose.yml.j2 index ee32ed39..e926d8da 100644 --- a/roles/docker-pixelfed/templates/docker-compose.yml.j2 +++ b/roles/docker-pixelfed/templates/docker-compose.yml.j2 @@ -41,11 +41,8 @@ services: driver: journald image: mariadb restart: always - environment: - MYSQL_DATABASE: "pixelfed" - MYSQL_USER: "pixelfed" - MYSQL_PASSWORD: "{{pixelfed_database_password}}" - MYSQL_RANDOM_ROOT_PASSWORD: 'yes' + env_file: + - ./env volumes: - database:/var/lib/mysql healthcheck: diff --git a/roles/docker-pixelfed/templates/env.j2 b/roles/docker-pixelfed/templates/env.j2 index 3cc79059..af0aa95e 100644 --- a/roles/docker-pixelfed/templates/env.j2 +++ b/roles/docker-pixelfed/templates/env.j2 @@ -5,12 +5,12 @@ APP_KEY= APP_NAME="Pixelfed Prod" APP_ENV=production APP_DEBUG=false -APP_URL=https://real.domain -APP_DOMAIN="real.domain" -ADMIN_DOMAIN="real.domain" -SESSION_DOMAIN="real.domain" +APP_URL=https://{{domain}} +APP_DOMAIN="{{domain}}" +ADMIN_DOMAIN="{{domain}}" +SESSION_DOMAIN="{{domain}}" -OPEN_REGISTRATION=true +OPEN_REGISTRATION=false ENFORCE_EMAIL_VERIFICATION=false PF_MAX_USERS=1000 OAUTH_ENABLED=true @@ -46,13 +46,13 @@ RESTRICTED_INSTANCE=false ## Mail MAIL_DRIVER=log -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_FROM_ADDRESS="pixelfed@example.com" +MAIL_HOST={{system_email_host}} +MAIL_PORT=587 +MAIL_FROM_ADDRESS="{{system_email_username}}" MAIL_FROM_NAME="Pixelfed" -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null +MAIL_USERNAME={{system_email_username}} +MAIL_PASSWORD={{system_email_password}} +MAIL_ENCRYPTION=tls ## Databases (MySQL) DB_CONNECTION=mysql @@ -66,14 +66,10 @@ MYSQL_DATABASE=pixelfed_prod MYSQL_PASSWORD=pixelfed_db_pass MYSQL_RANDOM_ROOT_PASSWORD=true MYSQL_USER=pixelfed - -## Databases (Postgres) -#DB_CONNECTION=pgsql -#DB_HOST=postgres -#DB_PORT=5432 -#DB_DATABASE=pixelfed -#DB_USERNAME=postgres -#DB_PASSWORD=postgres +MYSQL_DATABASE="pixelfed" +MYSQL_USER="pixelfed" +MYSQL_PASSWORD="{{pixelfed_database_password}}" +MYSQL_ROOT_PASSWORD="{{pixelfed_database_password}}" ## Cache (Redis) REDIS_CLIENT=phpredis @@ -104,13 +100,6 @@ WEBFINGER=true FILESYSTEM_DRIVER=local FILESYSTEM_CLOUD=s3 PF_ENABLE_CLOUD=false -#AWS_ACCESS_KEY_ID= -#AWS_SECRET_ACCESS_KEY= -#AWS_DEFAULT_REGION= -#AWS_BUCKET= -#AWS_URL= -#AWS_ENDPOINT= -#AWS_USE_PATH_STYLE_ENDPOINT=false ## Horizon HORIZON_DARKMODE=false