]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - systems/eldiron/websites/mgoblin/default.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / mgoblin / default.nix
similarity index 70%
rename from modules/private/websites/tools/mgoblin/default.nix
rename to systems/eldiron/websites/mgoblin/default.nix
index 1e5f5a0b8e501ca15425c85b2f530e076fb85579..f276c62f4f5d56644f08dba84f4ee56ba226100b 100644 (file)
@@ -1,4 +1,4 @@
-{ lib, pkgs, config,  ... }:
+{ lib, pkgs, config, mediagoblin, ... }:
 let
   env = config.myEnv.tools.mediagoblin;
   cfg = config.myServices.websites.tools.mediagoblin;
@@ -9,6 +9,32 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
+    myServices.dns.zones."immae.eu".subdomains.mgoblin =
+      with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
+
+    myServices.chatonsProperties.services.mediagoblin = {
+      file.datetime = "2022-08-21T20:00:00";
+      service = {
+        name = "Mediagoblin";
+        description = "MediaGoblin is a free software media publishing platform that anyone can run";
+        website = "https://mgoblin.immae.eu/";
+        logo = "https://mgoblin.immae.eu/mgoblin_static/images/goblin.ico";
+        status.level = "OK";
+        status.description = "OK";
+        registration."" = ["MEMBER" "CLIENT"];
+        registration.load = "OPEN";
+        install.type = "PACKAGE";
+      };
+      software = {
+        name = "Mediagoblin";
+        website = "https://mediagoblin.org/";
+        license.url = "http://www.gnu.org/licenses/agpl.html";
+        license.name = "GNU Affero General Public License";
+        version = mcfg.package.version;
+        source.url = "https://git.savannah.gnu.org/git/mediagoblin.git";
+        modules = map (a: a.pluginName) mcfg.package.plugins;
+      };
+    };
     secrets.keys."webapps/tools-mediagoblin" = {
       user = "mediagoblin";
       group = "mediagoblin";
@@ -79,7 +105,7 @@ in {
 
     services.mediagoblin = {
       enable     = true;
-      package    = pkgs.webapps.mediagoblin.withPlugins (p: [p.basicsearch]);
+      package    = mediagoblin.withPlugins (p: [p.basicsearch]);
       configFile = config.secrets.fullPaths."webapps/tools-mediagoblin";
     };
     services.filesWatcher.mediagoblin-web = {
@@ -95,9 +121,9 @@ in {
       "proxy" "proxy_http"
     ];
     users.users.wwwrun.extraGroups = [ "mediagoblin" ];
+    security.acme.certs.eldiron.extraDomainNames = [ "mgoblin.immae.eu" ];
     services.websites.env.tools.vhostConfs.mgoblin = {
       certName    = "eldiron";
-      addToCerts  = true;
       hosts       = ["mgoblin.immae.eu" ];
       root        = null;
       extraConfig = [ ''
@@ -130,5 +156,18 @@ in {
         ProxyPassReverse / unix://${mcfg.sockets.paster}|http://mgoblin.immae.eu/
       '' ];
     };
+    myServices.monitoring.fromMasterActivatedPlugins = [ "http" ];
+    myServices.monitoring.fromMasterObjects.service = [
+      {
+        service_description = "mediagoblin website is running on mgoblin.immae.eu";
+        host_name = config.hostEnv.fqdn;
+        use = "external-web-service";
+        check_command = ["check_https" "mgoblin.immae.eu" "/" "<title>GNU MediaGoblin"];
+
+        servicegroups = "webstatus-webapps";
+        _webstatus_name = "Mediagoblin";
+        _webstatus_url = "https://mgoblin.immae.eu/";
+      }
+    ];
   };
 }