nixos/dokuwiki: add <name?> option

Enables multi-site configurations.

This break compatibility with prior configurations that expect options
for a single dokuwiki instance in `services.dokuwiki`.
This commit is contained in:
dadada 2020-03-29 22:39:14 +02:00
parent e233a9d4dd
commit dc7ed06615
No known key found for this signature in database
GPG key ID: EEB8D1CE62C4DFEA
2 changed files with 125 additions and 76 deletions

View file

@ -1,29 +1,42 @@
import ./make-test-python.nix ({ lib, ... }:
with lib;
import ./make-test-python.nix ({ pkgs, ... }:
{
name = "dokuwiki";
meta.maintainers = with maintainers; [ maintainers."1000101" ];
meta.maintainers = with pkgs.lib.maintainers; [ "1000101" ];
nodes.machine =
{ pkgs, ... }:
{ services.dokuwiki = {
enable = true;
acl = " ";
superUser = null;
nginx = {
forceSSL = false;
enableACME = false;
};
};
machine = { ... }: {
services.dokuwiki."site1.local" = {
acl = " ";
superUser = null;
nginx = {
forceSSL = false;
enableACME = false;
};
};
services.dokuwiki."site2.local" = {
acl = " ";
superUser = null;
nginx = {
forceSSL = false;
enableACME = false;
};
};
networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ];
};
testScript = ''
machine.start()
machine.wait_for_unit("phpfpm-dokuwiki.service")
site_names = ["site1.local", "site2.local"]
start_all()
machine.wait_for_unit("phpfpm-dokuwiki-site1.local.service")
machine.wait_for_unit("phpfpm-dokuwiki-site2.local.service")
machine.wait_for_unit("nginx.service")
machine.wait_for_open_port(80)
machine.succeed("curl -sSfL http://localhost/ | grep 'DokuWiki'")
machine.succeed("curl -sSfL http://site1.local/ | grep 'DokuWiki'")
machine.succeed("curl -sSfL http://site2.local/ | grep 'DokuWiki'")
'';
})