From fb8f911c494fea18db6f6a026d6e41e2068709f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:09:49 +0100 Subject: [PATCH] New Script: Element Synapse (#1955) * add element synapse script * Update install/elementsynapse-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Update install/elementsynapse-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * fixes * fixes v2 --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/elementsynapse.sh | 49 +++++++++++++++++++++++++++++++ install/elementsynapse-install.sh | 43 +++++++++++++++++++++++++++ json/elementsynapse.json | 34 +++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 ct/elementsynapse.sh create mode 100644 install/elementsynapse-install.sh create mode 100644 json/elementsynapse.json diff --git a/ct/elementsynapse.sh b/ct/elementsynapse.sh new file mode 100644 index 000000000..376cac8fe --- /dev/null +++ b/ct/elementsynapse.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tremor021 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/element-hq/synapse + +# App Default Values +APP="Element Synapse" +var_tags="server" +var_cpu="1" +var_ram="1024" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# App Output & Base Settings +header_info "$APP" +base_settings + +# Core +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /etc/matrix-synapse ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating $APP LXC" + apt-get update &>/dev/null + apt-get -y upgrade &>/dev/null + msg_ok "Updated $APP LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8008${CL}" \ No newline at end of file diff --git a/install/elementsynapse-install.sh b/install/elementsynapse-install.sh new file mode 100644 index 000000000..120e56fda --- /dev/null +++ b/install/elementsynapse-install.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tremor021 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y + sudo \ + curl \ + mc \ + lsb-release \ + wget \ + apt-transport-https \ + debconf-utils +msg_ok "Installed Dependencies" + +msg_info "Installing Element Synapse" +wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg +echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/matrix-org.list +$STD apt-get update +echo "matrix-synapse-py3 matrix-synapse/server-name string matrix" | debconf-set-selections +echo "matrix-synapse-py3 matrix-synapse/report-stats boolean false" | debconf-set-selections +$STD apt-get install matrix-synapse-py3 -y +sed -i 's/127.0.0.1/0.0.0.0/g' /etc/matrix-synapse/homeserver.yaml +systemctl enable -q --now matrix-synapse +msg_ok "Installed Element Synapse" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/elementsynapse.json b/json/elementsynapse.json new file mode 100644 index 000000000..1de1c0834 --- /dev/null +++ b/json/elementsynapse.json @@ -0,0 +1,34 @@ +{ + "name": "Element Synapse", + "slug": "elementsynapse", + "categories": [ + 4 + ], + "date_created": "2025-02-02", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8008, + "documentation": "https://element-hq.github.io/synapse/latest/welcome_and_overview.html", + "website": "https://element.io/", + "logo": "https://element.io/images/logo-mark-primary.svg", + "description": "Synapse is an open source Matrix homeserver implementation, written and maintained by Element. Matrix is the open standard for secure and interoperable real time communications. You can directly run and manage the source code in this repository, available under an AGPL license. There is no support provided from Element unless you have a subscription.", + "install_methods": [ + { + "type": "default", + "script": "ct/elementsynapse.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] + } \ No newline at end of file