diff --git a/docker/collabora/Dockerfile b/docker/collabora/Dockerfile new file mode 100644 index 00000000..08f5a799 --- /dev/null +++ b/docker/collabora/Dockerfile @@ -0,0 +1,65 @@ +FROM almalinux:8 + +LABEL maintainer="contact@apheleia-it.ch" +LABEL dist=centos8 +LABEL tier=${TIER} + +ENV DISTRO=centos8 +ENV LANG=en_US.utf8 +ENV LC_ALL=en_US.utf8 + +# Add EPEL. +RUN dnf -y install dnf-plugin-config-manager && \ + dnf config-manager --set-enabled powertools && \ + dnf -y install epel-release && \ + dnf -y install iputils vim-enhanced bind-utils && \ + dnf clean all +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 + +ARG CUSTOMER_HASH + +RUN id cool || (groupadd -g 1001 cool && useradd -d /opt/cool/ -u 1001 -g 1001 cool) +RUN rpm --import "https://collaboraoffice.com/repos/CollaboraOnline/22.05/customer-centos8-$CUSTOMER_HASH/repodata/repomd.xml.key" && \ + dnf config-manager --add-repo "https://collaboraoffice.com/repos/CollaboraOnline/22.05/customer-centos8-$CUSTOMER_HASH" && \ + dnf -y --setopt tsflags= install \ + openssl \ + xmlstarlet \ + collabora-online-brand \ + coolwsd \ + collaboraoffice-dict-de \ + collaboraofficebasis-de \ + collaboraoffice-dict-en \ + collaboraofficebasis-en-GB \ + collaboraoffice-dict-es \ + collaboraofficebasis-es \ + collaboraoffice-dict-fr \ + collaboraofficebasis-fr \ + collaboraoffice-dict-it \ + collaboraofficebasis-it \ + collaboraoffice-dict-nl \ + collaboraofficebasis-nl \ + collaboraoffice-dict-pt-BR \ + collaboraofficebasis-pt-BR \ + collaboraoffice-dict-pt-PT \ + collaboraofficebasis-pt \ + collaboraoffice-dict-ru \ + collaboraofficebasis-ru && \ + dnf clean all + +RUN sed -i -r -e 's/^SELINUX=.*$/SELINUX=permissive/g' /etc/selinux/config 2>/dev/null || : + +RUN setcap cap_fowner,cap_chown,cap_mknod,cap_sys_chroot=ep /usr/bin/coolforkit && \ + setcap cap_sys_admin=ep /usr/bin/coolmount + +WORKDIR /opt/cool/ + +ADD init.sh /init.sh + +RUN chown -R 1001:0 /etc/coolwsd /opt/ && \ + chmod -R g=u /etc/coolwsd /opt/ + +USER 1001 + +CMD ["/init.sh"] + +EXPOSE 9980 diff --git a/docker/collabora/init.sh b/docker/collabora/init.sh new file mode 100755 index 00000000..164f3af5 --- /dev/null +++ b/docker/collabora/init.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +xmlstarlet edit -L --update "/config/ssl/enable" --value "false" /etc/coolwsd/coolwsd.xml +xmlstarlet edit -L --update "/config/ssl/termination" --value "true" /etc/coolwsd/coolwsd.xml +xmlstarlet edit -L --update "/config/admin_console/enable" --value "false" /etc/coolwsd/coolwsd.xml +xmlstarlet edit -L --update "/config/storage/wopi/host[text()='localhost']" --value ".*" /etc/coolwsd/coolwsd.xml + +mkdir -p /tmp/ssl/ +pushd /tmp/ssl/ +mkdir -p certs/ca +openssl rand -writerand /opt/cool/.rnd +openssl genrsa -out certs/ca/root.key.pem 2048 +openssl req -x509 -new -nodes -key certs/ca/root.key.pem -days 9131 -out certs/ca/root.crt.pem -subj "/C=DE/ST=BW/L=Stuttgart/O=Dummy Authority/CN=Dummy Authority" +mkdir -p certs/servers +mkdir -p certs/tmp +mkdir -p certs/servers/localhost +openssl genrsa -out certs/servers/localhost/privkey.pem 2048 +if test "${cert_domain-set}" = set; then +openssl req -key certs/servers/localhost/privkey.pem -new -sha256 -out certs/tmp/localhost.csr.pem -subj "/C=DE/ST=BW/L=Stuttgart/O=Dummy Authority/CN=localhost" +else +openssl req -key certs/servers/localhost/privkey.pem -new -sha256 -out certs/tmp/localhost.csr.pem -subj "/C=DE/ST=BW/L=Stuttgart/O=Dummy Authority/CN=${cert_domain}" +fi +openssl x509 -req -in certs/tmp/localhost.csr.pem -CA certs/ca/root.crt.pem -CAkey certs/ca/root.key.pem -CAcreateserial -out certs/servers/localhost/cert.pem -days 9131 +mv -f certs/servers/localhost/privkey.pem /etc/coolwsd/key.pem +mv -f certs/servers/localhost/cert.pem /etc/coolwsd/cert.pem +mv -f certs/ca/root.crt.pem /etc/coolwsd/ca-chain.cert.pem +popd + +exec /usr/bin/coolwsd --version --o:sys_template_path=/opt/cool/systemplate --o:child_root_path=/opt/cool/child-roots --o:file_server_root_path=/usr/share/coolwsd --o:logging.color=false --o:stop_on_config_change=true diff --git a/docker/roundcube/rootfs/etc/roundcubemail/config.inc.php b/docker/roundcube/rootfs/etc/roundcubemail/config.inc.php index ea93674f..9cbb3577 100644 --- a/docker/roundcube/rootfs/etc/roundcubemail/config.inc.php +++ b/docker/roundcube/rootfs/etc/roundcubemail/config.inc.php @@ -1,255 +1,256 @@ = 5.6 $config['imap_conn_options'] = [ 'ssl' => [ 'verify_peer_name' => false, 'verify_peer' => false, 'allow_self_signed' => true ], 'proxy_protocol' => getenv('IMAP_PROXY_PROTOCOL') ]; $config['proxy_whitelist'] = ['127.0.0.1', '172.18.0.7']; // Caching and storage settings $config['imap_cache'] = 'db'; $config['imap_cache_ttl'] = '10d'; $config['messages_cache'] = 'db'; $config['message_cache_ttl'] = '10d'; $config['session_storage'] = 'db'; // SMTP Server Settings $config['smtp_server'] = getenv('MAIL_HOST'); $config['smtp_port'] = getenv('MAIL_PORT'); $config['smtp_user'] = '%u'; $config['smtp_pass'] = '%p'; $config['smtp_helo_host'] = $_SERVER["HTTP_HOST"] ?? null; // SMTP Connection TLS settings, adjust for Production // Required for PHP >= 5.6 $config['smtp_conn_options'] = Array( 'ssl' => Array( 'verify_peer_name' => false, 'verify_peer' => false, 'allow_self_signed' => true ) ); // LDAP Settings $config['ldap_cache'] = 'db'; $config['ldap_cache_ttl'] = '1h'; // Kolab specific defaults $config['product_name'] = 'Kolab Groupware'; $config['quota_zero_as_unlimited'] = false; $config['login_lc'] = 2; $config['auto_create_user'] = true; $config['enable_installer'] = false; // The SMTP server does not allow empty identities $config['mdn_use_from'] = true; // Plugins $config['plugins'] = array( 'kolab_auth', 'acl', 'archive', 'calendar', 'jqueryui', 'kolab_activesync', 'kolab_addressbook', 'kolab_config', 'kolab_delegation', 'kolab_files', 'kolab_folders', 'kolab_notes', 'kolab_tags', 'managesieve', 'newmail_notifier', 'odfviewer', 'password', 'redundant_attachments', 'tasklist', // contextmenu must be after kolab_addressbook (#444) 'contextmenu', 'enigma', ); // Do not show deleted messages, mark deleted messages as read, // and flag them as deleted instead of moving them to the Trash // folder. $config['skip_deleted'] = true; $config['read_when_deleted'] = true; $config['flag_for_deletion'] = true; $config['delete_always'] = true; $config['session_lifetime'] = 180; $config['password_charset'] = 'UTF-8'; $config['useragent'] = 'Kolab 16/Roundcube ' . RCUBE_VERSION; $config['message_sort_col'] = 'date'; $config['spellcheck_engine'] = 'pspell'; $config['spellcheck_dictionary'] = true; $config['spellcheck_ignore_caps'] = true; $config['spellcheck_ignore_nums'] = true; $config['spellcheck_ignore_syms'] = true; $config['spellcheck_languages'] = array( 'da' => 'Dansk', 'de' => 'Deutsch', 'en' => 'English', 'es' => 'Español', 'fr' => 'Français', 'it' => 'Italiano', 'nl' => 'Nederlands', 'pt' => 'Português', 'ru' => 'Русский', 'sv' => 'Svenska' ); $config['undo_timeout'] = 10; $config['upload_progress'] = 2; $config['address_template'] = '{street}
{locality} {zipcode}
{country} {region}'; $config['preview_pane'] = true; $config['preview_pane_mark_read'] = 0; $config['autoexpand_threads'] = 2; $config['top_posting'] = 0; $config['sig_above'] = false; $config['mdn_requests'] = 0; $config['mdn_default'] = false; $config['dsn_default'] = false; $config['reply_same_folder'] = false; if (file_exists(RCUBE_CONFIG_DIR . '/' . ($_SERVER["HTTP_HOST"] ?? null) . '/' . basename(__FILE__))) { include_once(RCUBE_CONFIG_DIR . '/' . ($_SERVER["HTTP_HOST"] ?? null) . '/' . basename(__FILE__)); } // Re-apply mandatory settings here. $config['debug_level'] = 1; $config['devel_mode'] = false; $config['log_driver'] = 'file'; $config['log_date_format'] = 'd-M-Y H:i:s,u O'; $config['syslog_id'] = 'roundcube'; $config['syslog_facility'] = LOG_USER; $config['smtp_log'] = false; $config['log_logins'] = true; $config['log_session'] = false; $config['sql_debug'] = false; $config['memcache_debug'] = false; $config['imap_debug'] = false; $config['ldap_debug'] = false; $config['smtp_debug'] = false; $config['skin'] = 'kolab'; $config['skin_include_php'] = false; $config['mime_magic'] = null; $config['im_identify_path'] = '/usr/bin/identify'; $config['im_convert_path'] = '/usr/bin/convert'; $config['log_dir'] = 'logs/'; #$config['temp_dir'] = '/var/lib/roundcubemail/'; // Some additional default folders (archive plugin) $config['archive_mbox'] = 'Archive'; // The Kolab daemon by default creates 'Spam' $config['junk_mbox'] = 'Spam'; $config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Spam', 'Trash', 'Archive'); $config['address_book_type'] = 'ldap'; $config['autocomplete_min_length'] = 3; $config['autocomplete_threads'] = 0; $config['autocomplete_max'] = 15; $config['ldap_public'] = array( 'kolab_addressbook' => array( 'name' => 'Global Address Book', 'hosts' => Array(getenv('LDAP_HOST')), 'port' => 389, 'use_tls' => false, 'base_dn' => 'dc=hosted,dc=com', 'user_specific' => true, 'bind_dn' => '%dn', 'bind_pass' => '', 'search_base_dn' => 'dc=hosted,dc=com', 'search_bind_dn' => 'uid=kolab-service,ou=Special Users,dc=mgmt,dc=com', 'search_bind_pw' => getenv('LDAP_SERVICE_BIND_PW'), 'search_filter' => '(&(objectClass=inetorgperson)(mail=%fu))', 'writable' => false, 'LDAP_Object_Classes' => array("top", "inetorgperson"), 'required_fields' => array("cn", "sn", "mail"), 'LDAP_rdn' => 'uid', 'ldap_version' => 3, // using LDAPv3 'search_fields' => array('displayname', 'mail'), 'sort' => array('displayname', 'sn', 'givenname', 'cn'), 'scope' => 'sub', 'filter' => '(objectClass=inetorgperson)', 'vlv' => true, 'vlv_search' => true, 'fuzzy_search' => true, 'sizelimit' => '0', 'timelimit' => '0', 'fieldmap' => Array( // Roundcube => LDAP 'name' => 'displayName', 'surname' => 'sn', 'firstname' => 'givenName', 'middlename' => 'initials', 'email:primary' => 'mail', 'email:alias' => 'alias', 'email:personal' => 'mailalternateaddress', 'phone:main' => 'telephoneNumber', 'phone:work' => 'alternateTelephoneNumber', 'phone:mobile' => 'mobile', 'phone:work2' => 'blackberry', 'jobtitle' => 'title', 'manager' => 'manager', 'assistant' => 'secretary', 'photo' => 'jpegphoto' ), 'groups' => Array( 'base_dn' => 'dc=hosted,dc=com', 'filter' => '(&' . '(|(objectclass=groupofuniquenames)(objectclass=groupofurls))' . '(mail=*))', 'object_classes' => Array("top", "groupOfUniqueNames"), 'member_attr' => 'uniqueMember', ), ), ); $config['autocomplete_addressbooks'] = Array( 'kolab_addressbook' ); $config['autocomplete_single'] = true; $config['htmleditor'] = 0; $config['kolab_http_request'] = Array( 'ssl_verify_host' => false, 'ssl_verify_peer' => false, ); @include('kolab_syncroton.inc.php'); - ?>