2021-11-04 19:00:01 +01:00
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
2021-12-14 19:39:11 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
2021-12-14 19:33:04 +01:00
|
|
|
# TODO: move to hackens.org
|
|
|
|
services.dokuwiki.sites."hackens.ens.fr" = {
|
2021-11-04 19:00:01 +01:00
|
|
|
enable = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
$conf['title'] = 'hackEns';
|
|
|
|
$conf['start'] = 'accueil';
|
|
|
|
$conf['lang'] = 'fr';
|
2022-03-11 15:23:51 +01:00
|
|
|
$conf['template'] = 'bootstrap3';
|
|
|
|
$conf['license'] = 'cc-by-sa';
|
|
|
|
$conf['breadcrumbs'] = 0; # On s'en fiche de l'historique des pages visitées
|
|
|
|
$conf['youarehere'] = true; # Par contre on veut notre position dans la hiérarchie du site
|
|
|
|
# On veut que les liens externes s'ouvrent dans de nouveaux onglets
|
|
|
|
$conf['target'] = array(
|
|
|
|
'extern' => '_tab'
|
|
|
|
);
|
|
|
|
$conf['htmlok'] = 1; # On peut mettre du html dans les pages
|
2021-11-04 19:00:01 +01:00
|
|
|
$conf['sitemap'] = 7;
|
|
|
|
$conf['rss_type'] = 'rss2';
|
2022-03-11 15:23:51 +01:00
|
|
|
$conf['userewrite'] = 1; # Important, sinon on casse tout avec les règles nginx définies par le module nixos
|
2021-11-04 19:00:01 +01:00
|
|
|
$conf['useslash'] = 1;
|
2022-03-11 15:23:51 +01:00
|
|
|
$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
|
2021-11-04 19:00:01 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
pluginsConfig = ''
|
|
|
|
$plugins['authmysql'] = 0;
|
|
|
|
$plugins['popularity'] = 0;
|
|
|
|
$plugins['authpgsql'] = 0;
|
|
|
|
$plugins['authpdo'] = 0;
|
|
|
|
$plugins['authldap'] = 0;
|
|
|
|
'';
|
|
|
|
|
|
|
|
disableActions = "register";
|
|
|
|
superUser = "@admin";
|
2022-03-11 15:23:51 +01:00
|
|
|
|
2022-03-13 12:08:33 +01:00
|
|
|
acluse = true;
|
2022-03-11 15:23:51 +01:00
|
|
|
|
|
|
|
# Il faut packager les templates
|
|
|
|
templates = let
|
2022-03-13 12:08:33 +01:00
|
|
|
template-bootstrap3 = { logo, favicon, apple-touch-icon }: pkgs.stdenv.mkDerivation {
|
2022-03-11 15:23:51 +01:00
|
|
|
name = "bootstrap3";
|
|
|
|
# Download the theme from the dokuwiki site
|
2022-03-13 12:08:33 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "giterlizzi";
|
|
|
|
repo = "dokuwiki-template-bootstrap3";
|
|
|
|
rev="v2021-03-11";
|
2022-03-11 15:23:51 +01:00
|
|
|
};
|
|
|
|
# We need unzip to build this package
|
|
|
|
buildInputs = [ pkgs.unzip ];
|
|
|
|
# Installing simply means copying all files to the output directory
|
2022-03-13 12:08:33 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R * $out/
|
|
|
|
rm $out/images/logo.png
|
|
|
|
rm $out/images/favicon.ico
|
|
|
|
rm $out/images/apple-touch-icon.png
|
|
|
|
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
|
|
|
|
'';
|
2022-03-11 15:23:51 +01:00
|
|
|
};
|
|
|
|
# And then pass this theme to the template list like this:
|
2022-03-13 12:08:33 +01:00
|
|
|
in [
|
|
|
|
template-bootstrap3 {
|
|
|
|
logo = https://hackens.org/_media/wiki/logo.png;
|
|
|
|
favicon = https://hackens.org/_media/wiki/favicon.ico;
|
|
|
|
apple-touch-icon = https://hackens.org/_media/wiki/logo.png;
|
|
|
|
}
|
|
|
|
];
|
2021-11-04 19:00:01 +01:00
|
|
|
};
|
|
|
|
}
|