~fnux/matrix-cdist-types

2a7cceef5bc9e8f5fe0ce407c416b8c4dd4c11f5 — Timothée Floure 1 year, 2 months ago 3dc2d80
Allow configuration of, document __matrix_riot type
M type/__matrix_riot/files/config.json.sh => type/__matrix_riot/files/config.json.sh +10 -19
@@ 1,9 1,13 @@
#!/bin/sh
#
# Upstream configuration guide/documentation:
#   https://github.com/vector-im/riot-web/blob/develop/docs/config.md

cat << EOF
{
    "default_server_name": "matrix.org",
    "brand": "Riot",
    "default_server_name": "$DEFAULT_SERVER_NAME",
    "brand": "$BRAND",
    defaultCountryCode: "$DEFAULT_COUNTRY_CODE"
    "integrations_ui_url": "https://scalar.vector.im/",
    "integrations_rest_url": "https://scalar.vector.im/api",
    "integrations_widgets_urls": [


@@ 13,32 17,19 @@ cat << EOF
        "https://scalar-staging.vector.im/api",
        "https://scalar-staging.riot.im/scalar/api"
    ],
    "hosting_signup_link": "https://modular.im/?utm_source=riot-web&utm_medium=web",
    "bug_report_endpoint_url": "https://riot.im/bugreports/submit",
    "features": {
    },
    "welcomeUserId": "@riot-bot:matrix.org",
    "piwik": {
        "url": "https://piwik.riot.im/",
        "siteId": 1,
        "policyUrl": "https://matrix.org/docs/guides/riot_im_cookie_policy"
    },
    rbug_report_endpoint_url": "https://riot.im/bugreports/submit",
    "roomDirectory": {
        "servers": [
            "matrix.org"
            $ROOM_DIRECTORY_SERVERS
        ]
    },
    "enable_presence_by_hs_url": {
        "https://matrix.org": false,
        "https://matrix-client.matrix.org": false
    },
    "terms_and_conditions_links": [
        {
            "url": "https://riot.im/privacy",
            "url": "$PRIVACY_POLICY_URL",
            "text": "Privacy Policy"
        },
        {
            "url": "https://matrix.org/docs/guides/riot_im_cookie_policy",
            "url": "$COOKIE_POLICY_URL",
            "text": "Cookie Policy"
        }
    ]

M type/__matrix_riot/gencode-remote => type/__matrix_riot/gencode-remote +1 -1
@@ 1,6 1,6 @@
#!/bin/sh -e
#
# 2019 Timothée Floure (timothee.floure@posteo.net)
# 2019 Timothée Floure (timothee.floure@ungleich.ch)
#
# This file is part of cdist.
#

M type/__matrix_riot/man.rst => type/__matrix_riot/man.rst +21 -57
@@ 1,76 1,41 @@
cdist-type__synapse(7)
cdist-type__matrix_riot(7)
======================

NAME
----
cdist-type__synapse - Install and configure Synapse, a Matrix homeserver
cdist-type__matrix_riot - Install and configure Riot, a web Matrix client.


DESCRIPTION
-----------
This type install and configure the Synapse Matrix homeserver. This is a
signleton type.
This type install and configure the Riot web client.


REQUIRED PARAMETERS
-------------------
server_name
  Name of your homeserver (e.g. ungleich.ch) used as part of your MXIDs. This
  value cannot be changed without meddling with the database once the server is
  being used.
install_dir
  Root directory of Riot's static files.

base_url
  Public URL of your homeserver (e.g. http://matrix.ungleich.ch).

database_engine
  'sqlite3' or 'postgresql'

database_name
  Path to the database if SQLite3 is used or database name if PostgresSQL is
  used.
version
  Release of Riot to install.

OPTIONAL PARAMETERS
-------------------
database_host
  Database node address, only used with PostgresSQL.

database_user
  Database user, only used with PostgresSQL.

database_password
  Database password, only used with PostgresSQL.

ldap_uri
  Address of your LDAP server.

ldap_base_dn
  Base DN of your LDAP tree.

ldap_uid_attribute
  LDAP attriute mapping to Synapse's uid field, default to uid.

ldap_mail_attribute
  LDAP attriute mapping to Synapse's mail field, default to mail.

ldap_name_attribute
  LDAP attriute mapping to Synapse's name field, default to givenName.

ldap_bind_dn
  User used to authenticate against your LDAP server.
default_server_name
  Matrix homeserver to connect to, defaults to 'matrix.org'.

ldap_bind_password
  Password used to authenticate against your LDAP server.
brand
  Web UI branding, defaults to 'Riot'.

ldap_filter
  LDAP user filter, defaulting to `(objectClass=posixAccount)`.
default_country_code
  ISO 3166 alpha2 country code to use when showing country selectors, such as
  phone number inputs. Defaults to GB.

BOOLEAN PARAMETERS
------------------
allow_registration
  Enables user registration on the homeserver.
privacy_policy_url
  Defaults to 'https://riot.im/privacy'.

allow_ldap_auth
  Enables ldap-backed authentication.
cookie_policy_url
  Defaults to 'https://matrix.org/docs/guides/riot_im_cookie_policy'.


EXAMPLES


@@ 78,18 43,17 @@ EXAMPLES

.. code-block:: sh

    # TODO
    __synapse
    __matrix_riot --install_dir /var/www/riot-web --version 1.5.6


SEE ALSO
--------
:strong:`TODO`\ (7)
- `cdist-type__matrix_synapse(7) <cdist-type__matrix_synapse.html>`_


AUTHORS
-------
Timothée Floure <timothee.floure@posteo.net>
Timothée Floure <timothee.floure@ungleich.ch>


COPYING

M type/__matrix_riot/manifest => type/__matrix_riot/manifest +8 -1
@@ 1,6 1,6 @@
#!/bin/sh -e
#
# 2019 Timothée Floure (timothee.floure@posteo.net)
# 2019 Timothée Floure (timothee.floure@ungleich.ch)
#
# This file is part of cdist.
#


@@ 32,6 32,13 @@ get_with_default () {

INSTALL_DIR=$(cat "$__object/parameter/install_dir")

export DEFAULT_SERVER_NAME=$(get_with_default 'default_server_name', 'matrix.org')
export BRAND=$(get_with_default 'brand', 'Riot')
export DEFAULT_COUNTRY_CODE=$(get_with_default 'brand', 'GB')
export ROOM_DIRECTORY_SERVERS=$(get_with_default 'room_directory_servers', '"matrix.org"')
export PRIVACY_POLICY_URL=$(get_with_default 'privacy_policy_url', 'https://riot.im/privacy')
export COOKIE_POLICY_URL=$(get_with_default 'cookie_policy_url', 'https://matrix.org/docs/guides/riot_im_cookie_policy')

# Ensure that curl and tar are installed, as they will be required by the
# gencode-remote script.
__package curl --state present

A type/__matrix_riot/parameter/optional => type/__matrix_riot/parameter/optional +6 -0
@@ 0,0 1,6 @@
default_server_name
brand
default_country_code
privacy_policy_url
cookie_policy_url
room_directory_servers

D type/__matrix_riot/singleton => type/__matrix_riot/singleton +0 -0