]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/tools/mastodon/mastodon.nix
Configure mailer spool for tools
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / mastodon / mastodon.nix
index 770aa2cb5b584cf3157ae92a7116206a4a032c85..8650ee310b860e9e28e5d6780b60b421c69aa771 100644 (file)
@@ -84,10 +84,9 @@ let
     VAPID_PRIVATE_KEY=${env.vapid.private}
     VAPID_PUBLIC_KEY=${env.vapid.public}
 
-    SMTP_SERVER=mail.immae.eu
-    SMTP_PORT=587
+    SMTP_DELIVERY_METHOD=sendmail
     SMTP_FROM_ADDRESS=notifications@mastodon.immae.eu
-    SMTP_DELIVERY_METHOD=smtp
+    SENDMAIL_LOCATION="/run/wrappers/bin/sendmail"
     PAPERCLIP_ROOT_PATH=${varDir}
 
     STREAMING_CLUSTER_NUM=1
@@ -115,6 +114,8 @@ let
         cp -a $mastodon $out
         cd $out
         chmod u+rwX . public
+        chmod -R u+rwX config/
+        sed -i -e 's@^end$@  config.action_mailer.sendmail_settings = { location: ENV.fetch("SENDMAIL_LOCATION", "/usr/sbin/sendmail") }\nend@' config/environments/production.rb
         RAILS_ENV=production ${gems}/bin/rails assets:precompile
         rm -rf tmp/cache
         ln -sf ../../../../../../../${varDir}/tmp/cache tmp