From b75803557d55b248d52495a4a39fdec52de4677c Mon Sep 17 00:00:00 2001 From: Maurice Debray Date: Thu, 31 Mar 2022 11:36:08 +0200 Subject: [PATCH] ACME, refactorisation --- hosts/hackens-org/wiki.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hosts/hackens-org/wiki.nix b/hosts/hackens-org/wiki.nix index 875de11..d20b56d 100644 --- a/hosts/hackens-org/wiki.nix +++ b/hosts/hackens-org/wiki.nix @@ -1,10 +1,14 @@ { pkgs, config, ... }: let - hostname = "hackens.ens.fr"; + hostname = "new.hackens.org" #config.my.subZone; + debug = true; #config.my.debug; in { networking.firewall.allowedTCPPorts = [ 80 443 ]; - # TODO: move to hackens.org + services.nginx.virtualHosts."${hostname}".enableACME = + if debug + then false + else true; services.dokuwiki.sites."${hostname}" = { enable = true; @@ -27,7 +31,6 @@ in $conf['useslash'] = 1; $conf['plugin']['tokenbucketauth']['tba_send_mail'] = 'hackens@clipper.ens.fr'; // Ban auto des IPs qui brute-forcent $conf['htmlmail'] = 0; // On envoie les mails en plain text - $conf['allowdebug'] = 1; ''; pluginsConfig = '' @@ -45,7 +48,7 @@ in # Il faut packager les templates templates = let - template-bootstrap3 = { version, logo, favicon, apple-touch-icon, dokuwikiPkgs }: pkgs.stdenv.mkDerivation { + template-bootstrap3 = { version, logo, favicon, apple-touch-icon, dokuwikiPath }: pkgs.stdenv.mkDerivation { name = "bootstrap3"; # Download the theme from the dokuwiki site src = pkgs.fetchFromGitHub version; @@ -61,7 +64,7 @@ in ln -s ${logo} $out/images/logo.png ln -s ${favicon} $out/images/favicon.ico ln -s ${apple-touch-icon} $out/images/apple-touch-icon.png - echo " $out/doku_inc.php # Lien vers le dokuwiki + echo " $out/doku_inc.php # Lien vers le dokuwiki ''; }; # And then pass this theme to the template list like this: @@ -77,15 +80,15 @@ in logo = ./media/logo.png; favicon = ./media/favicon.ico; apple-touch-icon = ./media/logo.png; - dokuwikiPkgs = config.services.dokuwiki.sites."${hostname}".package; # Erreur, ce n'est pas le bon package + dokuwikiPath = "${config.services.dokuwiki.sites."${hostname}".package}/share/dokuwiki"; }) ]; }; # On veut php-xml - services.phpfpm.pools."dokuwiki-${hostname}".phpPackage = pkgs.lib.mkForce ( pkgs.php74.withExtensions ( + services.phpfpm.pools."dokuwiki-${hostname}".phpPackage = pkgs.lib.mkForce ( pkgs.php74.withExtensions ( { all, enabled, ... }: - enabled ++ [ - all.xml - ] + enabled ++ [ + all.xml + ] )); }