From 9bcc7db1744f7e0e61b813d50d8bd57644ed1225 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Tue, 27 Dec 2022 22:46:05 +0100 Subject: [PATCH] mastodon: Redirect pre-CDN file paths --- secret/hosts/sail.nix | Bin 2583 -> 2538 bytes system/nixos/mastodon.nix | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/secret/hosts/sail.nix b/secret/hosts/sail.nix index 1e5d74b58588e921b9df590e51033ba32a3f944b..e2267cdaf8670e04c404acdbed07debbb4d8683e 100644 GIT binary patch literal 2538 zcmV?M{X=7(-aQPc?5H82&DLgp&^b zWbbjI*Fqe3(V0U-(`Z4R_*v_h@4ZN(Q$R;^CjfG?(lmv$-iHv6!btiGm5W{dBX4-n z#f%Pbs=|-AIBm&-%!d604>v?j!tsElc*rrVSdZ2=_Q3+abb6Vwc09J)rYjrr(GwM` z+%loVv_q0wlyz1R5_b~WlH1nRg0wfmD%{eXt6}eOY4>xG5q4-A%3rN z`2Zm9N51>vZs^mLWNjJG0N-5H{&7z2`okQ2waGyft-R=Z3meFdOdwyQxX?a}6NM`L z^#vAk0`o&u^-bHgv;AK!5!Pg`feR3>*nFnEa5QC+89Bn_l>yQI_eGp?*0iP*`+h5O z5*-vpi8Ooe!y~in;&V=A3d4n3WmoKPn!lYlojry#ykD;d-sYa+GhvT<`K*z5MHi2K zB!^25Z4?WovM}<_@)*L<^X2}2>oBdY0(=c>S6Viy_A9<|7Bo+;_15rn0-m&9aY~3& z<)?TC-?cgvZ2*c8sSM}BQ_xT}ocqUM=89`Tvd;}D`4GZA4V+8C(^8;3q6}M?$|^a4 zc5iAKWS9rUGtG4?JIoI(6e~+iu5r@4u5P$Xi4TRoAAFAGGWnKJ`m=1lDVGGp$&}5b z)|&L%pQY0nmUfx`lO@y^5s>LnHiEpyG@P_<{HP+JFO9TRpYd7}#2U;9@P!Msy1M3a znAnj=-Nmnc|4NDP=OYFr_GcUStC9ke;?dTdNoMFX(yZ7(-s0J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$p*sXI_eE>nK<>nTko0?*vLXvu}w;t&-UU9<{bcDe#O^ z6yPkKZBE}oF4%(0QG7B$a8ywe7B}~HoCCMGie>_dt;tvZvNMsTaFuO=Ijx5iTX4Q9 zbw8DiWtDfhU-?~jdH=mB&>)v_P1NmQGR^g?0yksME4XCw`x)m}Sv6~?OyO?_REEVv zaMH0*drdezG>Y@Q&ke2?clHp+h)oDSSvAfloXYOghaI*TnUlg!ik)l#K~2>kkE8ZB zX;lY#(EnMbKw-?voTWz*+rHaXBc8lC1gOJE_-C^%I@WZRu3mU8a^A(M3<6V)Rz0w@zD)Q#f4|li31-JkJ diff --git a/system/nixos/mastodon.nix b/system/nixos/mastodon.nix index 30a1e84..c79fb84 100644 --- a/system/nixos/mastodon.nix +++ b/system/nixos/mastodon.nix @@ -86,8 +86,8 @@ in S3_PROTOCOL = "https"; S3_REGION = secret.mastodon.s3.region; S3_ENDPOINT = secret.mastodon.s3.endpoint; - S3_ALIAS_HOST = secret.mastodon.s3.hostname; - S3_HOSTNAME = secret.mastodon.s3.hostname; + S3_ALIAS_HOST = "mastodon-cdn.kempkens.io"; + S3_HOSTNAME = "mastodon-cdn.kempkens.io"; }; }; @@ -105,7 +105,9 @@ in forceSSL = false; enableACME = false; - locations."/system/".alias = "/var/lib/mastodon/public-system/"; + locations."/system/" = { + return = "301 https://mastodon-cdn.kempkens.io$request_uri"; + }; locations."/" = { tryFiles = "$uri @proxy";