This commit is contained in:
Bob Mottram 2016-03-04 18:09:38 +00:00
parent 3a32c60539
commit 1cfe374210
1 changed files with 31 additions and 2 deletions

View File

@ -9175,6 +9175,34 @@ function install_search_engine {
return
fi
apt-get -y install python-pip libyaml-dev python-werkzeug python-babel
apt-get -y install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev uwsgi uwsgi-plugin-python libapache2-mod-uwsgi
pip install certifi
if [ ! "$?" = "0" ]; then
exit 737692
fi
pip install pyyaml
if [ ! "$?" = "0" ]; then
exit 469242
fi
pip install flask --upgrade
if [ ! "$?" = "0" ]; then
exit 888575
fi
pip install flask_restless --upgrade
if [ ! "$?" = "0" ]; then
exit 54835
fi
pip install flask_babel --upgrade
if [ ! "$?" = "0" ]; then
exit 63738
fi
if [ ! -d $SEARCH_ENGINE_PATH ]; then
mkdir -p $SEARCH_ENGINE_PATH
fi
@ -9221,7 +9249,7 @@ function install_search_engine {
echo 'server {' >> /etc/nginx/sites-available/searx
echo " listen 127.0.0.1:${SEARCH_ENGINE_ONION_PORT} default_server;" >> /etc/nginx/sites-available/searx
echo " root ${SEARCH_ENGINE_PATH}/searx;" >> /etc/nginx/sites-available/searx
echo " server_name searx;" >> /etc/nginx/sites-available/searx
echo " server_name ${SEARCH_ENGINE_ONION_HOSTNAME};" >> /etc/nginx/sites-available/searx
echo ' access_log off;' >> /etc/nginx/sites-available/searx
echo " error_log /var/log/searx_error.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/searx
echo '' >> /etc/nginx/sites-available/searx
@ -9258,7 +9286,8 @@ function install_search_engine {
else
SEARCH_ENGINE_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
fi
sed -i "s|secret_key.*|secret_key : \"$SEARCH_ENGINE_SECRET_KEY\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
sed -i "s|base_url.*|base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
chown -R searx:searx ${SEARCH_ENGINE_PATH}/searx