From 64c247026a4fe02db1d31e2bd45839f577c7c1bb Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Mon, 30 Sep 2019 14:20:26 +0200 Subject: [PATCH 001/527] [__locale_system] Support Devuan --- cdist/conf/type/__locale_system/manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__locale_system/manifest b/cdist/conf/type/__locale_system/manifest index 80f7401b..4a1fdeed 100755 --- a/cdist/conf/type/__locale_system/manifest +++ b/cdist/conf/type/__locale_system/manifest @@ -26,7 +26,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - debian|ubuntu) + debian|devuan|ubuntu) locale_conf="/etc/default/locale" ;; archlinux) From 2cf44c66d46435e859fe0528d4b414dafd8b468a Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Wed, 15 Jan 2020 19:00:30 +0100 Subject: [PATCH 002/527] [__directory] Add --state exists and --state pre-exists --- cdist/conf/type/__directory/gencode-remote | 17 ++++++++++++++--- cdist/conf/type/__directory/man.rst | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/cdist/conf/type/__directory/gencode-remote b/cdist/conf/type/__directory/gencode-remote index 374db47a..e1ab69d7 100755 --- a/cdist/conf/type/__directory/gencode-remote +++ b/cdist/conf/type/__directory/gencode-remote @@ -3,6 +3,7 @@ # 2011-2013 Nico Schottelius (nico-cdist at schottelius.org) # 2013 Steven Armstrong (steven-cdist armstrong.cc) # 2014 Daniel Heule (hda at sfs.biz) +# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch) # # This file is part of cdist. # @@ -21,8 +22,8 @@ # destination="/$__object_id" -state_should="$(cat "$__object/parameter/state")" -type="$(cat "$__object/explorer/type")" +state_should=$(cat "$__object/parameter/state") +type=$(cat "$__object/explorer/type") stat_file="$__object/explorer/stat" # variable to keep track if we have to set directory attributes @@ -72,7 +73,7 @@ set_mode() { } case "$state_should" in - present) + present|exists) if [ "$type" != "directory" ]; then set_attributes=1 if [ "$type" != "none" ]; then @@ -83,6 +84,10 @@ case "$state_should" in fi echo "mkdir $mkdiropt '$destination'" echo "create" >> "$__messages_out" + elif [ "$state_should" = 'exists' ]; then + # The type is directory and --state exists. We are done and do not + # check or set the attributes. + exit 0 fi # Note: Mode - needs to happen last as a chown/chgrp can alter mode by @@ -103,6 +108,12 @@ case "$state_should" in fi done ;; + pre-exists) + if [ "$type" != "directory" ]; then + echo "Directory \"$destination\" does not exist" >&2 + exit 1 + fi + ;; absent) if [ "$type" = "directory" ]; then echo "rm -rf '$destination'" diff --git a/cdist/conf/type/__directory/man.rst b/cdist/conf/type/__directory/man.rst index 74b00afe..7755334c 100644 --- a/cdist/conf/type/__directory/man.rst +++ b/cdist/conf/type/__directory/man.rst @@ -19,7 +19,18 @@ None. OPTIONAL PARAMETERS ------------------- state - 'present' or 'absent', defaults to 'present' + 'present', 'absent', 'exists' or 'pre-exists', defaults to 'present' where: + + present + the directory exists and the given attributes are set. + absent + the directory does not exist. + exists + the directory exists, but its attributes are not altered if it already + existed. + pre-exists + check that the directory exists and is indeed a directory, but do not + create or modify it. group Group to chgrp to. @@ -36,7 +47,7 @@ BOOLEAN PARAMETERS parents Whether to create parents as well (mkdir -p behaviour). Warning: all intermediate directory permissions default - to whatever mkdir -p does. + to whatever mkdir -p does. Usually this means root:root, 0700. From c6aba8d189c2efc7c88f9c595acba7ceae5a4e00 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Sun, 23 Feb 2020 22:59:41 +0100 Subject: [PATCH 003/527] [explorer/disks] Fix for NetBSD When connecting over SSH and running /bin/sh, the PATH is missing sbin locations. sysctl is located at /sbin/sysctl on NetBSD. --- cdist/conf/explorer/disks | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cdist/conf/explorer/disks b/cdist/conf/explorer/disks index 87a6b5c6..08290bc7 100755 --- a/cdist/conf/explorer/disks +++ b/cdist/conf/explorer/disks @@ -1,14 +1,20 @@ -#!/bin/sh +#!/bin/sh -e uname_s="$(uname -s)" -case "${uname_s}" in +case $uname_s in FreeBSD) sysctl -n kern.disks ;; - OpenBSD|NetBSD) + OpenBSD) sysctl -n hw.disknames | grep -Eo '[lsw]d[0-9]+' | xargs ;; + NetBSD) + PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" + sysctl -n hw.disknames \ + | awk 'BEGIN { RS = " " } /^[lsw]d[0-9]+/' \ + | xargs + ;; Linux) if command -v lsblk > /dev/null then @@ -23,5 +29,3 @@ case "${uname_s}" in printf "Don't know how to list disks for %s operating system, if you can please submit a patch\n" "${uname_s}" >&2 ;; esac - -exit 0 From d3bd2669ec49fb861016e614893dac280ed5fd35 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Sun, 23 Feb 2020 23:07:40 +0100 Subject: [PATCH 004/527] [explorer/disks] Support Linux without lsblk (fallback to sysfs) --- cdist/conf/explorer/disks | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/cdist/conf/explorer/disks b/cdist/conf/explorer/disks index 08290bc7..0fabc95f 100755 --- a/cdist/conf/explorer/disks +++ b/cdist/conf/explorer/disks @@ -16,16 +16,33 @@ case $uname_s in | xargs ;; Linux) - if command -v lsblk > /dev/null + # list of major device numbers toexclude: + # ram disks, floppies, cdroms + # https://www.kernel.org/doc/Documentation/admin-guide/devices.txt + ign_majors='1 2 11' + + if command -v lsblk >/dev/null 2>&1 then - # exclude ram disks, floppies and cdroms - # https://www.kernel.org/doc/Documentation/admin-guide/devices.txt - lsblk -e 1,2,11 -dno name | xargs + lsblk -e "$(echo "$ign_majors" | tr ' ' ',')" -dno name | xargs + elif test -d /sys/block/ + then + # shellcheck disable=SC2012 + ls -1 /sys/block/ \ + | awk -v ign_majors="$(echo "$ign_majors" | tr ' ' '|')" ' + { + devfile = "/sys/block/" $0 "/dev" + getline devno < devfile + close(devfile) + if (devno !~ "^(" ign_majors "):") print + }' \ + | xargs else - printf "Don't know how to list disks for %s operating system without lsblk, if you can please submit a patch\n" "${uname_s}" >&2 + echo "Don't know how to list disks on Linux without lsblk and sysfs." >&2 + echo 'If you can, please submit a patch.'>&2 fi ;; *) - printf "Don't know how to list disks for %s operating system, if you can please submit a patch\n" "${uname_s}" >&2 + printf "Don't know how to list disks for %s operating system.\n" "${uname_s}" >&2 + printf 'If you can please submit a patch\n' >&2 ;; esac From 1ef126e16f95e822562978abd895a3c036f7d5c4 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Sun, 23 Feb 2020 23:08:40 +0100 Subject: [PATCH 005/527] [explorer/disks] Move xargs call to the bottom --- cdist/conf/explorer/disks | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cdist/conf/explorer/disks b/cdist/conf/explorer/disks index 0fabc95f..ed1afce4 100755 --- a/cdist/conf/explorer/disks +++ b/cdist/conf/explorer/disks @@ -7,13 +7,12 @@ case $uname_s in sysctl -n kern.disks ;; OpenBSD) - sysctl -n hw.disknames | grep -Eo '[lsw]d[0-9]+' | xargs + sysctl -n hw.disknames | grep -Eo '[lsw]d[0-9]+' ;; NetBSD) PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" sysctl -n hw.disknames \ - | awk 'BEGIN { RS = " " } /^[lsw]d[0-9]+/' \ - | xargs + | awk 'BEGIN { RS = " " } /^[lsw]d[0-9]+/' ;; Linux) # list of major device numbers toexclude: @@ -23,7 +22,7 @@ case $uname_s in if command -v lsblk >/dev/null 2>&1 then - lsblk -e "$(echo "$ign_majors" | tr ' ' ',')" -dno name | xargs + lsblk -e "$(echo "$ign_majors" | tr ' ' ',')" -dno name elif test -d /sys/block/ then # shellcheck disable=SC2012 @@ -34,8 +33,7 @@ case $uname_s in getline devno < devfile close(devfile) if (devno !~ "^(" ign_majors "):") print - }' \ - | xargs + }' else echo "Don't know how to list disks on Linux without lsblk and sysfs." >&2 echo 'If you can, please submit a patch.'>&2 @@ -45,4 +43,5 @@ case $uname_s in printf "Don't know how to list disks for %s operating system.\n" "${uname_s}" >&2 printf 'If you can please submit a patch\n' >&2 ;; -esac +esac \ +| xargs From 6db6dc4ac0950579ce13252dcca6d0f61f5533c6 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Sun, 23 Feb 2020 23:14:14 +0100 Subject: [PATCH 006/527] [explorer/disks] Add license header --- cdist/conf/explorer/disks | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cdist/conf/explorer/disks b/cdist/conf/explorer/disks index ed1afce4..24540601 100755 --- a/cdist/conf/explorer/disks +++ b/cdist/conf/explorer/disks @@ -1,4 +1,24 @@ #!/bin/sh -e +# +# based on previous work by other people, modified by: +# 2020 Dennis Camera +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# Finds disks of the system (excl. ram disks, floppy, cdrom) uname_s="$(uname -s)" From b2db864eaf95a50e7e0d31be52f86ab1d0bea480 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 26 Feb 2020 13:01:29 +0100 Subject: [PATCH 007/527] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 8463bb89..35590655 100644 --- a/docs/changelog +++ b/docs/changelog @@ -7,6 +7,7 @@ next: * Explorer init: Rewrite and support more init systems (Dennis Camera) * New type: __service (Timothée Floure) * Types __consul_*: Add optional parameter for using distribution packages (Timothée Floure) + * Explorer disks: Fix NetBSD, support Linux w/o lsblk (Dennis Camera) 6.5.1: 2020-02-15 * Type __consul_agent: Add Debian 10 support (Nico Schottelius) From 45cb56d22b2d4c6fc40618ae28cca5dd833e2387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 26 Feb 2020 10:31:06 +0100 Subject: [PATCH 008/527] Import __matrix_riot type --- .../type/__matrix_riot/files/config.json.sh | 56 ++++++++++++++ cdist/conf/type/__matrix_riot/gencode-remote | 74 +++++++++++++++++++ cdist/conf/type/__matrix_riot/man.rst | 72 ++++++++++++++++++ cdist/conf/type/__matrix_riot/manifest | 68 +++++++++++++++++ .../__matrix_riot/parameter/default/brand | 1 + .../parameter/default/cookie_policy_url | 1 + .../parameter/default/default_country_code | 1 + .../parameter/default/default_server_name | 1 + .../parameter/default/default_server_url | 1 + .../__matrix_riot/parameter/default/owner | 1 + .../parameter/default/privacy_policy_url | 1 + .../parameter/default/room_directory_servers | 1 + .../type/__matrix_riot/parameter/optional | 9 +++ .../type/__matrix_riot/parameter/required | 2 + 14 files changed, 289 insertions(+) create mode 100755 cdist/conf/type/__matrix_riot/files/config.json.sh create mode 100755 cdist/conf/type/__matrix_riot/gencode-remote create mode 100644 cdist/conf/type/__matrix_riot/man.rst create mode 100755 cdist/conf/type/__matrix_riot/manifest create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/brand create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/cookie_policy_url create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/default_country_code create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/default_server_name create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/default_server_url create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/owner create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/privacy_policy_url create mode 100644 cdist/conf/type/__matrix_riot/parameter/default/room_directory_servers create mode 100644 cdist/conf/type/__matrix_riot/parameter/optional create mode 100644 cdist/conf/type/__matrix_riot/parameter/required diff --git a/cdist/conf/type/__matrix_riot/files/config.json.sh b/cdist/conf/type/__matrix_riot/files/config.json.sh new file mode 100755 index 00000000..d15d4862 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/files/config.json.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Upstream configuration guide/documentation: +# https://github.com/vector-im/riot-web/blob/develop/docs/config.md + +generate_embedded_pages () { + if [ $EMBED_HOMEPAGE ]; then + cat << EOF + "embeddedPages": { + "homeUrl": "home.html" + }, +EOF + fi +} + +cat << EOF +{ + "default_server_config": { + "m.homeserver": { + "base_url": "$DEFAULT_SERVER_URL", + "server_name": "$DEFAULT_SERVER_NAME" + }, + "m.identity_server": { + "base_url": "https://vector.im" + } + }, + "brand": "$BRAND", + "defaultCountryCode": "$DEFAULT_COUNTRY_CODE", + "integrations_ui_url": "https://scalar.vector.im/", + "integrations_rest_url": "https://scalar.vector.im/api", + "integrations_widgets_urls": [ + "https://scalar.vector.im/_matrix/integrations/v1", + "https://scalar.vector.im/api", + "https://scalar-staging.vector.im/_matrix/integrations/v1", + "https://scalar-staging.vector.im/api", + "https://scalar-staging.riot.im/scalar/api" + ], + "bug_report_endpoint_url": "https://riot.im/bugreports/submit", + "roomDirectory": { + "servers": [ + $ROOM_DIRECTORY_SERVERS + ] + }, + $(generate_embedded_pages) + "terms_and_conditions_links": [ + { + "url": "$PRIVACY_POLICY_URL", + "text": "Privacy Policy" + }, + { + "url": "$COOKIE_POLICY_URL", + "text": "Cookie Policy" + } + ] +} +EOF diff --git a/cdist/conf/type/__matrix_riot/gencode-remote b/cdist/conf/type/__matrix_riot/gencode-remote new file mode 100755 index 00000000..b8935588 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/gencode-remote @@ -0,0 +1,74 @@ +#!/bin/sh -e +# +# 2019 Timothée Floure (timothee.floure@ungleich.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +VERSION=$(cat "$__object/parameter/version") +INSTALL_DIR=$(cat "$__object/parameter/install_dir") +OWNER=$(cat "$__object/parameter/owner") + +src="riot-v$VERSION" +archive="$src.tar.gz" +config='config.json' +homepage='home.html' +url="https://github.com/vector-im/riot-web/releases/download/v$VERSION/$archive" + +# tar and curl are installed by the __matrix-riot manifest. mktemp is usually +# provided by coreutils and assumed installed. +cat << EOF +set -e + +# Ensure that coreutils is installed. +if [ ! -x \$(which mktemp) ]; then + echo "mktemp is not available on the remote host." >&2 + exit 1 +fi + +# Create temporary working directory. +tmpdir=\$(mktemp -d) +cd \$tmpdir + +# Download and extract sources. +curl -L '$url' > $archive +tar xf $archive + +# Backup configuration deployed by __matrix_riot. +cp '$INSTALL_DIR/$config' '$config' + +# Backup homepage deployed by __matrix_riot +if [ -f '$INSTALL_DIR/$homepage' ]; then + cp '$INSTALL_DIR/$homepage' '$homepage' +fi + +# Deploy sources and restore configuration. +rm -r '$INSTALL_DIR' +mv '$src' '$INSTALL_DIR' +cp '$config' '$INSTALL_DIR/$config' + +# Restore homepage if available. +if [ -f '$homepage' ]; then + cp '$homepage' '$INSTALL_DIR/$homepage' +fi + +# Chown deployed files to requested owner. +chown -R '$OWNER' '$INSTALL_DIR' + +# Remove temporary working directory. +cd / +rm -r \$tmpdir +EOF diff --git a/cdist/conf/type/__matrix_riot/man.rst b/cdist/conf/type/__matrix_riot/man.rst new file mode 100644 index 00000000..c8d80024 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/man.rst @@ -0,0 +1,72 @@ +cdist-type__matrix_riot(7) +====================== + +NAME +---- +cdist-type__matrix_riot - Install and configure Riot, a web Matrix client. + + +DESCRIPTION +----------- +This type install and configure the Riot web client. + + +REQUIRED PARAMETERS +------------------- +install_dir + Root directory of Riot's static files. + +version + Release of Riot to install. + +OPTIONAL PARAMETERS +------------------- +default_server_name + Name of matrix homeserver to connect to, defaults to 'matrix.org'. + +default_server_url + URL of matrix homeserver to connect to, defaults to 'https://matrix-client.matrix.org'. + +owner + Owner of the deployed files, passed to `chown`. Defaults to 'root'. + +brand + Web UI branding, defaults to 'Riot'. + +default_country_code + ISO 3166 alpha2 country code to use when showing country selectors, such as + phone number inputs. Defaults to GB. + +privacy_policy_url + Defaults to 'https://riot.im/privacy'. + +cookie_policy_url + Defaults to 'https://matrix.org/docs/guides/riot_im_cookie_policy'. + +homepage + Path to custom Riot homepage, displayed once logged in. + +EXAMPLES +-------- + +.. code-block:: sh + + __matrix_riot my-riot --install_dir /var/www/riot-web --version 1.5.6 + + +SEE ALSO +-------- +- `cdist-type__matrix_synapse(7) `_ + + +AUTHORS +------- +Timothée Floure + + +COPYING +------- +Copyright \(C) 2019 Timothée Floure. You can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. diff --git a/cdist/conf/type/__matrix_riot/manifest b/cdist/conf/type/__matrix_riot/manifest new file mode 100755 index 00000000..703e8b6f --- /dev/null +++ b/cdist/conf/type/__matrix_riot/manifest @@ -0,0 +1,68 @@ +#!/bin/sh -e +# +# 2019 Timothée Floure (timothee.floure@ungleich.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +INSTALL_DIR=$(cat "$__object/parameter/install_dir") + +default_server_name=$(cat "$__object/parameter/default_server_name") +brand=$(cat "$__object/parameter/brand") +default_country_code=$(cat "$__object/parameter/default_country_code") +room_directory_servers=$(cat "$__object/parameter/room_directory_servers") +privacy_policy_url=$(cat "$__object/parameter/privacy_policy_url") +cookie_policy_url=$(cat "$__object/parameter/cookie_policy_url") + +export DEFAULT_SERVER_NAME=$default_server_name +export BRAND=$brand +export DEFAULT_COUNTRY_CODE=$default_country_code +export ROOM_DIRECTORY_SERVERS=$room_directory_servers +export PRIVACY_POLICY_URL=$privacy_policy_url +export COOKIE_POLICY_URL=$cookie_policy_url + +if [ -f "$__object/parameter/homepage" ]; then + export EMBED_HOMEPAGE=1 + homepage=$(cat "$__object/parameter/homepage") +fi + +# Owner of the uploaded files. +owner=$(cat "$__object/parameter/owner") + +# Ensure that curl and tar are installed, as they will be required by the +# gencode-remote script. +__package curl --state present +__package tar --state present + +# Generate and deploy configuration file. +mkdir -p "$__object/files" +"$__type/files/config.json.sh" > "$__object/files/config.json" + +# Install the config.json configuration file. The application's sources are +# downloaded and deployed by gencode-remote. +__directory "$INSTALL_DIR" \ + --owner "$owner" --mode 0755 --parents \ + --state present +require="__directory/$INSTALL_DIR" __file "$INSTALL_DIR/config.json" \ + --source "$__object/files/config.json" \ + --mode 0664 \ + --state present +if [ $EMBED_HOMEPAGE ]; then + require="__directory/$INSTALL_DIR" __file "$INSTALL_DIR/home.html" \ + --source "$homepage" \ + --mode 0664 \ + --state present +fi diff --git a/cdist/conf/type/__matrix_riot/parameter/default/brand b/cdist/conf/type/__matrix_riot/parameter/default/brand new file mode 100644 index 00000000..e8095bb8 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/brand @@ -0,0 +1 @@ +Riot diff --git a/cdist/conf/type/__matrix_riot/parameter/default/cookie_policy_url b/cdist/conf/type/__matrix_riot/parameter/default/cookie_policy_url new file mode 100644 index 00000000..04e9c2b7 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/cookie_policy_url @@ -0,0 +1 @@ +https://matrix.org/docs/guides/riot_im_cookie_policy diff --git a/cdist/conf/type/__matrix_riot/parameter/default/default_country_code b/cdist/conf/type/__matrix_riot/parameter/default/default_country_code new file mode 100644 index 00000000..30ac4a3b --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/default_country_code @@ -0,0 +1 @@ +GB diff --git a/cdist/conf/type/__matrix_riot/parameter/default/default_server_name b/cdist/conf/type/__matrix_riot/parameter/default/default_server_name new file mode 100644 index 00000000..5528ffdd --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/default_server_name @@ -0,0 +1 @@ +matrix.org diff --git a/cdist/conf/type/__matrix_riot/parameter/default/default_server_url b/cdist/conf/type/__matrix_riot/parameter/default/default_server_url new file mode 100644 index 00000000..2cb92277 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/default_server_url @@ -0,0 +1 @@ +https://matrix-client.matrix.org diff --git a/cdist/conf/type/__matrix_riot/parameter/default/owner b/cdist/conf/type/__matrix_riot/parameter/default/owner new file mode 100644 index 00000000..d8649da3 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/owner @@ -0,0 +1 @@ +root diff --git a/cdist/conf/type/__matrix_riot/parameter/default/privacy_policy_url b/cdist/conf/type/__matrix_riot/parameter/default/privacy_policy_url new file mode 100644 index 00000000..4cdd12c1 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/privacy_policy_url @@ -0,0 +1 @@ +https://riot.im/privacy diff --git a/cdist/conf/type/__matrix_riot/parameter/default/room_directory_servers b/cdist/conf/type/__matrix_riot/parameter/default/room_directory_servers new file mode 100644 index 00000000..4ea73ad5 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/default/room_directory_servers @@ -0,0 +1 @@ +"matrix.org" diff --git a/cdist/conf/type/__matrix_riot/parameter/optional b/cdist/conf/type/__matrix_riot/parameter/optional new file mode 100644 index 00000000..c5e949fe --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/optional @@ -0,0 +1,9 @@ +default_server_url +default_server_name +brand +default_country_code +privacy_policy_url +cookie_policy_url +room_directory_servers +owner +homepage diff --git a/cdist/conf/type/__matrix_riot/parameter/required b/cdist/conf/type/__matrix_riot/parameter/required new file mode 100644 index 00000000..a76477e9 --- /dev/null +++ b/cdist/conf/type/__matrix_riot/parameter/required @@ -0,0 +1,2 @@ +version +install_dir From 80d2007ba93441d94d773031ee9b8c26ec48d6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 26 Feb 2020 12:14:58 +0100 Subject: [PATCH 009/527] Import __matrix_synapse type --- .../__matrix_synapse/files/homeserver.yaml.sh | 1651 +++++++++++++++++ .../type/__matrix_synapse/files/log.config.sh | 38 + cdist/conf/type/__matrix_synapse/man.rst | 122 ++ cdist/conf/type/__matrix_synapse/manifest | 234 +++ .../type/__matrix_synapse/parameter/boolean | 5 + .../parameter/default/database_host | 0 .../parameter/default/database_password | 0 .../parameter/default/database_user | 0 .../parameter/default/ldap_base_dn | 0 .../parameter/default/ldap_bind_dn | 0 .../parameter/default/ldap_bind_password | 0 .../parameter/default/ldap_filter | 1 + .../parameter/default/ldap_mail_attribute | 1 + .../parameter/default/ldap_name_attribute | 1 + .../parameter/default/ldap_uid_attribute | 1 + .../parameter/default/ldap_uri | 0 .../parameter/default/max_upload_size | 1 + .../parameter/default/turn_user_lifetime | 1 + .../type/__matrix_synapse/parameter/optional | 14 + .../parameter/optional_multiple | 1 + .../type/__matrix_synapse/parameter/required | 4 + cdist/conf/type/__matrix_synapse/singleton | 0 22 files changed, 2075 insertions(+) create mode 100755 cdist/conf/type/__matrix_synapse/files/homeserver.yaml.sh create mode 100755 cdist/conf/type/__matrix_synapse/files/log.config.sh create mode 100644 cdist/conf/type/__matrix_synapse/man.rst create mode 100755 cdist/conf/type/__matrix_synapse/manifest create mode 100644 cdist/conf/type/__matrix_synapse/parameter/boolean create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/database_host create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/database_password create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/database_user create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_base_dn create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_bind_dn create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_bind_password create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_filter create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_mail_attribute create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_name_attribute create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_uid_attribute create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/ldap_uri create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/max_upload_size create mode 100644 cdist/conf/type/__matrix_synapse/parameter/default/turn_user_lifetime create mode 100644 cdist/conf/type/__matrix_synapse/parameter/optional create mode 100644 cdist/conf/type/__matrix_synapse/parameter/optional_multiple create mode 100644 cdist/conf/type/__matrix_synapse/parameter/required create mode 100644 cdist/conf/type/__matrix_synapse/singleton diff --git a/cdist/conf/type/__matrix_synapse/files/homeserver.yaml.sh b/cdist/conf/type/__matrix_synapse/files/homeserver.yaml.sh new file mode 100755 index 00000000..01f328d9 --- /dev/null +++ b/cdist/conf/type/__matrix_synapse/files/homeserver.yaml.sh @@ -0,0 +1,1651 @@ +#!/bin/sh + +# NOTE: this template has been generated using the +# matrix-synapse-1.5.1-1.fc31.noarch Fedora package for use with CDIST. + +generate_database () { + if [ "$DATABASE_ENGINE" = "sqlite3" ]; then + cat << EOF +database: + # The database engine name + name: "$DATABASE_ENGINE" + # Arguments to pass to the engine + args: + # Path to the database + database: "$DATABASE_NAME" +EOF + else +cat << EOF +database: + # The database engine name + name: "$DATABASE_ENGINE" + # Arguments to pass to the engine + args: + database: "$DATABASE_NAME" + host: "$DATABASE_HOST" + user: "$DATABASE_USER" + password: "$DATABASE_PASSWORD" +EOF + fi +} + +generate_password_providers () { + if [ "$ENABLE_LDAP_AUTH" = "true" ]; then + cat <