From 0d5ab221d5fe5808f76f3d2883a509fb028f77d0 Mon Sep 17 00:00:00 2001 From: joker-x Date: Sun, 6 Sep 2020 02:58:34 +0200 Subject: [PATCH] Add docker support --- README.md | 6 ++++++ docker-entrypoint.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/README.md b/README.md index 7c949544..9e8cfa17 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,12 @@ variables (e.g. `URL_BASE_TRUSTED=https://mailtrain.domain.com (and more env-var | LDAP_UIDTAG | LDAP UID tag (e.g. uid/cn/username) | | WITH_ZONE_MTA | enables or disables builtin Zone-MTA (default: true) | | POOL_NAME | sets builtin Zone-MTA pool name (default: os.hostname()) | +| WITH_CAS | use if you want to use CAS | +| CAS_URL | CAS base URL | +| CAS_NAMETAG | The field used to save the name (default: username) | +| CAS_MAILTAG | The field used to save the email (default: mail) | +| CAS_NEWUSERROLE | The role of new users (default: nobody) | +| CAS_NEWUSERNAMESPACEID | The namespace id of new users (default: 1) | If you don't want to modify the original `docker-compose.yml`, you can put your overrides to another file (e.g. `docker-compose.override.yml`) -- like the one below. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index f2e879f9..d1c55ea2 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -26,6 +26,12 @@ LDAP_UIDTAG=${LDAP_UIDTAG:-'username'} LDAP_MAILTAG=${LDAP_MAILTAG:-'mail'} LDAP_NAMETAG=${LDAP_NAMETAG:-'username'} LDAP_METHOD=${LDAP_METHOD:-'ldapjs'} +WITH_CAS=${WITH_CAS:-'false'} +CAS_URL=${CAS_URL:-'https://example.cas-server.com'} +CAS_NAMETAG=${CAS_NAMETAG:-'username'} +CAS_MAILTAG=${CAS_MAILTAG:-'mail'} +CAS_NEWUSERROLE=${CAS_NEWUSERROLE:-'nobody'} +CAS_NEWUSERNAMESPACEID=${CAS_NEWUSERNAMESPACEID:-'1'} MONGO_HOST=${MONGO_HOST:-'mongo'} WITH_REDIS=${WITH_REDIS:-'true'} REDIS_HOST=${REDIS_HOST:-'redis'} @@ -110,6 +116,27 @@ ldap: EOT fi + # Manage CAS if enabled + if [ "$WITH_CAS" = "true" ]; then + echo 'Info: CAS enabled' + cat >> server/config/production.yaml <> server/config/production.yaml <