From 18d0cc3048243d15cf6108ccd05d62390ecf5503 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 23 Mar 2016 13:45:06 +0100 Subject: l 2 websites domsen: add domsen user --- lass/2configs/websites/domsen.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 109c216c0..895146d25 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -1,6 +1,8 @@ { config, pkgs, ... }: -{ +let + inherit (config.krebs.lib) genid; +in { imports = [ ../../3modules/static_nginx.nix ../../3modules/owncloud_nginx.nix @@ -26,6 +28,15 @@ rootPassword = toString (); }; + users.users.domsen = { + uid = genid "domsen"; + description = "maintenance acc for domsen"; + home = "/home/domsen"; + useDefaultShell = true; + extraGroups = [ "nginx" ]; + createHome = true; + }; + #lass.wordpress = { # "ubikmedia.de" = { # }; -- cgit v1.2.3 From 7af3dfe9bf367f02619881c47060b4645d12f71e Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 9 Apr 2016 14:21:39 +0200 Subject: l 2 websites: use helper functions --- lass/2configs/websites/domsen.nix | 38 ++++++++++++--------- lass/2configs/websites/fritz.nix | 48 ++++++++++++++++++--------- lass/2configs/websites/wohnprojekt-rhh.de.nix | 20 +++++++---- 3 files changed, 67 insertions(+), 39 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 895146d25..173e87864 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -1,26 +1,32 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let inherit (config.krebs.lib) genid; + inherit (import ../../4lib { inherit lib pkgs; }) + manageCert + activateACME + ssl + servePage + serveOwncloud; + in { imports = [ - ../../3modules/static_nginx.nix - ../../3modules/owncloud_nginx.nix - ../../3modules/wordpress_nginx.nix - ]; + ( ssl "reich-gebaeudereinigung.de" ) + ( servePage "reich-gebaeudereinigung.de" ) - lass.staticPage = { - "karlaskop.de" = {}; - "makeup.apanowicz.de" = {}; - "pixelpocket.de" = {}; - "reich-gebaeudereinigung.de" = {}; - }; + ( servePage "karlaskop.de" ) + ( manageCert "karlaskop.de" ) - lass.owncloud = { - "o.ubikmedia.de" = { - instanceid = "oc8n8ddbftgh"; - }; - }; + ( servePage "makeup.apanowicz.de" ) + ( manageCert "makeup.apanowicz.de" ) + + ( servePage "pixelpocket.de" ) + ( manageCert "pixelpocket.de" ) + + ( ssl "o.ubikmedia.de" ) + ( serveOwncloud "o.ubikmedia.de" ) + + ]; services.mysql = { enable = true; diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 073f3de14..16a240d7c 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -1,23 +1,39 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: -{ +let + inherit (import ../../4lib { inherit lib pkgs; }) + manageCert + activateACME + ssl + servePage + serveOwncloud; +in { imports = [ - ../../3modules/static_nginx.nix - ../../3modules/owncloud_nginx.nix - ../../3modules/wordpress_nginx.nix - ]; + ( manageCert "biostase.de" ) + ( servePage "biostase.de" ) + + ( manageCert "gs-maubach.de" ) + ( servePage "gs-maubach.de" ) + + ( manageCert "spielwaren-kern.de" ) + ( servePage "spielwaren-kern.de" ) + + ( manageCert "societyofsimtech.de" ) + ( servePage "societyofsimtech.de" ) - lass.staticPage = { - "biostase.de" = {}; - "gs-maubach.de" = {}; - "spielwaren-kern.de" = {}; - "societyofsimtech.de" = {}; - "ttf-kleinaspach.de" = {}; - "edsn.de" = {}; - "eab.berkeley.edu" = {}; - "habsys.de" = {}; - }; + ( manageCert "ttf-kleinaspach.de" ) + ( servePage "ttf-kleinaspach.de" ) + + ( manageCert "edsn.de" ) + ( servePage "edsn.de" ) + + ( manageCert "eab.berkeley.edu" ) + ( servePage "eab.berkeley.edu" ) + + ( manageCert "habsys.de" ) + ( servePage "habsys.de" ) + ]; #lass.owncloud = { # "o.ubikmedia.de" = { diff --git a/lass/2configs/websites/wohnprojekt-rhh.de.nix b/lass/2configs/websites/wohnprojekt-rhh.de.nix index ac784d4c7..4e3eb071a 100644 --- a/lass/2configs/websites/wohnprojekt-rhh.de.nix +++ b/lass/2configs/websites/wohnprojekt-rhh.de.nix @@ -1,14 +1,20 @@ -{ config, ... }: +{ config, pkgs, lib, ... }: -{ +let + inherit (config.krebs.lib) genid; + inherit (import ../../4lib { inherit lib pkgs; }) + manageCert + activateACME + ssl + servePage + serveOwncloud; + +in { imports = [ - ../../3modules/static_nginx.nix + ( ssl "wohnprojekt-rhh.de" ) + ( servePage "wohnprojekt-rhh.de" ) ]; - lass.staticPage = { - "wohnprojekt-rhh.de" = {}; - }; - users.users.laura = { home = "/srv/http/wohnprojekt-rhh.de"; createHome = true; -- cgit v1.2.3 From a638c4eecd55420e3a579763561e4cfa672d1cd5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 11 Apr 2016 16:50:22 +0200 Subject: l 2 websites domsen: serve wordpress --- lass/2configs/websites/domsen.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 173e87864..b02f31629 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -4,28 +4,32 @@ let inherit (config.krebs.lib) genid; inherit (import ../../4lib { inherit lib pkgs; }) manageCert + manageCerts activateACME ssl servePage - serveOwncloud; + serveOwncloud + serveWordpress; in { imports = [ ( ssl "reich-gebaeudereinigung.de" ) ( servePage "reich-gebaeudereinigung.de" ) - ( servePage "karlaskop.de" ) ( manageCert "karlaskop.de" ) + ( servePage "karlaskop.de" ) - ( servePage "makeup.apanowicz.de" ) ( manageCert "makeup.apanowicz.de" ) + ( servePage "makeup.apanowicz.de" ) - ( servePage "pixelpocket.de" ) ( manageCert "pixelpocket.de" ) + ( servePage "pixelpocket.de" ) ( ssl "o.ubikmedia.de" ) ( serveOwncloud "o.ubikmedia.de" ) + ( manageCerts [ "ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) + ( serveWordpress [ "ubikmedia.de" "*.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) ]; services.mysql = { -- cgit v1.2.3 From 72e46878ea759f8909c90d2f5f293bfb8f3a6104 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 11 Apr 2016 16:50:49 +0200 Subject: l 2 websites: activate sqlBackups --- lass/2configs/websites/domsen.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index b02f31629..cbda7b99e 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -38,6 +38,15 @@ in { rootPassword = toString (); }; + services.mysqlBackup = { + enable = true; + databases = [ + "ubikmedia_de" + "o_ubikmedia_de" + ]; + location = "/bku/sql_dumps"; + }; + users.users.domsen = { uid = genid "domsen"; description = "maintenance acc for domsen"; -- cgit v1.2.3 From 2723a1fcd85ccaf9fea6faa6ec51358f706b8883 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 11 Apr 2016 16:51:12 +0200 Subject: l 2 websites domsen: add apcu to phpfpm --- lass/2configs/websites/domsen.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index cbda7b99e..1b62bd977 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -56,10 +56,13 @@ in { createHome = true; }; - #lass.wordpress = { - # "ubikmedia.de" = { - # }; - #}; - + services.phpfpm.phpIni = pkgs.runCommand "php.ini" { + options = '' + extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so + ''; + } '' + cat ${pkgs.php}/etc/php-recommended.ini > $out + echo "$options" >> $out + ''; } -- cgit v1.2.3 From de6e888da9ed85ebbe35fa23569fbd8617734798 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 13 Apr 2016 16:32:04 +0200 Subject: l websites: use lists in helpers --- lass/2configs/websites/domsen.nix | 22 +++++++-------- lass/2configs/websites/fritz.nix | 39 ++++++++++++++------------- lass/2configs/websites/wohnprojekt-rhh.de.nix | 9 +++---- 3 files changed, 35 insertions(+), 35 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 1b62bd977..caaee96bb 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -13,22 +13,22 @@ let in { imports = [ - ( ssl "reich-gebaeudereinigung.de" ) - ( servePage "reich-gebaeudereinigung.de" ) + ( ssl [ "reich-gebaeudereinigung.de" ]) + ( servePage [ "reich-gebaeudereinigung.de" ]) - ( manageCert "karlaskop.de" ) - ( servePage "karlaskop.de" ) + ( manageCerts [ "karlaskop.de" ]) + ( servePage [ "karlaskop.de" ]) - ( manageCert "makeup.apanowicz.de" ) - ( servePage "makeup.apanowicz.de" ) + ( ssl [ "makeup.apanowicz.de" ]) + ( servePage [ "makeup.apanowicz.de" ]) - ( manageCert "pixelpocket.de" ) - ( servePage "pixelpocket.de" ) + ( manageCerts [ "pixelpocket.de" ]) + ( servePage [ "pixelpocket.de" ]) - ( ssl "o.ubikmedia.de" ) - ( serveOwncloud "o.ubikmedia.de" ) + ( ssl [ "o.ubikmedia.de" ]) + ( serveOwncloud [ "o.ubikmedia.de" ]) - ( manageCerts [ "ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) + ( ssl [ "ubikmedia.de" "aldona.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) ( serveWordpress [ "ubikmedia.de" "*.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) ]; diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 16a240d7c..7a35ba75b 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -2,37 +2,40 @@ let inherit (import ../../4lib { inherit lib pkgs; }) - manageCert + manageCerts activateACME ssl servePage - serveOwncloud; + serveWordpress; in { imports = [ - ( manageCert "biostase.de" ) - ( servePage "biostase.de" ) + #( manageCerts [ "biostase.de" ]) + #( servePage [ "biostase.de" ]) - ( manageCert "gs-maubach.de" ) - ( servePage "gs-maubach.de" ) + #( manageCerts [ "gs-maubach.de" ]) + #( servePage [ "gs-maubach.de" ]) - ( manageCert "spielwaren-kern.de" ) - ( servePage "spielwaren-kern.de" ) + #( manageCerts [ "spielwaren-kern.de" ]) + #( servePage [ "spielwaren-kern.de" ]) - ( manageCert "societyofsimtech.de" ) - ( servePage "societyofsimtech.de" ) + #( manageCerts [ "societyofsimtech.de" ]) + #( servePage [ "societyofsimtech.de" ]) - ( manageCert "ttf-kleinaspach.de" ) - ( servePage "ttf-kleinaspach.de" ) + #( manageCerts [ "ttf-kleinaspach.de" ]) + #( servePage [ "ttf-kleinaspach.de" ]) - ( manageCert "edsn.de" ) - ( servePage "edsn.de" ) + #( manageCerts [ "edsn.de" ]) + #( servePage [ "edsn.de" ]) - ( manageCert "eab.berkeley.edu" ) - ( servePage "eab.berkeley.edu" ) + #( manageCerts [ "eab.berkeley.edu" ]) + #( servePage [ "eab.berkeley.edu" ]) - ( manageCert "habsys.de" ) - ( servePage "habsys.de" ) + ( manageCerts [ "eastuttgart.de" ]) + ( serveWordpress [ "eastuttgart.de" ]) + + ( manageCerts [ "habsys.de" ]) + ( servePage [ "habsys.de" ]) ]; #lass.owncloud = { diff --git a/lass/2configs/websites/wohnprojekt-rhh.de.nix b/lass/2configs/websites/wohnprojekt-rhh.de.nix index 4e3eb071a..858054531 100644 --- a/lass/2configs/websites/wohnprojekt-rhh.de.nix +++ b/lass/2configs/websites/wohnprojekt-rhh.de.nix @@ -3,16 +3,13 @@ let inherit (config.krebs.lib) genid; inherit (import ../../4lib { inherit lib pkgs; }) - manageCert - activateACME ssl - servePage - serveOwncloud; + servePage; in { imports = [ - ( ssl "wohnprojekt-rhh.de" ) - ( servePage "wohnprojekt-rhh.de" ) + ( ssl [ "wohnprojekt-rhh.de" ]) + ( servePage [ "wohnprojekt-rhh.de" ]) ]; users.users.laura = { -- cgit v1.2.3 From c9c10168082f648b2d5c25355f55ab4dce885135 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 13 Apr 2016 16:33:25 +0200 Subject: l 2 websites fritz: activate mysql & mysqlBackup --- lass/2configs/websites/fritz.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 7a35ba75b..c022dfbe2 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -38,6 +38,20 @@ in { ( servePage [ "habsys.de" ]) ]; + services.mysql = { + enable = true; + package = pkgs.mariadb; + rootPassword = toString (); + }; + + services.mysqlBackup = { + enable = true; + databases = [ + "eastuttgart_de" + ]; + location = "/bku/sql_dumps"; + }; + #lass.owncloud = { # "o.ubikmedia.de" = { # instanceid = "oc8n8ddbftgh"; -- cgit v1.2.3 From 4ee39c0d71bb6a91bb5c64342ede2f5731c9c1e7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 19 Apr 2016 13:23:12 +0200 Subject: l 2 websites fritz: manage more habsys domains --- lass/2configs/websites/fritz.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index c022dfbe2..0eff39908 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -34,8 +34,8 @@ in { ( manageCerts [ "eastuttgart.de" ]) ( serveWordpress [ "eastuttgart.de" ]) - ( manageCerts [ "habsys.de" ]) - ( servePage [ "habsys.de" ]) + ( manageCerts [ "habsys.de" "habsys.eu" ]) + ( servePage [ "habsys.de" "habsys.eu" ]) ]; services.mysql = { -- cgit v1.2.3 From 20d4383d1f0ed484e402478d92da24d4aed44285 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 20 Apr 2016 13:59:49 +0200 Subject: l 2 websites: use lass.mysqlBackup --- lass/2configs/websites/domsen.nix | 10 ++++++++++ lass/2configs/websites/fritz.nix | 18 +++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index caaee96bb..a6fdad645 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -38,6 +38,16 @@ in { rootPassword = toString (); }; + lass.mysqlBackup = { + enable = true; + config.domsen = { + password = toString (); + databases = [ + "ubikmedia_de" + "o_ubikmedia_de" + ]; + }; + }; services.mysqlBackup = { enable = true; databases = [ diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 0eff39908..b02c2e878 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -44,12 +44,14 @@ in { rootPassword = toString (); }; - services.mysqlBackup = { + lass.mysqlBackup = { enable = true; - databases = [ - "eastuttgart_de" - ]; - location = "/bku/sql_dumps"; + config.fritz = { + password = toString (); + databases = [ + "eastuttgart_de" + ]; + }; }; #lass.owncloud = { @@ -57,10 +59,4 @@ in { # instanceid = "oc8n8ddbftgh"; # }; #}; - - #services.mysql = { - # enable = true; - # package = pkgs.mariadb; - # rootPassword = toString (); - #}; } -- cgit v1.2.3 From a8dc3819fe4946d3e998bb4e048ef166ccf40e08 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 25 Apr 2016 17:37:06 +0200 Subject: l 2 websites fritz: enable ssl --- lass/2configs/websites/fritz.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index b02c2e878..632aa1e89 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -31,10 +31,10 @@ in { #( manageCerts [ "eab.berkeley.edu" ]) #( servePage [ "eab.berkeley.edu" ]) - ( manageCerts [ "eastuttgart.de" ]) + ( ssl [ "eastuttgart.de" ]) ( serveWordpress [ "eastuttgart.de" ]) - ( manageCerts [ "habsys.de" "habsys.eu" ]) + ( ssl [ "habsys.de" "habsys.eu" ]) ( servePage [ "habsys.de" "habsys.eu" ]) ]; -- cgit v1.2.3 From 6e85a853cbbf0179e24ef13b19fa409779b4fb77 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 27 Apr 2016 12:49:47 +0200 Subject: l 2 websites fritz: activate new domains --- lass/2configs/websites/fritz.nix | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 632aa1e89..e35615040 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -10,26 +10,23 @@ let in { imports = [ - #( manageCerts [ "biostase.de" ]) - #( servePage [ "biostase.de" ]) + ( manageCerts [ "biostase.de" "www.biostase.de" ]) + #( serveWordpress [ "biostase.de" "www.biostase.de" ]) - #( manageCerts [ "gs-maubach.de" ]) - #( servePage [ "gs-maubach.de" ]) + ( manageCerts [ "radical-dreamers.de" ]) + ( serveWordpress [ "radical-dreamers.de" ]) - #( manageCerts [ "spielwaren-kern.de" ]) - #( servePage [ "spielwaren-kern.de" ]) + ( manageCerts [ "gs-maubach.de" ]) + ( serveWordpress [ "gs-maubach.de" ]) - #( manageCerts [ "societyofsimtech.de" ]) - #( servePage [ "societyofsimtech.de" ]) + ( manageCerts [ "spielwaren-kern.de" ]) + ( serveWordpress [ "spielwaren-kern.de" ]) - #( manageCerts [ "ttf-kleinaspach.de" ]) - #( servePage [ "ttf-kleinaspach.de" ]) + ( manageCerts [ "familienpraxis-korntal.de" ]) + ( servePage [ "familienpraxis-korntal.de" ]) - #( manageCerts [ "edsn.de" ]) - #( servePage [ "edsn.de" ]) - - #( manageCerts [ "eab.berkeley.edu" ]) - #( servePage [ "eab.berkeley.edu" ]) + ( manageCerts [ "ttf-kleinaspach.de" ]) + ( serveWordpress [ "ttf-kleinaspach.de" ]) ( ssl [ "eastuttgart.de" ]) ( serveWordpress [ "eastuttgart.de" ]) @@ -49,14 +46,12 @@ in { config.fritz = { password = toString (); databases = [ + "biostase_de" "eastuttgart_de" + "radical_dreamers_de" + "spielwaren_kern_de" + "ttf_kleinaspach_de" ]; }; }; - - #lass.owncloud = { - # "o.ubikmedia.de" = { - # instanceid = "oc8n8ddbftgh"; - # }; - #}; } -- cgit v1.2.3 From d4b67a1fed34a1256de1930598a0f6be42e89df1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 13 May 2016 00:22:22 +0200 Subject: l 2 websites domsen: use msmtp as sendmail --- lass/2configs/websites/domsen.nix | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index a6fdad645..001e339a4 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -1,7 +1,10 @@ { config, pkgs, lib, ... }: let - inherit (config.krebs.lib) genid; + inherit (config.krebs.lib) + genid + readFile + ; inherit (import ../../4lib { inherit lib pkgs; }) manageCert manageCerts @@ -11,6 +14,16 @@ let serveOwncloud serveWordpress; + msmtprc = pkgs.writeText "msmtprc" '' + account prism + host localhost + account default: prism + ''; + + sendmail = pkgs.writeDash "msmtp" '' + exec ${pkgs.msmtp}/bin/msmtp --read-envelope-from -C ${msmtprc} "$@" + ''; + in { imports = [ ( ssl [ "reich-gebaeudereinigung.de" ]) @@ -66,13 +79,10 @@ in { createHome = true; }; - services.phpfpm.phpIni = pkgs.runCommand "php.ini" { - options = '' - extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so - ''; - } '' - cat ${pkgs.php}/etc/php-recommended.ini > $out - echo "$options" >> $out + services.phpfpm.phpIni = pkgs.writeText "php.ini" '' + ${readFile "${pkgs.php}/etc/php-recommended.ini"} + extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so + sendmail_path = ${sendmail} -t ''; } -- cgit v1.2.3 From 0fd95b3228ac1ba7e4e18e4207691ce401471e6a Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 20 May 2016 00:06:11 +0200 Subject: l 2 websites domsen: use pgpfpm.phpOptions --- lass/2configs/websites/domsen.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 001e339a4..f31fccd51 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -79,8 +79,7 @@ in { createHome = true; }; - services.phpfpm.phpIni = pkgs.writeText "php.ini" '' - ${readFile "${pkgs.php}/etc/php-recommended.ini"} + services.phpfpm.phpOptions = '' extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so sendmail_path = ${sendmail} -t ''; -- cgit v1.2.3 From 5691537512d24aa542c7ae2d9225c46712e1e811 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 24 May 2016 22:46:41 +0200 Subject: l 2 websites fritz: prefix www. everywhere --- lass/2configs/websites/fritz.nix | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index e35615040..4b539bc10 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -13,26 +13,26 @@ in { ( manageCerts [ "biostase.de" "www.biostase.de" ]) #( serveWordpress [ "biostase.de" "www.biostase.de" ]) - ( manageCerts [ "radical-dreamers.de" ]) - ( serveWordpress [ "radical-dreamers.de" ]) + ( manageCerts [ "radical-dreamers.de" "www.radical-dreamers.de" ]) + ( serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ]) - ( manageCerts [ "gs-maubach.de" ]) - ( serveWordpress [ "gs-maubach.de" ]) + ( manageCerts [ "gs-maubach.de" "www.gs-maubach.de" ]) + ( serveWordpress [ "gs-maubach.de" "www.gs-maubach.de" ]) - ( manageCerts [ "spielwaren-kern.de" ]) - ( serveWordpress [ "spielwaren-kern.de" ]) + ( manageCerts [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) + ( serveWordpress [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) - ( manageCerts [ "familienpraxis-korntal.de" ]) - ( servePage [ "familienpraxis-korntal.de" ]) + ( manageCerts [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) + ( servePage [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) - ( manageCerts [ "ttf-kleinaspach.de" ]) - ( serveWordpress [ "ttf-kleinaspach.de" ]) + ( manageCerts [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) + ( serveWordpress [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) - ( ssl [ "eastuttgart.de" ]) - ( serveWordpress [ "eastuttgart.de" ]) + ( ssl [ "eastuttgart.de" "www.eastuttgart.de" ]) + ( serveWordpress [ "eastuttgart.de" "www.eastuttgart.de" ]) - ( ssl [ "habsys.de" "habsys.eu" ]) - ( servePage [ "habsys.de" "habsys.eu" ]) + ( ssl [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) + ( servePage [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) ]; services.mysql = { -- cgit v1.2.3 From f1cbe54717e4f8f1b648e22f644a32f1b9abf82a Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 24 May 2016 23:20:11 +0200 Subject: l 2 websites fritz: serve biostase.de --- lass/2configs/websites/fritz.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 4b539bc10..5ce2887c4 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -11,7 +11,7 @@ let in { imports = [ ( manageCerts [ "biostase.de" "www.biostase.de" ]) - #( serveWordpress [ "biostase.de" "www.biostase.de" ]) + ( serveWordpress [ "biostase.de" "www.biostase.de" ]) ( manageCerts [ "radical-dreamers.de" "www.radical-dreamers.de" ]) ( serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ]) -- cgit v1.2.3 From 5b4333f2a72b167d7640f15c68e3bbb0aab7809d Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 24 May 2016 23:21:43 +0200 Subject: l 2 websites fritz: add fritz root authorizedKeys --- lass/2configs/websites/fritz.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 5ce2887c4..b0473c2ff 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -54,4 +54,7 @@ in { ]; }; }; + users.users.root.openssh.authorizedKeys.keys = [ + config.krebs.users.fritz.pubkey + ]; } -- cgit v1.2.3 From 565d06608e7eb4a51693f769e239861f48e3bf37 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 May 2016 16:32:32 +0200 Subject: l 2 websites domsen: use old phpIni again --- lass/2configs/websites/domsen.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index f31fccd51..43f9b3924 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -79,9 +79,18 @@ in { createHome = true; }; - services.phpfpm.phpOptions = '' - extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so - sendmail_path = ${sendmail} -t + #services.phpfpm.phpOptions = '' + # extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so + # sendmail_path = ${sendmail} -t + #''; + services.phpfpm.phpIni = pkgs.runCommand "php.ini" { + options = '' + extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so + sendmail_path = ${sendmail} -t -i" + ''; + } '' + cat ${pkgs.php}/etc/php-recommended.ini > $out + echo "$options" >> $out ''; } -- cgit v1.2.3 From b78cafa686a4e01f815f75d1c815996e54fa4597 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 25 May 2016 16:32:59 +0200 Subject: l 2 websites fritz: use ssl everywhere --- lass/2configs/websites/fritz.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index b0473c2ff..b063504f0 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -10,28 +10,28 @@ let in { imports = [ - ( manageCerts [ "biostase.de" "www.biostase.de" ]) + ( ssl [ "biostase.de" "www.biostase.de" ]) ( serveWordpress [ "biostase.de" "www.biostase.de" ]) - ( manageCerts [ "radical-dreamers.de" "www.radical-dreamers.de" ]) + ( ssl [ "radical-dreamers.de" "www.radical-dreamers.de" ]) ( serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ]) - ( manageCerts [ "gs-maubach.de" "www.gs-maubach.de" ]) + ( ssl [ "gs-maubach.de" "www.gs-maubach.de" ]) ( serveWordpress [ "gs-maubach.de" "www.gs-maubach.de" ]) - ( manageCerts [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) + ( ssl [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) ( serveWordpress [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) - ( manageCerts [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) + ( ssl [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) ( servePage [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) - ( manageCerts [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) + ( ssl [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) ( serveWordpress [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) ( ssl [ "eastuttgart.de" "www.eastuttgart.de" ]) ( serveWordpress [ "eastuttgart.de" "www.eastuttgart.de" ]) - ( ssl [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) + #( ssl [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) ( servePage [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) ]; -- cgit v1.2.3 From 80e50fd8a05192faaf0e6f87faa3ea9c0313aa32 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 31 May 2016 23:26:35 +0200 Subject: l: move websites libs to 2/websites/util --- lass/2configs/websites/domsen.nix | 8 +- lass/2configs/websites/fritz.nix | 12 +- lass/2configs/websites/util.nix | 228 ++++++++++++++++++++++++++ lass/2configs/websites/wohnprojekt-rhh.de.nix | 10 +- 4 files changed, 244 insertions(+), 14 deletions(-) create mode 100644 lass/2configs/websites/util.nix (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 43f9b3924..35a391d1b 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -1,14 +1,10 @@ { config, pkgs, lib, ... }: let - inherit (config.krebs.lib) + inherit (import { config = {}; inherit lib; }) genid - readFile ; - inherit (import ../../4lib { inherit lib pkgs; }) - manageCert - manageCerts - activateACME + inherit (import {inherit lib pkgs;}) ssl servePage serveOwncloud diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index b063504f0..487c4644e 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -1,12 +1,16 @@ { config, pkgs, lib, ... }: let - inherit (import ../../4lib { inherit lib pkgs; }) - manageCerts - activateACME + inherit (import { config = {}; inherit lib; }) + genid + head + nameValuePair + ; + inherit (import {inherit lib pkgs;}) ssl servePage - serveWordpress; + serveWordpress + ; in { imports = [ diff --git a/lass/2configs/websites/util.nix b/lass/2configs/websites/util.nix new file mode 100644 index 000000000..84a20c711 --- /dev/null +++ b/lass/2configs/websites/util.nix @@ -0,0 +1,228 @@ +{ lib, pkgs, ... }: + +with lib; + +rec { + + manageCerts = domains: + let + domain = head domains; + in { + security.acme = { + certs."${domain}" = { + email = "lassulus@gmail.com"; + webroot = "/var/lib/acme/challenges/${domain}"; + plugins = [ + "account_key.json" + "key.pem" + "fullchain.pem" + ]; + group = "nginx"; + allowKeysForGroup = true; + extraDomains = genAttrs domains (_: null); + }; + }; + + krebs.nginx.servers."${domain}" = { + locations = [ + (nameValuePair "/.well-known/acme-challenge" '' + root /var/lib/acme/challenges/${domain}/; + '') + ]; + }; + }; + + ssl = domains: + { + imports = [ + ( manageCerts domains ) + ( activateACME (head domains) ) + ]; + }; + + activateACME = domain: + { + krebs.nginx.servers.${domain} = { + ssl = { + enable = true; + certificate = "/var/lib/acme/${domain}/fullchain.pem"; + certificate_key = "/var/lib/acme/${domain}/key.pem"; + }; + }; + }; + + servePage = domains: + let + domain = head domains; + in { + krebs.nginx.servers.${domain} = { + server-names = domains; + locations = [ + (nameValuePair "/" '' + root /srv/http/${domain}; + '') + ]; + }; + }; + + serveOwncloud = domains: + let + domain = head domains; + in { + krebs.nginx.servers."${domain}" = { + server-names = domains; + extraConfig = '' + # Add headers to serve security related headers + add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + + # Path to the root of your installation + root /srv/http/${domain}/; + # set max upload size + client_max_body_size 10G; + fastcgi_buffers 64 4K; + + # Disable gzip to avoid the removal of the ETag header + gzip off; + + # Uncomment if your server is build with the ngx_pagespeed module + # This module is currently not supported. + #pagespeed off; + + index index.php; + error_page 403 /core/templates/403.php; + error_page 404 /core/templates/404.php; + + rewrite ^/.well-known/carddav /remote.php/carddav/ permanent; + rewrite ^/.well-known/caldav /remote.php/caldav/ permanent; + + # The following 2 rules are only needed for the user_webfinger app. + # Uncomment it if you're planning to use this app. + rewrite ^/.well-known/host-meta /public.php?service=host-meta last; + rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; + ''; + locations = [ + (nameValuePair "/robots.txt" '' + allow all; + log_not_found off; + access_log off; + '') + (nameValuePair "~ ^/(build|tests|config|lib|3rdparty|templates|data)/" '' + deny all; + '') + + (nameValuePair "~ ^/(?:autotest|occ|issue|indie|db_|console)" '' + deny all; + '') + + (nameValuePair "/" '' + rewrite ^/remote/(.*) /remote.php last; + rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; + try_files $uri $uri/ =404; + '') + + (nameValuePair "~ \.php(?:$|/)" '' + fastcgi_split_path_info ^(.+\.php)(/.+)$; + include ${pkgs.nginx}/conf/fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param HTTPS on; + fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice + fastcgi_pass unix:/srv/http/${domain}/phpfpm.pool; + fastcgi_intercept_errors on; + '') + + # Adding the cache control header for js and css files + # Make sure it is BELOW the location ~ \.php(?:$|/) { block + (nameValuePair "~* \.(?:css|js)$" '' + add_header Cache-Control "public, max-age=7200"; + # Add headers to serve security related headers + add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + # Optional: Don't log access to assets + access_log off; + '') + + # Optional: Don't log access to other assets + (nameValuePair "~* \.(?:jpg|jpeg|gif|bmp|ico|png|swf)$" '' + access_log off; + '') + ]; + }; + services.phpfpm.poolConfigs."${domain}" = '' + listen = /srv/http/${domain}/phpfpm.pool + user = nginx + group = nginx + pm = dynamic + pm.max_children = 5 + pm.start_servers = 2 + pm.min_spare_servers = 1 + pm.max_spare_servers = 3 + listen.owner = nginx + listen.group = nginx + # errors to journal + php_admin_value[error_log] = 'stderr' + php_admin_flag[log_errors] = on + catch_workers_output = yes + ''; + }; + + serveWordpress = domains: + let + domain = head domains; + + in { + krebs.nginx.servers."${domain}" = { + server-names = domains; + extraConfig = '' + root /srv/http/${domain}/; + index index.php; + access_log /tmp/nginx_acc.log; + error_log /tmp/nginx_err.log; + error_page 404 /404.html; + error_page 500 502 503 504 /50x.html; + ''; + locations = [ + (nameValuePair "/" '' + try_files $uri $uri/ /index.php?$args; + '') + (nameValuePair "~ \.php$" '' + fastcgi_pass unix:/srv/http/${domain}/phpfpm.pool; + include ${pkgs.nginx}/conf/fastcgi.conf; + '') + #(nameValuePair "~ /\\." '' + # deny all; + #'') + #Directives to send expires headers and turn off 404 error logging. + (nameValuePair "~* ^.+\.(xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$" '' + access_log off; + log_not_found off; + expires max; + '') + ]; + }; + services.phpfpm.poolConfigs."${domain}" = '' + listen = /srv/http/${domain}/phpfpm.pool + user = nginx + group = nginx + pm = dynamic + pm.max_children = 5 + pm.start_servers = 2 + pm.min_spare_servers = 1 + pm.max_spare_servers = 3 + listen.owner = nginx + listen.group = nginx + # errors to journal + php_admin_value[error_log] = 'stderr' + php_admin_flag[log_errors] = on + catch_workers_output = yes + ''; + }; + +} diff --git a/lass/2configs/websites/wohnprojekt-rhh.de.nix b/lass/2configs/websites/wohnprojekt-rhh.de.nix index 858054531..fb1a58109 100644 --- a/lass/2configs/websites/wohnprojekt-rhh.de.nix +++ b/lass/2configs/websites/wohnprojekt-rhh.de.nix @@ -1,11 +1,13 @@ { config, pkgs, lib, ... }: let - inherit (config.krebs.lib) genid; - inherit (import ../../4lib { inherit lib pkgs; }) + inherit (import { config = {}; inherit lib; }) + genid + ; + inherit (import {inherit lib pkgs;}) ssl - servePage; - + servePage + ; in { imports = [ ( ssl [ "wohnprojekt-rhh.de" ]) -- cgit v1.2.3 From 76296d5cc5f1ddb1108c3f213204bb386353ad93 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 1 Jun 2016 00:13:19 +0200 Subject: l 2 websites: put sqlBackup in seperate file --- lass/2configs/websites/domsen.nix | 53 +++++++++++--------------------- lass/2configs/websites/fritz.nix | 58 +++++++++++++++--------------------- lass/2configs/websites/sqlBackup.nix | 28 +++++++++++++++++ 3 files changed, 69 insertions(+), 70 deletions(-) create mode 100644 lass/2configs/websites/sqlBackup.nix (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 35a391d1b..45d09c3b9 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -22,49 +22,30 @@ let in { imports = [ - ( ssl [ "reich-gebaeudereinigung.de" ]) - ( servePage [ "reich-gebaeudereinigung.de" ]) + ./sqlBackup.nix + (ssl [ "reich-gebaeudereinigung.de" ]) + (servePage [ "reich-gebaeudereinigung.de" ]) - ( manageCerts [ "karlaskop.de" ]) - ( servePage [ "karlaskop.de" ]) + (ssl [ "karlaskop.de" ]) + (servePage [ "karlaskop.de" ]) - ( ssl [ "makeup.apanowicz.de" ]) - ( servePage [ "makeup.apanowicz.de" ]) + (ssl [ "makeup.apanowicz.de" ]) + (servePage [ "makeup.apanowicz.de" ]) - ( manageCerts [ "pixelpocket.de" ]) - ( servePage [ "pixelpocket.de" ]) + (ssl [ "pixelpocket.de" ]) + (servePage [ "pixelpocket.de" ]) - ( ssl [ "o.ubikmedia.de" ]) - ( serveOwncloud [ "o.ubikmedia.de" ]) + (ssl [ "o.ubikmedia.de" ]) + (serveOwncloud [ "o.ubikmedia.de" ]) - ( ssl [ "ubikmedia.de" "aldona.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) - ( serveWordpress [ "ubikmedia.de" "*.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ] ) + (ssl [ "ubikmedia.de" "aldona.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ]) + (serveWordpress [ "ubikmedia.de" "*.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ]) ]; - services.mysql = { - enable = true; - package = pkgs.mariadb; - rootPassword = toString (); - }; - - lass.mysqlBackup = { - enable = true; - config.domsen = { - password = toString (); - databases = [ - "ubikmedia_de" - "o_ubikmedia_de" - ]; - }; - }; - services.mysqlBackup = { - enable = true; - databases = [ - "ubikmedia_de" - "o_ubikmedia_de" - ]; - location = "/bku/sql_dumps"; - }; + lass.mysqlBackup.config.all.databases = [ + "ubikmedia_de" + "o_ubikmedia_de" + ]; users.users.domsen = { uid = genid "domsen"; diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 487c4644e..63efbecb6 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -14,50 +14,40 @@ let in { imports = [ - ( ssl [ "biostase.de" "www.biostase.de" ]) - ( serveWordpress [ "biostase.de" "www.biostase.de" ]) + ./sqlBackup.nix + (ssl [ "biostase.de" "www.biostase.de" ]) + (serveWordpress [ "biostase.de" "www.biostase.de" ]) - ( ssl [ "radical-dreamers.de" "www.radical-dreamers.de" ]) - ( serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ]) + (ssl [ "radical-dreamers.de" "www.radical-dreamers.de" ]) + (serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ]) - ( ssl [ "gs-maubach.de" "www.gs-maubach.de" ]) - ( serveWordpress [ "gs-maubach.de" "www.gs-maubach.de" ]) + (ssl [ "gs-maubach.de" "www.gs-maubach.de" ]) + (serveWordpress [ "gs-maubach.de" "www.gs-maubach.de" ]) - ( ssl [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) - ( serveWordpress [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) + (ssl [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) + (serveWordpress [ "spielwaren-kern.de" "www.spielwaren-kern.de" ]) - ( ssl [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) - ( servePage [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) + (ssl [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) + (servePage [ "familienpraxis-korntal.de" "www.familienpraxis-korntal.de" ]) - ( ssl [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) - ( serveWordpress [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) + (ssl [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) + (serveWordpress [ "ttf-kleinaspach.de" "www.ttf-kleinaspach.de" ]) - ( ssl [ "eastuttgart.de" "www.eastuttgart.de" ]) - ( serveWordpress [ "eastuttgart.de" "www.eastuttgart.de" ]) + (ssl [ "eastuttgart.de" "www.eastuttgart.de" ]) + (serveWordpress [ "eastuttgart.de" "www.eastuttgart.de" ]) - #( ssl [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) - ( servePage [ "www.habsys.de" "habsys.de" "www.habsys.eu" "habsys.eu" ]) + (ssl [ "habsys.de" "www.habsys.de" "habsys.eu" "www.habsys.eu" ]) + (servePage [ "habsys.de" "www.habsys.de" "habsys.eu" "www.habsys.eu" ]) ]; - services.mysql = { - enable = true; - package = pkgs.mariadb; - rootPassword = toString (); - }; + lass.mysqlBackup.config.all.databases = [ + "biostase_de" + "eastuttgart_de" + "radical_dreamers_de" + "spielwaren_kern_de" + "ttf_kleinaspach_de" + ]; - lass.mysqlBackup = { - enable = true; - config.fritz = { - password = toString (); - databases = [ - "biostase_de" - "eastuttgart_de" - "radical_dreamers_de" - "spielwaren_kern_de" - "ttf_kleinaspach_de" - ]; - }; - }; users.users.root.openssh.authorizedKeys.keys = [ config.krebs.users.fritz.pubkey ]; diff --git a/lass/2configs/websites/sqlBackup.nix b/lass/2configs/websites/sqlBackup.nix new file mode 100644 index 000000000..7cb4b320e --- /dev/null +++ b/lass/2configs/websites/sqlBackup.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +{ + krebs.secret.files.mysql_rootPassword = { + path = "${config.services.mysql.dataDir}/mysql_rootPassword"; + owner.name = "root"; + source-path = toString + "/mysql_rootPassword"; + }; + + services.mysql = { + enable = true; + package = pkgs.mariadb; + rootPassword = config.krebs.secret.files.mysql_rootPassword.path; + }; + + systemd.services.mysql = { + requires = [ "secret.service" ]; + after = [ "secret.service" ]; + }; + + lass.mysqlBackup = { + enable = true; + config.all = { + password = toString (); + }; + }; +} + -- cgit v1.2.3 From 26394051b339ab46cf7033663cc4a61036dbd6da Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 1 Jun 2016 00:14:11 +0200 Subject: l 2 websites util: add server-names to manageCerts --- lass/2configs/websites/util.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs/websites') diff --git a/lass/2configs/websites/util.nix b/lass/2configs/websites/util.nix index 84a20c711..330d8ba86 100644 --- a/lass/2configs/websites/util.nix +++ b/lass/2configs/websites/util.nix @@ -24,6 +24,7 @@ rec { }; krebs.nginx.servers."${domain}" = { + server-names = domains; locations = [ (nameValuePair "/.well-known/acme-challenge" '' root /var/lib/acme/challenges/${domain}/; -- cgit v1.2.3