Allow configuration via environment variables.

This commit is contained in:
Cassowary 2022-11-30 13:47:10 -08:00
parent b0035f4a68
commit f4001ca148
4 changed files with 44 additions and 2 deletions

View File

@ -1,8 +1,20 @@
TYPE=fluffychat
DOMAIN=fluffychat.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.fluffychat.example.com`'
LETS_ENCRYPT_ENV=production
COMPOSE_FILE="compose.yml"
# Single Sign-On using traefik-forward-auth
#TFA_MIDDLEWARE_NAME="keycloak"
#COMPOSE_FILE="$COMPOSE_FILE:compose.sso.yml"
# User configuration
# Tab labels etc.
FLUFFY_APPLICATION_NAME=FluffyChat
# What the homeserver at the login screen defaults to
FLUFFY_DEFAULT_HOMESERVER=matrix.example.com

8
compose.sso.yml Normal file
View File

@ -0,0 +1,8 @@
version: "3.8"
services:
app:
environment:
- TFA_MIDDLEWARE_NAME
deploy:
labels:
- "traefik.http.routers.${STACK_NAME}.middlewares=${TFA_MIDDLEWARE_NAME}@file"

View File

@ -4,8 +4,14 @@ version: "3.8"
services:
app:
image: git.coopcloud.tech/coop-cloud/fluffychat:v1.7.1
environment:
- FLUFFY_APPLICATION_NAME
- FLUFFY_DEFAULT_HOMESERVER
networks:
- proxy
configs:
- source: config_json
target: /usr/share/nginx/config.json
deploy:
restart_policy:
condition: on-failure
@ -30,3 +36,9 @@ services:
networks:
proxy:
external: true
configs:
config_json:
name: ${STACK_NAME}_config_json_${CONFIG_JSON_VERSION}
file: config.json.tmpl
template_driver: golang

10
config.json.tmpl Normal file
View File

@ -0,0 +1,10 @@
{
"application_name": "{{ env "FLUFFY_APPLICATION_NAME" }}",
"application_welcome_message": null,
"default_homeserver": "{{ env "FLUFFY_DEFAULT_HOMESERVER" }}",
"web_base_url": "https://{{ env "DOMAIN" }}/",
"privacy_url": "https://{{ env "DOMAIN" }}/en/privacy.html",
"render_html": false,
"hide_redacted_events": false,
"hide_unknown_events": false
}