]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - systems/eldiron/websites/peertube/default.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / peertube / default.nix
similarity index 57%
rename from modules/private/websites/tools/peertube/default.nix
rename to systems/eldiron/websites/peertube/default.nix
index 68c992f64ff7fe65b1566845d98ab0e9b426108c..0ebe4e79b41e655459288e24b3ca6ba128c3beb2 100644 (file)
@@ -2,14 +2,53 @@
 let
   env = config.myEnv.tools.peertube;
   cfg = config.myServices.websites.tools.peertube;
-  pcfg = config.services.peertube;
+  pcfg = config.immaeServices.peertube;
 in {
   options.myServices.websites.tools.peertube = {
     enable = lib.mkEnableOption "enable Peertube's website";
   };
 
   config = lib.mkIf cfg.enable {
-    services.peertube = {
+    myServices.dns.zones."immae.eu".subdomains.peertube =
+      with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
+
+    myServices.chatonsProperties.hostings.peertube = {
+      file.datetime = "2022-08-21T20:00:00";
+      hosting = {
+        name = "Peertube";
+        description = "Free software to take back control of your videos";
+        website = "https://peertube.immae.eu/";
+        logo = "https://peertube.immae.eu/client/assets/images/icons/icon-192x192.png";
+        type = "INSTANCE";
+        status.level = "OK";
+        status.description = "OK";
+        registration.load = "OPEN";
+        install.type = "PACKAGE";
+      };
+    };
+    myServices.chatonsProperties.services.peertube = {
+      file.datetime = "2022-08-21T20:00:00";
+      service = {
+        name = "Peertube";
+        description = "Free software to take back control of your videos";
+        website = "https://peertube.immae.eu/";
+        logo = "https://peertube.immae.eu/client/assets/images/icons/icon-192x192.png";
+        status.level = "OK";
+        status.description = "OK";
+        registration."" = ["MEMBER" "CLIENT"];
+        registration.load = "OPEN";
+        install.type = "PACKAGE";
+      };
+      software = {
+        name = "Peertube";
+        website = "https://joinpeertube.org/";
+        license.url = "https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE";
+        license.name = "GNU Affero General Public License";
+        version = pcfg.package.version;
+        source.url = "https://github.com/Chocobozzz/PeerTube";
+      };
+    };
+    immaeServices.peertube = {
       enable = true;
       configFile = config.secrets.fullPaths."webapps/tools-peertube";
     };
@@ -68,9 +107,9 @@ in {
       paths = [ pcfg.configFile ];
     };
 
+    security.acme.certs.eldiron.extraDomainNames = [ "peertube.immae.eu" ];
     services.websites.env.tools.vhostConfs.peertube = {
       certName    = "eldiron";
-      addToCerts  = true;
       hosts       = [ "peertube.immae.eu" ];
       root        = null;
       extraConfig = [ ''
@@ -90,5 +129,19 @@ in {
           RequestHeader set X-Real-IP %{REMOTE_ADDR}s
       '' ];
     };
+
+    myServices.monitoring.fromMasterActivatedPlugins = [ "http" ];
+    myServices.monitoring.fromMasterObjects.service = [
+      {
+        service_description = "peertube website is running on peertube.immae.eu";
+        host_name = config.hostEnv.fqdn;
+        use = "external-web-service";
+        check_command = ["check_https" "peertube.immae.eu" "/" "<title>Immae’s PeerTube"];
+
+        servicegroups = "webstatus-webapps";
+        _webstatus_name = "Peertube";
+        _webstatus_url = "https://peertube.immae.eu/";
+      }
+    ];
   };
 }