Просмотр исходного кода

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 7 лет назад
Родитель
Сommit
1b14ea302d
4 измененных файлов: 87 добавлений и 13 удалений
  1. 15
    1
      doc/EN/app_searx.org
  2. 34
    5
      src/freedombone-app-searx
  3. 1
    2
      src/freedombone-usb-canary
  4. 37
    5
      website/EN/app_searx.html

+ 15
- 1
doc/EN/app_searx.org Просмотреть файл

@@ -25,6 +25,8 @@ In terms of security both the connection between you and the server, and the out
25 25
 [[file:images/searx.jpg]]
26 26
 #+END_CENTER
27 27
 
28
+* Installation
29
+
28 30
 ssh into the system with:
29 31
 
30 32
 #+BEGIN_SRC bash
@@ -33,6 +35,18 @@ ssh myusername@mydomain.com -p 2222
33 35
 
34 36
 Select *Administrator controls* then *Add/remove apps*. From there you can use cursor keys, space and enter keys to select *searx*.
35 37
 
36
-Once it has installed go to *About* on the *Administrator control panel* and look for *searx*. Take a note of the onion address, and you can then enter that into a Tor compatible browser. Go to *Passwords* on the *Administrator control panel* and select *searx*. This will give you the login password for your search site, and it prevents millions of random internet users from using your site as their default search engine and ruining the performance of your system.
38
+Once it has installed go to *About* on the *Administrator control panel* and look for *searx*. Take a note of the onion address, and you can then enter that into a Tor compatible browser.
39
+
40
+* Make it your default search
41
+
42
+If you are using a Tor browser or Firefox then click on the magnifying glass icon next to the search box and you can then add your metasearch site. A small icon will appear called "/Freedombone Metasearch/" and you can then right click on it and make it the default search.
43
+
44
+* Enabling password login
45
+
46
+It's possible that you might not want just anyone on the interwebs to be able to use your metasearch engine. Even with the onion routing this might carry some legal risk or make you a target for denial-of-service attempts (although Tor's rate limits and the firewall will give you some defense against that).
47
+
48
+To enable password login go to the *Administrator control panel* then *App settings* then select *searx* and *Enable login*. If you select "yes" then the password will be displayed.
49
+
50
+* Customization
37 51
 
38 52
 It's also possible to customise the background image if you go to *App settings* then select *searx*.

+ 34
- 5
src/freedombone-app-searx Просмотреть файл

@@ -147,6 +147,33 @@ function searx_set_background_image {
147 147
     esac
148 148
 }
149 149
 
150
+function searx_enable_login {
151
+    dialog --title $"Enable Searx login" \
152
+           --backtitle $"Freedombone Control Panel" \
153
+           --defaultno \
154
+           --yesno $"\nDo you want to add a login so that random web users can't use your metasearch engine?" 10 60
155
+    sel=$?
156
+    case $sel in
157
+        0) if grep -q '#auth_basic' /etc/nginx/sites-available/searx; then
158
+               sed -i 's|#auth_basic|auth_basic|g' /etc/nginx/sites-available/searx
159
+               systemctl restart nginx
160
+           fi
161
+           read_config_param $MY_USERNAME
162
+           SEARX_LOGIN_PASS=$(${PROJECT_NAME}-pass -u $MY_USERNAME -a searx)
163
+           dialog --title $"Enable Searx login" \
164
+                  --msgbox $"Searx logins are now enabled with the password $SEARX_LOGIN_PASS" 6 65
165
+           SEARX_LOGIN_PASS=
166
+           ;;
167
+        1) if ! grep -q '#auth_basic' /etc/nginx/sites-available/searx; then
168
+               sed -i 's|auth_basic|#auth_basic|g' /etc/nginx/sites-available/searx
169
+               systemctl restart nginx
170
+           fi
171
+           dialog --title $"Disable Searx login" \
172
+                  --msgbox $"Searx logins are now disabled. Anyone can access your metasearch engine." 6 65
173
+           ;;
174
+    esac
175
+}
176
+
150 177
 function configure_interactive_searx {
151 178
     while true
152 179
     do
@@ -154,9 +181,10 @@ function configure_interactive_searx {
154 181
         trap "rm -f $data" 0 1 2 5 15
155 182
         dialog --backtitle $"Freedombone Control Panel" \
156 183
                --title $"SearX Metasearch" \
157
-               --radiolist $"Choose an operation:" 11 70 2 \
184
+               --radiolist $"Choose an operation:" 12 70 3 \
158 185
                1 $"Set a background image" off \
159
-               2 $"Exit" on 2> $data
186
+               2 $"Enable login" off \
187
+               3 $"Exit" on 2> $data
160 188
         sel=$?
161 189
         case $sel in
162 190
             1) return;;
@@ -164,7 +192,8 @@ function configure_interactive_searx {
164 192
         esac
165 193
         case $(cat $data) in
166 194
             1) searx_set_background_image;;
167
-            2) break;;
195
+            2) searx_enable_login;;
196
+            3) break;;
168 197
         esac
169 198
     done
170 199
 }
