]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Start moving websites configuration to modules
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 14 May 2019 06:47:00 +0000 (08:47 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 14 May 2019 07:41:18 +0000 (09:41 +0200)
37 files changed:
libs.nix
modules/default.nix
modules/private/default.nix
modules/private/httpd-service-builder.nix
modules/websites/default.nix [new file with mode: 0644]
modules/websites/nosslVhost/index.html [new file with mode: 0644]
nixops/eldiron.nix
nixops/modules/buildbot/default.nix
nixops/modules/task/default.nix
nixops/modules/websites/aten/default.nix
nixops/modules/websites/capitaines/default.nix
nixops/modules/websites/chloe/default.nix
nixops/modules/websites/connexionswing/default.nix
nixops/modules/websites/default.nix
nixops/modules/websites/emilia/default.nix
nixops/modules/websites/ftp/denisejerome.nix
nixops/modules/websites/ftp/florian.nix
nixops/modules/websites/ftp/immae.nix
nixops/modules/websites/ftp/jerome.nix
nixops/modules/websites/ftp/leila.nix
nixops/modules/websites/ftp/nassime.nix
nixops/modules/websites/ftp/papa.nix
nixops/modules/websites/ftp/release.nix
nixops/modules/websites/ftp/temp.nix
nixops/modules/websites/ludivine/default.nix
nixops/modules/websites/piedsjaloux/default.nix
nixops/modules/websites/tellesflorian/default.nix
nixops/modules/websites/tools/cloud.nix
nixops/modules/websites/tools/dav/default.nix
nixops/modules/websites/tools/db.nix
nixops/modules/websites/tools/diaspora.nix
nixops/modules/websites/tools/ether.nix
nixops/modules/websites/tools/git/default.nix
nixops/modules/websites/tools/mastodon.nix
nixops/modules/websites/tools/mediagoblin.nix
nixops/modules/websites/tools/peertube.nix
nixops/modules/websites/tools/tools/default.nix

index eb00311c987c5d37960d1bad3722cf85871434c2..c7d357b978598c1d26759504bd826428886bbe55 100644 (file)
--- a/libs.nix
+++ b/libs.nix
@@ -77,4 +77,4 @@ rec {
     }
   '';
 
-}
+} // (if builtins.pathExists ./lib/private then import ./lib/private else {})
index 6c491601e6f53cc81892f445dae1d6bf0bd97aae..acb0bb5161d18e3dc95db394ba54c1a7cb820da1 100644 (file)
@@ -8,4 +8,6 @@
   mastodon = ./webapps/mastodon.nix;
   mediagoblin = ./webapps/mediagoblin.nix;
   peertube = ./webapps/peertube.nix;
+
+  websites = ./websites;
 } // (if builtins.pathExists ./private then import ./private else {})
index ba463748172a2193ecd8591734c72d05c10ce1b0..6c71af3ec473aa2c2b51b025cfbc7f21650aedaa 100644 (file)
@@ -1,6 +1,6 @@
 {
   # adatped from nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix
-  httpdProd  = import ./httpd-service-builder.nix { httpdName = "Prod"; withUsers = false; };
   httpdInte  = import ./httpd-service-builder.nix { httpdName = "Inte"; withUsers = false; };
+  httpdProd  = import ./httpd-service-builder.nix { httpdName = "Prod"; withUsers = false; };
   httpdTools = import ./httpd-service-builder.nix { httpdName = "Tools"; withUsers = true; };
 }
index 0f0fe2244564ecdb97e4ed83271b36096360565a..d049202c1d59c5c9e8b496240cd38f4cb7b83122 100644 (file)
@@ -7,7 +7,7 @@ with lib;
 
 let
 
-  mainCfg = config.services."httpd${httpdName}";
+  mainCfg = config.services.httpd."${httpdName}";
 
   httpd = mainCfg.package.out;
 
