From 99015fac8125d197eb8b519c7036cbbb739e8ec4 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Fri, 6 May 2022 17:43:12 +0200 Subject: services: web: add rss-bridge (with ParisJazzClubBridge) --- config/services/web/default.nix | 2 +- pkgs/default.nix | 2 +- tests/run-tests.sh | 20 ++++++++++++++++++-- tests/vm.nix | 8 ++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/config/services/web/default.nix b/config/services/web/default.nix index 98761ae..1c29ff2 100644 --- a/config/services/web/default.nix +++ b/config/services/web/default.nix @@ -1,7 +1,7 @@ { ... }: { - imports = [ ./money ./quentin ./searx ]; + imports = [ ./money ./quentin ./rss ./searx ]; security.acme = { acceptTerms = true; diff --git a/pkgs/default.nix b/pkgs/default.nix index 8182baa..e7120f7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,5 +2,5 @@ { academic-webpage = pkgs.callPackage ./academic-webpage { }; - filtron = pkgs.callPackage ./filtron {}; + filtron = pkgs.callPackage ./filtron {}; } diff --git a/tests/run-tests.sh b/tests/run-tests.sh index a309c69..300056e 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -14,6 +14,7 @@ sudo nixos-container start hermes || exit 2 trap cleanup EXIT sleep 0.1 IP=$(nixos-container show-ip hermes) +CURL_FLAGS='--location --silent' echo echo Checking that all the services are running : @@ -21,7 +22,7 @@ declare -A PORTS PORTS[quentin]=8080 PORTS[searx]=8081 PORTS[money]=8082 -CURL_FLAGS='--location --silent' +PORTS[rss]=8083 for SERVICE in "${!PORTS[@]}" do echo Checking connection to container version of $SERVICE.aristote.fr ... @@ -38,7 +39,7 @@ echo echo Checking custom Searx engines : declare -A QUERIES QUERIES[alternativeto]=Searx -QUERIES[emojipedia]='Thinking%20Face' +QUERIES[emojipedia]='Thinking%20Face' QUERIES[nlab]='Kan%20extension' QUERIES[wikipediafr]=Paris QUERIES[wikipediaen]=Paris @@ -60,3 +61,18 @@ do fi done echo Done. + +echo +echo Checking custom RSS bridges : +BRIDGES=ParisJazzClub +for BRIDGE in "$BRIDGES" +do + echo Checking bridge $BRIDGE ... + RESULT=$(curl "http://$IP:${PORTS[rss]}/?action=display&bridge=$BRIDGE&format=Plaintext" $CURL_FLAGS --output /dev/null --write-out '%{http_code}\n') + if [[ ! "$RESULT" = 200 ]] + then + echo "Connection failed." + exit 2 + fi +done +echo Done. diff --git a/tests/vm.nix b/tests/vm.nix index abda6bc..4894cec 100644 --- a/tests/vm.nix +++ b/tests/vm.nix @@ -44,6 +44,14 @@ in { forceSSL = lib.mkForce false; enableACME = lib.mkForce false; }; + rss = { + listen = lib.mkForce [{ + addr = "0.0.0.0"; + port = 8083; + }]; + forceSSL = lib.mkForce false; + enableACME = lib.mkForce false; + }; }; environment.etc."searx/secrets".text = '' -- cgit v1.2.3