diff --git a/systems/jeeves/docker/great_cloud_of_witnesses.nix b/systems/jeeves/docker/great_cloud_of_witnesses.nix index 2113c36..3d259ad 100644 --- a/systems/jeeves/docker/great_cloud_of_witnesses.nix +++ b/systems/jeeves/docker/great_cloud_of_witnesses.nix @@ -1,21 +1,48 @@ +{ + config, + pkgs, + lib, + ... +}: + let vars = import ../vars.nix; in { - config, - ... -}: -{ - virtualisation.oci-containers.containers.great_cloud_of_witnesses = { - image = "ubuntu/apache2:2.4-22.04_beta"; - ports = [ "8092:80" ]; - volumes = [ - "${../../../common/docker_templates}/file_server/sites/:/etc/apache2/sites-enabled/" - "${vars.services}/great_cloud_of_witnesses:/data" - "/var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock" - ]; - extraOptions = [ "--network=web" ]; - autoStart = true; + + # environment.systemPackages = with pkgs; [ php.withExtensions ({ all, ... }: [ all.pdo_pgsql ]) ]; + + services.httpd = { + enable = true; + adminAddr = "webmaster@localhost"; + + enablePHP = true; + phpPackage = pkgs.php.withExtensions ( + { enabled, all }: + enabled + ++ [ + all.pdo + all.pdo_pgsql + ] + ); + extraModules = [ "rewrite" ]; + virtualHosts.great_cloud_of_witnesses = { + hostName = "localhost"; + listen = [ + { + ip = "*"; + port = 8092; + } + + ]; + documentRoot = "${vars.services}/great_cloud_of_witnesses"; + extraConfig = '' + + AllowOverride All + Require all granted + + ''; + }; }; sops.secrets.gcw_password = { @@ -26,7 +53,7 @@ in users = { users.gcw = { isSystemUser = true; - hashedPasswordFile = "${config.sops.secrets.gcw_password.path}"; + hashedPasswordFile = config.sops.secrets.gcw_password.path; group = "gcw"; }; groups.gcw = { }; diff --git a/systems/jeeves/services/haproxy.cfg b/systems/jeeves/services/haproxy.cfg index 06c369a..63b6eba 100644 --- a/systems/jeeves/services/haproxy.cfg +++ b/systems/jeeves/services/haproxy.cfg @@ -31,7 +31,7 @@ frontend ContentSwitching acl host_homeassistant hdr(host) -i homeassistant.tmmworkshop.com acl host_jellyfin hdr(host) -i jellyfin.tmmworkshop.com acl host_share hdr(host) -i share.tmmworkshop.com - acl host_uptime_kuma hdr(host) -i uptimekuma-jeeves.tmmworkshop.com + acl host_gcw hdr(host) -i gcw.tmmworkshop.com use_backend audiobookshelf_nodes if host_audiobookshelf use_backend cache_nodes if host_cache @@ -39,7 +39,7 @@ frontend ContentSwitching use_backend homeassistant_nodes if host_homeassistant use_backend jellyfin if host_jellyfin use_backend share_nodes if host_share - use_backend uptime_kuma_nodes if host_uptime_kuma + use_backend gcw_nodes if host_gcw backend audiobookshelf_nodes mode http @@ -68,6 +68,6 @@ backend share_nodes mode http server server 127.0.0.1:8091 -backend uptime_kuma_nodes +backend gcw_nodes mode http - server server 127.0.0.1:3001 + server server 127.0.0.1:8092