aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/tools/mastodon/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/modules/websites/tools/mastodon/default.nix')
-rw-r--r--nixops/modules/websites/tools/mastodon/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/nixops/modules/websites/tools/mastodon/default.nix b/nixops/modules/websites/tools/mastodon/default.nix
index 0aaff70..6e34280 100644
--- a/nixops/modules/websites/tools/mastodon/default.nix
+++ b/nixops/modules/websites/tools/mastodon/default.nix
@@ -5,6 +5,7 @@ let
5 env = myconfig.env.tools.mastodon; 5 env = myconfig.env.tools.mastodon;
6 }; 6 };
7 7
8 root = "/run/current-system/webapps/tools_mastodon";
8 cfg = config.services.myWebsites.tools.mastodon; 9 cfg = config.services.myWebsites.tools.mastodon;
9in { 10in {
10 options.services.myWebsites.tools.mastodon = { 11 options.services.myWebsites.tools.mastodon = {
@@ -138,10 +139,14 @@ in {
138 "headers" "proxy" "proxy_wstunnel" "proxy_http" 139 "headers" "proxy" "proxy_wstunnel" "proxy_http"
139 ]; 140 ];
140 security.acme.certs."eldiron".extraDomains."mastodon.immae.eu" = null; 141 security.acme.certs."eldiron".extraDomains."mastodon.immae.eu" = null;
142 system.extraSystemBuilderCmds = ''
143 mkdir -p $out/webapps
144 ln -s ${mastodon.railsRoot}/public/ $out/webapps/tools_mastodon
145 '';
141 services.myWebsites.tools.vhostConfs.mastodon = { 146 services.myWebsites.tools.vhostConfs.mastodon = {
142 certName = "eldiron"; 147 certName = "eldiron";
143 hosts = ["mastodon.immae.eu" ]; 148 hosts = ["mastodon.immae.eu" ];
144 root = "${mastodon.railsRoot}/public/"; 149 root = root;
145 extraConfig = [ '' 150 extraConfig = [ ''
146 Header always set Referrer-Policy "strict-origin-when-cross-origin" 151 Header always set Referrer-Policy "strict-origin-when-cross-origin"
147 Header always set Strict-Transport-Security "max-age=31536000" 152 Header always set Strict-Transport-Security "max-age=31536000"
@@ -178,7 +183,7 @@ in {
178 Options -MultiViews 183 Options -MultiViews
179 </Directory> 184 </Directory>
180 185
181 <Directory ${mastodon.railsRoot}/public/> 186 <Directory ${root}>
182 Require all granted 187 Require all granted
183 Options -MultiViews +FollowSymlinks 188 Options -MultiViews +FollowSymlinks
184 </Directory> 189 </Directory>