]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - systems/eldiron/websites/tools/yourls.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / tools / yourls.nix
similarity index 64%
rename from modules/private/websites/tools/tools/yourls.nix
rename to systems/eldiron/websites/tools/yourls.nix
index 3717520298adf5d10772d9198b910fecd2bbc3cf..9e54b0d0555540ae9c12a9d36483e7992eb1d0a3 100644 (file)
@@ -1,11 +1,5 @@
 { env, yourls, yourls-plugins, config }:
 rec {
-  activationScript = {
-    deps = [ "httpd" ];
-    text = ''
-      install -m 0755 -o ${apache.user} -g ${apache.group} -d /var/lib/php/sessions/yourls
-    '';
-  };
   keys."webapps/tools-yourls" = {
     user = apache.user;
     group = apache.group;
@@ -39,6 +33,29 @@ rec {
       define( 'LDAPAUTH_USERCACHE_TYPE', 0);
     '';
   };
+  chatonsProperties = {
+    file.datetime = "2022-08-27T18:00:00";
+    service = {
+      name = "Yourls";
+      description = "Your own URL shortener";
+      website = "https://tools.immae.eu/url/admin/";
+      logo = "https://tools.immae.eu/url/images/favicon.gif";
+      status.level = "OK";
+      status.description = "OK";
+      registration."" = ["MEMBER" "CLIENT"];
+      registration.load = "FULL";
+      install.type = "PACKAGE";
+    };
+    software = {
+      name = "YOURLS";
+      website = "http://yourls.org/";
+      license.url = "https://github.com/YOURLS/YOURLS/blob/master/LICENSE";
+      license.name = "MIT License";
+      version = webRoot.version;
+      source.url = "https://github.com/YOURLS/YOURLS";
+      modules = map (a: a.pluginName) webRoot.plugins;
+    };
+  };
   webRoot = (yourls.override { yourls_config = config.secrets.fullPaths."webapps/tools-yourls"; }).withPlugins (p: [p.ldap]);
   apache = rec {
     user = "wwwrun";
@@ -79,8 +96,23 @@ rec {
 
       # Needed to avoid clashes in browser cookies (same domain)
       "php_value[session.name]" = "YourlsPHPSESSID";
-      "php_admin_value[open_basedir]" = "${basedir}:/tmp:/var/lib/php/sessions/yourls";
-      "php_admin_value[session.save_path]" = "/var/lib/php/sessions/yourls";
+      "php_admin_value[session.save_handler]" = "redis";
+      "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:Yourls:'";
+      "php_admin_value[open_basedir]" = "${basedir}:/tmp";
     };
   };
+  monitoringPlugins = [ "http" ];
+  monitoringObjects.service = [
+    {
+      service_description = "yourl website is running on tools.immae.eu";
+      host_name = config.hostEnv.fqdn;
+      use = "external-web-service";
+      check_command = ["check_https" "tools.immae.eu" "/url/admin/" "<title>YOURLS"];
+
+      servicegroups = "webstatus-webapps";
+      _webstatus_name = "YOURLS";
+      _webstatus_url = "https://tools.immae.eu/url/admin/";
+    }
+
+  ];
 }