ACME, refactorisation
This commit is contained in:
parent
deffeb3ef5
commit
b75803557d
1 changed files with 13 additions and 10 deletions
|
@ -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 "<?php define('DOKU_INC', '${dokuwikiPkgs}/share/dokuwiki/');" > $out/doku_inc.php # Lien vers le dokuwiki
|
||||
echo "<?php define('DOKU_INC', '${dokuwikiPath}');" > $out/doku_inc.php # Lien vers le dokuwiki
|
||||
'';
|
||||
};
|
||||
# And then pass this theme to the template list like this:
|
||||
|
@ -77,7 +80,7 @@ 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";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue