From fb50f748ee484a54a63b2e42c26e6e17d95d7360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sara=20Aim=C3=A9e=20Smiseth?= <51710585+SaraSmiseth@users.noreply.github.com> Date: Fri, 18 Sep 2020 18:53:33 +0200 Subject: [PATCH] Make 03-e2e-policy.cfg.lua configurable with ENV variables. --- CHANGELOG.md | 3 ++- conf.d/03-e2e-policy.cfg.lua | 6 +++--- docker-entrypoint.sh | 2 ++ readme.md | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67e5145..aa189ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## Unreleased -* Made 04-server_contact_info.cfg.lua configurable with ENV variables. See [#4](https://github.com/SaraSmiseth/prosody/issues/4). +* Made 04-server_contact_info.cfg.lua configurable with ENV variables. Fixes [#4](https://github.com/SaraSmiseth/prosody/issues/4). +* Made 03-e2e-policy.cfg.lua configurable with ENV variables. Fixes [#9](https://github.com/SaraSmiseth/prosody/issues/9). ## v1.1.1 diff --git a/conf.d/03-e2e-policy.cfg.lua b/conf.d/03-e2e-policy.cfg.lua index ba094e5..c4f1053 100644 --- a/conf.d/03-e2e-policy.cfg.lua +++ b/conf.d/03-e2e-policy.cfg.lua @@ -1,7 +1,7 @@ -e2e_policy_chat = "required" -e2e_policy_muc = "required" +e2e_policy_chat = os.getenv("E2E_POLICY_CHAT") +e2e_policy_muc = os.getenv("E2E_POLICY_MUC") e2e_policy_whitelist = {} e2e_policy_message_optional_chat = "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for conversations on this server." e2e_policy_message_required_chat = "For security reasons, OMEMO, OTR or PGP encryption is required for conversations on this server." e2e_policy_message_optional_muc = "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for MUC on this server." -e2e_policy_message_required_muc = "For security reasons, OMEMO, OTR or PGP encryption is required for MUC on this server." \ No newline at end of file +e2e_policy_message_required_muc = "For security reasons, OMEMO, OTR or PGP encryption is required for MUC on this server." diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 350cf3e..a562226 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -20,6 +20,8 @@ export DOMAIN_HTTP_UPLOAD=${DOMAIN_HTTP_UPLOAD:-"upload.$DOMAIN"} export DOMAIN_MUC=${DOMAIN_MUC:-"conference.$DOMAIN"} export DOMAIN_PROXY=${DOMAIN_PROXY:-"proxy.$DOMAIN"} export DOMAIN_PUBSUB=${DOMAIN_PUBSUB:-"pubsub.$DOMAIN"} +export E2E_POLICY_CHAT=${E2E_POLICY_CHAT:-"required"} +export E2E_POLICY_MUC=${E2E_POLICY_MUC:-"required"} export LOG_LEVEL=${LOG_LEVEL:-"info"} export C2S_REQUIRE_ENCRYPTION=${C2S_REQUIRE_ENCRYPTION:-true} export S2S_REQUIRE_ENCRYPTION=${S2S_REQUIRE_ENCRYPTION:-true} diff --git a/readme.md b/readme.md index 46f544e..30c24ab 100644 --- a/readme.md +++ b/readme.md @@ -191,6 +191,8 @@ Inspect logs: ```docker-compose logs -f```. | **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** | | **DOMAIN_PUBSUB** | Domain for a XEP-0060 pubsub service | *optional* | pubsub.**DOMAIN** | +| **E2E_POLICY_CHAT** | Policy for chat messages. Possible values: "none", "optional" and "required". | *optional* | "required" | +| **E2E_POLICY_MUC** | Policy for MUC messages. Possible values: "none", "optional" and "required". | *optional* | "required" | | **LOG_LEVEL** | Min log level. Change to debug for more information | *optional* | info | | **C2S_REQUIRE_ENCRYPTION** | Whether to force all client-to-server connections to be encrypted or not | *optional* | true | | **S2S_REQUIRE_ENCRYPTION** | Whether to force all server-to-server connections to be encrypted or not | *optional* | true |