From 1b5054c5f803665b44a93b65457699cf6d8b5109 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Mon, 29 May 2023 23:49:16 +0800 Subject: [PATCH] fixes i needed during deployment --- privfrontends/compose/breezewiki/compose.yml.j2 | 2 +- privfrontends/compose/scribe/compose.yml.j2 | 2 +- privfrontends/compose/watchtower/compose.yml.j2 | 1 - privfrontends/docker-tasks.yaml | 10 +++++++--- privfrontends/playbook.yaml | 17 +++++++++++------ privfrontends/templates/Caddyfile.j2 | 8 ++++++-- privfrontends/templates/eu/darknet.Caddyfile | 11 ++--------- privfrontends/templates/eu/misc.Caddyfile | 4 +++- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/privfrontends/compose/breezewiki/compose.yml.j2 b/privfrontends/compose/breezewiki/compose.yml.j2 index b617302..a2fadb8 100644 --- a/privfrontends/compose/breezewiki/compose.yml.j2 +++ b/privfrontends/compose/breezewiki/compose.yml.j2 @@ -6,4 +6,4 @@ services: ports: - "10416:10416" volumes: - - "./config.ini:/app/config.ini" + - "./extras.conf:/app/config.ini" diff --git a/privfrontends/compose/scribe/compose.yml.j2 b/privfrontends/compose/scribe/compose.yml.j2 index cf11ecb..d1d424d 100644 --- a/privfrontends/compose/scribe/compose.yml.j2 +++ b/privfrontends/compose/scribe/compose.yml.j2 @@ -13,4 +13,4 @@ services: - APP_DOMAIN=scribe.projectsegfau.lt - LUCKY_ENV=production - PORT=8006 - - SECRET_KEY_BASE={{scribe_secret_key_base}} + - SECRET_KEY_BASE={{scribe_secret_key_base}} diff --git a/privfrontends/compose/watchtower/compose.yml.j2 b/privfrontends/compose/watchtower/compose.yml.j2 index 7733522..e455e04 100644 --- a/privfrontends/compose/watchtower/compose.yml.j2 +++ b/privfrontends/compose/watchtower/compose.yml.j2 @@ -1,4 +1,3 @@ -version: 2 services: watchtower: image: containrrr/watchtower diff --git a/privfrontends/docker-tasks.yaml b/privfrontends/docker-tasks.yaml index 8139bae..9064a49 100644 --- a/privfrontends/docker-tasks.yaml +++ b/privfrontends/docker-tasks.yaml @@ -1,4 +1,8 @@ --- +- name: Create directory for service + file: + path: /opt/docker/{{item}} + state: directory - name: Copy docker-compose templates for the service template: src: ./compose/{{item}}/compose.yml.j2 @@ -20,16 +24,16 @@ command: chdir: "/opt/docker/{{ item }}" cmd: docker compose pull - when: check_status is changed + when: check_status.changed - name: "Stop docker service" command: chdir: "/opt/docker/{{ item }}" cmd: docker compose down - when: check_status is changed + when: check_status.changed - name: "Start docker service" command: chdir: "/opt/docker/{{ item }}" cmd: docker compose up -d --build --remove-orphans - when: check_status is changed + when: check_status.changed diff --git a/privfrontends/playbook.yaml b/privfrontends/playbook.yaml index d12695e..6ddfb15 100644 --- a/privfrontends/playbook.yaml +++ b/privfrontends/playbook.yaml @@ -2,11 +2,12 @@ - name: Setup Caddy hosts: privfrontends roles: - - role: caddy_ansible.caddy_ansible + - role: caddy-ansible caddy_systemd_capabilities_enabled: true caddy_config: "{{ lookup('template', './templates/Caddyfile.j2') }}" caddy_user: "caddy" caddy_home: "/var/lib/caddy" + caddy_packages: ["github.com/caddy-dns/rfc2136@master"] # Static weekly builds of caddy with rfc2136 dns plugin caddy_url_base: "https://cb.projectsegfau.lt/api/download" tasks: @@ -14,18 +15,22 @@ copy: src: "./templates/{{ inventory_hostname }}/" dest: /etc/caddy/ - remote_src: true directory_mode: true + - name: Restart + service: + name: caddy + enabled: yes + state: restarted - name: Setup docker compose for privacy frontends hosts: privfrontends vars: docker_services: - anonymousoverflow - - beatbump + #- beatbump - breezewiki - gothub - gothub-dev - - invidious + #- invidious - librarian - libreddit - nitter @@ -34,8 +39,8 @@ - teddit - watchtower non_pizza_docker_services: - - piped - - searxng-docker + #- piped + - searxng tasks: # # community.docker does not support compose 2.0 right now. diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index 7504170..79c7333 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -134,6 +134,10 @@ proxy.lbry.projectsegfau.lt { reverse_proxy localhost:3001 import def } +gothub.dev.projectsegfau.lt gh.dev.psf.lt { + reverse_proxy localhost:1025 + import def +} {% else %} inv.{{inventory_hostname}}.projectsegfau.lt { reverse_proxy localhost:7573 @@ -260,7 +264,7 @@ pi.{{inventory_hostname}}.psf.lt { } {% endif %} lbry.{{inventory_hostname}}.projectsegfau.lt lbry.projectsegfau.lt { - reverse_proxy :7269 + reverse_proxy :3550 import def import torloc lbry import i2ploc pjsf7uucpqf2crcmfo3nvwdmjhirxxjfyuvibdfp5x3af2ghqnaa.b32.i2p @@ -392,4 +396,4 @@ search.{{inventory_hostname}}.projectsegfau.lt s.psf.lt s.{{inventory_hostname}} } } {% endif %} -include ./*.Caddyfile +import ./*.Caddyfile diff --git a/privfrontends/templates/eu/darknet.Caddyfile b/privfrontends/templates/eu/darknet.Caddyfile index f0955a3..248e6d8 100644 --- a/privfrontends/templates/eu/darknet.Caddyfile +++ b/privfrontends/templates/eu/darknet.Caddyfile @@ -1,10 +1,3 @@ -http://pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion http://pjsfg3pdzzocax6a4oznoyf5k4etzknfatqu23i43wxejwdaffoa.b32.i2p { - reverse_proxy https://projectsegfau.lt { - header_up Host "projectsegfau.lt" - } - import tor www - import i2ploc pjsfg3pdzzocax6a4oznoyf5k4etzknfatqu23i43wxejwdaffoa.b32.i2p -} http://www.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion http://pjsfg3pdzzocax6a4oznoyf5k4etzknfatqu23i43wxejwdaffoa.b32.i2p { reverse_proxy https://projectsegfau.lt { header_up Host "projectsegfau.lt" @@ -68,9 +61,9 @@ http://gothub.dev.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion import tor gothub.dev reverse_proxy localhost:1025 } -http://inv.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion http://pjsfi2szfkb4guqzmfmlyq4no46fayertjrwt4h2uughccrh2lvq.b32.i2p { +http://inv.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion http://pjsfhqamc7k6htnumrvn4cwqqdoggeepj7u5viyimgnxg3gar72q.b32.i2p { import tor inv - import i2ploc pjsfi2szfkb4guqzmfmlyq4no46fayertjrwt4h2uughccrh2lvq.b32.i2p + import i2ploc pjsfhqamc7k6htnumrvn4cwqqdoggeepj7u5viyimgnxg3gar72q.b32.i2p reverse_proxy https://invidious.projectsegfau.lt { header_up Host "invidious.projectsegfau.lt" } diff --git a/privfrontends/templates/eu/misc.Caddyfile b/privfrontends/templates/eu/misc.Caddyfile index 829a14c..210fa14 100644 --- a/privfrontends/templates/eu/misc.Caddyfile +++ b/privfrontends/templates/eu/misc.Caddyfile @@ -1,5 +1,7 @@ stats.eu.projectsegfau.lt { - import auth + basicauth * { + admin $2a$14$4R5m1Kl74xwVp8MsR.jFeOpa6ssXwHN7ANwJi300zIrienTG44Abi + } reverse_proxy localhost:9100 import def }