aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-10-16 13:49:24 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-10-16 13:49:24 +0200
commit6a8252b11bb02f3e67857d5a9d733b1affa6a625 (patch)
tree175cb91c386b444ce951361baaa4875136d5c9e4 /modules/private/websites
parent5304a64b84c5a84525c96419cc6126775af306e0 (diff)
downloadNix-6a8252b11bb02f3e67857d5a9d733b1affa6a625.tar.gz
Nix-6a8252b11bb02f3e67857d5a9d733b1affa6a625.tar.zst
Nix-6a8252b11bb02f3e67857d5a9d733b1affa6a625.zip
Add backup module
Diffstat (limited to 'modules/private/websites')
-rw-r--r--modules/private/websites/aten/integration.nix1
-rw-r--r--modules/private/websites/aten/production.nix1
-rw-r--r--modules/private/websites/chloe/integration.nix1
-rw-r--r--modules/private/websites/chloe/production.nix1
-rw-r--r--modules/private/websites/connexionswing/integration.nix1
-rw-r--r--modules/private/websites/connexionswing/production.nix1
-rw-r--r--modules/private/websites/default.nix3
-rw-r--r--modules/private/websites/emilia/production.nix3
-rw-r--r--modules/private/websites/florian/app.nix1
-rw-r--r--modules/private/websites/ludivinecassal/integration.nix1
-rw-r--r--modules/private/websites/ludivinecassal/production.nix1
-rw-r--r--modules/private/websites/piedsjaloux/integration.nix1
-rw-r--r--modules/private/websites/piedsjaloux/production.nix1
-rw-r--r--modules/private/websites/tools/diaspora/default.nix3
-rw-r--r--modules/private/websites/tools/ether/default.nix3
-rw-r--r--modules/private/websites/tools/mail/default.nix4
-rw-r--r--modules/private/websites/tools/mastodon/default.nix3
-rw-r--r--modules/private/websites/tools/tools/default.nix9
-rw-r--r--modules/private/websites/tools/tools/dokuwiki.nix3
-rw-r--r--modules/private/websites/tools/tools/kanboard.nix3
-rw-r--r--modules/private/websites/tools/tools/rompr.nix3
-rw-r--r--modules/private/websites/tools/tools/shaarli.nix3
-rw-r--r--modules/private/websites/tools/tools/ttrss.nix3
-rw-r--r--modules/private/websites/tools/tools/wallabag.nix3
24 files changed, 57 insertions, 0 deletions
diff --git a/modules/private/websites/aten/integration.nix b/modules/private/websites/aten/integration.nix
index 6768f80..0c92818 100644
--- a/modules/private/websites/aten/integration.nix
+++ b/modules/private/websites/aten/integration.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration"; 8 options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.aten_dev.rootDir = app.varDir;
11 services.phpApplication.apps.aten_dev = { 12 services.phpApplication.apps.aten_dev = {
12 websiteEnv = "integration"; 13 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user; 14 httpdUser = config.services.httpd.Inte.user;
diff --git a/modules/private/websites/aten/production.nix b/modules/private/websites/aten/production.nix
index 97f4a08..2ffcef3 100644
--- a/modules/private/websites/aten/production.nix
+++ b/modules/private/websites/aten/production.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.aten.production.enable = lib.mkEnableOption "enable Aten's website in production"; 8 options.myServices.websites.aten.production.enable = lib.mkEnableOption "enable Aten's website in production";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.aten_prod.rootDir = app.varDir;
11 services.webstats.sites = [ { name = "aten.pro"; } ]; 12 services.webstats.sites = [ { name = "aten.pro"; } ];
12 services.phpApplication.apps.aten_prod = { 13 services.phpApplication.apps.aten_prod = {
13 websiteEnv = "production"; 14 websiteEnv = "production";
diff --git a/modules/private/websites/chloe/integration.nix b/modules/private/websites/chloe/integration.nix
index 1f7ac31..75e25af 100644
--- a/modules/private/websites/chloe/integration.nix
+++ b/modules/private/websites/chloe/integration.nix
@@ -12,6 +12,7 @@ in {
12 options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration"; 12 options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration";
13 13
14 config = lib.mkIf cfg.enable { 14 config = lib.mkIf cfg.enable {
15 services.backup.profiles.chloe_dev.rootDir = chloe.app.varDir;
15 secrets.keys = chloe.keys; 16 secrets.keys = chloe.keys;
16 systemd.services.phpfpm-chloe_dev.after = lib.mkAfter chloe.phpFpm.serviceDeps; 17 systemd.services.phpfpm-chloe_dev.after = lib.mkAfter chloe.phpFpm.serviceDeps;
17 systemd.services.phpfpm-chloe_dev.wants = chloe.phpFpm.serviceDeps; 18 systemd.services.phpfpm-chloe_dev.wants = chloe.phpFpm.serviceDeps;
diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix
index 6cfdb7f..7c59806 100644
--- a/modules/private/websites/chloe/production.nix
+++ b/modules/private/websites/chloe/production.nix
@@ -12,6 +12,7 @@ in {
12 options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production"; 12 options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production";
13 13
14 config = lib.mkIf cfg.enable { 14 config = lib.mkIf cfg.enable {
15 services.backup.profiles.chloe_prod.rootDir = chloe.app.varDir;
15 secrets.keys = chloe.keys; 16 secrets.keys = chloe.keys;
16 services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ]; 17 services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
17 18
diff --git a/modules/private/websites/connexionswing/integration.nix b/modules/private/websites/connexionswing/integration.nix
index 2ceaffa..fee8e4f 100644
--- a/modules/private/websites/connexionswing/integration.nix
+++ b/modules/private/websites/connexionswing/integration.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.connexionswing.integration.enable = lib.mkEnableOption "enable Connexionswing's website in integration"; 8 options.myServices.websites.connexionswing.integration.enable = lib.mkEnableOption "enable Connexionswing's website in integration";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.connexionswing_dev.rootDir = app.varDir;
11 services.phpApplication.apps.connexionswing_dev = { 12 services.phpApplication.apps.connexionswing_dev = {
12 websiteEnv = "integration"; 13 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user; 14 httpdUser = config.services.httpd.Inte.user;
diff --git a/modules/private/websites/connexionswing/production.nix b/modules/private/websites/connexionswing/production.nix
index 1427c8d..79e672a 100644
--- a/modules/private/websites/connexionswing/production.nix
+++ b/modules/private/websites/connexionswing/production.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.connexionswing.production.enable = lib.mkEnableOption "enable Connexionswing's website in production"; 8 options.myServices.websites.connexionswing.production.enable = lib.mkEnableOption "enable Connexionswing's website in production";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.connexionswing_prod.rootDir = app.varDir;
11 services.webstats.sites = [ { name = "connexionswing.com"; } ]; 12 services.webstats.sites = [ { name = "connexionswing.com"; } ];
12 services.phpApplication.apps.connexionswing_prod = { 13 services.phpApplication.apps.connexionswing_prod = {
13 websiteEnv = "production"; 14 websiteEnv = "production";
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix
index f55f7e3..e2bcef5 100644
--- a/modules/private/websites/default.nix
+++ b/modules/private/websites/default.nix
@@ -73,6 +73,9 @@ in
73 }; 73 };
74 74
75 config = { 75 config = {
76 services.backup.profiles.php = {
77 rootDir = "/var/lib/php";
78 };
76 users.users.wwwrun.extraGroups = [ "keys" ]; 79 users.users.wwwrun.extraGroups = [ "keys" ];
77 networking.firewall.allowedTCPPorts = [ 80 443 ]; 80 networking.firewall.allowedTCPPorts = [ 80 443 ];
78 81
diff --git a/modules/private/websites/emilia/production.nix b/modules/private/websites/emilia/production.nix
index 422bfd4..0dab316 100644
--- a/modules/private/websites/emilia/production.nix
+++ b/modules/private/websites/emilia/production.nix
@@ -43,6 +43,9 @@ in {
43 options.myServices.websites.emilia.production.enable = lib.mkEnableOption "enable Emilia's website"; 43 options.myServices.websites.emilia.production.enable = lib.mkEnableOption "enable Emilia's website";
44 44
45 config = lib.mkIf cfg.enable { 45 config = lib.mkIf cfg.enable {
46 services.backup.profiles.emilia_prod = {
47 rootDir = varDir;
48 };
46 system.activationScripts.emilia = '' 49 system.activationScripts.emilia = ''
47 install -m 0755 -o wwwrun -g wwwrun -d ${varDir} 50 install -m 0755 -o wwwrun -g wwwrun -d ${varDir}
48 ''; 51 '';
diff --git a/modules/private/websites/florian/app.nix b/modules/private/websites/florian/app.nix
index 3f44ec4..7e2c333 100644
--- a/modules/private/websites/florian/app.nix
+++ b/modules/private/websites/florian/app.nix
@@ -9,6 +9,7 @@ in {
9 options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration"; 9 options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration";
10 10
11 config = lib.mkIf cfg.enable { 11 config = lib.mkIf cfg.enable {
12 services.backup.profiles.tellesflorian_dev.rootDir = app.varDir;
12 services.phpApplication.apps.florian_dev = { 13 services.phpApplication.apps.florian_dev = {
13 websiteEnv = "integration"; 14 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user; 15 httpdUser = config.services.httpd.Inte.user;
diff --git a/modules/private/websites/ludivinecassal/integration.nix b/modules/private/websites/ludivinecassal/integration.nix
index 55f2432..d1b8f9b 100644
--- a/modules/private/websites/ludivinecassal/integration.nix
+++ b/modules/private/websites/ludivinecassal/integration.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.ludivinecassal.integration.enable = lib.mkEnableOption "enable Ludivine's website in integration"; 8 options.myServices.websites.ludivinecassal.integration.enable = lib.mkEnableOption "enable Ludivine's website in integration";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.ludivinecassal_dev.rootDir = app.varDir;
11 services.phpApplication.apps.ludivinecassal_dev = { 12 services.phpApplication.apps.ludivinecassal_dev = {
12 websiteEnv = "integration"; 13 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user; 14 httpdUser = config.services.httpd.Inte.user;
diff --git a/modules/private/websites/ludivinecassal/production.nix b/modules/private/websites/ludivinecassal/production.nix
index 82f6899..341fd6d 100644
--- a/modules/private/websites/ludivinecassal/production.nix
+++ b/modules/private/websites/ludivinecassal/production.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.ludivinecassal.production.enable = lib.mkEnableOption "enable Ludivine's website in production"; 8 options.myServices.websites.ludivinecassal.production.enable = lib.mkEnableOption "enable Ludivine's website in production";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.ludivinecassal_prod.rootDir = app.varDir;
11 services.webstats.sites = [ { name = "ludivinecassal.com"; } ]; 12 services.webstats.sites = [ { name = "ludivinecassal.com"; } ];
12 services.phpApplication.apps.ludivinecassal_prod = { 13 services.phpApplication.apps.ludivinecassal_prod = {
13 websiteEnv = "production"; 14 websiteEnv = "production";
diff --git a/modules/private/websites/piedsjaloux/integration.nix b/modules/private/websites/piedsjaloux/integration.nix
index 0a33bc0..853fcff 100644
--- a/modules/private/websites/piedsjaloux/integration.nix
+++ b/modules/private/websites/piedsjaloux/integration.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.piedsjaloux.integration.enable = lib.mkEnableOption "enable PiedsJaloux's website in integration"; 8 options.myServices.websites.piedsjaloux.integration.enable = lib.mkEnableOption "enable PiedsJaloux's website in integration";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.piedsjaloux_dev.rootDir = app.varDir;
11 services.phpApplication.apps.piedsjaloux_dev = { 12 services.phpApplication.apps.piedsjaloux_dev = {
12 websiteEnv = "integration"; 13 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user; 14 httpdUser = config.services.httpd.Inte.user;
diff --git a/modules/private/websites/piedsjaloux/production.nix b/modules/private/websites/piedsjaloux/production.nix
index 9007f19..9e64fca 100644
--- a/modules/private/websites/piedsjaloux/production.nix
+++ b/modules/private/websites/piedsjaloux/production.nix
@@ -8,6 +8,7 @@ in {
8 options.myServices.websites.piedsjaloux.production.enable = lib.mkEnableOption "enable PiedsJaloux's website in production"; 8 options.myServices.websites.piedsjaloux.production.enable = lib.mkEnableOption "enable PiedsJaloux's website in production";
9 9
10 config = lib.mkIf cfg.enable { 10 config = lib.mkIf cfg.enable {
11 services.backup.profiles.piedsjaloux_prod.rootDir = app.varDir;
11 services.webstats.sites = [ { name = "piedsjaloux.fr"; } ]; 12 services.webstats.sites = [ { name = "piedsjaloux.fr"; } ];
12 services.phpApplication.apps.piedsjaloux_prod = { 13 services.phpApplication.apps.piedsjaloux_prod = {
13 websiteEnv = "production"; 14 websiteEnv = "production";
diff --git a/modules/private/websites/tools/diaspora/default.nix b/modules/private/websites/tools/diaspora/default.nix
index 17a6a09..24d3d51 100644
--- a/modules/private/websites/tools/diaspora/default.nix
+++ b/modules/private/websites/tools/diaspora/default.nix
@@ -10,6 +10,9 @@ in {
10 }; 10 };
11 11
12 config = lib.mkIf cfg.enable { 12 config = lib.mkIf cfg.enable {
13 services.backup.profiles.diaspora = {
14 rootDir = dcfg.dataDir;
15 };
13 users.users.diaspora.extraGroups = [ "keys" ]; 16 users.users.diaspora.extraGroups = [ "keys" ];
14 17
15 secrets.keys = [ 18 secrets.keys = [
diff --git a/modules/private/websites/tools/ether/default.nix b/modules/private/websites/tools/ether/default.nix
index c038528..600254b 100644
--- a/modules/private/websites/tools/ether/default.nix
+++ b/modules/private/websites/tools/ether/default.nix
@@ -12,6 +12,9 @@ in {
12 }; 12 };
13 13
14 config = lib.mkIf cfg.enable { 14 config = lib.mkIf cfg.enable {
15 services.backup.profiles.etherpad-lite = {
16 rootDir = "/var/lib/private/etherpad-lite";
17 };
15 secrets.keys = [ 18 secrets.keys = [
16 { 19 {
17 dest = "webapps/tools-etherpad-apikey"; 20 dest = "webapps/tools-etherpad-apikey";
diff --git a/modules/private/websites/tools/mail/default.nix b/modules/private/websites/tools/mail/default.nix
index ea0a27f..35711af 100644
--- a/modules/private/websites/tools/mail/default.nix
+++ b/modules/private/websites/tools/mail/default.nix
@@ -17,6 +17,10 @@ in
17 ]; 17 ];
18 18
19 config = lib.mkIf cfg.enable { 19 config = lib.mkIf cfg.enable {
20 services.backup.profiles.mail.excludeFile = ''
21 + ${rainloop.varDir}
22 + ${roundcubemail.varDir}
23 '';
20 secrets.keys = roundcubemail.keys; 24 secrets.keys = roundcubemail.keys;
21 25
22 services.websites.env.tools.modules = 26 services.websites.env.tools.modules =
diff --git a/modules/private/websites/tools/mastodon/default.nix b/modules/private/websites/tools/mastodon/default.nix
index d67ae2b..2236bd5 100644
--- a/modules/private/websites/tools/mastodon/default.nix
+++ b/modules/private/websites/tools/mastodon/default.nix
@@ -10,6 +10,9 @@ in {
10 }; 10 };
11 11
12 config = lib.mkIf cfg.enable { 12 config = lib.mkIf cfg.enable {
13 services.backup.profiles.mastodon = {
14 rootDir = mcfg.dataDir;
15 };
13 secrets.keys = [{ 16 secrets.keys = [{
14 dest = "webapps/tools-mastodon"; 17 dest = "webapps/tools-mastodon";
15 user = "mastodon"; 18 user = "mastodon";
diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix
index e17c708..6f27b0b 100644
--- a/modules/private/websites/tools/tools/default.nix
+++ b/modules/private/websites/tools/tools/default.nix
@@ -51,6 +51,15 @@ in {
51 ++ wallabag.keys 51 ++ wallabag.keys
52 ++ yourls.keys; 52 ++ yourls.keys;
53 53
54 services.backup.profiles = {
55 dokuwiki = dokuwiki.backups;
56 kanboard = kanboard.backups;
57 rompr = rompr.backups;
58 shaarli = shaarli.backups;
59 ttrss = ttrss.backups;
60 wallabag = wallabag.backups;
61 };
62
54 services.websites.env.tools.modules = 63 services.websites.env.tools.modules =
55 [ "proxy_fcgi" ] 64 [ "proxy_fcgi" ]
56 ++ adminer.apache.modules 65 ++ adminer.apache.modules
diff --git a/modules/private/websites/tools/tools/dokuwiki.nix b/modules/private/websites/tools/tools/dokuwiki.nix
index c61d15f..e40d671 100644
--- a/modules/private/websites/tools/tools/dokuwiki.nix
+++ b/modules/private/websites/tools/tools/dokuwiki.nix
@@ -1,5 +1,8 @@
1{ lib, stdenv, dokuwiki, dokuwiki-plugins }: 1{ lib, stdenv, dokuwiki, dokuwiki-plugins }:
2rec { 2rec {
3 backups = {
4 rootDir = varDir;
5 };
3 varDir = "/var/lib/dokuwiki"; 6 varDir = "/var/lib/dokuwiki";
4 activationScript = { 7 activationScript = {
5 deps = [ "wrappers" ]; 8 deps = [ "wrappers" ];
diff --git a/modules/private/websites/tools/tools/kanboard.nix b/modules/private/websites/tools/tools/kanboard.nix
index 68f92b8..68c3a10 100644
--- a/modules/private/websites/tools/tools/kanboard.nix
+++ b/modules/private/websites/tools/tools/kanboard.nix
@@ -1,5 +1,8 @@
1{ env, kanboard }: 1{ env, kanboard }:
2rec { 2rec {
3 backups = {
4 rootDir = varDir;
5 };
3 varDir = "/var/lib/kanboard"; 6 varDir = "/var/lib/kanboard";
4 activationScript = { 7 activationScript = {
5 deps = [ "wrappers" ]; 8 deps = [ "wrappers" ];
diff --git a/modules/private/websites/tools/tools/rompr.nix b/modules/private/websites/tools/tools/rompr.nix
index fea59fc..74034f0 100644
--- a/modules/private/websites/tools/tools/rompr.nix
+++ b/modules/private/websites/tools/tools/rompr.nix
@@ -1,5 +1,8 @@
1{ lib, env, rompr }: 1{ lib, env, rompr }:
2rec { 2rec {
3 backups = {
4 rootDir = varDir;
5 };
3 varDir = "/var/lib/rompr"; 6 varDir = "/var/lib/rompr";
4 activationScript = '' 7 activationScript = ''
5 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ 8 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
diff --git a/modules/private/websites/tools/tools/shaarli.nix b/modules/private/websites/tools/tools/shaarli.nix
index 2e89a47..28041ba 100644
--- a/modules/private/websites/tools/tools/shaarli.nix
+++ b/modules/private/websites/tools/tools/shaarli.nix
@@ -2,6 +2,9 @@
2let 2let
3 varDir = "/var/lib/shaarli"; 3 varDir = "/var/lib/shaarli";
4in rec { 4in rec {
5 backups = {
6 rootDir = varDir;
7 };
5 activationScript = '' 8 activationScript = ''
6 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \ 9 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
7 ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \ 10 ${varDir}/cache ${varDir}/pagecache ${varDir}/tmp ${varDir}/data \
diff --git a/modules/private/websites/tools/tools/ttrss.nix b/modules/private/websites/tools/tools/ttrss.nix
index 05c8cab..598cc3a 100644
--- a/modules/private/websites/tools/tools/ttrss.nix
+++ b/modules/private/websites/tools/tools/ttrss.nix
@@ -1,5 +1,8 @@
1{ php, env, ttrss, ttrss-plugins }: 1{ php, env, ttrss, ttrss-plugins }:
2rec { 2rec {
3 backups = {
4 rootDir = varDir;
5 };
3 varDir = "/var/lib/ttrss"; 6 varDir = "/var/lib/ttrss";
4 activationScript = { 7 activationScript = {
5 deps = [ "wrappers" ]; 8 deps = [ "wrappers" ];
diff --git a/modules/private/websites/tools/tools/wallabag.nix b/modules/private/websites/tools/tools/wallabag.nix
index 2912b2c..8572d64 100644
--- a/modules/private/websites/tools/tools/wallabag.nix
+++ b/modules/private/websites/tools/tools/wallabag.nix
@@ -1,5 +1,8 @@
1{ env, wallabag, mylibs }: 1{ env, wallabag, mylibs }:
2rec { 2rec {
3 backups = {
4 rootDir = varDir;
5 };
3 varDir = "/var/lib/wallabag"; 6 varDir = "/var/lib/wallabag";
4 keys = [{ 7 keys = [{
5 dest = "webapps/tools-wallabag"; 8 dest = "webapps/tools-wallabag";