@@ -438,7 +438,7 @@ in
 
   options = {
 
-    services."httpd${httpdName}" = {
+    services.httpd."${httpdName}" = {
 
       enable = mkOption {
         type = types.bool;
@@ -655,7 +655,7 @@ in
 
   ###### implementation
 
-  config = mkIf config.services."httpd${httpdName}".enable {
+  config = mkIf config.services.httpd."${httpdName}".enable {
 
     assertions = [ { assertion = mainCfg.enableSSL == true
                                -> mainCfg.sslServerCert != null
@@ -679,7 +679,7 @@ in
 
     environment.systemPackages = [httpd] ++ concatMap (svc: svc.extraPath) allSubservices;
 
-    services."httpd${httpdName}".phpOptions =
+    services.httpd."${httpdName}".phpOptions =
       ''
         ; Needed for PHP's mail() function.
         sendmail_path = sendmail -t -i
diff --git a/modules/websites/default.nix b/modules/websites/default.nix
new file mode 100644 (file)
index 0000000..6a18c8a
--- /dev/null
@@ -0,0 +1,148 @@
+{ lib, config, ... }: with lib;
+let
+  cfg = config.services.websites;
+in
+{
+  options.services.websites = with types; mkOption {
+    default = {};
+    description = "Each type of website to enable will target a distinct httpd server";
+    type = attrsOf (submodule {
+      options = {
+        enable = mkEnableOption "Enable websites of this type";
+        adminAddr = mkOption {
+          type = str;
+          description = "Admin e-mail address of the instance";
+        };
+        httpdName = mkOption {
+          type = str;
+          description = "Name of the httpd instance to assign this type to";
+        };
+        ips = mkOption {
+          type = listOf string;
+          default = [];
+          description = "ips to listen to";
+        };
+        modules = mkOption {
+          type = listOf str;
+          default = [];
+          description = "Additional modules to load in Apache";
+        };
+        extraConfig = mkOption {
+          type = listOf lines;
+          default = [];
+          description = "Additional configuration to append to Apache";
+        };
+        nosslVhost = mkOption {
+          description = "A default nossl vhost for captive portals";
+          default = {};
+          type = submodule {
+            options = {
+              enable = mkEnableOption "Add default no-ssl vhost for this instance";
+              host = mkOption {
+                type = string;
+                description = "The hostname to use for this vhost";
+              };
+              root = mkOption {
+                type = path;
+                default = ./nosslVhost;
+                description = "The root folder to serve";
+              };
+              indexFile = mkOption {
+                type = string;
+                default = "index.html";
+                description = "The index file to show.";
+              };
+            };
+          };
+        };
+        fallbackVhost = mkOption {
+          description = "The fallback vhost that will be defined as first vhost in Apache";
+          type = submodule {
+            options = {
+              certName = mkOption { type = string; };
+              hosts    = mkOption { type = listOf string; };
+              root     = mkOption { type = nullOr path; };
+              extraConfig = mkOption { type = listOf lines; default = []; };
+            };
+          };
+        };
+        vhostConfs = mkOption {
+          default = {};
+          description = "List of vhosts to define for Apache";
+          type = attrsOf (submodule {
+            options = {
+              certName = mkOption { type = string; };
+              hosts    = mkOption { type = listOf string; };
+              root     = mkOption { type = nullOr path; };
+              extraConfig = mkOption { type = listOf lines; default = []; };
+            };
+          });
+        };
+      };
+    });
+  };
+
+  config.services.httpd = let
+    redirectVhost = ips: { # Should go last, catchall http -> https redirect
+      listen = map (ip: { inherit ip; port = 80; }) ips;
+      hostName = "redirectSSL";
+      serverAliases = [ "*" ];
+      enableSSL = false;
+      logFormat = "combinedVhost";
+      documentRoot = "/var/lib/acme/acme-challenge";
+      extraConfig = ''
+        RewriteEngine on
+        RewriteCond "%{REQUEST_URI}"   "!^/\.well-known"
+        RewriteRule ^(.+)              https://%{HTTP_HOST}$1  [R=301]
+        # To redirect in specific "VirtualHost *:80", do
+        #   RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://host/$1
+        # rather than rewrite
+      '';
+    };
+    nosslVhost = ips: cfg: {
+      listen = map (ip: { inherit ip; port = 80; }) ips;
+      hostName = cfg.host;
+      enableSSL = false;
+      logFormat = "combinedVhost";
+      documentRoot = cfg.root;
+      extraConfig = ''
+        <Directory ${cfg.root}>
+          DirectoryIndex ${cfg.indexFile}
+          AllowOverride None
+          Require all granted
+
+          RewriteEngine on
+          RewriteRule ^/(.+)   /   [L]
+        </Directory>
+        '';
+    };
+    toVhost = ips: vhostConf: {
+      enableSSL = true;
+      sslServerCert = "/var/lib/acme/${vhostConf.certName}/cert.pem";
+      sslServerKey = "/var/lib/acme/${vhostConf.certName}/key.pem";
+      sslServerChain = "/var/lib/acme/${vhostConf.certName}/chain.pem";
+      logFormat = "combinedVhost";
+      listen = map (ip: { inherit ip; port = 443; }) ips;
+      hostName = builtins.head vhostConf.hosts;
+      serverAliases = builtins.tail vhostConf.hosts or [];
+      documentRoot = vhostConf.root;
+      extraConfig = builtins.concatStringsSep "\n" vhostConf.extraConfig;
+    };
+  in attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
+    icfg.httpdName (mkIf icfg.enable {
+      enable = true;
+      listen = map (ip: { inherit ip; port = 443; }) icfg.ips;
+      stateDir = "/run/httpd_${name}";
+      logPerVirtualHost = true;
+      multiProcessingModule = "worker";
+      inherit (icfg) adminAddr;
+      logFormat = "combinedVhost";
+      extraModules = lists.unique icfg.modules;
+      extraConfig = builtins.concatStringsSep "\n" icfg.extraConfig;
+      virtualHosts = [ (toVhost icfg.ips icfg.fallbackVhost) ]
+        ++ optionals (icfg.nosslVhost.enable) [ (nosslVhost icfg.ips icfg.nosslVhost) ]
+        ++ (attrsets.mapAttrsToList (n: v: toVhost icfg.ips v) icfg.vhostConfs)
+        ++ [ (redirectVhost icfg.ips) ];
+    })
+  ) cfg;
+}
diff --git a/modules/websites/nosslVhost/index.html b/modules/websites/nosslVhost/index.html
new file mode 100644 (file)
index 0000000..4401a80
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>No SSL site</title>
+  </head>
+  <body>
+    <h1>No SSL on this site</h1>
+    <p>Use for wifi networks with login page that doesn't work well with
+    https.</p>
+  </body>
+</html>
index 7d97377e8746c59b53499814e301dd55ae863f6d..35ce1812308f6767e6de0e23bacd920c5f2de220 100644 (file)
@@ -48,9 +48,6 @@
     ] ++ (builtins.attrValues (import ../modules));
     services.myGitolite.enable = true;
     services.myDatabases.enable = true;
-    services.myWebsites.production.enable = true;
-    services.myWebsites.integration.enable = true;
-    services.myWebsites.tools.enable = true;
     services.pure-ftpd.enable = true;
     services.irc.enable = true;
     services.pub.enable = true;
index c812af9296a4c5b69b5313cb6bf24e3c6796c7a6..89a0dea10610ff371049201d0f384eb26f608c7f 100644 (file)
@@ -37,7 +37,7 @@ in
       extraGroups = [ "keys" ];
     };
 
-    services.myWebsites.tools.vhostConfs.git.extraConfig = lib.attrsets.mapAttrsToList (k: project: ''
+    services.websites.tools.vhostConfs.git.extraConfig = lib.attrsets.mapAttrsToList (k: project: ''
         RedirectMatch permanent "^/buildbot/${project.name}$" "/buildbot/${project.name}/"
         RewriteEngine On
         RewriteRule ^/buildbot/${project.name}/ws(.*)$   unix:///run/buildbot/${project.name}.sock|ws://git.immae.eu/ws$1 [P,NE,QSA,L]
index 83706084a741fae4cff3ff8f0bd40afda2092200..feb3be81977a5fb6a00a118876dcc1ec09fc07d3 100644 (file)
@@ -102,8 +102,8 @@ in {
         '';
     }];
     security.acme.certs."eldiron".extraDomains.${fqdn} = null;
-    services.myWebsites.tools.modules = [ "proxy_fcgi" "sed" ];
-    services.myWebsites.tools.vhostConfs.task = {
+    services.websites.tools.modules = [ "proxy_fcgi" "sed" ];
+    services.websites.tools.vhostConfs.task = {
       certName    = "eldiron";
       hosts       = [ "task.immae.eu" ];
       root        = "/run/current-system/webapps/_task";
index 70bb34b5830e488c3e6fa4884cc0b163ee14d266..fd002a5a114fd9413e5688a073097e896fdf51e0 100644 (file)
@@ -40,9 +40,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${aten_prod.app.webRoot} $out/webapps/${aten_prod.apache.webappName}
         '';
-      services.myWebsites.apacheConfig.aten_prod.modules = aten_prod.apache.modules;
-      services.myWebsites.production.modules = aten_prod.apache.modules;
-      services.myWebsites.production.vhostConfs.aten = {
+      services.websites.production.modules = aten_prod.apache.modules;
+      services.websites.production.vhostConfs.aten = {
         certName    = "aten";
         hosts       = [ "aten.pro" "www.aten.pro" ];
         root        = aten_prod.apache.root;
@@ -60,8 +59,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${aten_dev.app.webRoot} $out/webapps/${aten_dev.apache.webappName}
         '';
-      services.myWebsites.integration.modules = aten_dev.apache.modules;
-      services.myWebsites.integration.vhostConfs.aten = {
+      services.websites.integration.modules = aten_dev.apache.modules;
+      services.websites.integration.vhostConfs.aten = {
         certName    = "eldiron";
         hosts       = [ "dev.aten.pro" ];
         root        = aten_dev.apache.root;
index 648cb1bb3a8742595cb96301d59555e1596b2f71..0d852667ee66e8c308953fe0fbb7894826a2311c 100644 (file)
@@ -22,7 +22,7 @@ in {
       ln -s ${siteDir} $out/webapps/${webappName}
       '';
 
-    services.myWebsites.production.vhostConfs.capitaines_mastodon = {
+    services.websites.production.vhostConfs.capitaines_mastodon = {
       certName    = "capitaines";
       hosts       = [ "mastodon.capitaines.fr" ];
       root        = root;
@@ -38,7 +38,7 @@ in {
       ];
     };
 
-    services.myWebsites.production.vhostConfs.capitaines = {
+    services.websites.production.vhostConfs.capitaines = {
       certName = "capitaines";
       hosts    = [ "capitaines.fr" ];
       root     = "/run/current-system/webapps/_www";
index ce67bedd5d83875369e8fd9c097990d86c6636ba..ba72d92d799b4ed0b5deb17e9c66263ebc7c410e 100644 (file)
@@ -42,8 +42,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${chloe_prod.app.webRoot} $out/webapps/${chloe_prod.apache.webappName}
         '';
-      services.myWebsites.production.modules = chloe_prod.apache.modules;
-      services.myWebsites.production.vhostConfs.chloe = {
+      services.websites.production.modules = chloe_prod.apache.modules;
+      services.websites.production.vhostConfs.chloe = {
         certName    = "chloe";
         hosts       = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
         root        = chloe_prod.apache.root;
@@ -63,8 +63,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${chloe_dev.app.webRoot} $out/webapps/${chloe_dev.apache.webappName}
         '';
-      services.myWebsites.integration.modules = chloe_dev.apache.modules;
-      services.myWebsites.integration.vhostConfs.chloe = {
+      services.websites.integration.modules = chloe_dev.apache.modules;
+      services.websites.integration.vhostConfs.chloe = {
         certName    = "eldiron";
         hosts       = ["chloe.immae.eu" ];
         root        = chloe_dev.apache.root;
index b19af7e01801d1b618648c3aad78aecdc2d3f52e..3643e190a19439c5a83a6ea51ed03e1149fdefd4 100644 (file)
@@ -43,8 +43,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${connexionswing_prod.app.webRoot} $out/webapps/${connexionswing_prod.apache.webappName}
         '';
-      services.myWebsites.production.modules = connexionswing_prod.apache.modules;
-      services.myWebsites.production.vhostConfs.connexionswing = {
+      services.websites.production.modules = connexionswing_prod.apache.modules;
+      services.websites.production.vhostConfs.connexionswing = {
         certName    = "connexionswing";
         hosts       = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ];
         root        = connexionswing_prod.apache.root;
@@ -64,8 +64,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${connexionswing_dev.app.webRoot} $out/webapps/${connexionswing_dev.apache.webappName}
         '';
-      services.myWebsites.integration.modules = connexionswing_dev.apache.modules;
-      services.myWebsites.integration.vhostConfs.connexionswing = {
+      services.websites.integration.modules = connexionswing_dev.apache.modules;
+      services.websites.integration.vhostConfs.connexionswing = {
         certName    = "eldiron";
         hosts       = ["connexionswing.immae.eu" "sandetludo.immae.eu" ];
         root        = connexionswing_dev.apache.root;
index 627d01a7dedd824970237c057e2a693f36cb68fa..5b839af9885c97a1b258133368b1723da1d7c381 100644 (file)
@@ -3,104 +3,66 @@ let
   cfg = config.services.myWebsites;
   www_root = "/run/current-system/webapps/_www";
   theme_root = "/run/current-system/webapps/_theme";
-  makeService = name: cfg: let
-    toVhost = vhostConf: {
-      enableSSL = true;
-      sslServerCert = "/var/lib/acme/${vhostConf.certName}/cert.pem";
-      sslServerKey = "/var/lib/acme/${vhostConf.certName}/key.pem";
-      sslServerChain = "/var/lib/acme/${vhostConf.certName}/chain.pem";
-      logFormat = "combinedVhost";
-      listen = map (ip: { inherit ip; port = 443; }) cfg.ips;
-      hostName = builtins.head vhostConf.hosts;
-      serverAliases = builtins.tail vhostConf.hosts or [];
-      documentRoot = vhostConf.root;
-      extraConfig = builtins.concatStringsSep "\n" vhostConf.extraConfig;
-    };
-    nosslVhost = {
-      listen = map (ip: { inherit ip; port = 80; }) cfg.ips;
-      hostName = "nossl.immae.eu";
-      enableSSL = false;
-      logFormat = "combinedVhost";
-      documentRoot = www_root;
+  apacheConfig = {
+    gzip = {
+      modules = [ "deflate" "filter" ];
       extraConfig = ''
-        <Directory ${www_root}>
-          DirectoryIndex nossl.html
-          AllowOverride None
-          Require all granted
-
-          RewriteEngine on
-          RewriteRule ^/(.+)   /   [L]
-        </Directory>
-        '';
+        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
+      '';
+    };
+    macros = {
+      modules = [ "macro" ];
     };
-    redirectVhost = { # Should go last, catchall http -> https redirect
-      listen = map (ip: { inherit ip; port = 80; }) cfg.ips;
-      hostName = "redirectSSL";
-      serverAliases = [ "*" ];
-      enableSSL = false;
-      logFormat = "combinedVhost";
-      documentRoot = "/var/lib/acme/acme-challenge";
+    stats = {
       extraConfig = ''
-        RewriteEngine on
-        RewriteCond "%{REQUEST_URI}"   "!^/\.well-known"
-        RewriteRule ^(.+)              https://%{HTTP_HOST}$1  [R=301]
-        # To redirect in specific "VirtualHost *:80", do
-        #   RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://host/$1
-        # rather than rewrite
+        <Macro Stats %{domain}>
+          Alias /webstats ${config.services.webstats.dataDir}/%{domain}
+          <Directory ${config.services.webstats.dataDir}/%{domain}>
+            DirectoryIndex index.html
+            AllowOverride None
+            Require all granted
+          </Directory>
+          <Location /webstats>
+            Use LDAPConnect
+            Require ldap-group cn=%{domain},ou=stats,cn=httpd,ou=services,dc=immae,dc=eu
+          </Location>
+        </Macro>
       '';
     };
-    fallbackVhost = toVhost { # Should go first, default choice
-      certName    = "eldiron";
-      hosts       = ["eldiron.immae.eu" ];
-      root        = www_root;
-      extraConfig = [ "DirectoryIndex index.htm" ];
+    ldap = {
+      modules = [ "ldap" "authnz_ldap" ];
+      extraConfig = ''
+        <IfModule ldap_module>
+          LDAPSharedCacheSize 500000
+          LDAPCacheEntries 1024
+          LDAPCacheTTL 600
+          LDAPOpCacheEntries 1024
+          LDAPOpCacheTTL 600
+        </IfModule>
+
+        Include /var/secrets/apache-ldap
+      '';
     };
-  in rec {
-    enable = true;
-    listen = map (ip: { inherit ip; port = 443; }) cfg.ips;
-    stateDir = "/run/httpd_${name}";
-    logPerVirtualHost = true;
-    multiProcessingModule = "worker";
-    adminAddr = "httpd@immae.eu";
-    logFormat = "combinedVhost";
-    extraModules = pkgs.lib.lists.unique (pkgs.lib.lists.flatten cfg.modules);
-    extraConfig = builtins.concatStringsSep "\n" cfg.extraConfig;
-    virtualHosts = [ fallbackVhost ]
-      ++ lib.optionals (name == "tools") [ nosslVhost ]
-      ++ (pkgs.lib.attrsets.mapAttrsToList (n: v: toVhost v) cfg.vhostConfs)
-      ++ [ redirectVhost ];
-  };
-  makeServiceOptions = name: {
-    enable = lib.mkEnableOption "enable websites in ${name}";
-    ips = lib.mkOption {
-      type = lib.types.listOf lib.types.string;
-      default = let
-        ips = myconfig.env.servers.eldiron.ips.${name};
-      in
-        [ips.ip4] ++ (ips.ip6 or []);
-      description = "${name} ips to listen to";
+    global = {
+      extraConfig = (pkgs.webapps.apache-default.override { inherit www_root;}).apacheConfig;
     };
-    modules = lib.mkOption {
-      type = lib.types.listOf (lib.types.str);
-      default = [];
+    apaxy = {
+      extraConfig = (pkgs.webapps.apache-theme.override { inherit theme_root; }).apacheConfig;
     };
-    extraConfig = lib.mkOption {
-      type = lib.types.listOf (lib.types.lines);
-      default = [];
+    http2 = {
+      modules = [ "http2" ];
+      extraConfig = ''
+        Protocols h2 http/1.1
+      '';
     };
-    vhostConfs = lib.mkOption {
-      type = lib.types.attrsOf (lib.types.submodule {
-        options = {
-          certName = lib.mkOption { type = lib.types.string; };
-          hosts    = lib.mkOption { type = lib.types.listOf lib.types.string; };
-          root     = lib.mkOption { type = lib.types.nullOr lib.types.path; };
-          extraConfig = lib.mkOption { type = lib.types.listOf lib.types.lines; default = []; };
-        };
-      });
+    customLog = {
+      extraConfig = ''
+        LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedVhost
+      '';
     };
   };
-  makeModules = cfg: pkgs.lib.lists.flatten (pkgs.lib.attrsets.mapAttrsToList (n: v: v.modules or []) cfg.apacheConfig);
-  makeExtraConfig = cfg: (builtins.filter (x: x != null) (pkgs.lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) cfg.apacheConfig));
+  makeModules = lib.lists.flatten (lib.attrsets.mapAttrsToList (n: v: v.modules or []) apacheConfig);
+  makeExtraConfig = (builtins.filter (x: x != null) (lib.attrsets.mapAttrsToList (n: v: v.extraConfig or null) apacheConfig));
 in
 {
   imports = [
@@ -135,30 +97,6 @@ in
     ./phpfpm
   ];
 
-  options.services.myWebsites = {
-    production = makeServiceOptions "production";
-    integration = makeServiceOptions "integration";
-    tools = makeServiceOptions "main";
-
-    apacheConfig = lib.mkOption {
-      type = lib.types.attrsOf (lib.types.submodule {
-        options = {
-          modules = lib.mkOption {
-            type = lib.types.listOf (lib.types.str);
-            default = [];
-          };
-          extraConfig = lib.mkOption {
-            type = lib.types.nullOr lib.types.lines;
-            default = null;
-          };
-        };
-      });
-      default = {};
-      description = "Extra global config";
-    };
-
-  };
-
   config = {
     users.users.wwwrun.extraGroups = [ "keys" ];
     networking.firewall.allowedTCPPorts = [ 80 443 ];
@@ -195,28 +133,28 @@ in
     services.myWebsites.tools.etherpad-lite.enable = true;
     services.myWebsites.tools.peertube.enable = true;
 
-    services.myWebsites.Chloe.production.enable = cfg.production.enable;
-    services.myWebsites.Ludivine.production.enable = cfg.production.enable;
-    services.myWebsites.Aten.production.enable = cfg.production.enable;
-    services.myWebsites.PiedsJaloux.production.enable = cfg.production.enable;
-    services.myWebsites.Connexionswing.production.enable = cfg.production.enable;
-    services.myWebsites.Jerome.production.enable = cfg.production.enable;
-    services.myWebsites.Nassime.production.enable = cfg.production.enable;
-    services.myWebsites.Florian.production.enable = cfg.production.enable;
-    services.myWebsites.Leila.production.enable = cfg.production.enable;
-    services.myWebsites.Papa.production.enable = cfg.production.enable;
-    services.myWebsites.DeniseJerome.production.enable = cfg.production.enable;
-    services.myWebsites.Emilia.production.enable = cfg.production.enable;
-    services.myWebsites.Capitaines.production.enable = cfg.production.enable;
-    services.myWebsites.Immae.production.enable = cfg.production.enable;
-    services.myWebsites.Release.production.enable = cfg.production.enable;
-    services.myWebsites.Temp.production.enable = cfg.production.enable;
+    services.myWebsites.Chloe.production.enable = true;
+    services.myWebsites.Ludivine.production.enable = true;
+    services.myWebsites.Aten.production.enable = true;
+    services.myWebsites.PiedsJaloux.production.enable = true;
+    services.myWebsites.Connexionswing.production.enable = true;
+    services.myWebsites.Jerome.production.enable = true;
+    services.myWebsites.Nassime.production.enable = true;
+    services.myWebsites.Florian.production.enable = true;
+    services.myWebsites.Leila.production.enable = true;
+    services.myWebsites.Papa.production.enable = true;
+    services.myWebsites.DeniseJerome.production.enable = true;
+    services.myWebsites.Emilia.production.enable = true;
+    services.myWebsites.Capitaines.production.enable = true;
+    services.myWebsites.Immae.production.enable = true;
+    services.myWebsites.Release.production.enable = true;
+    services.myWebsites.Temp.production.enable = true;
 
-    services.myWebsites.Chloe.integration.enable = cfg.integration.enable;
-    services.myWebsites.Ludivine.integration.enable = cfg.integration.enable;
-    services.myWebsites.Aten.integration.enable = cfg.integration.enable;
-    services.myWebsites.PiedsJaloux.integration.enable = cfg.integration.enable;
-    services.myWebsites.Connexionswing.integration.enable = cfg.integration.enable;
+    services.myWebsites.Chloe.integration.enable = true;
+    services.myWebsites.Ludivine.integration.enable = true;
+    services.myWebsites.Aten.integration.enable = true;
+    services.myWebsites.PiedsJaloux.integration.enable = true;
+    services.myWebsites.Connexionswing.integration.enable = true;
     services.myWebsites.TellesFlorian.integration.enable = true;
     services.myWebsites.Florian.integration.enable = true;
 
@@ -239,65 +177,6 @@ in
         '';
     }];
 
-    services.myWebsites.apacheConfig = {
-      gzip = {
-        modules = [ "deflate" "filter" ];
-        extraConfig = ''
-          AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
-        '';
-      };
-      macros = {
-        modules = [ "macro" ];
-      };
-      stats = {
-        extraConfig = ''
-          <Macro Stats %{domain}>
-            Alias /webstats ${config.services.webstats.dataDir}/%{domain}
-            <Directory ${config.services.webstats.dataDir}/%{domain}>
-              DirectoryIndex index.html
-              AllowOverride None
-              Require all granted
-            </Directory>
-            <Location /webstats>
-              Use LDAPConnect
-              Require ldap-group cn=%{domain},ou=stats,cn=httpd,ou=services,dc=immae,dc=eu
-            </Location>
-          </Macro>
-        '';
-      };
-      ldap = {
-        modules = [ "ldap" "authnz_ldap" ];
-        extraConfig = ''
-          <IfModule ldap_module>
-            LDAPSharedCacheSize 500000
-            LDAPCacheEntries 1024
-            LDAPCacheTTL 600
-            LDAPOpCacheEntries 1024
-            LDAPOpCacheTTL 600
-          </IfModule>
-
-          Include /var/secrets/apache-ldap
-        '';
-      };
-      global = {
-        extraConfig = (pkgs.webapps.apache-default.override { inherit www_root;}).apacheConfig;
-      };
-      apaxy = {
-        extraConfig = (pkgs.webapps.apache-theme.override { inherit theme_root; }).apacheConfig;
-      };
-      http2 = {
-        modules = [ "http2" ];
-        extraConfig = ''
-          Protocols h2 http/1.1
-        '';
-      };
-      customLog = {
-        extraConfig = ''
-          LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedVhost
-        '';
-      };
-    };
-
     system.activationScripts = {
       httpd = ''
         install -d -m 0755 /var/lib/acme/acme-challenge
@@ -334,26 +213,68 @@ in
         '';
     };
 
-    services.httpdProd = makeService "production" config.services.myWebsites.production;
-    services.myWebsites.production.modules = makeModules cfg;
-    services.myWebsites.production.extraConfig = makeExtraConfig cfg;
+    services.websites.production = {
+      enable = true;
+      adminAddr = "httpd@immae.eu";
+      httpdName = "Prod";
+      ips =
+        let ips = myconfig.env.servers.eldiron.ips.production;
+        in [ips.ip4] ++ (ips.ip6 or []);
+      modules = makeModules;
+      extraConfig = makeExtraConfig;
+      fallbackVhost = {
+        certName    = "eldiron";
+        hosts       = ["eldiron.immae.eu" ];
+        root        = www_root;
+        extraConfig = [ "DirectoryIndex index.htm" ];
+      };
+    };
 
-    services.httpdInte = makeService "integration" config.services.myWebsites.integration;
-    services.myWebsites.integration.modules = makeModules cfg;
-    services.myWebsites.integration.extraConfig = makeExtraConfig cfg;
+    services.websites.integration = {
+      enable = true;
+      adminAddr = "httpd@immae.eu";
+      httpdName = "Inte";
+      ips =
+        let ips = myconfig.env.servers.eldiron.ips.integration;
+        in [ips.ip4] ++ (ips.ip6 or []);
+      modules = makeModules;
+      extraConfig = makeExtraConfig;
+      fallbackVhost = {
+        certName    = "eldiron";
+        hosts       = ["eldiron.immae.eu" ];
+        root        = www_root;
+        extraConfig = [ "DirectoryIndex index.htm" ];
+      };
+    };
 
-    services.httpdTools = makeService "tools" config.services.myWebsites.tools;
-    services.myWebsites.tools.modules = makeModules cfg;
-    services.myWebsites.tools.extraConfig = makeExtraConfig cfg ++
-    [ ''
-        RedirectMatch ^/licen[cs]es?_et_tip(ping)?$ https://www.immae.eu/licences_et_tip.html
-        RedirectMatch ^/licen[cs]es?_and_tip(ping)?$ https://www.immae.eu/licenses_and_tipping.html
-        RedirectMatch ^/licen[cs]es?$ https://www.immae.eu/licenses_and_tipping.html
-        RedirectMatch ^/tip(ping)?$ https://www.immae.eu/licenses_and_tipping.html
-        RedirectMatch ^/(mentions|mentions_legales|legal)$ https://www.immae.eu/mentions.html
-        RedirectMatch ^/CGU$ https://www.immae.eu/CGU
-      ''
-      ]
-    ;
+    services.websites.tools = {
+      enable = true;
+      adminAddr = "httpd@immae.eu";
+      httpdName = "Tools";
+      ips =
+        let ips = myconfig.env.servers.eldiron.ips.main;
+        in [ips.ip4] ++ (ips.ip6 or []);
+      modules = makeModules;
+      extraConfig = makeExtraConfig ++
+        [ ''
+            RedirectMatch ^/licen[cs]es?_et_tip(ping)?$ https://www.immae.eu/licences_et_tip.html
+            RedirectMatch ^/licen[cs]es?_and_tip(ping)?$ https://www.immae.eu/licenses_and_tipping.html
+            RedirectMatch ^/licen[cs]es?$ https://www.immae.eu/licenses_and_tipping.html
+            RedirectMatch ^/tip(ping)?$ https://www.immae.eu/licenses_and_tipping.html
+            RedirectMatch ^/(mentions|mentions_legales|legal)$ https://www.immae.eu/mentions.html
+            RedirectMatch ^/CGU$ https://www.immae.eu/CGU
+          ''
+          ];
+      nosslVhost = {
+        enable = true;
+        host = "nossl.immae.eu";
+      };
+      fallbackVhost = {
+        certName    = "eldiron";
+        hosts       = ["eldiron.immae.eu" ];
+        root        = www_root;
+        extraConfig = [ "DirectoryIndex index.htm" ];
+      };
+    };
   };
 }
index 97173b924f483ed4b369144e2ffcaa7028c8dfb3..4e32beceb010fb87fee2aa0f73fd9ffab548798f 100644 (file)
@@ -61,7 +61,7 @@ in {
       mkdir -p $out/webapps
       ln -s ${siteDir} $out/webapps/${webappName}
       '';
-    services.myWebsites.production.vhostConfs.emilia = {
+    services.websites.production.vhostConfs.emilia = {
       certName    = "emilia";
       hosts       = [ "saison-photo.org" "www.saison-photo.org" ];
       root        = root;
index 85aae2704b825850acbe6807c75f11f815ab0294..fa31430c211921ba18a57a9822a12ea783a2c1f2 100644 (file)
@@ -17,7 +17,7 @@ in {
       domain = "denisejerome.piedsjaloux.fr";
     };
 
-    services.myWebsites.production.vhostConfs.denisejerome = {
+    services.websites.production.vhostConfs.denisejerome = {
       certName    = "denisejerome";
       hosts       = ["denisejerome.piedsjaloux.fr" ];
       root        = varDir;
index 2c8edbbd1611678ac2128ee847fef2bd7780fc3d..8097507ea82474d99033f343e7004fc55befc794 100644 (file)
@@ -24,8 +24,8 @@ in {
         };
       };
 
-      services.myWebsites.production.modules = adminer.apache.modules;
-      services.myWebsites.production.vhostConfs.florian = {
+      services.websites.production.modules = adminer.apache.modules;
+      services.websites.production.vhostConfs.florian = {
         certName    = "florian";
         hosts       = [ "tellesflorian.com" "www.tellesflorian.com" ];
         root        = "${varDir}/tellesflorian.com";
@@ -49,8 +49,8 @@ in {
       security.acme.certs."ftp".extraDomains."florian.immae.eu" = null;
       security.acme.certs."eldiron".extraDomains."florian.immae.eu" = null;
 
-      services.myWebsites.integration.modules = adminer.apache.modules;
-      services.myWebsites.integration.vhostConfs.florian = {
+      services.websites.integration.modules = adminer.apache.modules;
+      services.websites.integration.vhostConfs.florian = {
         certName    = "eldiron";
         hosts       = [ "florian.immae.eu" ];
         root        = "${varDir}/florian.immae.eu";
index 64f8f3124e2c4210b8e94135d29f91a2f644f887..e188d95d8787e7f255e64d67e165ec33bae9d8d1 100644 (file)
@@ -28,8 +28,8 @@ in {
 
       php_admin_value[open_basedir] = "${varDir}:/tmp"
       '';
-    services.myWebsites.production.modules = [ "proxy_fcgi" ];
-    services.myWebsites.production.vhostConfs.immae = {
+    services.websites.production.modules = [ "proxy_fcgi" ];
+    services.websites.production.vhostConfs.immae = {
       certName    = "eldiron";
       hosts       = [ "www.immae.eu" ];
       root        = varDir;
@@ -58,7 +58,7 @@ in {
 
     security.acme.certs."eldiron".extraDomains."bouya.org" = null;
     security.acme.certs."eldiron".extraDomains."www.bouya.org" = null;
-    services.myWebsites.production.vhostConfs.bouya = {
+    services.websites.production.vhostConfs.bouya = {
       certName    = "eldiron";
       hosts       = [ "bouya.org" "www.bouya.org" ];
       root        = null;
index 5b86697610d0cb1edea14ee73fd8f5a4ddecc7e1..a340644e60be27dbd18a44f4586a9e224764028e 100644 (file)
@@ -58,8 +58,8 @@ in {
     services.myPhpfpm.poolPhpConfigs.jerome = ''
       extension=${pkgs.php}/lib/php/extensions/mysqli.so
       '';
-    services.myWebsites.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ];
-    services.myWebsites.production.vhostConfs.naturaloutil = {
+    services.websites.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ];
+    services.websites.production.vhostConfs.naturaloutil = {
       certName    = "naturaloutil";
       hosts       = ["naturaloutil.immae.eu" ];
       root        = varDir;
index c5c27b1a950231cd7e8e578d75650f5f5dc9b772..518537214430d911c0e032dd994086e663f21c0e 100644 (file)
@@ -38,8 +38,8 @@ in {
         { name = "chorale.leila.bouya.org"; }
       ];
 
-      services.myWebsites.production.modules = [ "proxy_fcgi" ];
-      services.myWebsites.production.vhostConfs.leila_chorale = {
+      services.websites.production.modules = [ "proxy_fcgi" ];
+      services.websites.production.vhostConfs.leila_chorale = {
         certName    = "leila";
         hosts       = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
         root        = "${varDir}/Chorale";
@@ -61,7 +61,7 @@ in {
             ''
         ];
       };
-      services.myWebsites.production.vhostConfs.leila = {
+      services.websites.production.vhostConfs.leila = {
         certName    = "leila";
         hosts       = [ "leila.bouya.org" ];
         root        = varDir;
index 0e54786348f862673ab0ce2eec147201e6cf0c9a..9ed8a809bb50be8c1751089b20a18754f9e8bcd3 100644 (file)
@@ -18,7 +18,7 @@ in {
       domain = "nassime.bouya.org";
     };
 
-    services.myWebsites.production.vhostConfs.nassime = {
+    services.websites.production.vhostConfs.nassime = {
       certName    = "nassime";
       hosts       = ["nassime.bouya.org" ];
       root        = varDir;
index aedae6324176fc398857d030e65ea0739aaa9f28..cdbc1b0b7c0fd46ee6155e2baff139fdd562f629 100644 (file)
@@ -34,7 +34,7 @@ in {
       ];
     };
 
-    services.myWebsites.production.vhostConfs.papa = {
+    services.websites.production.vhostConfs.papa = {
       certName    = "papa";
       hosts       = [ "surveillance.maison.bbc.bouya.org" ];
       root        = varDir;
index 4d996e35dae8390e681bf2271f37a9bcbb97c5b9..2ddd8bca4b394ad6cdcd05f08c262f08ffcac735 100644 (file)
@@ -15,7 +15,7 @@ in {
 
     security.acme.certs."eldiron".extraDomains."release.immae.eu" = null;
 
-    services.myWebsites.production.vhostConfs.release = {
+    services.websites.production.vhostConfs.release = {
       certName    = "eldiron";
       hosts       = [ "release.immae.eu" ];
       root        = varDir;
index 087b499a2fea044b39e8f35e1759703da8035317..bdd80c0d83e84dbd35302d85544cd17ca4af5a58 100644 (file)
@@ -13,8 +13,8 @@ in {
   config = lib.mkIf cfg.production.enable {
     security.acme.certs."eldiron".extraDomains."temp.immae.eu" = null;
 
-    services.myWebsites.production.modules = [ "headers" ];
-    services.myWebsites.production.vhostConfs.temp = {
+    services.websites.production.modules = [ "headers" ];
+    services.websites.production.vhostConfs.temp = {
       certName    = "eldiron";
       hosts       = [ "temp.immae.eu" ];
       root        = varDir;
index df75eff35fae20ee8f11c772b332b3f90dcd50dd..dfeff0ad6542646ed8860a959a9c68e712dffe69 100644 (file)
@@ -40,8 +40,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${ludivinecassal_prod.app.webRoot} $out/webapps/${ludivinecassal_prod.apache.webappName}
         '';
-      services.myWebsites.production.modules = ludivinecassal_prod.apache.modules;
-      services.myWebsites.production.vhostConfs.ludivine = {
+      services.websites.production.modules = ludivinecassal_prod.apache.modules;
+      services.websites.production.vhostConfs.ludivine = {
         certName    = "ludivinecassal";
         hosts       = ["ludivinecassal.com" "www.ludivinecassal.com" ];
         root        = ludivinecassal_prod.apache.root;
@@ -60,9 +60,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${ludivinecassal_dev.app.webRoot} $out/webapps/${ludivinecassal_dev.apache.webappName}
         '';
-      services.myWebsites.apacheConfig.ludivinecassal_dev.modules = ludivinecassal_dev.apache.modules;
-      services.myWebsites.integration.modules = ludivinecassal_dev.apache.modules;
-      services.myWebsites.integration.vhostConfs.ludivine = {
+      services.websites.integration.modules = ludivinecassal_dev.apache.modules;
+      services.websites.integration.vhostConfs.ludivine = {
         certName    = "eldiron";
         hosts       = [ "ludivine.immae.eu" ];
         root        = ludivinecassal_dev.apache.root;
index 10c1f6c91eb31d18c464029daeac4287a8195809..6ffb19c034547ca6d7cf78aa2f701a780b0e0f60 100644 (file)
@@ -40,8 +40,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${piedsjaloux_prod.app.webRoot} $out/webapps/${piedsjaloux_prod.apache.webappName}
         '';
-      services.myWebsites.production.modules = piedsjaloux_prod.apache.modules;
-      services.myWebsites.production.vhostConfs.piedsjaloux = {
+      services.websites.production.modules = piedsjaloux_prod.apache.modules;
+      services.websites.production.vhostConfs.piedsjaloux = {
         certName    = "piedsjaloux";
         hosts       = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ];
         root        = piedsjaloux_prod.apache.root;
@@ -59,8 +59,8 @@ in {
         mkdir -p $out/webapps
         ln -s ${piedsjaloux_dev.app.webRoot} $out/webapps/${piedsjaloux_dev.apache.webappName}
         '';
-      services.myWebsites.integration.modules = piedsjaloux_dev.apache.modules;
-      services.myWebsites.integration.vhostConfs.piedsjaloux = {
+      services.websites.integration.modules = piedsjaloux_dev.apache.modules;
+      services.websites.integration.vhostConfs.piedsjaloux = {
         certName    = "eldiron";
         hosts       = [ "piedsjaloux.immae.eu" ];
         root        = piedsjaloux_dev.apache.root;
index 93ee02308f1b24423f1ef1211907574983a7aa29..eb02174c6727e47d3d4caa1f197d1fccf8495088 100644 (file)
@@ -26,8 +26,8 @@ in {
       mkdir -p $out/webapps
       ln -s ${tellesflorian_dev.app.webRoot} $out/webapps/${tellesflorian_dev.apache.webappName}
       '';
-    services.myWebsites.integration.modules = adminer.apache.modules ++ tellesflorian_dev.apache.modules;
-    services.myWebsites.integration.vhostConfs.tellesflorian = {
+    services.websites.integration.modules = adminer.apache.modules ++ tellesflorian_dev.apache.modules;
+    services.websites.integration.vhostConfs.tellesflorian = {
       certName    = "eldiron";
       hosts       = ["app.tellesflorian.com" ];
       root        = tellesflorian_dev.apache.root;
index 40faec77998bac05ea032ff15c7d5fac73e3d87b..69b5fb07dabd2e6889768e8b07fc453137ef0b86 100644 (file)
@@ -51,9 +51,9 @@ in {
   config = lib.mkIf cfg.enable {
     security.acme.certs."eldiron".extraDomains."cloud.immae.eu" = null;
 
-    services.myWebsites.tools.modules = [ "proxy_fcgi" ];
+    services.websites.tools.modules = [ "proxy_fcgi" ];
 
-    services.myWebsites.tools.vhostConfs.cloud = {
+    services.websites.tools.vhostConfs.cloud = {
       certName    = "eldiron";
       hosts       = ["cloud.immae.eu" ];
       root        = apacheRoot;
index 5b5a0763b76c46fa34fd61eb0c238bc2559b9081..ea2105b495ffca6391080830657d6670380c50e1 100644 (file)
@@ -30,9 +30,9 @@ in {
     security.acme.certs."eldiron".extraDomains."dav.immae.eu" = null;
 
     secrets.keys = davical.keys;
-    services.myWebsites.tools.modules = davical.apache.modules;
+    services.websites.tools.modules = davical.apache.modules;
 
-    services.myWebsites.tools.vhostConfs.dav = {
+    services.websites.tools.vhostConfs.dav = {
       certName    = "eldiron";
       hosts       = ["dav.immae.eu" ];
       root        = null;
index f7ca585980c9009153e2498a80ffffded6faf860..70650fa6090acea960e7ae2e2f71057c4603c091 100644 (file)
@@ -11,8 +11,8 @@ in {
   config = lib.mkIf cfg.enable {
     security.acme.certs."eldiron".extraDomains."db-1.immae.eu" = null;
 
-    services.myWebsites.tools.modules = adminer.apache.modules;
-    services.myWebsites.tools.vhostConfs.db-1 = {
+    services.websites.tools.modules = adminer.apache.modules;
+    services.websites.tools.vhostConfs.db-1 = {
       certName    = "eldiron";
       hosts       = ["db-1.immae.eu" ];
       root        = null;
index f6097a09da6f2af6a2f4d18c6fb9bd174782bba6..221e01c27af101270f2819e16156581a4a5617ae 100644 (file)
@@ -145,7 +145,7 @@ in {
       configDir = "/var/secrets/webapps/diaspora";
     };
 
-    services.myWebsites.tools.modules = [
+    services.websites.tools.modules = [
       "headers" "proxy" "proxy_http"
     ];
     security.acme.certs."eldiron".extraDomains."diaspora.immae.eu" = null;
@@ -153,7 +153,7 @@ in {
       mkdir -p $out/webapps
       ln -s ${dcfg.workdir}/public/ $out/webapps/tools_diaspora
       '';
-    services.myWebsites.tools.vhostConfs.diaspora = {
+    services.websites.tools.vhostConfs.diaspora = {
       certName    = "eldiron";
       hosts       = [ "diaspora.immae.eu" ];
       root        = root;
index 0ce578816c1bfa18d55a8e3db45429a05bddad0d..6222b22d6d09dcb3891db0463ca6202b21451a17 100644 (file)
@@ -133,11 +133,11 @@ in {
 
     systemd.services.etherpad-lite.serviceConfig.SupplementaryGroups = "keys";
 
-    services.myWebsites.tools.modules = [
+    services.websites.tools.modules = [
       "headers" "proxy" "proxy_http" "proxy_wstunnel"
     ];
     security.acme.certs."eldiron".extraDomains."ether.immae.eu" = null;
-    services.myWebsites.tools.vhostConfs.etherpad-lite = {
+    services.websites.tools.vhostConfs.etherpad-lite = {
       certName    = "eldiron";
       hosts       = [ "ether.immae.eu" ];
       root        = null;
index bfcfc6212c58a15820f5244baf4a4d273ce99b38..ea0d9717ae152f2df53d288a048d74da56888a11 100644 (file)
@@ -16,7 +16,7 @@ in {
     security.acme.certs."eldiron".extraDomains."git.immae.eu" = null;
 
     secrets.keys = mantisbt.keys;
-    services.myWebsites.tools.modules =
+    services.websites.tools.modules =
       gitweb.apache.modules ++
       mantisbt.apache.modules;
     system.extraSystemBuilderCmds = ''
@@ -25,7 +25,7 @@ in {
       ln -s ${mantisbt.webRoot} $out/webapps/${mantisbt.apache.webappName}
       '';
 
-    services.myWebsites.tools.vhostConfs.git = {
+    services.websites.tools.vhostConfs.git = {
       certName    = "eldiron";
       hosts       = ["git.immae.eu" ];
       root        = gitweb.apache.root;
index e0f589a161ad9b6fa56a70703863ab8fe0ef01c6..38b21074ac02cdbfc39050ed5c202fb89f3077a0 100644 (file)
@@ -64,7 +64,7 @@ in {
       dataDir = "/var/lib/mastodon_immae";
     };
 
-    services.myWebsites.tools.modules = [
+    services.websites.tools.modules = [
       "headers" "proxy" "proxy_wstunnel" "proxy_http"
     ];
     security.acme.certs."eldiron".extraDomains."mastodon.immae.eu" = null;
@@ -72,7 +72,7 @@ in {
       mkdir -p $out/webapps
       ln -s ${mcfg.workdir}/public/ $out/webapps/tools_mastodon
       '';
-    services.myWebsites.tools.vhostConfs.mastodon = {
+    services.websites.tools.vhostConfs.mastodon = {
       certName    = "eldiron";
       hosts       = ["mastodon.immae.eu" ];
       root        = root;
index 6b266811d7e70de3a84e571c645d670a6be1a129..8a6f03f1b13548dcba7a67ee0907046edc871a47 100644 (file)
@@ -79,12 +79,12 @@ in {
       configFile = "/var/secrets/webapps/tools-mediagoblin";
     };
 
-    services.myWebsites.tools.modules = [
+    services.websites.tools.modules = [
       "proxy" "proxy_http"
     ];
     users.users.wwwrun.extraGroups = [ "mediagoblin" ];
     security.acme.certs."eldiron".extraDomains."mgoblin.immae.eu" = null;
-    services.myWebsites.tools.vhostConfs.mgoblin = {
+    services.websites.tools.vhostConfs.mgoblin = {
       certName    = "eldiron";
       hosts       = ["mgoblin.immae.eu" ];
       root        = null;
index 0184a3098062cb00a5e16dbe7610c4b92f2e26e8..6cc6d3834b25f4f07c1138f8e09484743a8263d9 100644 (file)
@@ -150,11 +150,11 @@ in {
         '';
     }];
 
-    services.myWebsites.tools.modules = [
+    services.websites.tools.modules = [
       "headers" "proxy" "proxy_http" "proxy_wstunnel"
     ];
     security.acme.certs."eldiron".extraDomains."peertube.immae.eu" = null;
-    services.myWebsites.tools.vhostConfs.peertube = {
+    services.websites.tools.vhostConfs.peertube = {
       certName    = "eldiron";
       hosts       = [ "peertube.immae.eu" ];
       root        = null;
index 10feefee087f615daa70961708c837508f44a12f..5e84f45a15cd641540114252bfeb97f1e4322333 100644 (file)
@@ -58,10 +58,10 @@ in {
       ++ wallabag.keys
       ++ yourls.keys;
 
-    services.myWebsites.integration.modules =
+    services.websites.integration.modules =
       rainloop.apache.modules;
 
-    services.myWebsites.tools.modules =
+    services.websites.tools.modules =
       [ "proxy_fcgi" ]
       ++ adminer.apache.modules
       ++ ympd.apache.modules
@@ -84,7 +84,7 @@ in {
         '';
     };
 
-    services.myWebsites.integration.vhostConfs.devtools = {
+    services.websites.integration.vhostConfs.devtools = {
       certName    = "eldiron";
       hosts       = ["devtools.immae.eu" ];
       root        = "/var/lib/ftp/devtools.immae.eu";
@@ -103,7 +103,7 @@ in {
       ];
     };
 
-    services.myWebsites.tools.vhostConfs.tools = {
+    services.websites.tools.vhostConfs.tools = {
       certName    = "eldiron";
       hosts       = ["tools.immae.eu" ];
       root        = "/var/lib/ftp/tools.immae.eu";
@@ -133,7 +133,7 @@ in {
     };
 
     security.acme.certs."eldiron".extraDomains."outils.immae.eu" = null;
-    services.myWebsites.tools.vhostConfs.outils = {
+    services.websites.tools.vhostConfs.outils = {
       certName = "eldiron";
       hosts    = [ "outils.immae.eu" ];
       root     = null;