diff --git a/conf.d/05-server_contact_info.cfg.lua b/conf.d/04-server_contact_info.cfg.lua similarity index 100% rename from conf.d/05-server_contact_info.cfg.lua rename to conf.d/04-server_contact_info.cfg.lua diff --git a/conf.d/04-vhost.cfg.lua b/conf.d/05-vhost.cfg.lua similarity index 65% rename from conf.d/04-vhost.cfg.lua rename to conf.d/05-vhost.cfg.lua index 40ddf3d..a791784 100644 --- a/conf.d/04-vhost.cfg.lua +++ b/conf.d/05-vhost.cfg.lua @@ -1,4 +1,7 @@ local domain = os.getenv("DOMAIN") +local domain_http_upload = os.getenv("DOMAIN_HTTP_UPLOAD") +local domain_muc = os.getenv("DOMAIN_MUC") +local domain_proxy = os.getenv("DOMAIN_PROXY") ssl = { key = "/usr/local/etc/prosody/certs/prosody.key"; @@ -7,16 +10,11 @@ ssl = { VirtualHost (domain) --- Set up a SOCKS5 bytestream proxy for server-proxied file transfers -Component ("proxy." .. domain) "proxy65" - proxy65_address = "proxy." .. domain - proxy65_acl = { domain } - -- Set up a http file upload because proxy65 is not working in muc -Component ("upload." .. domain) "http_upload" +Component (domain_http_upload) "http_upload" http_upload_expire_after = 60 * 60 * 24 * 7 -- a week in seconds -Component ("conference." .. domain) "muc" +Component (domain_muc) "muc" name = "Prosody Chatrooms" restrict_room_creation = false max_history_messages = 20 @@ -24,3 +22,8 @@ Component ("conference." .. domain) "muc" "muc_mam", "vcard_muc" } + +-- Set up a SOCKS5 bytestream proxy for server-proxied file transfers +Component (domain_proxy) "proxy65" + proxy65_address = domain_proxy + proxy65_acl = { domain } diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4e327d1..b49169c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,4 +10,13 @@ if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then prosodyctl register $LOCAL $DOMAIN $PASSWORD fi -exec "$@" \ No newline at end of file +if [ -z "$DOMAIN" ]; then + echo "[ERROR] DOMAIN must be set!" + exit 1 +fi + +export DOMAIN_HTTP_UPLOAD=${DOMAIN_HTTP_UPLOAD:-"upload.$DOMAIN"} +export DOMAIN_MUC=${DOMAIN_MUC:-"conference.$DOMAIN"} +export DOMAIN_PROXY=${DOMAIN_PROXY:-"proxy.$DOMAIN"} + +exec "$@" diff --git a/readme.md b/readme.md index bd106ff..f6b55ab 100644 --- a/readme.md +++ b/readme.md @@ -21,6 +21,7 @@ While Conversations got everything set-up out-of-the-box, Gajim was used with th - [Directories](#directories) - [Run](#run) - [Configuration](#configuration) + - [Environment variables](#environment-variables) - [DNS](#dns) - [server_contact_info](#server_contact_info) - [Debugging](#debugging) @@ -101,6 +102,15 @@ Inspect logs: ```docker-compose logs -f``` ### Configuration +### Environment variables + +| Variable | Description | Type | Default value | +| -------- | ----------- | ---- | ------------- | +| **DOMAIN** | domain | **required** | null +| **DOMAIN_HTTP_UPLOAD** | Domain which lets clients upload files over HTTP | *optional* | upload.**DOMAIN** +| **DOMAIN_MUC** | Domain for Multi-user chat (MUC) for allowing you to create hosted chatrooms/conferences for XMPP users | *optional* | conference.**DOMAIN** +| **DOMAIN_PROXY** | Domain for SOCKS5 bytestream proxy for server-proxied file transfers | *optional* | proxy.**DOMAIN** + #### DNS You need these DNS record pointing to your server: @@ -124,7 +134,7 @@ It is configured for the following contacts: * security * support -You can change them in [05-server_contact_info.cfg.lua](./conf.d/05-server_contact_info.cfg.lua). +You can change them in [05-server_contact_info.cfg.lua](./conf.d/04-server_contact_info.cfg.lua). ### Debugging