From 8dd4a651a39ea78b33ce68251fd0856bf8270e0c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 11:09:11 +0100 Subject: [PATCH 1/6] Wording --- doc/EN/app_searx.org | 2 +- website/EN/app_searx.html | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/EN/app_searx.org b/doc/EN/app_searx.org index 3a2b234c..6c1d4f18 100644 --- a/doc/EN/app_searx.org +++ b/doc/EN/app_searx.org @@ -39,7 +39,7 @@ Once it has installed go to *About* on the *Administrator control panel* and loo * Make it your default search -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. +In a Tor browser 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. * Enabling password login diff --git a/website/EN/app_searx.html b/website/EN/app_searx.html index b60210d2..7b400650 100644 --- a/website/EN/app_searx.html +++ b/website/EN/app_searx.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -265,9 +265,9 @@ In terms of security both the connection between you and the server, and the out -
-

Installation

-
+
+

Installation

+

ssh into the system with:

@@ -287,18 +287,18 @@ Once it has installed go to About on the Administrator control panel
-
-

Make it your default search

-
+
+

Make it your default search

+

-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. +In a Tor browser 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.

-
-

Enabling password login

-
+
+

Enabling password login

+

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).

@@ -309,9 +309,9 @@ To enable password login go to the Administrator control panel then Ap
-
-

Customization

-
+
+

Customization

+

It's also possible to customise the background image if you go to App settings then select searx.

From 391edfe243fbe91e5ccbee57ae9f0303da51ca24 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 12:17:16 +0100 Subject: [PATCH 2/6] Update default search engine for all users --- src/freedombone-utils-web | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/freedombone-utils-web b/src/freedombone-utils-web index 05184c90..98ce2055 100755 --- a/src/freedombone-utils-web +++ b/src/freedombone-utils-web @@ -534,20 +534,27 @@ function install_dynamicdns { mark_completed $FUNCNAME } +function update_default_search_engine { + for d in /home/*/ ; do + USERNAME=$(echo "$d" | awk -F '/' '{print $3}') + if [[ $(is_valid_user "$USERNAME") == "1" ]]; then + if ! grep -q "WWW_HOME" /home/$USERNAME/.bashrc; then + if ! grep -q 'controluser' /home/$USERNAME/.bashrc; then + echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$USERNAME/.bashrc + else + sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$USERNAME/.bashrc + fi + fi + fi + done +} + function install_command_line_browser { if [[ $(is_completed $FUNCNAME) == "1" ]]; then return fi apt-get -yq install elinks - - # set the home page - if ! grep -q "WWW_HOME" /home/$MY_USERNAME/.bashrc; then - if ! grep -q 'controluser' /home/$MY_USERNAME/.bashrc; then - echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$MY_USERNAME/.bashrc - else - sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$MY_USERNAME/.bashrc - fi - fi + update_default_search_engine mark_completed $FUNCNAME } From d7abf4dc0699a3d8365e896b27e306c815d645ee Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 12:21:38 +0100 Subject: [PATCH 3/6] Use searx as default search for users --- src/freedombone-app-searx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index b14b4624..6499d582 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -1011,6 +1011,9 @@ function install_searx { systemctl daemon-reload systemctl start searx.service + DEFAULT_SEARCH="http://$SEARX_ONION_HOSTNAME" + update_default_search_engine + SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" ${PROJECT_NAME}-pass -u $MY_USERNAME -a searx -p "$SEARX_PASSWORD" if grep -q "$MY_USERNAME:" /etc/nginx/.htpasswd; then From 5293a3cdf21aefbb48de5381ae8d608c719160a4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 12:24:23 +0100 Subject: [PATCH 4/6] Avoid duplicate bashrc entries --- src/freedombone-utils-web | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/freedombone-utils-web b/src/freedombone-utils-web index 98ce2055..a63dda38 100755 --- a/src/freedombone-utils-web +++ b/src/freedombone-utils-web @@ -540,9 +540,17 @@ function update_default_search_engine { if [[ $(is_valid_user "$USERNAME") == "1" ]]; then if ! grep -q "WWW_HOME" /home/$USERNAME/.bashrc; then if ! grep -q 'controluser' /home/$USERNAME/.bashrc; then - echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$USERNAME/.bashrc + if ! grep -q 'export WWW_HOME=' /home/$USERNAME/.bashrc; then + echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$USERNAME/.bashrc + else + sed -i "s|export WWW_HOME=.*|export WWW_HOME=$DEFAULT_SEARCH|g" /home/$USERNAME/.bashrc + fi else - sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$USERNAME/.bashrc + if ! grep -q 'export WWW_HOME=' /home/$USERNAME/.bashrc; then + sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$USERNAME/.bashrc + else + sed -i "s|export WWW_HOME=.*|export WWW_HOME=$DEFAULT_SEARCH|g" /home/$USERNAME/.bashrc + fi fi fi fi From 1f7c90cd49c3082eeb72fa1e90818d69d734bc16 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 12:28:57 +0100 Subject: [PATCH 5/6] Set default search if searx is available --- src/freedombone-app-searx | 1 - src/freedombone-utils-web | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 6499d582..070aaa2d 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -1011,7 +1011,6 @@ function install_searx { systemctl daemon-reload systemctl start searx.service - DEFAULT_SEARCH="http://$SEARX_ONION_HOSTNAME" update_default_search_engine SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" diff --git a/src/freedombone-utils-web b/src/freedombone-utils-web index a63dda38..2376ee9d 100755 --- a/src/freedombone-utils-web +++ b/src/freedombone-utils-web @@ -535,6 +535,10 @@ function install_dynamicdns { } function update_default_search_engine { + if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then + DEFAULT_SEARCH="http://$(cat /var/lib/tor/hidden_service_searx/hostname)" + fi + for d in /home/*/ ; do USERNAME=$(echo "$d" | awk -F '/' '{print $3}') if [[ $(is_valid_user "$USERNAME") == "1" ]]; then From e766e655f3d88afc6d9910c2f05ac25c3cf805fe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 12:31:56 +0100 Subject: [PATCH 6/6] Update default search after searx removal --- src/freedombone-app-searx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 070aaa2d..a5de0ae9 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -846,6 +846,7 @@ function remove_searx { remove_completion_param install_searx sed -i '/Search engine /d' $COMPLETION_FILE sed -i '/searx /d' $COMPLETION_FILE + update_default_search_engine } function install_searx {