mirror of
https://github.com/SaraSmiseth/prosody.git
synced 2025-01-18 13:10:37 +00:00
Environment variables for subdomains
This commit is contained in:
parent
32fbf2c8db
commit
b3d3eee131
4 changed files with 31 additions and 9 deletions
|
@ -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 }
|
|
@ -10,4 +10,13 @@ if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
|
|||
prosodyctl register $LOCAL $DOMAIN $PASSWORD
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
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 "$@"
|
||||
|
|
12
readme.md
12
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue