Compare commits

...

10 Commits

6 changed files with 66 additions and 62 deletions

49
.drone.yml Normal file
View File

@ -0,0 +1,49 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: matrix-synapse
generate_secrets: true
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
networks:
- proxy
environment:
DOMAIN: matrix-synapse.swarm-test.autonomic.zone
STACK_NAME: matrix-synapse
LETS_ENCRYPT_ENV: production
DISCORD_BRIDGE_YAML_VERSION: v1
ENTRYPOINT_CONF_VERSION: v1
HOMESERVER_YAML_VERSION: v17
LOG_CONFIG_VERSION: v1
SHARED_SECRET_AUTH_VERSION: v1
SIGNAL_BRIDGE_YAML_VERSION: v1
TELEGRAM_BRIDGE_YAML_VERSION: v1
SECRET_DB_PASSWORD_VERSION: v1
SECRET_FORM_SECRET_VERSION: v1
SECRET_MACAROON_SECRET_KEY_VERSION: v1
SECRET_REGISTRATION_SHARED_SECRET_VERSION: v1
trigger:
branch:
- main
---
kind: pipeline
name: generate recipe catalogue
steps:
- name: release a new version
image: plugins/downstream
settings:
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -18,73 +18,28 @@
1. Set up Docker Swarm and [`abra`](https://docs.coopcloud.tech/abra/) 1. Set up Docker Swarm and [`abra`](https://docs.coopcloud.tech/abra/)
2. Deploy [`coop-cloud/traefik`](https://git.coopcloud.tech/coop-cloud/traefik) 2. Deploy [`coop-cloud/traefik`](https://git.coopcloud.tech/coop-cloud/traefik)
3. `abra app new matrix-synapse --secrets` (optionally with `--pass` if you'd like to save secrets in `pass`) 3. `abra app new matrix-synapse --secrets` (optionally with `--pass` if you'd like to save secrets in `pass`)
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to your Docker swarm box 4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy` 5. `abra app deploy YOURAPPDOMAIN`
6. Create an initial user: `abra app YOURAPPDOMAIN run app register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008` 6. Create an initial user: `abra app run YOURAPPDOMAIN app register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008`
## Tips & Tricks ## Tips & Tricks
### Disabling federation ### Disabling federation
> We're not sure this does it exactly and there is still a discussion running - Use `DISABLE_FEDERATION=1` to turn off federation listeners
> upstream about whether this is the right way to do it & whether it could be - Don't use [`compose.matrix.yml`](https://git.coopcloud.tech/coop-cloud/traefik/src/branch/master/compose.matrix.yml) in your traefik config to keep the federation ports closed
> more convenient. We welcome issues / change sets to close up more federation
> functionality.
- use `DISABLE_FEDERATION=1` to turn off federation listeners
- don't use [`compose.matrix.yml`](https://git.coopcloud.tech/coop-cloud/traefik/src/branch/master/compose.matrix.yml) in your traefik config to keep the federation ports closed
### Enabling federation ### Enabling federation
See [`#27`](https://git.coopcloud.tech/coop-cloud/matrix-synapse/pulls/27) for more. See [`#27`](https://git.coopcloud.tech/coop-cloud/matrix-synapse/pulls/27) for more. Depending on your setup, using `SERVE_SERVER_WELLKNOWN=true` might work to start federating. Make sure you don't leave `DISABLE_FEDERATION=1` set!
Depending on your setup, using `SERVE_SERVER_WELLKNOWN=true` might work to start federating.
Make sure you don't leave `DISABLE_FEDERATION=1` set!
### Seeing what changed in `homeserver.yaml` between versions
Change the version range to suit your needs.
```
git clone https://github.com/matrix-org/synapse
cd synapse/docs
git log --follow -p v1.48.0..v1.51.0 sample_config.yaml
```
### Generating a new `homeserver.yaml`
The default is also available to see [here](https://matrix-org.github.io/synapse/latest/usage/configuration/homeserver_sample_config.html).
```
docker run -it \
--entrypoint="" \
-e SYNAPSE_SERVER_NAME=foo.com \
-e SYNAPSE_REPORT_STATS=no \
matrixdotorg/synapse:v1.48.0 \
sh -c '/start.py generate; cat /data/homeserver.yaml' > homeserver.yaml.tmpl`
```
### Generating a new `<server>.log.config`
```
docker run -it \
--entrypoint="" \
-e SYNAPSE_SERVER_NAME=foo.com \
-e SYNAPSE_REPORT_STATS=no \
matrixdotorg/synapse:v1.48.0 \
sh -c '/start.py generate; cat /data/foo.com.log.config' > log.config
```
### Getting client discovery on a custom domain ### Getting client discovery on a custom domain
You'll need to deploy something like [this](https://git.autonomic.zone/ruangrupa/well-known-uris). You'll need to deploy something like [this](https://git.autonomic.zone/ruangrupa/well-known-uris). This could be implemented in this recipe but we haven't merged it in yet. Change sets are welcome.
This could be implemented in this recipe but we haven't merged it in yet. Change sets are welcome.
### Telegram bridging ### Telegram bridging
> WIP > WIP docs
Setting it up is a bit of a chicken/egg & chasing cats moment. Setting it up is a bit of a chicken/egg & chasing cats moment.
@ -123,7 +78,7 @@ Some helpful documentation:
### Discord bridging ### Discord bridging
> WIP > WIP docs
Just as messy as the Telegram bridging above! Rough guide: Just as messy as the Telegram bridging above! Rough guide:
@ -142,9 +97,9 @@ Some helpful documentation:
### Signal bridging ### Signal bridging
> WIP > WIP docs
OK, it's also awful to set this up. Do you see a pattern emerging? :) OK, it's also awful to set this up. Do you see a pattern emerging :)
- fake that you have the required tokens: - fake that you have the required tokens:
- `abra app secret insert example.com signal_hs_token v1 foo` - `abra app secret insert example.com signal_hs_token v1 foo`

View File

@ -9,7 +9,7 @@ services:
- shared_secret_auth - shared_secret_auth
configs: configs:
- source: shared_secret_auth - source: shared_secret_auth
target: /usr/local/lib/python3.9/site-packages/shared_secret_authenticator.py target: /usr/local/lib/python3.11/site-packages/shared_secret_authenticator.py
configs: configs:
shared_secret_auth: shared_secret_auth:

View File

@ -10,7 +10,7 @@ services:
- signal-data:/signal-data - signal-data:/signal-data
signald: signald:
image: docker.io/signald/signald:0.23.0-non-root image: docker.io/signald/signald:0.23.2-non-root
networks: networks:
- internal - internal
volumes: volumes:

View File

@ -10,7 +10,7 @@ services:
- telegram-data:/telegram-data - telegram-data:/telegram-data
telegrambridge: telegrambridge:
image: dock.mau.dev/mautrix/telegram:v0.12.2 image: dock.mau.dev/mautrix/telegram:v0.13.0
depends_on: depends_on:
- telegramdb - telegramdb
configs: configs:

View File

@ -3,7 +3,7 @@ version: "3.8"
services: services:
app: app:
image: "matrixdotorg/synapse:v1.74.0" image: "matrixdotorg/synapse:v1.77.0"
volumes: volumes:
- "data:/data" - "data:/data"
depends_on: depends_on:
@ -61,7 +61,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=3.0.0+v1.74.0" - "coop-cloud.${STACK_NAME}.version=3.2.0+v1.77.0"
db: db:
image: postgres:13-alpine image: postgres:13-alpine
@ -102,7 +102,7 @@ configs:
file: entrypoint.sh.tmpl file: entrypoint.sh.tmpl
template_driver: golang template_driver: golang
homeserver_yaml: homeserver_yaml:
name: ${STACK_NAME}_homserver_yaml_${HOMESERVER_YAML_VERSION} name: ${STACK_NAME}_homeserver_yaml_${HOMESERVER_YAML_VERSION}
file: homeserver.yaml.tmpl file: homeserver.yaml.tmpl
template_driver: golang template_driver: golang
log_config: log_config: