From 4dcd8b2efae62cc8c64b2d62910f498ded07b2d3 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Sun, 24 Dec 2023 20:44:44 +0530 Subject: [PATCH 1/2] add matrix media_store resolving --- privfrontends/templates/in/apps.Caddyfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/privfrontends/templates/in/apps.Caddyfile b/privfrontends/templates/in/apps.Caddyfile index a074403..ca9f9cf 100644 --- a/privfrontends/templates/in/apps.Caddyfile +++ b/privfrontends/templates/in/apps.Caddyfile @@ -50,6 +50,12 @@ matrix.projectsegfau.lt { handle_path / { redir https://wiki.projectsegfau.lt/Matrix } + @hasSlashes path_regexp expression \/_matrix\/media\/projectsegfau.lt\/([a-zA-Z]{2})([a-zA-Z]{2})([a-zA-z]+) + rewrite @hasSlashes /mediawork/{re.expression.1}/{re.expression.2}/{re.expression.3} + handle_path /mediawork/* { + root * /mnt/matrix/synapse/storage/media-store/local_content + file_server browse + } } # Element From dff37d2f62fdb0ea71464347ea75da435dbaa292 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Sun, 24 Dec 2023 20:45:10 +0530 Subject: [PATCH 2/2] merge --- privfrontends/templates/eu/darknet.Caddyfile | 3 +- privfrontends/templates/eu/misc.Caddyfile | 54 +++++++++---------- privfrontends/templates/in/apps.Caddyfile | 30 +++++------ privfrontends/templates/in/internal.Caddyfile | 6 +-- privfrontends/templates/us/misc.Caddyfile | 1 + 5 files changed, 47 insertions(+), 47 deletions(-) diff --git a/privfrontends/templates/eu/darknet.Caddyfile b/privfrontends/templates/eu/darknet.Caddyfile index 1bbe4af..e5e3f3f 100644 --- a/privfrontends/templates/eu/darknet.Caddyfile +++ b/privfrontends/templates/eu/darknet.Caddyfile @@ -19,7 +19,7 @@ http://cockpit.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion { import tor cockpit } http://*.p.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion { - @host header_regexp host Host ^([a-zA-Z0-9]+\-)?([A-Za-z0-9]+)\.p\.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad\.onion + @host header_regexp host Host ^([a-zA-Z0-9]+\-)?([A-Za-z0-9]+)\.p\.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad\.onion handle @host { reverse_proxy 10.7.0.2:80 { header_up Host "{re.host.1}{re.host.2}.p.projectsegfau.lt" @@ -118,7 +118,6 @@ http://search.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion htt } } - http://git.pjsfkvpxlinjamtawaksbnnaqs2fc2mtvmozrzckxh7f3kis6yea25ad.onion http://pjsfdrtv2465bisenvzhfvdleznx4arlih2hlnrhpzugailnm7iq.b32.i2p { import tor git import i2ploc pjsfdrtv2465bisenvzhfvdleznx4arlih2hlnrhpzugailnm7iq.b32.i2p diff --git a/privfrontends/templates/eu/misc.Caddyfile b/privfrontends/templates/eu/misc.Caddyfile index 0d56886..eafc732 100644 --- a/privfrontends/templates/eu/misc.Caddyfile +++ b/privfrontends/templates/eu/misc.Caddyfile @@ -6,39 +6,39 @@ inv.bp.projectsegfau.lt, i.bp.psf.lt, invidious.projectsegfau.lt, inv.projectseg reverse_proxy localhost:7573 { header_up Host "invidious.projectsegfau.lt" } - @pipedproxy { - path /videoplayback - path /videoplayback/* - path /vi/* - path /ggpht/* - } - handle @pipedproxy { - reverse_proxy :6970 { - header_up Host "proxy.piped.projectsegfau.lt" - } - @jpgRedirect path_regexp maxres2 /vi/(.+)/maxres.jpg - @thumbnailRedirect path /ggpht/* - uri @thumbnailRedirect strip_prefix /ggpht - rewrite @thumbnailRedirect ?host=yt3.ggpht.com - uri @jpgRedirect replace /maxres.jpg /maxres2.jpg - rewrite /vi/* ?host=i.ytimg.com - } + @pipedproxy { + path /videoplayback + path /videoplayback/* + path /vi/* + path /ggpht/* + } + handle @pipedproxy { + reverse_proxy :6970 { + header_up Host "proxy.piped.projectsegfau.lt" + } + @jpgRedirect path_regexp maxres2 /vi/(.+)/maxres.jpg + @thumbnailRedirect path /ggpht/* + uri @thumbnailRedirect strip_prefix /ggpht + rewrite @thumbnailRedirect ?host=yt3.ggpht.com + uri @jpgRedirect replace /maxres.jpg /maxres2.jpg + rewrite /vi/* ?host=i.ytimg.com + } import def header -X-Frame-Options import torloc invbp import i2ploc pjsfi2szfkb4guqzmfmlyq4no46fayertjrwt4h2uughccrh2lvq.b32.i2p } - piped.projectsegfau.lt proxy.piped.projectsegfau.lt api.piped.projectsegfau.lt { - reverse_proxy :6970 - header -X-Frame-Options - import def - } +piped.projectsegfau.lt proxy.piped.projectsegfau.lt api.piped.projectsegfau.lt { + reverse_proxy :6970 + header -X-Frame-Options + import def +} pi.psf.lt { - reverse_proxy :6970 { - header_up Host "piped.projectsegfau.lt" - } - header -X-Frame-Options - import def + reverse_proxy :6970 { + header_up Host "piped.projectsegfau.lt" + } + header -X-Frame-Options + import def } proxy.lbry.projectsegfau.lt { reverse_proxy localhost:3001 diff --git a/privfrontends/templates/in/apps.Caddyfile b/privfrontends/templates/in/apps.Caddyfile index ca9f9cf..5679740 100644 --- a/privfrontends/templates/in/apps.Caddyfile +++ b/privfrontends/templates/in/apps.Caddyfile @@ -30,12 +30,12 @@ psf.lt { reverse_proxy :1337 import def import torloc www - header /.well-known/matrix/* Content-Type application/json - header /.well-known/matrix/* Access-Control-Allow-Origin * - handle_path /.well-known/* { - root * /var/www/psf-well-known - file_server - } + header /.well-known/matrix/* Content-Type application/json + header /.well-known/matrix/* Access-Control-Allow-Origin * + handle_path /.well-known/* { + root * /var/www/psf-well-known + file_server + } } www.projectsegfau.lt www.psf.lt { @@ -51,11 +51,11 @@ matrix.projectsegfau.lt { redir https://wiki.projectsegfau.lt/Matrix } @hasSlashes path_regexp expression \/_matrix\/media\/projectsegfau.lt\/([a-zA-Z]{2})([a-zA-Z]{2})([a-zA-z]+) - rewrite @hasSlashes /mediawork/{re.expression.1}/{re.expression.2}/{re.expression.3} - handle_path /mediawork/* { - root * /mnt/matrix/synapse/storage/media-store/local_content - file_server browse - } + rewrite @hasSlashes /mediawork/{re.expression.1}/{re.expression.2}/{re.expression.3} + handle_path /mediawork/* { + root * /mnt/matrix/synapse/storage/media-store/local_content + file_server browse + } } # Element @@ -196,10 +196,10 @@ auth.p.projectsegfau.lt { } # kbin kbin.projectsegfau.lt, kb.psf.lt { - reverse_proxy :8014 { - header_up X-Real-IP {remote_host} - } - import def + reverse_proxy :8014 { + header_up X-Real-IP {remote_host} + } + import def } gothub.dev.projectsegfau.lt gh.dev.psf.lt { diff --git a/privfrontends/templates/in/internal.Caddyfile b/privfrontends/templates/in/internal.Caddyfile index ec17b5a..99b9fed 100644 --- a/privfrontends/templates/in/internal.Caddyfile +++ b/privfrontends/templates/in/internal.Caddyfile @@ -43,12 +43,12 @@ docs.gothub.app { } synapseadmin.vpn.projectsegfau.lt s.v.psf.lt { - import acmedns + import acmedns reverse_proxy :8420 } bitpuit.vpn.projectsegfau.lt b.v.psf.lt { - import acmedns + import acmedns reverse_proxy https://192.168.1.2:8006 { transport http { tls_insecure_skip_verify @@ -58,7 +58,7 @@ bitpuit.vpn.projectsegfau.lt b.v.psf.lt { } bitpuit2.vpn.projectsegfau.lt b2.v.psf.lt { - import acmedns + import acmedns reverse_proxy https://192.168.1.58:8006 { transport http { tls_insecure_skip_verify diff --git a/privfrontends/templates/us/misc.Caddyfile b/privfrontends/templates/us/misc.Caddyfile index e69de29..8b13789 100644 --- a/privfrontends/templates/us/misc.Caddyfile +++ b/privfrontends/templates/us/misc.Caddyfile @@ -0,0 +1 @@ +