From 61d009f18d5886db8b22ae41e04bb41a4ba2fddb Mon Sep 17 00:00:00 2001 From: Quentin Date: Sat, 1 Jun 2019 16:02:49 +0200 Subject: Initial commit --- consul/configuration/.gitignore | 27 ++ .../configuration/chat/coturn/turnserver.conf.tpl | 19 + consul/configuration/chat/riot_web/config.json | 23 ++ .../chat/synapse/conf.d/report_stats.yaml | 1 + .../chat/synapse/conf.d/server_name.yaml | 1 + consul/configuration/chat/synapse/homeserver.yaml | 405 +++++++++++++++++++++ consul/configuration/chat/synapse/log.yaml | 41 +++ consul/configuration/email/dkim/keytable | 1 + consul/configuration/email/dkim/signingtable | 2 + .../configuration/email/dkim/smtp.private.sample | 0 consul/configuration/email/dkim/smtp.txt.sample | 0 consul/configuration/email/dkim/trusted | 4 + consul/configuration/email/dovecot/certs.gen | 13 + .../email/dovecot/dovecot-ldap.conf.sample | 8 + consul/configuration/email/postfix/certs.gen | 13 + consul/configuration/email/postfix/dynamicmaps.cf | 9 + consul/configuration/email/postfix/header_checks | 3 + .../email/postfix/ldap-account.cf.sample | 12 + .../email/postfix/ldap-alias.cf.sample | 9 + consul/configuration/email/postfix/main.cf | 107 ++++++ consul/configuration/email/postfix/master.cf | 114 ++++++ consul/configuration/email/postfix/transport | 5 + consul/configuration/email/postfix/transport.db | Bin 0 -> 12288 bytes consul/configuration/email/sogo/sogo.conf.tpl | 68 ++++ consul/configuration/mariadb/main/env.tpl | 6 + consul/configuration/postgres/keeper/env.tpl | 3 + .../configuration/seafile/ccnet/mykey.peer.sample | 0 consul/configuration/seafile/ccnet/seafile.ini | 1 + .../configuration/seafile/conf/ccnet.conf.sample | 29 ++ .../configuration/seafile/conf/mykey.peer.sample | 0 consul/configuration/seafile/conf/seafdav.conf | 5 + .../configuration/seafile/conf/seafile.conf.sample | 19 + .../seafile/conf/seahub_settings.py.sample | 21 ++ consul/configuration/traefik/cloudflare.env.sample | 2 + consul/configuration/traefik/traefik.toml.sample | 53 +++ consul/restore_configuration.sh | 7 + consul/secrets/.gitignore | 10 + consul/secrets/chat/coturn/static-auth.sample | 0 .../secrets/chat/synapse/homeserver.tls.crt.sample | 0 .../secrets/chat/synapse/homeserver.tls.dh.sample | 0 .../secrets/chat/synapse/homeserver.tls.key.sample | 0 consul/secrets/chat/synapse/ldap_binddn.sample | 0 consul/secrets/chat/synapse/ldap_bindpw.sample | 0 consul/secrets/chat/synapse/postgres_db.sample | 0 consul/secrets/chat/synapse/postgres_pwd.sample | 0 consul/secrets/chat/synapse/postgres_user.sample | 0 .../chat/synapse/registration_shared_secret.sample | 0 consul/secrets/email/sogo/ldap_binddn.sample | 0 consul/secrets/email/sogo/ldap_bindpw.sample | 0 consul/secrets/email/sogo/postgre_auth.sample | 0 consul/secrets/mariadb/main/ldap_binddn.sample | 0 consul/secrets/mariadb/main/ldap_bindpwd.sample | 0 consul/secrets/mariadb/main/mysql_pwd.sample | 0 consul/secrets/postgres/keeper/pg_repl_pwd.sample | 0 .../postgres/keeper/pg_repl_username.sample | 0 consul/secrets/postgres/keeper/pg_su_pwd.sample | 0 56 files changed, 1041 insertions(+) create mode 100644 consul/configuration/.gitignore create mode 100644 consul/configuration/chat/coturn/turnserver.conf.tpl create mode 100644 consul/configuration/chat/riot_web/config.json create mode 100644 consul/configuration/chat/synapse/conf.d/report_stats.yaml create mode 100644 consul/configuration/chat/synapse/conf.d/server_name.yaml create mode 100644 consul/configuration/chat/synapse/homeserver.yaml create mode 100644 consul/configuration/chat/synapse/log.yaml create mode 100644 consul/configuration/email/dkim/keytable create mode 100644 consul/configuration/email/dkim/signingtable create mode 100644 consul/configuration/email/dkim/smtp.private.sample create mode 100644 consul/configuration/email/dkim/smtp.txt.sample create mode 100644 consul/configuration/email/dkim/trusted create mode 100755 consul/configuration/email/dovecot/certs.gen create mode 100644 consul/configuration/email/dovecot/dovecot-ldap.conf.sample create mode 100755 consul/configuration/email/postfix/certs.gen create mode 100644 consul/configuration/email/postfix/dynamicmaps.cf create mode 100644 consul/configuration/email/postfix/header_checks create mode 100644 consul/configuration/email/postfix/ldap-account.cf.sample create mode 100644 consul/configuration/email/postfix/ldap-alias.cf.sample create mode 100644 consul/configuration/email/postfix/main.cf create mode 100644 consul/configuration/email/postfix/master.cf create mode 100644 consul/configuration/email/postfix/transport create mode 100644 consul/configuration/email/postfix/transport.db create mode 100644 consul/configuration/email/sogo/sogo.conf.tpl create mode 100644 consul/configuration/mariadb/main/env.tpl create mode 100644 consul/configuration/postgres/keeper/env.tpl create mode 100644 consul/configuration/seafile/ccnet/mykey.peer.sample create mode 100644 consul/configuration/seafile/ccnet/seafile.ini create mode 100644 consul/configuration/seafile/conf/ccnet.conf.sample create mode 100644 consul/configuration/seafile/conf/mykey.peer.sample create mode 100644 consul/configuration/seafile/conf/seafdav.conf create mode 100644 consul/configuration/seafile/conf/seafile.conf.sample create mode 100644 consul/configuration/seafile/conf/seahub_settings.py.sample create mode 100644 consul/configuration/traefik/cloudflare.env.sample create mode 100644 consul/configuration/traefik/traefik.toml.sample create mode 100755 consul/restore_configuration.sh create mode 100644 consul/secrets/.gitignore create mode 100644 consul/secrets/chat/coturn/static-auth.sample create mode 100644 consul/secrets/chat/synapse/homeserver.tls.crt.sample create mode 100644 consul/secrets/chat/synapse/homeserver.tls.dh.sample create mode 100644 consul/secrets/chat/synapse/homeserver.tls.key.sample create mode 100644 consul/secrets/chat/synapse/ldap_binddn.sample create mode 100644 consul/secrets/chat/synapse/ldap_bindpw.sample create mode 100644 consul/secrets/chat/synapse/postgres_db.sample create mode 100644 consul/secrets/chat/synapse/postgres_pwd.sample create mode 100644 consul/secrets/chat/synapse/postgres_user.sample create mode 100644 consul/secrets/chat/synapse/registration_shared_secret.sample create mode 100644 consul/secrets/email/sogo/ldap_binddn.sample create mode 100644 consul/secrets/email/sogo/ldap_bindpw.sample create mode 100644 consul/secrets/email/sogo/postgre_auth.sample create mode 100644 consul/secrets/mariadb/main/ldap_binddn.sample create mode 100644 consul/secrets/mariadb/main/ldap_bindpwd.sample create mode 100644 consul/secrets/mariadb/main/mysql_pwd.sample create mode 100644 consul/secrets/postgres/keeper/pg_repl_pwd.sample create mode 100644 consul/secrets/postgres/keeper/pg_repl_username.sample create mode 100644 consul/secrets/postgres/keeper/pg_su_pwd.sample (limited to 'consul') diff --git a/consul/configuration/.gitignore b/consul/configuration/.gitignore new file mode 100644 index 0000000..bc3a54e --- /dev/null +++ b/consul/configuration/.gitignore @@ -0,0 +1,27 @@ +# Blacklist everything cleverly +* +!*/ + +# Whitelist some patterns +!*.sample +!*.gen +!*.tpl +!.gitignore + +# Whitelist specific files +!seafile/conf/seafdav.conf +!seafile/ccnet/seafile.ini + +!email/dkim/keytable +!email/dkim/signingtable +!email/dkim/trusted +!email/postfix/dynamicmaps.cf +!email/postfix/header_checks +!email/postfix/main.cf +!email/postfix/master.cf +!email/postfix/transport +!email/postfix/transport.db + +!email/sogo/sogo.conf.tpl + +!chat/**/* diff --git a/consul/configuration/chat/coturn/turnserver.conf.tpl b/consul/configuration/chat/coturn/turnserver.conf.tpl new file mode 100644 index 0000000..f867ac0 --- /dev/null +++ b/consul/configuration/chat/coturn/turnserver.conf.tpl @@ -0,0 +1,19 @@ +use-auth-secret +static-auth-secret={{ key "secrets/chat/coturn/static-auth" | trimSpace }} +realm=turn.deuxfleurs.fr + +# VoIP traffic is all UDP. There is no reason to let users connect to arbitrary TCP endpoints via the relay. +#no-tcp-relay + +# don't let the relay ever try to connect to private IP address ranges within your network (if any) +# given the turn server is likely behind your firewall, remember to include any privileged public IPs too. +#denied-peer-ip=10.0.0.0-10.255.255.255 +#denied-peer-ip=192.168.0.0-192.168.255.255 +#denied-peer-ip=172.16.0.0-172.31.255.255 + +# consider whether you want to limit the quota of relayed streams per user (or total) to avoid risk of DoS. +user-quota=12 # 4 streams per video call, so 12 streams = 3 simultaneous relayed calls per user. +total-quota=1200 + +min-port=49152 +max-port=49252 diff --git a/consul/configuration/chat/riot_web/config.json b/consul/configuration/chat/riot_web/config.json new file mode 100644 index 0000000..cfa94fe --- /dev/null +++ b/consul/configuration/chat/riot_web/config.json @@ -0,0 +1,23 @@ +{ + "default_hs_url": "https://im.deuxfleurs.fr", + "default_is_url": "https://vector.im", + "disable_custom_urls": false, + "disable_guests": false, + "disable_login_language_selector": false, + "disable_3pid_login": false, + "brand": "Deuxfleurs", + "integrations_ui_url": "https://scalar.vector.im/", + "integrations_rest_url": "https://scalar.vector.im/api", + "integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html", + "bug_report_endpoint_url": "https://riot.im/bugreports/submit", + "features": { + "feature_groups": "labs", + "feature_pinning": "labs" + }, + "default_federate": true, + "welcomePageUrl": "home.html", + "default_theme": "light", + "roomDirectory": { + "servers": [ "im.deuxfleurs.fr", "matrix.org" ] + } +} diff --git a/consul/configuration/chat/synapse/conf.d/report_stats.yaml b/consul/configuration/chat/synapse/conf.d/report_stats.yaml new file mode 100644 index 0000000..cb95cc3 --- /dev/null +++ b/consul/configuration/chat/synapse/conf.d/report_stats.yaml @@ -0,0 +1 @@ +report_stats: true diff --git a/consul/configuration/chat/synapse/conf.d/server_name.yaml b/consul/configuration/chat/synapse/conf.d/server_name.yaml new file mode 100644 index 0000000..540ce45 --- /dev/null +++ b/consul/configuration/chat/synapse/conf.d/server_name.yaml @@ -0,0 +1 @@ +server_name: deuxfleurs.fr diff --git a/consul/configuration/chat/synapse/homeserver.yaml b/consul/configuration/chat/synapse/homeserver.yaml new file mode 100644 index 0000000..119dd7c --- /dev/null +++ b/consul/configuration/chat/synapse/homeserver.yaml @@ -0,0 +1,405 @@ +# vim:ft=yaml + +server_name: "deuxfleurs.fr" +# PEM encoded X509 certificate for TLS. +# You can replace the self-signed certificate that synapse +# autogenerates on launch with your own SSL certificate + key pair +# if you like. Any required intermediary certificates can be +# appended after the primary certificate in hierarchical order. +tls_certificate_path: "/etc/matrix-synapse/homeserver.tls.crt" + +# PEM encoded private key for TLS +tls_private_key_path: "/etc/matrix-synapse/homeserver.tls.key" + +# PEM dh parameters for ephemeral keys +tls_dh_params_path: "/etc/matrix-synapse/homeserver.tls.dh" + +# Don't bind to the https port +no_tls: True + + +## Server ## + +# When running as a daemon, the file to store the pid in +pid_file: "/var/run/matrix-synapse.pid" + +# Whether to serve a web client from the HTTP/HTTPS root resource. +web_client: False + +# The public-facing base URL for the client API (not including _matrix/...) +public_baseurl: https://im.deuxfleurs.fr/ + +# Set the soft limit on the number of file descriptors synapse can use +# Zero is used to indicate synapse should set the soft limit to the +# hard limit. +soft_file_limit: 0 + +# The GC threshold parameters to pass to `gc.set_threshold`, if defined +# gc_thresholds: [700, 10, 10] + +# A list of other Home Servers to fetch the public room directory from +# and include in the public room directory of this home server +# This is a temporary stopgap solution to populate new server with a +# list of rooms until there exists a good solution of a decentralized +# room directory. +# secondary_directory_servers: +# - matrix.org +# - vector.im + +# List of ports that Synapse should listen on, their purpose and their +# configuration. +listeners: + # Unsecure HTTP listener, + # For when matrix traffic passes through loadbalancer that unwraps TLS. + - port: 8008 + tls: false + bind_address: '' + type: http + + x_forwarded: false + + resources: + - names: [client] + compress: true + - names: [federation] + compress: false + + # Turn on the twisted ssh manhole service on localhost on the given + # port. + # - port: 9000 + # bind_address: 127.0.0.1 + # type: manhole + + +# Database configuration +database: + name: psycopg2 + args: + user: {{ key "secrets/chat/synapse/postgres_user" | trimSpace }} + password: {{ key "secrets/chat/synapse/postgres_pwd" | trimSpace }} + database: {{ key "secrets/chat/synapse/postgres_db" | trimSpace }} + host: psql-proxy.service.2.cluster.deuxfleurs.fr + port: 5432 + cp_min: 5 + cp_max: 10 +# Number of events to cache in memory. +event_cache_size: "10K" + + +# A yaml python logging config file +log_config: "/etc/matrix-synapse/log.yaml" + +# Stop twisted from discarding the stack traces of exceptions in +# deferreds by waiting a reactor tick before running a deferred's +# callbacks. +# full_twisted_stacktraces: true + + +## Ratelimiting ## + +# Number of messages a client can send per second +rc_messages_per_second: 0.2 + +# Number of message a client can send before being throttled +rc_message_burst_count: 10.0 + +# The federation window size in milliseconds +federation_rc_window_size: 1000 + +# The number of federation requests from a single server in a window +# before the server will delay processing the request. +federation_rc_sleep_limit: 10 + +# The duration in milliseconds to delay processing events from +# remote servers by if they go over the sleep limit. +federation_rc_sleep_delay: 500 + +# The maximum number of concurrent federation requests allowed +# from a single server +federation_rc_reject_limit: 50 + +# The number of federation requests to concurrently process from a +# single server +federation_rc_concurrent: 3 + + + +# Directory where uploaded images and attachments are stored. +media_store_path: "/var/lib/matrix-synapse/media" +uploads_path: "/var/lib/matrix-synapse/uploads" + +# The largest allowed upload size in bytes +max_upload_size: "100M" + +# Maximum number of pixels that will be thumbnailed +max_image_pixels: "32M" + +# Whether to generate new thumbnails on the fly to precisely match +# the resolution requested by the client. If true then whenever +# a new resolution is requested by the client the server will +# generate a new thumbnail. If false the server will pick a thumbnail +# from a precalculated list. +dynamic_thumbnails: false + +# List of thumbnail to precalculate when an image is uploaded. +thumbnail_sizes: +- width: 32 + height: 32 + method: crop +- width: 96 + height: 96 + method: crop +- width: 320 + height: 240 + method: scale +- width: 640 + height: 480 + method: scale +- width: 800 + height: 600 + method: scale + +# Is the preview URL API enabled? If enabled, you *must* specify +# an explicit url_preview_ip_range_blacklist of IPs that the spider is +# denied from accessing. +url_preview_enabled: True + +# List of IP address CIDR ranges that the URL preview spider is denied +# from accessing. There are no defaults: you must explicitly +# specify a list for URL previewing to work. You should specify any +# internal services in your network that you do not want synapse to try +# to connect to, otherwise anyone in any Matrix room could cause your +# synapse to issue arbitrary GET requests to your internal services, +# causing serious security issues. +# +url_preview_ip_range_blacklist: + - '127.0.0.0/8' + - '10.0.0.0/8' + - '172.16.0.0/12' + - '192.168.0.0/16' +# +# List of IP address CIDR ranges that the URL preview spider is allowed +# to access even if they are specified in url_preview_ip_range_blacklist. +# This is useful for specifying exceptions to wide-ranging blacklisted +# target IP ranges - e.g. for enabling URL previews for a specific private +# website only visible in your network. +# +# url_preview_ip_range_whitelist: +# - '192.168.1.1' + +# Optional list of URL matches that the URL preview spider is +# denied from accessing. You should use url_preview_ip_range_blacklist +# in preference to this, otherwise someone could define a public DNS +# entry that points to a private IP address and circumvent the blacklist. +# This is more useful if you know there is an entire shape of URL that +# you know that will never want synapse to try to spider. +# +# Each list entry is a dictionary of url component attributes as returned +# by urlparse.urlsplit as applied to the absolute form of the URL. See +# https://docs.python.org/2/library/urlparse.html#urlparse.urlsplit +# The values of the dictionary are treated as an filename match pattern +# applied to that component of URLs, unless they start with a ^ in which +# case they are treated as a regular expression match. If all the +# specified component matches for a given list item succeed, the URL is +# blacklisted. +# +# url_preview_url_blacklist: +# # blacklist any URL with a username in its URI +# - username: '*' +# +# # blacklist all *.google.com URLs +# - netloc: 'google.com' +# - netloc: '*.google.com' +# +# # blacklist all plain HTTP URLs +# - scheme: 'http' +# +# # blacklist http(s)://www.acme.com/foo +# - netloc: 'www.acme.com' +# path: '/foo' +# +# # blacklist any URL with a literal IPv4 address +# - netloc: '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' + +# The largest allowed URL preview spidering size in bytes +max_spider_size: "10M" + + + + +## Captcha ## + +# This Home Server's ReCAPTCHA public key. +recaptcha_public_key: "YOUR_PUBLIC_KEY" + +# This Home Server's ReCAPTCHA private key. +recaptcha_private_key: "YOUR_PRIVATE_KEY" + +# Enables ReCaptcha checks when registering, preventing signup +# unless a captcha is answered. Requires a valid ReCaptcha +# public/private key. +enable_registration_captcha: False + +# A secret key used to bypass the captcha test entirely. +#captcha_bypass_secret: "YOUR_SECRET_HERE" + +# The API endpoint to use for verifying m.login.recaptcha responses. +recaptcha_siteverify_api: "https://www.google.com/recaptcha/api/siteverify" + + +## Turn ## + +# The public URIs of the TURN server to give to clients +turn_uris: [ "turn:turn.deuxfleurs.fr:3478?transport=udp", "turn:turn.deuxfleurs.fr:3478?transport=tcp" ] + +# The shared secret used to compute passwords for the TURN server +turn_shared_secret: '{{ key "secrets/chat/coturn/static-auth" | trimSpace }}' + +# How long generated TURN credentials last +turn_user_lifetime: "1h" + +turn_allow_guests: True + +## Registration ## + +# Enable registration for new users. +enable_registration: False + +# If set, allows registration by anyone who also has the shared +# secret, even if registration is otherwise disabled. +registration_shared_secret: '{{ key "secrets/chat/synapse/registration_shared_secret" | trimSpace }}' + +# Sets the expiry for the short term user creation in +# milliseconds. For instance the bellow duration is two weeks +# in milliseconds. +user_creation_max_duration: 1209600000 + +# Set the number of bcrypt rounds used to generate password hash. +# Larger numbers increase the work factor needed to generate the hash. +# The default number of rounds is 12. +bcrypt_rounds: 12 + +# Allows users to register as guests without a password/email/etc, and +# participate in rooms hosted on this server which have been made +# accessible to anonymous users. +allow_guest_access: True + +# The list of identity servers trusted to verify third party +# identifiers by this server. +trusted_third_party_id_servers: + - matrix.org + - vector.im + + +## Metrics ### + +# Enable collection and rendering of performance metrics +enable_metrics: False + +## API Configuration ## + +# A list of event types that will be included in the room_invite_state +room_invite_state_types: + - "m.room.join_rules" + - "m.room.canonical_alias" + - "m.room.avatar" + - "m.room.name" + + +# A list of application service config file to use +app_service_config_files: [] + + +# macaroon_secret_key: + +# Used to enable access token expiration. +expire_access_token: False + +## Signing Keys ## + +# Path to the signing key to sign messages with +signing_key_path: "/etc/matrix-synapse/homeserver.signing.key" + +# The keys that the server used to sign messages with but won't use +# to sign new messages. E.g. it has lost its private key +old_signing_keys: {} +# "ed25519:auto": +# # Base64 encoded public key +# key: "The public part of your old signing key." +# # Millisecond POSIX timestamp when the key expired. +# expired_ts: 123456789123 + +# How long key response published by this server is valid for. +# Used to set the valid_until_ts in /key/v2 APIs. +# Determines how quickly servers will query to check which keys +# are still valid. +key_refresh_interval: "1d" # 1 Day. + +# The trusted servers to download signing keys from. +perspectives: + servers: + "matrix.org": + verify_keys: + "ed25519:auto": + key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw" + + + +# Enable SAML2 for registration and login. Uses pysaml2 +# config_path: Path to the sp_conf.py configuration file +# idp_redirect_url: Identity provider URL which will redirect +# the user back to /login/saml2 with proper info. +# See pysaml2 docs for format of config. +#saml2_config: +# enabled: true +# config_path: "/home/erikj/git/synapse/sp_conf.py" +# idp_redirect_url: "http://test/idp" + + + +# Enable CAS for registration and login. +#cas_config: +# enabled: true +# server_url: "https://cas-server.com" +# service_url: "https://homesever.domain.com:8448" +# #required_attributes: +# # name: value + + +# The JWT needs to contain a globally unique "sub" (subject) claim. +# +# jwt_config: +# enabled: true +# secret: "a secret" +# algorithm: "HS256" + +password_providers: + - module: "ldap_auth_provider.LdapAuthProvider" + config: + enabled: true + uri: "ldap://bottin.service.2.cluster.deuxfleurs.fr:389" + start_tls: false + bind_dn: '{{ key "secrets/chat/synapse/ldap_binddn" | trimSpace }}' + bind_password: '{{ key "secrets/chat/synapse/ldap_bindpw" | trimSpace }}' + base: "ou=users,dc=deuxfleurs,dc=fr" + attributes: + uid: "cn" + name: "displayName" + mail: "mail" + +# Enable password for login. +password_config: + enabled: true + +# Enable sending emails for notification events +#email: +# enable_notifs: false +# smtp_host: "localhost" +# smtp_port: 25 +# notif_from: "Your Friendly %(app)s Home Server " +# app_name: Matrix +# template_dir: res/templates +# notif_template_html: notif_mail.html +# notif_template_text: notif_mail.txt +# notif_for_new_users: True +report_stats: false diff --git a/consul/configuration/chat/synapse/log.yaml b/consul/configuration/chat/synapse/log.yaml new file mode 100644 index 0000000..eb69d8f --- /dev/null +++ b/consul/configuration/chat/synapse/log.yaml @@ -0,0 +1,41 @@ + +version: 1 + +formatters: + precise: + format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s' + +filters: + context: + (): synapse.util.logcontext.LoggingContextFilter + request: "" + +handlers: + file: + class: logging.handlers.RotatingFileHandler + formatter: precise + filename: /var/log/matrix-synapse/homeserver.log + maxBytes: 10485760 + backupCount: 3 + filters: [context] + level: WARN + console: + class: logging.StreamHandler + formatter: precise + level: WARN + +loggers: + synapse: + level: INFO + + synapse.storage.SQL: + level: INFO + + ldap3: + level: DEBUG + ldap_auth_provider: + level: DEBUG + +root: + level: INFO + handlers: [file, console] diff --git a/consul/configuration/email/dkim/keytable b/consul/configuration/email/dkim/keytable new file mode 100644 index 0000000..f4ac7cd --- /dev/null +++ b/consul/configuration/email/dkim/keytable @@ -0,0 +1 @@ +smtp._domainkey.deuxfleurs.fr deuxfleurs.fr:smtp:/etc/dkim/smtp.private diff --git a/consul/configuration/email/dkim/signingtable b/consul/configuration/email/dkim/signingtable new file mode 100644 index 0000000..60d66ff --- /dev/null +++ b/consul/configuration/email/dkim/signingtable @@ -0,0 +1,2 @@ +*@deuxfleurs.fr smtp._domainkey.deuxfleurs.fr +*@dufour.io smtp._domainkey.deuxfleurs.fr diff --git a/consul/configuration/email/dkim/smtp.private.sample b/consul/configuration/email/dkim/smtp.private.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/configuration/email/dkim/smtp.txt.sample b/consul/configuration/email/dkim/smtp.txt.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/configuration/email/dkim/trusted b/consul/configuration/email/dkim/trusted new file mode 100644 index 0000000..a01170d --- /dev/null +++ b/consul/configuration/email/dkim/trusted @@ -0,0 +1,4 @@ +127.0.0.1 +localhost +192.168.1.0/24 +172.16.0.0/12 diff --git a/consul/configuration/email/dovecot/certs.gen b/consul/configuration/email/dovecot/certs.gen new file mode 100755 index 0000000..f26e917 --- /dev/null +++ b/consul/configuration/email/dovecot/certs.gen @@ -0,0 +1,13 @@ +#!/bin/bash + +TLSINFO="/C=FR/ST=Bretagne/L=Rennes/O=Deuxfleurs/CN=imap.deuxfleurs.fr" +openssl req \ + -new \ + -newkey rsa:4096 \ + -days 3650 \ + -nodes \ + -x509 \ + -subj ${TLSINFO} \ + -keyout dovecot.key \ + -out dovecot.crt + diff --git a/consul/configuration/email/dovecot/dovecot-ldap.conf.sample b/consul/configuration/email/dovecot/dovecot-ldap.conf.sample new file mode 100644 index 0000000..4848d6e --- /dev/null +++ b/consul/configuration/email/dovecot/dovecot-ldap.conf.sample @@ -0,0 +1,8 @@ +hosts = bottin.service.2.cluster.deuxfleurs.fr +dn = cn=,dc=deuxfleurs,dc=fr +dnpass = +base = dc=deuxfleurs,dc=fr +scope = subtree +user_filter = (&(mail=%u)(&(objectClass=inetOrgPerson)(memberOf=cn=email,ou=groups,dc=deuxfleurs,dc=fr))) +pass_filter = (&(mail=%u)(&(objectClass=inetOrgPerson)(memberOf=cn=email,ou=groups,dc=deuxfleurs,dc=fr))) +user_attrs = mail=/var/mail/%{ldap:mail} diff --git a/consul/configuration/email/postfix/certs.gen b/consul/configuration/email/postfix/certs.gen new file mode 100755 index 0000000..f25439b --- /dev/null +++ b/consul/configuration/email/postfix/certs.gen @@ -0,0 +1,13 @@ +#!/bin/bash + +TLSINFO="/C=FR/ST=Bretagne/L=Rennes/O=Deuxfleurs/CN=smtp.deuxfleurs.fr" +openssl req \ + -new \ + -newkey rsa:4096 \ + -days 3650 \ + -nodes \ + -x509 \ + -subj ${TLSINFO} \ + -keyout postfix.key \ + -out postfix.crt + diff --git a/consul/configuration/email/postfix/dynamicmaps.cf b/consul/configuration/email/postfix/dynamicmaps.cf new file mode 100644 index 0000000..32d8f62 --- /dev/null +++ b/consul/configuration/email/postfix/dynamicmaps.cf @@ -0,0 +1,9 @@ +# Postfix dynamic maps configuration file. +# +# The first match found is the one that is used. Wildcards are not supported +# as of postfix 2.0.2 +# +#type location of .so file open function (mkmap func) +#==== ================================ ============= ============ +ldap postfix-ldap.so dict_ldap_open +sqlite postfix-sqlite.so dict_sqlite_open diff --git a/consul/configuration/email/postfix/header_checks b/consul/configuration/email/postfix/header_checks new file mode 100644 index 0000000..cad52ec --- /dev/null +++ b/consul/configuration/email/postfix/header_checks @@ -0,0 +1,3 @@ +/^Received:/ IGNORE +/^X-Originating-IP:/ IGNORE +/^X-Mailer:/ IGNORE diff --git a/consul/configuration/email/postfix/ldap-account.cf.sample b/consul/configuration/email/postfix/ldap-account.cf.sample new file mode 100644 index 0000000..1b90252 --- /dev/null +++ b/consul/configuration/email/postfix/ldap-account.cf.sample @@ -0,0 +1,12 @@ +bind = yes +bind_dn = cn=,dc=deuxfleurs,dc=fr +bind_pw = +version = 3 +timeout = 20 +start_tls = no +tls_require_cert = no +server_host = ldap://bottin.service.2.cluster.deuxfleurs.fr +scope = sub +search_base = ou=users,dc=deuxfleurs,dc=fr +query_filter = mail=%s +result_attribute = mail diff --git a/consul/configuration/email/postfix/ldap-alias.cf.sample b/consul/configuration/email/postfix/ldap-alias.cf.sample new file mode 100644 index 0000000..8ed3361 --- /dev/null +++ b/consul/configuration/email/postfix/ldap-alias.cf.sample @@ -0,0 +1,9 @@ +server_host = bottin.service.2.cluster.deuxfleurs.fr +server_port = 389 +search_base = dc=deuxfleurs,dc=fr +query_filter = (&(objectClass=inetOrgPerson)(memberOf=cn=%s,ou=mailing_lists,ou=groups,dc=deuxfleurs,dc=fr)) +result_attribute = mail +bind = yes +bind_dn = cn=,dc=deuxfleurs,dc=fr +bind_pw = +version = 3 diff --git a/consul/configuration/email/postfix/main.cf b/consul/configuration/email/postfix/main.cf new file mode 100644 index 0000000..f121089 --- /dev/null +++ b/consul/configuration/email/postfix/main.cf @@ -0,0 +1,107 @@ +#=== +# Base configuration +#=== +myhostname = smtp.deuxfleurs.fr +alias_maps = hash:/etc/aliases +alias_database = hash:/etc/aliases +myorigin = /etc/mailname +mydestination = smtp.deuxfleurs.fr +mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24 +mailbox_size_limit = 0 +recipient_delimiter = + +inet_protocols = all +inet_interfaces = all +message_size_limit = 204800000 +smtpd_banner = $myhostname +biff = no +append_dot_mydomain = no +readme_directory = no +compatibility_level = 2 + +#=== +# TLS parameters +#=== +smtpd_tls_cert_file=/etc/ssl/certs/postfix.crt +smtpd_tls_key_file=/etc/ssl/private/postfix.key +smtpd_use_tls=yes +smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache +smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache +#smtp_tls_policy_maps = hash:/etc/postfix/tls_policy +smtp_tls_security_level = may + +#=== +# Remove privacy related content from emails +#=== +mime_header_checks = regexp:/etc/postfix/header_checks +header_checks = regexp:/etc/postfix/header_checks + +#=== +# Handle user authentication (handled by dovecot) +#=== +smtpd_sasl_auth_enable = yes +smtpd_sasl_path = inet:dovecot-auth.service.2.cluster.deuxfleurs.fr:1337 +smtpd_sasl_type = dovecot + +#=== +# Restrictions / Checks +#=== +# -- Inspired by: http://www.postfix.org/SMTPD_ACCESS_README.html#lists + +# Require a valid HELO +smtpd_helo_required = yes +# As we use the same postfix to send and receive, +# we can't enforce a valid HELO hostname... +#smtpd_helo_restrictions = +# reject_unknown_helo_hostname + +# Require that sender email has a valid domain +smtpd_sender_restrictions = + reject_unknown_sender_domain + +# Delivering email policy +# MyNetwork is required by sogo +smtpd_recipient_restrictions = + permit_sasl_authenticated + permit_mynetworks + reject_unauth_destination + reject_rbl_client zen.spamhaus.org + reject_rhsbl_reverse_client dbl.spamhaus.org + reject_rhsbl_helo dbl.spamhaus.org + reject_rhsbl_sender dbl.spamhaus.org + +# Sending email policy +# MyNetwork is required by sogo +smtpd_relay_restrictions = + permit_sasl_authenticated + permit_mynetworks + reject_unauth_destination + +smtpd_data_restrictions = reject_unauth_pipelining + +smtpd_client_connection_rate_limit = 2 + +#=== +# Rate limiting +#=== +slow_destination_recipient_limit = 20 +slow_destination_concurrency_limit = 2 + +#==== +# Transport configuration +#==== +transport_maps = hash:/etc/postfix/transport +virtual_mailbox_domains = deuxfleurs.fr, dufour.io, dufour.tk +virtual_mailbox_maps = ldap:/etc/postfix/ldap-account.cf +#virtual_alias_domains = deuxfleurs.fr, dufour.io, dufour.tk +virtual_alias_maps = ldap:/etc/postfix/ldap-alias.cf +virtual_transport = lmtp:dovecot-lmtp.service.2.cluster.deuxfleurs.fr:24 +#master_service_disable = +#tcp_windowsize = 1400 + +#=== +# Mail filters +#=== +milter_default_action = accept +milter_protocol = 6 +smtpd_milters = inet:opendkim.service.2.cluster.deuxfleurs.fr:8999 +non_smtpd_milters = inet:opendkim.service.2.cluster.deuxfleurs.fr:8999 diff --git a/consul/configuration/email/postfix/master.cf b/consul/configuration/email/postfix/master.cf new file mode 100644 index 0000000..53bc601 --- /dev/null +++ b/consul/configuration/email/postfix/master.cf @@ -0,0 +1,114 @@ +# +# Postfix master process configuration file. For details on the format +# of the file, see the master(5) manual page (command: "man 5 master"). +# +# Do not forget to execute "postfix reload" after editing this file. +# +# ========================================================================== +# service type private unpriv chroot wakeup maxproc command + args +# (yes) (yes) (yes) (never) (100) +# ========================================================================== +smtp inet n - n - - smtpd +submission inet n - n - - smtpd + -o smtpd_tls_security_level=encrypt + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o milter_macro_daemon_name=ORIGINATING +smtps inet n - n - - smtpd + -o smtpd_tls_wrappermode=yes + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o milter_macro_daemon_name=ORIGINATING +slow unix - - n - 5 smtp + -o syslog_name=postfix-slow + -o smtp_destination_concurrency_limit=3 + -o slow_destination_rate_delay=1 + + +#628 inet n - - - - qmqpd +pickup fifo n - n 60 1 pickup +cleanup unix n - n - 0 cleanup +qmgr fifo n - n 300 1 qmgr +#qmgr fifo n - - 300 1 oqmgr +tlsmgr unix - - n 1000? 1 tlsmgr +rewrite unix - - n - - trivial-rewrite +bounce unix - - n - 0 bounce +defer unix - - n - 0 bounce +trace unix - - n - 0 bounce +verify unix - - n - 1 verify +flush unix n - n 1000? 0 flush +proxymap unix - - n - - proxymap +proxywrite unix - - n - 1 proxymap +# When relaying mail as backup MX, disable fallback_relay to avoid MX loops +smtp unix - - n - - smtp +# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 +relay unix - - n - - smtp + -o smtp_fallback_relay= +showq unix n - n - - showq +error unix - - n - - error +retry unix - - n - - error +discard unix - - n - - discard +local unix - n n - - local +virtual unix - n n - - virtual +lmtp unix - - n - - lmtp +anvil unix - - n - 1 anvil +# +# ==================================================================== +# Interfaces to non-Postfix software. Be sure to examine the manual +# pages of the non-Postfix software to find out what options it wants. +# +# Many of the following services use the Postfix pipe(8) delivery +# agent. See the pipe(8) man page for information about ${recipient} +# and other message envelope options. +# ==================================================================== +# +# maildrop. See the Postfix MAILDROP_README file for details. +# Also specify in main.cf: maildrop_destination_recipient_limit=1 +# +scache unix - - n - 1 scache +maildrop unix - n n - - pipe + flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} +# +# ==================================================================== +# +# Recent Cyrus versions can use the existing "lmtp" master.cf entry. +# +# Specify in cyrus.conf: +# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 +# +# Specify in main.cf one or more of the following: +# mailbox_transport = lmtp:inet:localhost +# virtual_transport = lmtp:inet:localhost +# +# ==================================================================== +# +# Cyrus 2.1.5 (Amos Gouaux) +# Also specify in main.cf: cyrus_destination_recipient_limit=1 +# +#cyrus unix - n n - - pipe +# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} +# +# ==================================================================== +# Old example of delivery via Cyrus. +# +#old-cyrus unix - n n - - pipe +# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} +# +# ==================================================================== +# +# See the Postfix UUCP_README file for configuration details. +# +uucp unix - n n - - pipe + flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) +# +# Other external delivery methods. +# +ifmail unix - n n - - pipe + flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) +bsmtp unix - n n - - pipe + flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient +scalemail-backend unix - n n - 2 pipe + flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} +mailman unix - n n - - pipe + flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py + ${nexthop} ${user} diff --git a/consul/configuration/email/postfix/transport b/consul/configuration/email/postfix/transport new file mode 100644 index 0000000..68f62c5 --- /dev/null +++ b/consul/configuration/email/postfix/transport @@ -0,0 +1,5 @@ +#wanadoo.com slow: +#wanadoo.fr slow: +#orange.com slow: +#orange.fr slow: +#smtp.orange.fr slow: diff --git a/consul/configuration/email/postfix/transport.db b/consul/configuration/email/postfix/transport.db new file mode 100644 index 0000000..487f394 Binary files /dev/null and b/consul/configuration/email/postfix/transport.db differ diff --git a/consul/configuration/email/sogo/sogo.conf.tpl b/consul/configuration/email/sogo/sogo.conf.tpl new file mode 100644 index 0000000..bb13a83 --- /dev/null +++ b/consul/configuration/email/sogo/sogo.conf.tpl @@ -0,0 +1,68 @@ +{ + WONoDetach = NO; + WOWorkersCount = 10; + WOPort = "127.0.0.1:20000"; + SOGoProfileURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_user_profile"; + OCSFolderInfoURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_folder_info"; + OCSSessionsFolderURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_sessions_folder"; + OCSEMailAlarmsFolderURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_alarms_folder"; + OCSStoreURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_store"; + OCSAclURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_acl"; + OCSCacheFolderURL = "postgresql://{{ key "secrets/email/sogo/postgre_auth" | trimSpace }}@psql-proxy.service.2.cluster.deuxfleurs.fr:5432/sogo/sogo_cache_folder"; + SOGoTimeZone = "Europe/Paris"; + SOGoMailDomain = "deuxfleurs.fr"; + SOGoLanguage = French; + SOGoAppointmentSendEMailNotifications = YES; + SOGoEnablePublicAccess = YES; + SOGoMailingMechanism = smtp; + SOGoSMTPServer = postfix-smtp.service.2.cluster.deuxfleurs.fr; + SOGoSMTPAuthenticationType = PLAIN; + SOGoForceExternalLoginWithEmail = YES; + SOGoIMAPAclConformsToIMAPExt = YES; + SOGoTimeZone = UTC; + SOGoSentFolderName = Sent; + SOGoTrashFolderName = Trash; + SOGoDraftsFolderName = Drafts; + SOGoIMAPServer = "imaps://dovecot-imaps.service.2.cluster.deuxfleurs.fr:993/"; + SOGoSieveServer = "sieve://sieve.service.2.cluster.deuxfleurs.fr:4190/?tls=YES"; + SOGoIMAPAclConformsToIMAPExt = YES; + SOGoVacationEnabled = NO; + SOGoForwardEnabled = NO; + SOGoSieveScriptsEnabled = NO; + SOGoFirstDayOfWeek = 1; + SOGoRefreshViewCheck = every_5_minutes; + SOGoMailAuxiliaryUserAccountsEnabled = NO; + SOGoPasswordChangeEnabled = YES; + SOGoPageTitle = "deuxfleurs.fr"; + SOGoLoginModule = Mail; + SOGoMailAddOutgoingAddresses = YES; + SOGoSelectedAddressBook = autobook; + SOGoMailAuxiliaryUserAccountsEnabled = YES; + SOGoCalendarEventsDefaultClassification = PRIVATE; + SOGoMailReplyPlacement = above; + SOGoMailSignaturePlacement = above; + SOGoMailComposeMessageType = html; + + SOGoLDAPContactInfoAttribute = "displayname"; + + SOGoUserSources = ( + { + type = ldap; + CNFieldName = displayname; + IDFieldName = cn; + UIDFieldName = cn; + MailFieldNames = (mail, mailForwardingAddress); + SearchFieldNames = (displayname, cn, sn, mail, telephoneNumber); + IMAPLoginFieldName = mail; + baseDN = "ou=users,dc=deuxfleurs,dc=fr"; + bindDN = "{{ key "secrets/email/sogo/ldap_binddn" | trimSpace }}"; + bindPassword = "{{ key "secrets/email/sogo/ldap_bindpw" | trimSpace}}"; + bindFields = (cn, mail); + canAuthenticate = YES; + displayName = "Bottin"; + hostname = "ldap://bottin.service.2.cluster.deuxfleurs.fr:389"; + id = bottin; + isAddressBook = NO; + } + ); +} diff --git a/consul/configuration/mariadb/main/env.tpl b/consul/configuration/mariadb/main/env.tpl new file mode 100644 index 0000000..5ac1b19 --- /dev/null +++ b/consul/configuration/mariadb/main/env.tpl @@ -0,0 +1,6 @@ +LDAP_URI = "ldap://bottin.service.2.cluster.deuxfleurs.fr" +LDAP_BASE = "ou=users,dc=deuxfleurs,dc=fr" +LDAP_VERSION = 3 +LDAP_BIND_DN = "{{ key "secrets/mariadb/main/ldap_binddn" | trimSpace }}" +LDAP_BIND_PW = "{{ key "secrets/mariadb/main/ldap_bindpwd" | trimSpace }}" +MYSQL_PASSWORD = "{{ key "secrets/mariadb/main/mysql_pwd" | trimSpace }}" diff --git a/consul/configuration/postgres/keeper/env.tpl b/consul/configuration/postgres/keeper/env.tpl new file mode 100644 index 0000000..7831aad --- /dev/null +++ b/consul/configuration/postgres/keeper/env.tpl @@ -0,0 +1,3 @@ +PG_SU_PWD={{ key "secrets/postgres/keeper/pg_su_pwd" | trimSpace }} +PG_REPL_USER={{ key "secrets/postgres/keeper/pg_repl_username" | trimSpace }} +PG_REPL_PWD={{ key "secrets/postgres/keeper/pg_repl_pwd" | trimSpace }} diff --git a/consul/configuration/seafile/ccnet/mykey.peer.sample b/consul/configuration/seafile/ccnet/mykey.peer.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/configuration/seafile/ccnet/seafile.ini b/consul/configuration/seafile/ccnet/seafile.ini new file mode 100644 index 0000000..306d126 --- /dev/null +++ b/consul/configuration/seafile/ccnet/seafile.ini @@ -0,0 +1 @@ +/mnt/seafile-data/ \ No newline at end of file diff --git a/consul/configuration/seafile/conf/ccnet.conf.sample b/consul/configuration/seafile/conf/ccnet.conf.sample new file mode 100644 index 0000000..0c93bef --- /dev/null +++ b/consul/configuration/seafile/conf/ccnet.conf.sample @@ -0,0 +1,29 @@ +[General] +USER_NAME = deuxfleurs +ID = +NAME = deuxfleurs +SERVICE_URL = https://cloud.deuxfleurs.fr + +[Network] +PORT = 10001 + +[Client] +PORT = 13418 + +[LDAP] +HOST = ldap://bottin.service.2.cluster.deuxfleurs.fr/ +BASE = ou=users,dc=deuxfleurs,dc=fr +USER_DN = cn=,dc=deuxfleurs,dc=fr +FILTER = memberOf=CN=seafile,OU=groups,DC=deuxfleurs,DC=fr +PASSWORD = +LOGIN_ATTR = mail + +[Database] +ENGINE = mysql +HOST = mariadb.service.2.cluster.deuxfleurs.fr +PORT = 3306 +USER = seafile +PASSWD = +DB = ccnet-db +CONNECTION_CHARSET = utf8 + diff --git a/consul/configuration/seafile/conf/mykey.peer.sample b/consul/configuration/seafile/conf/mykey.peer.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/configuration/seafile/conf/seafdav.conf b/consul/configuration/seafile/conf/seafdav.conf new file mode 100644 index 0000000..49a79a2 --- /dev/null +++ b/consul/configuration/seafile/conf/seafdav.conf @@ -0,0 +1,5 @@ +[WEBDAV] +enabled = true +port = 8084 +fastcgi = false +share_name = /seafdav diff --git a/consul/configuration/seafile/conf/seafile.conf.sample b/consul/configuration/seafile/conf/seafile.conf.sample new file mode 100644 index 0000000..cfe3592 --- /dev/null +++ b/consul/configuration/seafile/conf/seafile.conf.sample @@ -0,0 +1,19 @@ +[network] +port = 12001 + +[fileserver] +port = 8082 +max_upload_size=8192 +max_download_dir_size=8192 + +[database] +type = mysql +host = mariadb.service.2.cluster.deuxfleurs.fr +port = 3306 +user = seafile +password = +db_name = seafile-db +connection_charset = utf8 + +[quota] +default = 50 diff --git a/consul/configuration/seafile/conf/seahub_settings.py.sample b/consul/configuration/seafile/conf/seahub_settings.py.sample new file mode 100644 index 0000000..06aa7d3 --- /dev/null +++ b/consul/configuration/seafile/conf/seahub_settings.py.sample @@ -0,0 +1,21 @@ +SECRET_KEY = "8ep+sgi&s1-f2cq2178!ekk!0h0nw2y4z1-olbaopxmodsd8vk" +FILE_SERVER_ROOT = 'https://cloud.deuxfleurs.fr/seafhttp' +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'seahub-db', + 'USER': 'seafile', + 'PASSWORD': '', + 'HOST': 'mariadb.service.2.cluster.deuxfleurs.fr', + 'PORT': '3306', + 'OPTIONS': { + 'init_command': 'SET storage_engine=INNODB', + } + } +} +FILE_PREVIEW_MAX_SIZE = 100 * 1024 * 1024 +ENABLE_THUMBNAIL = True +THUMBNAIL_ROOT = '/mnt/seafile-data/thumbnail/thumb/' +THUMBNAIL_EXTENSION = 'png' +THUMBNAIL_DEFAULT_SIZE = '24' +PREVIEW_DEFAULT_SIZE = '300' diff --git a/consul/configuration/traefik/cloudflare.env.sample b/consul/configuration/traefik/cloudflare.env.sample new file mode 100644 index 0000000..072e671 --- /dev/null +++ b/consul/configuration/traefik/cloudflare.env.sample @@ -0,0 +1,2 @@ +CF_API_EMAIL = "" +CF_API_KEY = "" diff --git a/consul/configuration/traefik/traefik.toml.sample b/consul/configuration/traefik/traefik.toml.sample new file mode 100644 index 0000000..fbfc745 --- /dev/null +++ b/consul/configuration/traefik/traefik.toml.sample @@ -0,0 +1,53 @@ +InsecureSkipVerify = true +defaultEntryPoints = ["http", "https"] + +[entryPoints] + [entryPoints.admin] + address = ":8082" + [entryPoints.admin.auth.basic] + users = [":"] + + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + entryPoint = "https" + + [entryPoints.https] + address = ":443" + compress = true + [entryPoints.https.tls] + +[retry] + +[acme] + email = "quentin@dufour.io" + storage = "traefik/acme/account" + entryPoint = "https" + onHostRule = true + + [acme.dnsChallenge] + provider = "cloudflare" + delayBeforeCheck = 0 + + [acme.httpChallenge] + entryPoint = "http" + +[[acme.domains]] + main = "deuxfleurs.fr" + +[api] + entryPoint = "admin" + dashboard = true + +[consul] + endpoint = "consul.service.2.cluster.deuxfleurs.fr:8500" + watch = true + prefix = "traefik" + +[consulCatalog] + endpoint = "consul.service.2.cluster.deuxfleurs.fr:8500" + prefix = "traefik" + domain = "web.deuxfleurs.fr" + exposedByDefault = false + + diff --git a/consul/restore_configuration.sh b/consul/restore_configuration.sh new file mode 100755 index 0000000..ba4d353 --- /dev/null +++ b/consul/restore_configuration.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +find {configuration,secrets} -type f \ + | grep --perl-regexp --invert-match "\.sample$|\.gen$|/.gitignore$" \ + | while read filename; do + consul kv put "${filename}" "@${filename}" + done diff --git a/consul/secrets/.gitignore b/consul/secrets/.gitignore new file mode 100644 index 0000000..1d7b40b --- /dev/null +++ b/consul/secrets/.gitignore @@ -0,0 +1,10 @@ +# Blacklist everything cleverly +* +!*/ + +# Whitelist some patterns +!*.sample +!*.gen +!.gitignore + +# Whitelist specific files diff --git a/consul/secrets/chat/coturn/static-auth.sample b/consul/secrets/chat/coturn/static-auth.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/homeserver.tls.crt.sample b/consul/secrets/chat/synapse/homeserver.tls.crt.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/homeserver.tls.dh.sample b/consul/secrets/chat/synapse/homeserver.tls.dh.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/homeserver.tls.key.sample b/consul/secrets/chat/synapse/homeserver.tls.key.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/ldap_binddn.sample b/consul/secrets/chat/synapse/ldap_binddn.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/ldap_bindpw.sample b/consul/secrets/chat/synapse/ldap_bindpw.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/postgres_db.sample b/consul/secrets/chat/synapse/postgres_db.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/postgres_pwd.sample b/consul/secrets/chat/synapse/postgres_pwd.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/postgres_user.sample b/consul/secrets/chat/synapse/postgres_user.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/chat/synapse/registration_shared_secret.sample b/consul/secrets/chat/synapse/registration_shared_secret.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/email/sogo/ldap_binddn.sample b/consul/secrets/email/sogo/ldap_binddn.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/email/sogo/ldap_bindpw.sample b/consul/secrets/email/sogo/ldap_bindpw.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/email/sogo/postgre_auth.sample b/consul/secrets/email/sogo/postgre_auth.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/mariadb/main/ldap_binddn.sample b/consul/secrets/mariadb/main/ldap_binddn.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/mariadb/main/ldap_bindpwd.sample b/consul/secrets/mariadb/main/ldap_bindpwd.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/mariadb/main/mysql_pwd.sample b/consul/secrets/mariadb/main/mysql_pwd.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/postgres/keeper/pg_repl_pwd.sample b/consul/secrets/postgres/keeper/pg_repl_pwd.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/postgres/keeper/pg_repl_username.sample b/consul/secrets/postgres/keeper/pg_repl_username.sample new file mode 100644 index 0000000..e69de29 diff --git a/consul/secrets/postgres/keeper/pg_su_pwd.sample b/consul/secrets/postgres/keeper/pg_su_pwd.sample new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3