mother-of-all-self-hosting / mash-playbook

🐋 Ansible playbook which helps you host various FOSS services as Docker containers on your own server
GNU Affero General Public License v3.0
417 stars 48 forks source link

mash-playbook + matrix-docker-ansible-deploy playbook #64

Open Gregivy opened 1 year ago

Gregivy commented 1 year ago

What is the best way to combine this playbook with the matrix playbook to run on the same machine? Is there any nuances of using traefik/postgre? As traefik service is present in both playbooks will it be enough to use it from only one of the playbooks (e.g. if I already use matrix playbook, can skip turning on traefik in mash playbook)?

spantaleev commented 1 year ago

The recommended way is to have only one of those playbooks install Traefik. Preferrably matrix-docker-ansible-deploy, because its Traefik setup is more involved (handling the custom port tpc/8448 for federation, etc.).

Thus, the mash-playbook setup's vars.yml should include some configuration like this:

mash_playbook_reverse_proxy_type: other-traefik-container
mash_playbook_reverse_proxyable_services_additional_network: traefik

Also, just one of these playbooks should install Docker and timesync. It doesn't hurt if both have these installation steps, but it's somewhat wasteful.


This should be documented better somewhere

thomsbe commented 1 year ago

Same question about postgres. As @Gregivy already asked, what about 2 containers with postgres? I have the matrix-playbook running, this provides postgres. Mash has it's own postgres-container? How to combine these two, since I guess, one database-container is better than two with limited ressources.

spantaleev commented 1 year ago

It's possible to use a single Postgres instance, but easiest if you run a Postgres instance for each playbook.

By default, both playbooks automatically wire components to use their own Postgres instance, so you will be spared a lot of effort.

Here's an example of database credentials initialization: https://github.com/mother-of-all-self-hosting/mash-playbook/blob/2176f0b551d25ef69d53fdbf1a337a79a1185ac5/group_vars/mash_servers#L231-L333

Here's an example of one service (Miniflux) being connected to the Postgres container network: https://github.com/mother-of-all-self-hosting/mash-playbook/blob/2176f0b551d25ef69d53fdbf1a337a79a1185ac5/group_vars/mash_servers#L1621-L1626

If you want mash services to use the Matrix playbook's Postgres, you need to do both of these things manually:

thomsbe commented 1 year ago

Ok, I will stick with the two databases :smile:

The traefik config results in a 404. The mash-containers are connected to the traefik-network. But it looks like there is no routing for the 2 new hostnames, "git" and "status". Traefik-log:

Jun 09 13:20:02 tbaer.de matrix-traefik[3962152]: 172.28.0.1 - - [09/Jun/2023:11:19:32 +0000] "GET /_matrix/client/r0/sync?filter=5&timeout=30000&since=s87124_1436984_122_33113_35512_10_5118_685_0_1 HTTP/1.1" 200 171 "-" "-" 130 "matrix-nginx-proxy-matrix-client@docker" "http://172.25.0.3:8080" 30014ms

Jun 09 13:20:02 tbaer.de matrix-traefik[3962152]: 172.28.0.1 - - [09/Jun/2023:11:20:02 +0000] "OPTIONS /_matrix/client/r0/sync?filter=5&timeout=30000&since=s87124_1436984_122_33113_35512_10_5118_685_0_1 HTTP/1.1" 204 0 "-" "-" 132 "matrix-nginx-proxy-matrix-client@docker" "http://172.25.0.3:8080" 4ms

Jun 09 13:20:03 tbaer.de matrix-traefik[3962152]: 172.28.0.1 - - [09/Jun/2023:11:20:03 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 134 "-" "-" 0ms

The last line here is the request resulting in a 404. It seems, there is a missing piece somewhere in the config. I can't get up the traefik-dashboard on the matrix-side, because of an parsing error in some template. I don't know traefik, but I can connect to the running container. But it looks like there is now way to show the routes via cli. Is there a missing piece of config in the providers.yml or something?

Traefik is fronted by Caddyserver, I have added the 2 new hostnames to the other matrix-releated names in the same block. There are no other ports listening and the request from the outside reaches traefik, so I guess, this part is working, only the routing for the hostnames is missing to treafik.