From c9f0975e766e79d4bd6adf4255cd081f54d654cb Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Aug 2021 13:05:06 +0100 Subject: [PATCH] Add synapse app --- apps/registry.json | 22 ++++++++++++++++++++++ apps/synapse/data/synapse/.gitkeep | 0 apps/synapse/docker-compose.yml | 25 +++++++++++++++++++++++++ scripts/configure | 4 ++++ templates/.env-sample | 2 ++ templates/torrc-sample | 5 +++++ 6 files changed, 58 insertions(+) create mode 100644 apps/synapse/data/synapse/.gitkeep create mode 100644 apps/synapse/docker-compose.yml diff --git a/apps/registry.json b/apps/registry.json index 6c5032c..9e13f00 100644 --- a/apps/registry.json +++ b/apps/registry.json @@ -108,6 +108,28 @@ "path": "", "defaultPassword": "", "torOnly": false + }, + { + "id": "synapse", + "category": "Messaging", + "name": "Synapse", + "version": "1.38.0", + "tagline": "Matrix reference homeserver", + "description": "Synapse is a reference \"homeserver\" implementation of Matrix from the core development team at matrix.org, written in Python/Twisted. It is intended to showcase the concept of Matrix and let folks see the spec in the context of a codebase and let you run your own homeserver and generally help bootstrap the ecosystem.\n\nThe easiest way to try out your new Synapse installation is by connecting to it from a web client.\n\nAn easy way to get started is to install the \"Element\" app on your Umbrel and change its Homeserver URL from matrix.org server to your Synapse's Homeserver URL of http://umbrel.local:8008 (or http:// if you are accessing remotely).\n\nIn Matrix, every user runs one or more Matrix clients, which connect through to a Matrix homeserver. The homeserver stores all their personal chat history and user account information - much as a mail client connects through to an IMAP/SMTP server. Just like email, you can either run your own Matrix homeserver and control and own your own communications and history or use one hosted by someone else (e.g. matrix.org) - there is no single point of control or mandatory service provider in Matrix, unlike WhatsApp, Facebook, Hangouts, etc.", + "developer": "Matrix", + "website": "https://matrix.org", + "dependencies": [], + "repo": "https://github.com/matrix-org/synapse", + "support": "https://matrix.to/#/#synapse:matrix.org", + "port": 8008, + "gallery": [ + "1.jpg", + "2.jpg", + "3.jpg" + ], + "path": "", + "defaultPassword": "", + "torOnly": false }, { "id": "simple-torrent", diff --git a/apps/synapse/data/synapse/.gitkeep b/apps/synapse/data/synapse/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/synapse/docker-compose.yml b/apps/synapse/docker-compose.yml new file mode 100644 index 0000000..ee49ec3 --- /dev/null +++ b/apps/synapse/docker-compose.yml @@ -0,0 +1,25 @@ +version: "3.7" + +services: + server: + image: matrixdotorg/synapse:v1.39.0@sha256:f2cfc838172a3c8c3f3595a637ba465f0d933049ba48b7c7822cec2f0ccc9d80 + user: "1000:1000" + restart: on-failure + stop_grace_period: 1m + ports: + - "$APP_SYNAPSE_PORT:$APP_SYNAPSE_PORT" + entrypoint: "bash" + command: "-c './start.py generate && ./start.py migrate_config && exec ./start.py'" + volumes: + - ${APP_DATA_DIR}/data/synapse:/data + environment: + UID: "1000" + GID: "1000" + SYNAPSE_HTTP_PORT: "${APP_SYNAPSE_PORT}" + SYNAPSE_SERVER_NAME: "${APP_HIDDEN_SERVICE}" + SYNAPSE_REPORT_STATS: "yes" + SYNAPSE_ENABLE_REGISTRATION: "yes" + SYNAPSE_NO_TLS: "yes" + networks: + default: + ipv4_address: $APP_SYNAPSE_IP diff --git a/scripts/configure b/scripts/configure index 5c1096c..5cec459 100755 --- a/scripts/configure +++ b/scripts/configure @@ -176,6 +176,8 @@ APP_SIMPLETORRENT_IP="10.21.21.41" APP_PHOTOPRISM_IP="10.21.21.42" APP_PHOTOPRISM_PORT="8087" APP_PHOTOPRISM_DB_IP="10.21.21.43" +APP_SYNAPSE_IP="10.21.21.44" +APP_SYNAPSE_PORT="8008" # Generate RPC credentials if [[ -z ${BITCOIN_RPC_USER+x} ]] || [[ -z ${BITCOIN_RPC_PASS+x} ]] || [[ -z ${BITCOIN_RPC_AUTH+x} ]]; then @@ -357,6 +359,8 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" " sed -i "s//${APP_PHOTOPRISM_IP}/g" "${template}" sed -i "s//${APP_PHOTOPRISM_PORT}/g" "${template}" sed -i "s//${APP_PHOTOPRISM_DB_IP}/g" "${template}" + sed -i "s//${APP_SYNAPSE_IP}/g" "${template}" + sed -i "s//${APP_SYNAPSE_PORT}/g" "${template}" done ########################################################## diff --git a/templates/.env-sample b/templates/.env-sample index be14adc..fa85d42 100644 --- a/templates/.env-sample +++ b/templates/.env-sample @@ -79,3 +79,5 @@ APP_SIMPLETORRENT_IP= APP_PHOTOPRISM_IP= APP_PHOTOPRISM_PORT= APP_PHOTOPRISM_DB_IP= +APP_SYNAPSE_IP= +APP_SYNAPSE_PORT= diff --git a/templates/torrc-sample b/templates/torrc-sample index 7f3161a..85a31fd 100644 --- a/templates/torrc-sample +++ b/templates/torrc-sample @@ -110,4 +110,9 @@ HiddenServicePort 22 : HiddenServiceDir /var/lib/tor/app-simple-torrent HiddenServicePort 80 : +# synapse Hidden Service +HiddenServiceDir /var/lib/tor/app-synapse +HiddenServicePort 80 : +HiddenServicePort : + HashedControlPassword