Bob Mottram 9 年之前
父節點
當前提交
1cfe374210
共有 1 個文件被更改,包括 31 次插入2 次删除
  1. 31
    2
      src/freedombone

+ 31
- 2
src/freedombone 查看文件

@@ -9175,6 +9175,34 @@ function install_search_engine {
9175 9175
         return
9176 9176
     fi
9177 9177
 
9178
+    apt-get -y install python-pip libyaml-dev python-werkzeug python-babel
9179
+    apt-get -y install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev uwsgi uwsgi-plugin-python libapache2-mod-uwsgi
9180
+
9181
+    pip install certifi
9182
+    if [ ! "$?" = "0" ]; then
9183
+        exit 737692
9184
+    fi
9185
+
9186
+    pip install pyyaml
9187
+    if [ ! "$?" = "0" ]; then
9188
+        exit 469242
9189
+    fi
9190
+
9191
+    pip install flask --upgrade
9192
+    if [ ! "$?" = "0" ]; then
9193
+        exit 888575
9194
+    fi
9195
+
9196
+    pip install flask_restless --upgrade
9197
+    if [ ! "$?" = "0" ]; then
9198
+        exit 54835
9199
+    fi
9200
+
9201
+    pip install flask_babel --upgrade
9202
+    if [ ! "$?" = "0" ]; then
9203
+        exit 63738
9204
+    fi
9205
+
9178 9206
     if [ ! -d $SEARCH_ENGINE_PATH ]; then
9179 9207
         mkdir -p $SEARCH_ENGINE_PATH
9180 9208
     fi
@@ -9221,7 +9249,7 @@ function install_search_engine {
9221 9249
     echo 'server {' >> /etc/nginx/sites-available/searx
9222 9250
     echo "    listen 127.0.0.1:${SEARCH_ENGINE_ONION_PORT} default_server;" >> /etc/nginx/sites-available/searx
9223 9251
     echo "    root ${SEARCH_ENGINE_PATH}/searx;" >> /etc/nginx/sites-available/searx
9224
-    echo "    server_name searx;" >> /etc/nginx/sites-available/searx
9252
+    echo "    server_name ${SEARCH_ENGINE_ONION_HOSTNAME};" >> /etc/nginx/sites-available/searx
9225 9253
     echo '    access_log off;' >> /etc/nginx/sites-available/searx
9226 9254
     echo "    error_log /var/log/searx_error.log $WEBSERVER_LOG_LEVEL;" >> /etc/nginx/sites-available/searx
9227 9255
     echo '' >> /etc/nginx/sites-available/searx
@@ -9258,7 +9286,8 @@ function install_search_engine {
9258 9286
     else
9259 9287
         SEARCH_ENGINE_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
9260 9288
     fi
9261
-    sed -i "s|secret_key.*|secret_key : \"$SEARCH_ENGINE_SECRET_KEY\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
9289
+    sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
9290
+    sed -i "s|base_url.*|base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
9262 9291
 
9263 9292
     chown -R searx:searx ${SEARCH_ENGINE_PATH}/searx
9264 9293