mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-02 02:03:21 +00:00
nixos/open-webui: fix opensearch (#345529)
This commit is contained in:
commit
abbc4cb34c
@ -93,6 +93,7 @@ in
|
||||
DATA_DIR = ".";
|
||||
HF_HOME = ".";
|
||||
SENTENCE_TRANSFORMERS_HOME = ".";
|
||||
WEBUI_URL = "http://localhost:${toString cfg.port}";
|
||||
} // cfg.environment;
|
||||
|
||||
serviceConfig = {
|
||||
|
@ -31,6 +31,7 @@ in
|
||||
|
||||
testScript = ''
|
||||
import json
|
||||
import xml.etree.ElementTree as xml
|
||||
|
||||
machine.start()
|
||||
|
||||
@ -45,5 +46,18 @@ in
|
||||
|
||||
# Check that the name was overridden via the environmentFile option.
|
||||
assert webui_config["name"] == "${webuiName} (Open WebUI)"
|
||||
|
||||
webui_opensearch_xml = machine.succeed("curl http://127.0.0.1:${mainPort}/opensearch.xml")
|
||||
webui_opensearch = xml.fromstring(webui_opensearch_xml)
|
||||
|
||||
webui_opensearch_url = webui_opensearch.find(
|
||||
".//{http://a9.com/-/spec/opensearch/1.1/}Url"
|
||||
)
|
||||
assert (
|
||||
webui_opensearch_url is not None
|
||||
), f"no url tag found in {webui_opensearch_xml}"
|
||||
assert (
|
||||
webui_opensearch_url.get("template") == "http://localhost:8080/?q={searchTerms}"
|
||||
), "opensearch url doesn't match the configured port"
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user