From 1a41657f904552ec01a79206bfb7d387ed3c38d0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sat, 18 Dec 2021 17:43:21 +0100 Subject: [PATCH] add documentation, allow overrides, clean plugins --- docs/compose/docker-compose.yml | 1 + docs/compose/traefik/docker-compose.yml | 1 + docs/configuration.rst | 49 ++++++++++++++++++++++++ setup/flavors/compose/docker-compose.yml | 1 + setup/flavors/stack/docker-compose.yml | 1 + webmails/roundcube/Dockerfile | 8 +++- webmails/roundcube/config.inc.php | 7 +++- webmails/roundcube/start.py | 3 ++ 8 files changed, 68 insertions(+), 3 deletions(-) diff --git a/docs/compose/docker-compose.yml b/docs/compose/docker-compose.yml index 42be1cb0..344ea8b2 100644 --- a/docs/compose/docker-compose.yml +++ b/docs/compose/docker-compose.yml @@ -100,6 +100,7 @@ services: env_file: .env volumes: - "$ROOT/webmail:/data" + - "$ROOT/overrides/$WEBMAIL:/overrides:ro" depends_on: - imap diff --git a/docs/compose/traefik/docker-compose.yml b/docs/compose/traefik/docker-compose.yml index f295d2f8..25f341df 100644 --- a/docs/compose/traefik/docker-compose.yml +++ b/docs/compose/traefik/docker-compose.yml @@ -128,6 +128,7 @@ services: env_file: .env volumes: - "$ROOT/webmail:/data" + - "$ROOT/overrides/$WEBMAIL:/overrides:ro" depends_on: - imap diff --git a/docs/configuration.rst b/docs/configuration.rst index f7bece71..0ca6cf8f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -262,3 +262,52 @@ The roundcube service stores configurations in a database. - ``ROUNDCUBE_DB_PW``: the database password for roundcube service. (when not ``sqlite``) - ``ROUNDCUBE_DB_USER``: the database user for roundcube service. (when not ``sqlite``) - ``ROUNDCUBE_DB_NAME``: the database name for roundcube service. (when not ``sqlite``) + +.. _webmail_settings + +Webmail settings +---------------- + + +When using roundcube it is possible to select the plugins to be enabled by setting ``ROUNDCUBE_PLUGINS`` to +a comma separated list of plugin-names. Included plugins are: + +- acl (needs configuration) +- additional_message_headers (needs configuration) +- archive +- attachment_reminder +- carddav +- database_attachmentsi +- debug_logger +- emoticons +- enigma +- help +- hide_blockquote +- identicon +- identity_select +- jqueryui +- mailu +- managesieve +- markasjunk +- new_user_dialog +- newmail_notifier +- reconnect +- show_additional_headers (needs configuration) +- subscriptions_option +- vcard_attachments +- zipdownload + +If ``ROUNDCUBE_PLUGINS`` is not set the following plugins are enabled by default: + +- archive +- carddav +- enigma +- mailu +- managesieve +- markasjunk +- zipdownload + +To disable all plugins just set ``ROUNDCUBE_PLUGINS`` to ``mailu``. + +To configure a plugin add php files named ``*.inc`` to roundcube's :ref:`override section `. + diff --git a/setup/flavors/compose/docker-compose.yml b/setup/flavors/compose/docker-compose.yml index 18a881b8..500e99d6 100644 --- a/setup/flavors/compose/docker-compose.yml +++ b/setup/flavors/compose/docker-compose.yml @@ -147,6 +147,7 @@ services: env_file: {{ env }} volumes: - "{{ root }}/webmail:/data" + - "{{ root }}/overrides/{{ webmail_type }}:/overrides:ro" depends_on: - imap {% endif %} diff --git a/setup/flavors/stack/docker-compose.yml b/setup/flavors/stack/docker-compose.yml index 0c744d7e..99e348ea 100644 --- a/setup/flavors/stack/docker-compose.yml +++ b/setup/flavors/stack/docker-compose.yml @@ -123,6 +123,7 @@ services: env_file: {{ env }} volumes: - "{{ root }}/webmail:/data" + - "{{ root }}/overrides/{{ webmail_type }}:/overrides:ro" deploy: replicas: 1 healthcheck: diff --git a/webmails/roundcube/Dockerfile b/webmails/roundcube/Dockerfile index e2ce7eae..7584b558 100644 --- a/webmails/roundcube/Dockerfile +++ b/webmails/roundcube/Dockerfile @@ -57,7 +57,10 @@ RUN set -eu \ && chown www-data:www-data logs temp \ && chmod -R a+rX . \ && a2enmod rewrite deflate expires headers \ - && echo date.timezone=${TZ} > /usr/local/etc/php/conf.d/timezone.ini + && echo date.timezone=${TZ} > /usr/local/etc/php/conf.d/timezone.ini \ + && rm -rf plugins/{autologon,example_addressbook,http_authentication,krb_authentication,new_user_identity,password,redundant_attachments,squirrelmail_usercopy,userinfo,virtuser_file,virtuser_query} + +# enable database_attachments (and memcache?) COPY mailu.php /var/www/html/plugins/mailu/mailu.php COPY php.ini / @@ -65,7 +68,8 @@ COPY config.inc.php / COPY start.py / EXPOSE 80/tcp -VOLUME ["/data"] +VOLUME /data +VOLUME /overrides CMD /start.py diff --git a/webmails/roundcube/config.inc.php b/webmails/roundcube/config.inc.php index 67a8065d..e5a7e3c6 100644 --- a/webmails/roundcube/config.inc.php +++ b/webmails/roundcube/config.inc.php @@ -55,6 +55,11 @@ $config['sso_logout_url'] = '/sso/logout'; // configure enigma gpg plugin $config['enigma_pgp_homedir'] = '/data/gpg'; -// Set From header for DKIM signed message delivery reports +// set From header for DKIM signed message delivery reports $config['mdn_use_from'] = true; +// includes +{%- for inc in INCLUDES %} +include('{{ inc }}'); +{%- endfor %} + diff --git a/webmails/roundcube/start.py b/webmails/roundcube/start.py index 0a1dacaf..13cbdd42 100755 --- a/webmails/roundcube/start.py +++ b/webmails/roundcube/start.py @@ -59,6 +59,9 @@ else: context["PLUGINS"] = ",".join(f"'{p}'" for p in plugins) +# add overrides +context["INCLUDES"] = sorted(inc for inc in os.listdir("/overrides") if inc.endswith(".inc")) if os.path.isdir("/overrides") else [] + # create config files conf.jinja("/php.ini", context, "/usr/local/etc/php/conf.d/roundcube.ini") conf.jinja("/config.inc.php", context, "/var/www/html/config/config.inc.php")