diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 601bbf4..5d89a88 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -103,6 +103,7 @@ jobs: - client_timing.sh - clones.sh - powershell.sh + - homepage.sh steps: - name: Checkout uses: actions/checkout@v4 diff --git a/server/httpd.conf b/server/httpd.conf index edbdfbe..6c5320f 100644 --- a/server/httpd.conf +++ b/server/httpd.conf @@ -253,8 +253,8 @@ ServerSignature On # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # -DocumentRoot "/var/www/localhost/htdocs" - +DocumentRoot "/var/www/html" + # # Possible values for the Options directive are "None", "All", # or any combination of: diff --git a/tests/test_homepage.sh b/tests/test_homepage.sh new file mode 100755 index 0000000..7775e86 --- /dev/null +++ b/tests/test_homepage.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Dependencies/assumptions: +# - It is safe and OK to make changes to the Postgres database +# - The Nivlheim system service is running +# - The API is served at localhost:4040 +# - The web server is running and serving content at localhost:443/80 +# - Docker/Podman has a container image with the nivlheim client + +echo "------------- Testing homepage ------------" +set -e +cd `dirname $0` # cd to the dir where the test script is +PSQL=../ci/docker/psql.sh + +# tempdir +tempdir=$(mktemp -d -t tmp.XXXXXXXXXX) +function finish { + rm -rf "$tempdir" +} +trap finish EXIT + +curl -ksS https://localhost:443/ > $tempdir/homepage.html +if ! diff ../server/website/index.html $tempdir/homepage.html; then + echo "============================================================================" + echo "ERROR: The html that is served is different from the contents of index.html." + echo "============================================================================" + exit 1 +fi + +echo "Test result: OK"