]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - systems/eldiron/websites/diaspora/default.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / diaspora / default.nix
similarity index 73%
rename from modules/private/websites/tools/diaspora/default.nix
rename to systems/eldiron/websites/diaspora/default.nix
index 3a115ed1f82e7bc076dc6ae4da3adca695012af5..c5364466ef0f48859be9e0a1e4faf25eb85b9cd0 100644 (file)
@@ -10,6 +10,31 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
+    myServices.dns.zones."immae.eu".subdomains.diaspora =
+      with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
+
+    myServices.chatonsProperties.services.diaspora = {
+      file.datetime = "2022-08-21T01:39:00";
+      service = {
+        name = "Diaspora";
+        description = "The online social world where you are in control";
+        website = "https://diaspora.immae.eu";
+        logo = "https://diaspora.immae.eu/assets/apple-touch-icon-9f7c9cc3923b4817fbb25bfeb0dd5fd34638827fd9c82b5a03f7b68e6e90806f.png";
+        status.level = "OK";
+        status.description = "OK";
+        registration."" = ["MEMBER" "CLIENT"];
+        registration.load = "OPEN";
+        install.type = "PACKAGE";
+      };
+      software = {
+        name = "Diaspora*";
+        website = "https://diasporafoundation.org/";
+        license.url = "https://github.com/diaspora/diaspora/blob/develop/LICENSE";
+        license.name = "GNU Affero General Public License v3.0";
+        version = dcfg.package.version;
+        source.url = "https://github.com/diaspora/diaspora";
+      };
+    };
     users.users.diaspora.extraGroups = [ "keys" ];
 
     secrets.keys = {
@@ -23,6 +48,7 @@ in {
         user = "diaspora";
         group = "diaspora";
         permissions = "0400";
+        keyDependencies = [ pkgs.cacert ];
         text = ''
         configuration:
           environment:
@@ -142,7 +168,7 @@ in {
 
     services.diaspora = {
       enable = true;
-      package = pkgs.webapps.diaspora.override { ldap = true; };
+      withLdap = true;
       dataDir = "/var/lib/diaspora_immae";
       adminEmail = "diaspora@tools.immae.eu";
       configDir = config.secrets.fullPaths."webapps/diaspora";
@@ -156,9 +182,9 @@ in {
     services.websites.env.tools.modules = [
       "headers" "proxy" "proxy_http"
     ];
+    security.acme.certs.eldiron.extraDomainNames = [ "diaspora.immae.eu" ];
     services.websites.env.tools.vhostConfs.diaspora = {
       certName    = "eldiron";
-      addToCerts  = true;
       hosts       = [ "diaspora.immae.eu" ];
       root        = root;
       extraConfig = [ ''
@@ -181,5 +207,18 @@ in {
         </Directory>
       '' ];
     };
+    myServices.monitoring.fromMasterActivatedPlugins = [ "http" ];
+    myServices.monitoring.fromMasterObjects.service = [
+      {
+        service_description = "diaspora website is running on diaspora.immae.eu";
+        host_name = config.hostEnv.fqdn;
+        use = "external-web-service";
+        check_command = ["check_https" "diaspora.immae.eu" "/" "is the online social world where you are in control"];
+
+        servicegroups = "webstatus-webapps";
+        _webstatus_name = "Diaspora";
+        _webstatus_url = "https://diaspora.immae.eu/";
+      }
+    ];
   };
 }