From 83e38938c43d0baf32a08457fbf537aef077f73f Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Mon, 28 Jul 2025 12:09:26 +0530 Subject: [PATCH 1/3] make /pic/ work for libreddit --- privfrontends/templates/Caddyfile.j2 | 3 +++ privfrontends/vars.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index 698fa64..279ef0b 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -136,6 +136,9 @@ n.eu.psf.lt n.us.psf.lt n.in.psf.lt { {% endif %} libreddit.{{ server_prefix }}.projectsegfau.lt libreddit.projectsegfau.lt lr.psf.lt lr.{{ server_prefix }}.psf.lt { reverse_proxy :6464 + route { + reverse_proxy /pic/* :6465 + } import def log { # This is temporarily required to monitor nitter traffic due to scrapers being more active, so we need to monitor and rate limit them at a later date. diff --git a/privfrontends/vars.yaml b/privfrontends/vars.yaml index 9a723af..d9a87d5 100644 --- a/privfrontends/vars.yaml +++ b/privfrontends/vars.yaml @@ -114,7 +114,7 @@ apps: - name: redlib image: quay.io/redlib/redlib:latest ports: - - "8080" + - "6465:8080" environment: FRONT_PAGE: popular COMMENT_SORT: new From 0b18675117d79cb6f6835aee7f29dc558c1121ed Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Mon, 28 Jul 2025 14:35:27 +0530 Subject: [PATCH 2/3] incorrect path --- privfrontends/templates/Caddyfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index 279ef0b..d6339d7 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -137,7 +137,7 @@ n.eu.psf.lt n.us.psf.lt n.in.psf.lt { libreddit.{{ server_prefix }}.projectsegfau.lt libreddit.projectsegfau.lt lr.psf.lt lr.{{ server_prefix }}.psf.lt { reverse_proxy :6464 route { - reverse_proxy /pic/* :6465 + reverse_proxy /preview/* :6465 } import def log { From b74513fb9df27a02f5c27ff390493335bd7bf209 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Mon, 28 Jul 2025 19:12:47 +0530 Subject: [PATCH 3/3] ansiblize daemon.json --- all/playbook.yaml | 5 +++++ all/templates/eu/daemon.json | 18 ++++++++++++++++++ all/templates/in/daemon.json | 13 +++++++++++++ all/templates/us/daemon.json | 5 +++++ 4 files changed, 41 insertions(+) create mode 100644 all/templates/eu/daemon.json create mode 100644 all/templates/in/daemon.json create mode 100644 all/templates/us/daemon.json diff --git a/all/playbook.yaml b/all/playbook.yaml index 22f443a..c7112f3 100644 --- a/all/playbook.yaml +++ b/all/playbook.yaml @@ -208,6 +208,11 @@ dest: "/etc/borgmatic/config.yaml" state: "absent" regexp: "^.*encryption_passphrase" + - name: Copy per-server docker daemon.json + ansible.builtin.copy: + src: "./templates/{{ inventory_hostname }}/daemon.json" + dest: /etc/docker/daemon.json + mode: preserve handlers: - name: Restart sshd ansible.builtin.service: diff --git a/all/templates/eu/daemon.json b/all/templates/eu/daemon.json new file mode 100644 index 0000000..5a7bab1 --- /dev/null +++ b/all/templates/eu/daemon.json @@ -0,0 +1,18 @@ +{ + "experimental": true, + "ip6tables": true, + "ipv6": true, + "fixed-cidr-v6": "fd00::/64", + "log-driver": "local", + "default-address-pools": [ + { "base": "172.17.0.0/16", "size": 16 }, + { "base": "172.18.0.0/16", "size": 16 }, + { "base": "172.19.0.0/16", "size": 16 }, + { "base": "172.20.0.0/14", "size": 16 }, + { "base": "172.24.0.0/14", "size": 16 }, + { "base": "172.28.0.0/14", "size": 16 }, + { "base": "192.168.0.0/16", "size": 20 }, + { "base": "2001:db8::/104", "size": 112 } + ] + +} diff --git a/all/templates/in/daemon.json b/all/templates/in/daemon.json new file mode 100644 index 0000000..40641f5 --- /dev/null +++ b/all/templates/in/daemon.json @@ -0,0 +1,13 @@ +{ +"ipv6": true, +"log-driver": "local", +"fixed-cidr-v6": "2001:db8:1::/64", + "default-address-pools": [ + { + "base": "172.80.0.0/16", + "size": 24 + } + ], + "experimental": true, + "ip6tables": true +} diff --git a/all/templates/us/daemon.json b/all/templates/us/daemon.json new file mode 100644 index 0000000..e7343f4 --- /dev/null +++ b/all/templates/us/daemon.json @@ -0,0 +1,5 @@ +{ +"log-driver": "local", +"ipv6": true, +"fixed-cidr-v6": "fd00:dead:beef::/48" +}