Skip to content
Snippets Groups Projects
Commit 39bd5c72 authored by Bob Mottram's avatar Bob Mottram
Browse files

Create new searx secret on install

parent 535324d3
No related branches found
No related tags found
No related merge requests found
......@@ -754,6 +754,11 @@ function wait_for_enough_entropy {
done
}
function create_random_string {
wait_for_enough_entropy
openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c "${1}" ; echo -n ''
}
function web_admin_create_user {
username="$1"
password="$2"
......@@ -1155,6 +1160,11 @@ function after_setup_has_finished {
web_admin_create_add_apps
webadmin_update_version
# new searx secret
if [ -f "/etc/searx/searx/settings.yml" ]; then
sed -i "s|secret_key :.*|secret_key : \"$(create_random_string 30)\"|g" "/etc/searx/searx/settings.yml"
fi
# remove default user
if [ -d /home/fbone ]; then
userdel -r fbone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment