From 25406ea3a09cd6bad51b44246b77905198a75384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Tue, 30 Nov 2021 13:32:03 +0100 Subject: [PATCH] __matrix_synapse: add support for Ubuntu --- type/__matrix_synapse/gencode-remote | 2 +- type/__matrix_synapse/manifest | 30 ++++++++++------------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/type/__matrix_synapse/gencode-remote b/type/__matrix_synapse/gencode-remote index cf7c648..30770ed 100755 --- a/type/__matrix_synapse/gencode-remote +++ b/type/__matrix_synapse/gencode-remote @@ -8,7 +8,7 @@ case "$os" in synapse_conf_dir=/etc/synapse synapse_service=synapse ;; - debian) + debian|ubuntu) synapse_conf_dir=/etc/matrix-synapse synapse_service=matrix-synapse ;; diff --git a/type/__matrix_synapse/manifest b/type/__matrix_synapse/manifest index 40ce138..04ccd42 100755 --- a/type/__matrix_synapse/manifest +++ b/type/__matrix_synapse/manifest @@ -20,10 +20,9 @@ # OS-specific configuration. os=$(cat "$__global/explorer/os") -distribution=$(cat "$__global/explorer/lsb_codename") case "$os" in - debian) + debian|ubuntu) synapse_user=matrix-synapse synapse_pkg=matrix-synapse-py3 synapse_service=matrix-synapse @@ -31,22 +30,13 @@ case "$os" in synapse_conf_dir='/etc/matrix-synapse' synapse_data_dir='/var/lib/matrix-synapse' - # We use upstream's APT repository in order to stay up-to-date: upstream - # moves fast and downstream debian package is necessarily delayed. - case "$distribution" in - buster|bulleye|bookworm|sid) - __apt_key matrix-org \ - --uri https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg - require="__apt_key/matrix-org" __apt_source matrix-org \ - --uri https://packages.matrix.org/debian/ \ - --component main - package_req="__apt_source/matrix-org" - ;; - *) - echo "Unknown debian release '$distribution'. Exiting" >&2 - exit 1 - ;; - esac + __apt_key matrix-org \ + --uri https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg + + require="__apt_key/matrix-org" __apt_source matrix-org \ + --uri https://packages.matrix.org/debian/ \ + --component main + package_req="__apt_source/matrix-org" ;; alpine) synapse_user=synapse @@ -330,8 +320,8 @@ for directory in $DATA_DIR $LOG_DIR; do --owner $synapse_user done -# Make dpkg-reconfigure happy on debian systems. -if [ "$os" = "debian" ]; then +# Make dpkg-reconfigure happy on debian-based systems. +if [ "$os" = "debian" ] || [ "$os" = "ubuntu" ]; then require="$synapse_req" __file "$synapse_conf_dir/conf.d/server_name.yaml" \ --owner $synapse_user \ --source - <<- EOF