Sfoglia il codice sorgente

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

Bob Mottram 7 anni fa
parent
commit
1b14ea302d
4 ha cambiato i file con 87 aggiunte e 13 eliminazioni
  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 Vedi File

25
 [[file:images/searx.jpg]]
25
 [[file:images/searx.jpg]]
26
 #+END_CENTER
26
 #+END_CENTER
27
 
27
 
28
+* Installation
29
+
28
 ssh into the system with:
30
 ssh into the system with:
29
 
31
 
30
 #+BEGIN_SRC bash
32
 #+BEGIN_SRC bash
33
 
35
 
34
 Select *Administrator controls* then *Add/remove apps*. From there you can use cursor keys, space and enter keys to select *searx*.
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
 It's also possible to customise the background image if you go to *App settings* then select *searx*.
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 Vedi File

147
     esac
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
 function configure_interactive_searx {
177
 function configure_interactive_searx {
151
     while true
178
     while true
152
     do
179
     do
154
         trap "rm -f $data" 0 1 2 5 15
181
         trap "rm -f $data" 0 1 2 5 15
155
         dialog --backtitle $"Freedombone Control Panel" \
182
         dialog --backtitle $"Freedombone Control Panel" \
156
                --title $"SearX Metasearch" \
183
                --title $"SearX Metasearch" \
157
-               --radiolist $"Choose an operation:" 11 70 2 \
184
+               --radiolist $"Choose an operation:" 12 70 3 \
158
                1 $"Set a background image" off \
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
         sel=$?
188
         sel=$?
161
         case $sel in
189
         case $sel in
162
             1) return;;
190
             1) return;;
164
         esac
192
         esac
165
         case $(cat $data) in
193
         case $(cat $data) in
166
             1) searx_set_background_image;;
194
             1) searx_set_background_image;;
167
-            2) break;;
195
+            2) searx_enable_login;;
196
+            3) break;;
168
         esac
197
         esac
169
     done
198
     done
170
 }
199
 }
942
     function_check nginx_limits
971
     function_check nginx_limits
943
     nginx_limits searx '1M'
972
     nginx_limits searx '1M'
944
     echo '        proxy_pass http://localhost:8888;' >> /etc/nginx/sites-available/searx
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
     echo '    }' >> /etc/nginx/sites-available/searx
976
     echo '    }' >> /etc/nginx/sites-available/searx
948
     echo '' >> /etc/nginx/sites-available/searx
977
     echo '' >> /etc/nginx/sites-available/searx
949
     echo '    fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/searx
978
     echo '    fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/searx

+ 1
- 2
src/freedombone-usb-canary Vedi File

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

+ 37
- 5
website/EN/app_searx.html Vedi File

3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
 <head>
5
 <head>
6
-<!-- 2017-04-16 Sun 21:00 -->
6
+<!-- 2017-09-23 Sat 11:02 -->
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9
-<title></title>
9
+<title>&lrm;</title>
10
 <meta name="generator" content="Org mode" />
10
 <meta name="generator" content="Org mode" />
11
 <meta name="author" content="Bob Mottram" />
11
 <meta name="author" content="Bob Mottram" />
12
 <meta name="description" content="How to use SearX metasearch"
12
 <meta name="description" content="How to use SearX metasearch"
265
 </div>
265
 </div>
266
 </div>
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
 <p>
271
 <p>
269
 ssh into the system with:
272
 ssh into the system with:
270
 </p>
273
 </p>
271
 
274
 
272
 <div class="org-src-container">
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
 </div>
278
 </div>
276
 
279
 
277
 <p>
280
 <p>
279
 </p>
282
 </p>
280
 
283
 
281
 <p>
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
 </p>
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
 <p>
315
 <p>
286
 It's also possible to customise the background image if you go to <b>App settings</b> then select <b>searx</b>.
316
 It's also possible to customise the background image if you go to <b>App settings</b> then select <b>searx</b>.
287
 </p>
317
 </p>
288
 </div>
318
 </div>
319
+</div>
320
+</div>
289
 <div id="postamble" class="status">
321
 <div id="postamble" class="status">
290
 
322
 
291
 <style type="text/css">
323
 <style type="text/css">