diff options
| -rw-r--r-- | config/services/web/default.nix | 1 | ||||
| -rw-r--r-- | config/services/web/git/default.nix | 20 | ||||
| -rw-r--r-- | tests/configuration.nix | 3 | ||||
| -rwxr-xr-x | tests/run-tests.sh | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/config/services/web/default.nix b/config/services/web/default.nix index f6d51db..1fd1a51 100644 --- a/config/services/web/default.nix +++ b/config/services/web/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./git ./quentin ./rss ./searx diff --git a/config/services/web/git/default.nix b/config/services/web/git/default.nix new file mode 100644 index 0000000..213fed9 --- /dev/null +++ b/config/services/web/git/default.nix @@ -0,0 +1,20 @@ +{ config, pkgs, ... }: +{ + services.nginx = { + additionalModules = [ pkgs.nginxModules.subsFilter ]; + virtualHosts.git = { + serverName = "git.${config.networking.domain}"; + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://hephaistos.aristote.mesh/git/"; + extraConfig = '' + proxy_redirect default; + sub_filter_once off; + sub_filter 'href=\'/git/' 'href=\'/'; + sub_filter 'action=\'/git/' 'action=\'/'; + ''; + }; + }; + }; +} diff --git a/tests/configuration.nix b/tests/configuration.nix index dc64463..3944dcd 100644 --- a/tests/configuration.nix +++ b/tests/configuration.nix @@ -54,6 +54,9 @@ in rss = nginxMakeLocal 8083; webkeydirectory = nginxMakeLocal 8084; mesh = nginxMakeLocal 8085; + git = nginxMakeLocal 8086 // { + locations."/".proxyPass = lib.mkForce "http://192.168.2.2/git/"; + }; }; environment.etc = { diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 6b9a84a..6c64707 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -28,6 +28,7 @@ PORTS[quentin]=8080 PORTS[searx]=8081 PORTS[rss]=8083 PORTS[openpgpkey]=8084 +PORTS[git]=8086 for SERVICE in "${!PORTS[@]}" do URL="http://$IP:${PORTS[$SERVICE]}/" @@ -101,4 +102,9 @@ fi echo Done. echo +echo Checking cgit internal hyperlinks : +RESULT=$(curl "http://$IP:${PORTS[git]}/" $CURL_FLAGS) +echo $RESULT | grep "=\'/git/" > /dev/null && echo "Broken hyperlinks detected." + +echo read -n1 -srp "Press any key to stop the server." |
