diff --git a/Dockerfile b/Dockerfile index daf0ea7..e1b68f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM redis:alpine as redis -FROM searxng/searxng:2023.10.22-526d5c7b3 +FROM searxng/searxng:2023.11.14-b3d29cb86 USER root diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh index 66d24e5..1fc2e89 100755 --- a/docker_entrypoint.sh +++ b/docker_entrypoint.sh @@ -8,7 +8,7 @@ _term() { kill -TERM "$searxng_process" 2>/dev/null } -export TOR_ONLY="false" +export TOR_ONLY=$(yq e '.tor-url' /root/start9/config.yaml) export SEARXNG_HOSTNAME=$(yq e '.public-host' /root/start9/config.yaml) export LAN_ADDRESS=$(yq e '.lan-address' /root/start9/config.yaml) export TOR_ADDRESS=$(yq e '.tor-address' /root/start9/config.yaml) diff --git a/manifest.yaml b/manifest.yaml index f4a350b..4ab6373 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,9 +1,9 @@ id: searxng title: "SearXNG" -version: 2023.10.22 +version: 2023.11.14 release-notes: | * Updated SearXNG code to the latest version from upstream. - * Minor code fixes, cleanup and changes. + * Added option to set a Tor address as the base URL. license: MIT wrapper-repo: "https://github.com/Start9Labs/searxng-startos" upstream-repo: "https://github.com/searxng/searxng-docker" diff --git a/scripts/services/getConfig.ts b/scripts/services/getConfig.ts index 70108f8..1541a53 100644 --- a/scripts/services/getConfig.ts +++ b/scripts/services/getConfig.ts @@ -21,12 +21,6 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({ target: "lan-address", interface: "main", }, - // "tor-only": { - // "name": "Enable Tor", - // "description": "Enables your search engine on the Tor Network.", - // "type": "boolean", - // "default": false, - // }, // "autocomplete": { // "name": "Enable Autocomplete", // "description": "Turns on autocomplete when using SearXNG. This will send data to your Start9 server while typing, before pressing the search button and use multiple known search engines to return frequently searched terms. Note: This will decrease performance of the website when typing, and will make calls to the search engines before the search button is pressed.", @@ -42,6 +36,12 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({ default: "My SearXNG Engine", placeholder: "Uncle Jim SearXNG Engine", }, + "tor-url": { + "name": "Enable Tor address as the base URL", + "description": "Activates the utilization of a .onion address as the primary URL, particularly beneficial for publicly hosted instances over the Tor network.", + "type": "boolean", + "default": false, + }, "enable-metrics": { name: "Enable Stats", description: diff --git a/scripts/services/migrations.ts b/scripts/services/migrations.ts index 0afa183..7b34011 100644 --- a/scripts/services/migrations.ts +++ b/scripts/services/migrations.ts @@ -1,4 +1,28 @@ import { compat, types as T } from "../deps.ts"; export const migration: T.ExpectedExports.migration = - compat.migrations.fromMapping({}, "2023.10.22"); + compat.migrations.fromMapping( + { + "2023.11.14": { + up: compat.migrations.updateConfig( + (config: any) => { + config["tor-url"] = false; + + return config; + }, + true, + { version: "2023.11.14", type: "up" } + ), + down: compat.migrations.updateConfig( + (config: any) => { + delete config["tor-url"]; + + return config; + }, + true, + { version: "2023.11.14", type: "down" } + ), + }, + }, + "2023.11.14" + );