diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /modules/private/websites/papa/surveillance.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'modules/private/websites/papa/surveillance.nix')
-rw-r--r-- | modules/private/websites/papa/surveillance.nix | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/modules/private/websites/papa/surveillance.nix b/modules/private/websites/papa/surveillance.nix deleted file mode 100644 index a8e5149..0000000 --- a/modules/private/websites/papa/surveillance.nix +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.papa.surveillance; | ||
4 | varDir = "/var/lib/ftp/papa"; | ||
5 | apacheUser = config.services.httpd.Prod.user; | ||
6 | in { | ||
7 | options.myServices.websites.papa.surveillance.enable = lib.mkEnableOption "enable Papa surveillance's website"; | ||
8 | |||
9 | config = lib.mkIf cfg.enable { | ||
10 | security.acme.certs."ftp".extraDomains."surveillance.maison.bbc.bouya.org" = null; | ||
11 | |||
12 | services.cron = { | ||
13 | systemCronJobs = let | ||
14 | script = pkgs.writeScript "cleanup-papa" '' | ||
15 | #!${pkgs.stdenv.shell} | ||
16 | d=$(date -d "7 days ago" +%Y%m%d) | ||
17 | for i in /var/lib/ftp/papa/*/20[0-9][0-9][0-9][0-9][0-9][0-9]; do | ||
18 | if [ "$d" -gt $(basename $i) ]; then | ||
19 | rm -rf "$i" | ||
20 | fi | ||
21 | done | ||
22 | ''; | ||
23 | in | ||
24 | [ | ||
25 | '' | ||
26 | 0 6 * * * ${apacheUser} ${script} | ||
27 | '' | ||
28 | ]; | ||
29 | }; | ||
30 | |||
31 | services.websites.env.production.vhostConfs.papa_surveillance = { | ||
32 | certName = "papa"; | ||
33 | certMainHost = "surveillance.maison.bbc.bouya.org"; | ||
34 | hosts = [ "surveillance.maison.bbc.bouya.org" ]; | ||
35 | root = varDir; | ||
36 | extraConfig = [ | ||
37 | '' | ||
38 | Use Apaxy "${varDir}" "title .duplicity-ignore" | ||
39 | <Directory ${varDir}> | ||
40 | Use LDAPConnect | ||
41 | Options Indexes | ||
42 | AllowOverride None | ||
43 | Require ldap-group cn=surveillance.maison.bbc.bouya.org,cn=httpd,ou=services,dc=immae,dc=eu | ||
44 | </Directory> | ||
45 | '' | ||
46 | ]; | ||
47 | }; | ||
48 | }; | ||
49 | } | ||
50 | |||