diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-26 03:04:56 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-04-26 03:04:56 +0200 |
commit | 7df5e532c1ce2ab9e8527615c08c1178990870e6 (patch) | |
tree | 3790f2afe0be38e37ba82305a1139db6c6b61c79 /modules/private/websites/tools/tools/dmarc_reports.nix | |
parent | a8ef1adb4a90c2524ac09a85463598e5d41d2a4a (diff) | |
download | Nix-7df5e532c1ce2ab9e8527615c08c1178990870e6.tar.gz Nix-7df5e532c1ce2ab9e8527615c08c1178990870e6.tar.zst Nix-7df5e532c1ce2ab9e8527615c08c1178990870e6.zip |
Add dmarc reports
Diffstat (limited to 'modules/private/websites/tools/tools/dmarc_reports.nix')
-rw-r--r-- | modules/private/websites/tools/tools/dmarc_reports.nix | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/private/websites/tools/tools/dmarc_reports.nix b/modules/private/websites/tools/tools/dmarc_reports.nix new file mode 100644 index 0000000..2e44526 --- /dev/null +++ b/modules/private/websites/tools/tools/dmarc_reports.nix | |||
@@ -0,0 +1,56 @@ | |||
1 | { env }: | ||
2 | rec { | ||
3 | keys = [{ | ||
4 | dest = "webapps/tools-dmarc-reports.php"; | ||
5 | user = "wwwrun"; | ||
6 | group = "wwwrun"; | ||
7 | permissions = "0400"; | ||
8 | text = '' | ||
9 | <?php | ||
10 | $dbhost = "${env.mysql.host}"; | ||
11 | $dbname = "${env.mysql.database}"; | ||
12 | $dbuser = "${env.mysql.user}"; | ||
13 | $dbpass = "${env.mysql.password}"; | ||
14 | $dbport = "${env.mysql.port}"; | ||
15 | ?> | ||
16 | ''; | ||
17 | }]; | ||
18 | webRoot = ./dmarc_reports; | ||
19 | apache = rec { | ||
20 | user = "wwwrun"; | ||
21 | group = "wwwrun"; | ||
22 | modules = [ "proxy_fcgi" ]; | ||
23 | webappName = "tools_dmarc_reports"; | ||
24 | root = "/run/current-system/webapps/${webappName}"; | ||
25 | vhostConf = socket: '' | ||
26 | Alias /dmarc-reports "${root}" | ||
27 | <Directory "${root}"> | ||
28 | DirectoryIndex index.html | ||
29 | <FilesMatch "\.php$"> | ||
30 | SetHandler "proxy:unix:${socket}|fcgi://localhost" | ||
31 | </FilesMatch> | ||
32 | |||
33 | AllowOverride None | ||
34 | Options +FollowSymlinks | ||
35 | Require all granted | ||
36 | </Directory> | ||
37 | ''; | ||
38 | }; | ||
39 | phpFpm = rec { | ||
40 | basedir = builtins.concatStringsSep ":" | ||
41 | [ webRoot "/var/secrets/webapps/tools-dmarc-reports.php" ]; | ||
42 | pool = { | ||
43 | "listen.owner" = apache.user; | ||
44 | "listen.group" = apache.group; | ||
45 | "pm" = "ondemand"; | ||
46 | "pm.max_children" = "60"; | ||
47 | "pm.process_idle_timeout" = "60"; | ||
48 | |||
49 | # Needed to avoid clashes in browser cookies (same domain) | ||
50 | "php_admin_value[open_basedir]" = "${basedir}:/tmp"; | ||
51 | }; | ||
52 | phpEnv = { | ||
53 | SECRETS_FILE = "/var/secrets/webapps/tools-dmarc-reports.php"; | ||
54 | }; | ||
55 | }; | ||
56 | } | ||