@@ -942,8 +971,8 @@ function install_searx {
942 971
     function_check nginx_limits
943 972
     nginx_limits searx '1M'
944 973
     echo '        proxy_pass http://localhost:8888;' >> /etc/nginx/sites-available/searx
945
-    echo "        auth_basic \"${SEARX_LOGIN_TEXT}\";" >> /etc/nginx/sites-available/searx
946
-    echo '        auth_basic_user_file /etc/nginx/.htpasswd;' >> /etc/nginx/sites-available/searx
974
+    echo "        #auth_basic \"${SEARX_LOGIN_TEXT}\";" >> /etc/nginx/sites-available/searx
975
+    echo '        #auth_basic_user_file /etc/nginx/.htpasswd;' >> /etc/nginx/sites-available/searx
947 976
     echo '    }' >> /etc/nginx/sites-available/searx
948 977
     echo '' >> /etc/nginx/sites-available/searx
949 978
     echo '    fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/searx

+ 1
- 2
src/freedombone-usb-canary Просмотреть файл

@@ -5,8 +5,7 @@ PROJECT_NAME=freedombone
5 5
 UPTIME=$(cat /proc/uptime | awk -F '.' '{print $1}')
6 6
 if [ $UPTIME -gt 120 ]; then
7 7
     ADMIN_USER=$(cat /root/${PROJECT_NAME}-completed.txt | grep 'Admin user' | awk -F ':' '{print $2}')
8
-    #MY_EMAIL_ADDRESS=${ADMIN_USER}@$(cat /etc/hostname)
9
-    MY_EMAIL_ADDRESS=root@$(cat /etc/hostname)
8
+    MY_EMAIL_ADDRESS=${ADMIN_USER}@$(cat /etc/hostname)
10 9
     echo "USB device connected on ${DEVPATH}" | mail -s "${PROJECT_NAME} USB canary" ${MY_EMAIL_ADDRESS}
11 10
     echo "${ACTION}" > /tmp/usb-canary
12 11
     echo "${MY_EMAIL_ADDRESS}" >> /tmp/usb-canary

+ 37
- 5
website/EN/app_searx.html Просмотреть файл

@@ -3,10 +3,10 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2017-04-16 Sun 21:00 -->
6
+<!-- 2017-09-23 Sat 11:02 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9
-<title></title>
9
+<title>&lrm;</title>
10 10
 <meta name="generator" content="Org mode" />
11 11
 <meta name="author" content="Bob Mottram" />
12 12
 <meta name="description" content="How to use SearX metasearch"
@@ -265,13 +265,16 @@ In terms of security both the connection between you and the server, and the out
265 265
 </div>
266 266
 </div>
267 267
 
268
+<div id="outline-container-org404708e" class="outline-2">
269
+<h2 id="org404708e">Installation</h2>
270
+<div class="outline-text-2" id="text-org404708e">
268 271
 <p>
269 272
 ssh into the system with:
270 273
 </p>
271 274
 
272 275
 <div class="org-src-container">
273
-<pre><code class="src src-bash">ssh myusername@mydomain.com -p 2222
274
-</code></pre>
276
+<pre class="src src-bash">ssh myusername@mydomain.com -p 2222
277
+</pre>
275 278
 </div>
276 279
 
277 280
 <p>
@@ -279,13 +282,42 @@ Select <b>Administrator controls</b> then <b>Add/remove apps</b>. From there you
279 282
 </p>
280 283
 
281 284
 <p>
282
-Once it has installed go to <b>About</b> on the <b>Administrator control panel</b> and look for <b>searx</b>. Take a note of the onion address, and you can then enter that into a Tor compatible browser. Go to <b>Passwords</b> on the <b>Administrator control panel</b> and select <b>searx</b>. This will give you the login password for your search site, and it prevents millions of random internet users from using your site as their default search engine and ruining the performance of your system.
285
+Once it has installed go to <b>About</b> on the <b>Administrator control panel</b> and look for <b>searx</b>. Take a note of the onion address, and you can then enter that into a Tor compatible browser.
283 286
 </p>
287
+</div>
288
+</div>
284 289
 
290
+<div id="outline-container-org312dbda" class="outline-2">
291
+<h2 id="org312dbda">Make it your default search</h2>
292
+<div class="outline-text-2" id="text-org312dbda">
293
+<p>
294
+If you are using a Tor browser or Firefox then click on the magnifying glass icon next to the search box and you can then add your metasearch site. A small icon will appear called "<i>Freedombone Metasearch</i>" and you can then right click on it and make it the default search.
295
+</p>
296
+</div>
297
+</div>
298
+
299
+<div id="outline-container-org6b74e84" class="outline-2">
300
+<h2 id="org6b74e84">Enabling password login</h2>
301
+<div class="outline-text-2" id="text-org6b74e84">
302
+<p>
303
+It's possible that you might not want just anyone on the interwebs to be able to use your metasearch engine. Even with the onion routing this might carry some legal risk or make you a target for denial-of-service attempts (although Tor's rate limits and the firewall will give you some defense against that).
304
+</p>
305
+
306
+<p>
307
+To enable password login go to the <b>Administrator control panel</b> then <b>App settings</b> then select <b>searx</b> and <b>Enable login</b>. If you select "yes" then the password will be displayed.
308
+</p>
309
+</div>
310
+</div>
311
+
312
+<div id="outline-container-orgae556b2" class="outline-2">
313
+<h2 id="orgae556b2">Customization</h2>
314
+<div class="outline-text-2" id="text-orgae556b2">
285 315
 <p>
286 316
 It's also possible to customise the background image if you go to <b>App settings</b> then select <b>searx</b>.
287 317
 </p>
288 318
 </div>
319
+</div>
320
+</div>
289 321
 <div id="postamble" class="status">
290 322
 
291 323
 <style type="text/css">