diff --git a/dns.yml b/dns.yml index 3dcc103..47331fe 100644 --- a/dns.yml +++ b/dns.yml @@ -37,6 +37,8 @@ ip: "152.53.36.98" - name: watcher ip: "152.53.36.98" + - name: chat + ip: "152.53.36.98" - name: nerder.land dns_records: - name: "forms" diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index b2d576e..f6c9b8b 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -67,6 +67,15 @@ thesatelliteoflove.com { file_server } +chat.thesatelliteoflove.com, chat.thesatelliteoflove.com:8448 { + handle /.well-known/* { + root * /srv/matrix + file_server + } + reverse_proxy /_matrix/* conduit-homeserver-1:6167 +} + + bookmarks.thesatelliteoflove.com { reverse_proxy hoarder-web-1:3000 } diff --git a/roles/docker/files/caddy-compose.yml b/roles/docker/files/caddy-compose.yml index 0385029..537a7a9 100644 --- a/roles/docker/files/caddy-compose.yml +++ b/roles/docker/files/caddy-compose.yml @@ -6,6 +6,8 @@ services: - "80:80" - "443:443" - "443:443/udp" + - "8448:8448" + - "8448:8448/udp" volumes: - ./Caddyfile:/etc/caddy/Caddyfile - ./site:/srv diff --git a/roles/docker/files/client b/roles/docker/files/client new file mode 100644 index 0000000..5fc36ab --- /dev/null +++ b/roles/docker/files/client @@ -0,0 +1,5 @@ +{ + "m.homeserver": { + "base_url": "https://chat.thesatelliteoflove.com" + } +} diff --git a/roles/docker/files/server b/roles/docker/files/server new file mode 100644 index 0000000..b1f9409 --- /dev/null +++ b/roles/docker/files/server @@ -0,0 +1,3 @@ +{ + "m.server": "chat.thesatelliteoflove.com:443" +} diff --git a/roles/docker/tasks/conduit.yml b/roles/docker/tasks/conduit.yml new file mode 100644 index 0000000..7f1aa50 --- /dev/null +++ b/roles/docker/tasks/conduit.yml @@ -0,0 +1,29 @@ +- name: make conduit directories + ansible.builtin.file: + path: "{{ item}}" + state: directory + loop: + - /opt/stacks/conduit + +- name: copy well-known files + ansible.builtin.copy: + src: "{{item}}" + dest: /opt/stacks/caddy/site/matrix/ + owner: root + mode: 644 + loop: + - client + - server + +- name: Template out the compose file + ansible.builtin.template: + src: conduit-compose.yml.j2 + dest: /opt/stacks/conduit/compose.yml + owner: root + mode: 644 + +- name: deploy conduit stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/conduit + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 01b8bef..31059bb 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -152,4 +152,7 @@ - name: Install changedetection import_tasks: changedetection.yml - tags: changedetection \ No newline at end of file + tags: changedetection +- name: Install conduit + import_tasks: conduit.yml + tags: conduit diff --git a/roles/docker/templates/conduit-compose.yml.j2 b/roles/docker/templates/conduit-compose.yml.j2 new file mode 100644 index 0000000..87bbfee --- /dev/null +++ b/roles/docker/templates/conduit-compose.yml.j2 @@ -0,0 +1,46 @@ +services: + homeserver: + image: matrixconduit/matrix-conduit:next + restart: unless-stopped + volumes: + - db:/var/lib/matrix-conduit/ + labels: + glance.name: Conduit + glance.icon: si:matrix + glance.url: https://chat.thesatelliteoflove.com/ + glance.description: Matrix server + environment: + CONDUIT_SERVER_NAME: chat.thesatelliteoflove.com # EDIT THIS + CONDUIT_DATABASE_PATH: /var/lib/matrix-conduit/ + CONDUIT_DATABASE_BACKEND: rocksdb + CONDUIT_PORT: 6167 + CONDUIT_MAX_REQUEST_SIZE: 20000000 # in bytes, ~20 MB + CONDUIT_ALLOW_REGISTRATION: 'true' + CONDUIT_ALLOW_FEDERATION: 'true' + CONDUIT_ALLOW_CHECK_FOR_UPDATES: 'true' + CONDUIT_TRUSTED_SERVERS: '["matrix.org"]' + #CONDUIT_MAX_CONCURRENT_REQUESTS: 100 + CONDUIT_ADDRESS: 0.0.0.0 + CONDUIT_CONFIG: '' # Ignore this + # + ### Uncomment if you want to use your own Element-Web App. + ### Note: You need to provide a config.json for Element and you also need a second + ### Domain or Subdomain for the communication between Element and Conduit + ### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md + # element-web: + # image: vectorim/element-web:latest + # restart: unless-stopped + # ports: + # - 8009:80 + # volumes: + # - ./element_config.json:/app/config.json + # depends_on: + # - homeserver + +volumes: + db: + +networks: + default: + external: true + name: lava \ No newline at end of file