From bff9f620938d4fe178ea8ec5265d3f7814e557e0 Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 15 Aug 2024 09:28:42 -0600 Subject: [PATCH] Added gotosocial and added an attempted fix for the authentik redis nonsense --- roles/docker/files/Caddyfile | 4 +-- roles/docker/files/gitea-compose.yml | 2 +- roles/docker/tasks/gitea.yml | 2 +- roles/docker/tasks/gotosocial.yml | 19 ++++++++++ roles/docker/tasks/main.yml | 5 +-- .../docker/templates/authentik-compose.yml.j2 | 14 ++++---- .../templates/gotosocial-compose.yml.j2 | 36 +++++++++++++++++++ 7 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 roles/docker/tasks/gotosocial.yml create mode 100644 roles/docker/templates/gotosocial-compose.yml.j2 diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index 3dc1481..8540574 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -15,6 +15,6 @@ bookmarks.thesatelliteoflove.com { reverse_proxy hoarder-web-1:3000 } -ai.thesatelliteoflove.com { - reverse_proxy open-webui:8080 +social.thesatelliteoflove.com { + reverse_proxy gotosocial:8080 } \ No newline at end of file diff --git a/roles/docker/files/gitea-compose.yml b/roles/docker/files/gitea-compose.yml index fa80811..e427ec5 100644 --- a/roles/docker/files/gitea-compose.yml +++ b/roles/docker/files/gitea-compose.yml @@ -14,7 +14,7 @@ services: ports: - 222:22 extra_hosts: - - 'auth.thesatelliteoflove.com:172.20.0.6' + - 'auth.thesatelliteoflove.com:172.20.0.2' volumes: gitea: diff --git a/roles/docker/tasks/gitea.yml b/roles/docker/tasks/gitea.yml index 6af2f73..605aa10 100644 --- a/roles/docker/tasks/gitea.yml +++ b/roles/docker/tasks/gitea.yml @@ -1,4 +1,4 @@ -- name: make caddy directories +- name: make gitea directories ansible.builtin.file: path: "{{ item}}" state: directory diff --git a/roles/docker/tasks/gotosocial.yml b/roles/docker/tasks/gotosocial.yml new file mode 100644 index 0000000..6e0529a --- /dev/null +++ b/roles/docker/tasks/gotosocial.yml @@ -0,0 +1,19 @@ +- name: make gotosocial directories + ansible.builtin.file: + path: "{{ item}}" + state: directory + loop: + - /opt/stacks/gotosocial + +- name: Template out the compose file + ansible.builtin.template: + src: gotosocial-compose.yml.j2 + dest: /opt/stacks/gotosocial/compose.yml + owner: root + mode: 644 + +- name: deploy gotosocial stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/gotosocial + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 7824a9a..eef5e95 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -70,5 +70,6 @@ - name: Install authentik import_tasks: authentik.yml -#- name: Install openwebui -# import_tasks: openwebui.yml +- name: Install gotosocial + import_tasks: gotosocial.yml + diff --git a/roles/docker/templates/authentik-compose.yml.j2 b/roles/docker/templates/authentik-compose.yml.j2 index aa786b9..22ff1c6 100644 --- a/roles/docker/templates/authentik-compose.yml.j2 +++ b/roles/docker/templates/authentik-compose.yml.j2 @@ -18,7 +18,7 @@ services: POSTGRES_DB: ${PG_DB:-authentik} env_file: - .env - redis: + trout: image: docker.io/library/redis:alpine command: --save 60 1 --loglevel warning restart: unless-stopped @@ -29,13 +29,13 @@ services: retries: 5 timeout: 3s volumes: - - redis:/data + - trout:/data server: image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.6.3} restart: unless-stopped command: server environment: - AUTHENTIK_REDIS__HOST: redis + AUTHENTIK_REDIS__HOST: trout AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} @@ -50,13 +50,13 @@ services: - "${COMPOSE_PORT_HTTPS:-9443}:9443" depends_on: - postgresql - - redis + - trout worker: image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.6.3} restart: unless-stopped command: worker environment: - AUTHENTIK_REDIS__HOST: redis + AUTHENTIK_REDIS__HOST: trout AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} @@ -77,12 +77,12 @@ services: - .env depends_on: - postgresql - - redis + - trout volumes: database: driver: local - redis: + trout: driver: local networks: diff --git a/roles/docker/templates/gotosocial-compose.yml.j2 b/roles/docker/templates/gotosocial-compose.yml.j2 new file mode 100644 index 0000000..6ee9a7d --- /dev/null +++ b/roles/docker/templates/gotosocial-compose.yml.j2 @@ -0,0 +1,36 @@ +version: "3.3" + +services: + gotosocial: + image: superseriousbusiness/gotosocial:0.16.0 + container_name: gotosocial + user: 1000:1000 + extra_hosts: + - 'auth.thesatelliteoflove.com:172.20.0.2' + environment: + GTS_HOST: social.thesatelliteoflove.com + GTS_DB_TYPE: sqlite + GTS_DB_ADDRESS: /gotosocial/storage/sqlite.db + GTS_LETSENCRYPT_ENABLED: "false" + GTS_LETSENCRYPT_EMAIL_ADDRESS: "" + GTS_TRUSTED_PROXIES: "172.20.0.2" + GTS_ACCOUNT_DOMAIN: thesatelliteoflove.com + GTS_OIDC_ENABLED: "true" + GTS_OIDC_IDP_NAME: "Authentik" + GTS_OIDC_ISSUER: https://auth.thesatelliteoflove.com/application/o/gotosocial/ + GTS_OIDC_CLIENT_ID: {{ gts_oidc_client_id }} + GTS_OIDC_CLIENT_SECRET: {{ gts_oidc_client_secret }} + GTS_OIDC_LINK_EXISTING: "true" + TZ: UTC + volumes: + - gotosocial:/gotosocial/storage + restart: "always" + +volumes: + gotosocial: + driver: local + +networks: + default: + external: true + name: lava \ No newline at end of file