summaryrefslogtreecommitdiff
path: root/container
diff options
context:
space:
mode:
authorIvan Gabaldon <igabaldon@inetol.net>2026-06-16 15:32:47 +0200
committerGitHub <noreply@github.com>2026-06-16 15:32:47 +0200
commit502c820a25bfd9e7a7175671c9d7dc96cf8afbdf (patch)
tree2eb71a5ea283bcaba72bc99e88eff7d467588065 /container
parent4fb49b44988b0c2e9f323e0526f0c9c2bb8dfa2d (diff)
[fix] container: setup minimal (#6268)
Start minimal, use defaults, and extend later on. The templates are no longer checked for changes, which was confusing and annoying after a while. See: https://github.com/searxng/searxng/issues/6261#issuecomment-4716008282
Diffstat (limited to 'container')
-rw-r--r--container/builder.dockerfile5
-rwxr-xr-xcontainer/entrypoint.sh39
-rw-r--r--container/settings.template.yml8
3 files changed, 18 insertions, 34 deletions
diff --git a/container/builder.dockerfile b/container/builder.dockerfile
index eced10428..43eb50895 100644
--- a/container/builder.dockerfile
+++ b/container/builder.dockerfile
@@ -21,8 +21,6 @@ RUN --mount=type=cache,id=uv,target=/root/.cache/uv set -eux -o pipefail; \
COPY --exclude=./searx/version_frozen.py ./searx/ ./searx/
-ARG TIMESTAMP_SETTINGS="0"
-
RUN set -eux -o pipefail; \
python -m compileall -q -f -j 0 --invalidation-mode=unchecked-hash ./searx/; \
find ./searx/static/ -type f \
@@ -30,5 +28,4 @@ RUN set -eux -o pipefail; \
-exec gzip -9 -k {} + \
-exec brotli -9 -k {} + \
-exec gzip --test {}.gz + \
- -exec brotli --test {}.br +; \
- touch -c --date="@$TIMESTAMP_SETTINGS" ./searx/settings.yml
+ -exec brotli --test {}.br +
diff --git a/container/entrypoint.sh b/container/entrypoint.sh
index d33748bed..1ba87cc63 100755
--- a/container/entrypoint.sh
+++ b/container/entrypoint.sh
@@ -77,43 +77,23 @@ volume_handler() {
setup_ownership "$target" "directory"
}
-# Handle configuration file updates
-config_handler() {
- local target="$1"
- local template="$2"
- local new_template_target="$target.new"
-
- # Create/Update the configuration file
- if [ -f "$target" ]; then
- setup_ownership "$target" "file"
-
- if [ "$template" -nt "$target" ]; then
- cp -pfT "$template" "$new_template_target"
+setup() {
+ local template_settings="/usr/local/searxng/settings.template.yml"
+ local target_settings="$__SEARXNG_CONFIG_PATH/settings.yml"
- cat <<EOF
-...
-... INFORMATION
-... Update available for "$target"
-... It is recommended to update the configuration file to ensure proper functionality
-...
-... New version placed at "$new_template_target"
-... Please review and merge changes
-...
-EOF
- fi
- else
+ if [ ! -f "$target_settings" ]; then
cat <<EOF
...
... INFORMATION
-... "$target" does not exist, creating from template...
+... "$target_settings" does not exist, creating from template...
...
EOF
- cp -pfT "$template" "$target"
+ cp -pfT "$template_settings" "$target_settings"
- sed -i "s/ultrasecretkey/$(head -c 24 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9')/g" "$target"
+ sed -i "s/ultrasecretkey/$(head -c 24 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9')/g" "$target_settings"
fi
- check_file "$target"
+ check_file "$target_settings"
}
cat <<EOF
@@ -124,8 +104,7 @@ EOF
volume_handler "$__SEARXNG_CONFIG_PATH"
volume_handler "$__SEARXNG_DATA_PATH"
-# Check for files
-config_handler "$__SEARXNG_SETTINGS_PATH" "/usr/local/searxng/searx/settings.yml"
+setup
# root only features
if [ "$(id -u)" -eq 0 ]; then
diff --git a/container/settings.template.yml b/container/settings.template.yml
new file mode 100644
index 000000000..1005cca84
--- /dev/null
+++ b/container/settings.template.yml
@@ -0,0 +1,8 @@
+# Read the documentation before extending the defaults:
+# https://docs.searxng.org/admin/settings/
+
+use_default_settings: true
+
+server:
+ secret_key: "ultrasecretkey"
+ image_proxy: true