searx/run.sh

18 lines
497 B
Bash
Raw Permalink Normal View History

2019-07-14 12:23:07 +00:00
#!/usr/local/bin/dumb-init /bin/bash
set -euo pipefail
SECRET_KEY=${SECRET_KEY:-}
[[ -n ${SECRET_KEY} ]] || {
SECRET_KEY=$(openssl rand -hex 32)
echo "Attention: Secret key was auto-generated! You should"
echo "set it via SECRET_KEY env var to keep it persistent"
}
[[ -z ${BASE_URL:-} ]] || {
sed -i "s@base_url : False@base_url : '${BASE_URL}'@" searx/settings.yml
}
sed -i "s/secret_key : \"ultrasecretkey\"/secret_key : '${SECRET_KEY}'/" searx/settings.yml
exec python searx/webapp.py