From d1412f0d3bf51afea7a688a4aa6f34fb804d8c5b Mon Sep 17 00:00:00 2001 From: hexchen Date: Tue, 12 Jan 2021 18:20:49 +0000 Subject: [PATCH] hainich/lantifa: init mediawiki --- hosts/hainich/configuration.nix | 1 + hosts/hainich/services/lantifa.nix | 34 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 hosts/hainich/services/lantifa.nix diff --git a/hosts/hainich/configuration.nix b/hosts/hainich/configuration.nix index 56ac671..d4505ca 100644 --- a/hosts/hainich/configuration.nix +++ b/hosts/hainich/configuration.nix @@ -15,6 +15,7 @@ # ./k8s.nix ./services/docker.nix ./services/gitlab-runner.nix + ./services/lantifa.nix ]; boot.loader.grub.enable = true; boot.loader.grub.version = 2; diff --git a/hosts/hainich/services/lantifa.nix b/hosts/hainich/services/lantifa.nix new file mode 100644 index 0000000..4c8d529 --- /dev/null +++ b/hosts/hainich/services/lantifa.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +{ + containers.lantifa = { + autoStart = true; + privateNetwork = true; + hostAddress6 = "fd00::42:14"; + localAddress6 = "fd00::42:15"; + + config = {config, pkgs, ... }: { + networking.firewall.allowedTCPPorts = [ 4422 ]; + users.users.mediawiki.extraGroups = [ "keys" ]; + + services.mediawiki = { + enable = true; + name = "LANtifa"; + database.createLocally = true; + passwordFile = "/var/lib/mediawiki/mediawiki-password"; + + virtualHost = { + hostName = "wiki.lantifa.org"; + listen = [ { port = 4422; } ]; + adminAddr = "admin@hacc.space"; + }; + }; + }; + }; + + services.nginx.virtualHosts."wiki.lantifa.org" = { + locations."/".proxyPass = "http://[" + config.containers.lantifa.localAddress6 + "]:4422"; + forceSSL = true; + enableACME = true; + }; +}