librelad 875a60f90f LibrePortal v0.1.0 — initial release
A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys,
Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun
VPN routing, and a web dashboard to manage it all.

Free & open forever to self-host; optional paid hosted services fund it.
See PROMISE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-21 20:37:54 +01:00

136 lines
3.6 KiB
Bash
Executable File

#!/bin/bash
# Category : Privacy & Security Tools
# Description : SearxNG - Privacy-focused Search Engine (c/u/s/r/i):
installSearxng()
{
local config_variables="$1"
if [[ "$searxng" == *[cCtTuUsSrRiI]* ]]; then
dockerConfigSetupToContainer silent searxng;
local app_name=$CFG_SEARXNG_APP_NAME
initializeAppVariables $app_name;
fi
if [[ "$searxng" == *[cC]* ]]; then
editAppConfig $app_name;
fi
if [[ "$searxng" == *[uU]* ]]; then
dockerUninstallApp $app_name;
fi
if [[ "$searxng" == *[sS]* ]]; then
dockerComposeDown $app_name;
fi
if [[ "$searxng" == *[rR]* ]]; then
dockerComposeRestart $app_name;
fi
if [[ "$searxng" == *[iI]* ]]; then
isHeader "Install $app_name"
((menu_number++))
echo ""
echo "---- $menu_number. Setting up install folder and config file for $app_name."
echo ""
dockerConfigSetupToContainer "loud" "$app_name" "install" "$config_variables";
isSuccessful "Install folders and Config files have been setup for $app_name."
((menu_number++))
echo ""
((menu_number++))
echo ""
echo "---- $menu_number. Setting up the $app_name docker-compose.yml file."
echo ""
dockerComposeSetupFile $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Updating file permissions before starting."
echo ""
fixPermissionsBeforeStart $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Running the docker-compose.yml to install and start $app_name"
echo ""
dockerComposeUpdateAndStartApp $app_name install;
local searxng_timeout=10
local searxng_counter=0
# Loop to check for the existence of the file every second
while [ ! -f "$containers_dir$app_name/searxng-data/settings.yml" ]; do
if [ "$searxng_counter" -ge "$searxng_timeout" ]; then
isNotice "File not found after 10 seconds. Exiting..."
break
fi
isNotice "Waiting for the file to appear..."
read -t 1 # Wait for 1 second
# Increment the counter
local searxng_counter=$((searxng_counter + 1))
done
# Check if the file was found or if we timed out
if [ -f "$containers_dir$app_name/searxng-data/settings.yml" ]; then
# Perform the required operation on the file once it exists
local result=$(sudo sed -i "s/simple_style: auto/simple_style: $CFG_SEARXNG_THEME/" "$containers_dir$app_name/searxng-data/settings.yml")
checkSuccess "Changing from light mode to dark mode to avoid eye strain installs"
dockerComposeRestart $app_name;
fi
((menu_number++))
echo ""
echo "---- $menu_number. Running Application specific updates (if required)"
echo ""
appUpdateSpecifics $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Running Headscale setup (if required)"
echo ""
setupHeadscale $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Adding $app_name to the Apps Database table."
echo ""
databaseInstallApp $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Updating WebUI config file."
echo ""
webuiContainerSetup $app_name install;
((menu_number++))
echo ""
echo "---- $menu_number. You can find $app_name files at $containers_dir$app_name"
echo ""
echo " You can now navigate to your $app_name service using any of the options below : "
echo ""
menuShowFinalMessages $app_name;
menu_number=0
#sleep 3s
cd
fi
searxng=n
}