From 9dfefbcd9a83766fb45ede8e516fc7b432203de1 Mon Sep 17 00:00:00 2001 From: Tomasz Borychowski Date: Mon, 2 Nov 2020 00:23:25 +0000 Subject: [PATCH] search --- README.md | 8 +- apps/search/searx-settings.yml | 226 +++++++++++++++++++++++++++++++++ apps/search/searx.md | 93 ++++++++++++++ apps/search/whoogle.md | 23 ++++ 4 files changed, 347 insertions(+), 3 deletions(-) create mode 100644 apps/search/searx-settings.yml create mode 100644 apps/search/searx.md create mode 100644 apps/search/whoogle.md diff --git a/README.md b/README.md index bce0c08..d215e38 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ The aims is to provide a ready-to-run recipes that you can just copy, paste and So, without further ado, here's the current list: # General Information -- How to setup docker? +- How to setup docker & docker-compose? +- How to use docker-compose - Troubleshooting @@ -184,8 +185,9 @@ So, without further ado, here's the current list: # Search engines -- Searx -- Whoogle search +- [Searx](apps/search/searx.md) +- [Whoogle](apps/search/whoogle.md) + # Social - Monica CRM diff --git a/apps/search/searx-settings.yml b/apps/search/searx-settings.yml new file mode 100644 index 0000000..c33aa1f --- /dev/null +++ b/apps/search/searx-settings.yml @@ -0,0 +1,226 @@ +general: + debug : False # Debug mode, only for development + instance_name : "searx" # displayed name + +search: + safe_search : 1 # Filter results. 0: None, 1: Moderate, 2: Strict + autocomplete : "duckduckgo" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default + default_lang : "" # Default search language - leave blank to detect from browser information or use codes from 'languages.py' + ban_time_on_fail : 5 # ban time in seconds after engine errors + max_ban_time_on_fail : 120 # max ban time in seconds after engine errors + +server: + port : 8888 + bind_address : "127.0.0.1" # address to listen on + secret_key : "6dba0e8f736b4c9de99f3332e5ef6663d8d04cf9516dcd15ae15a97c0c25f" # change this! + base_url : https://searx.example.com/ # Set custom base_url. Possible values: False or "https://your.custom.host/location/" + image_proxy : True # Proxying image results through searx + http_protocol_version : "1.0" # 1.0 and 1.1 are supported + method: "POST" # POST queries are more secure as they don't show up in history but may cause problems when using Firefox containers + +ui: + static_path : "" # Custom static path - leave it blank if you didn't change + templates_path : "" # Custom templates path - leave it blank if you didn't change + default_theme : oscar # ui theme + default_locale : "" # Default interface locale - leave blank to detect from browser information or use codes from the 'locales' config section + theme_args : + oscar_style : logicodev-dark # default style of oscar +# results_on_new_tab: False # Open result links in a new tab by default +# categories_order : +# - general +# - files +# - map +# - it +# - science + +# searx supports result proxification using an external service: https://github.com/asciimoo/morty +result_proxy: + url : https://morty.example.com + key : !!binary "Op0RgXik5oOpTpgvawHPMdw823KolwS1JWfZa2vpt+FXXI" + + +outgoing: # communication with search engines + request_timeout : 2.0 # default timeout in seconds, can be override by engine + # max_request_timeout: 10.0 # the maximum timeout in seconds + useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administrator + pool_connections : 100 # Number of different hosts + pool_maxsize : 10 # Number of simultaneous requests by host +# uncomment below section if you want to use a proxy +# see http://docs.python-requests.org/en/latest/user/advanced/#proxies +# SOCKS proxies are also supported: see http://requests.readthedocs.io/en/master/user/advanced/#socks +# proxies : +# http : http://127.0.0.1:8080 +# https: http://127.0.0.1:8080 +# uncomment below section only if you have more than one network interface +# which can be the source of outgoing search requests +# source_ips: +# - 1.1.1.1 +# - 1.1.1.2 + +# External plugin configuration +# See http://searx.github.io/searx/dev/plugins.html for more details +# +# plugins: +# - plugin1 +# - plugin2 +# - ... + + +engines: + - name : wikipedia + engine : wikipedia + shortcut : wp + base_url : 'https://{language}.wikipedia.org/' + + - name : bing images + engine : bing_images + shortcut : bii + + + - name : currency + engine : currency_convert + categories : general + shortcut : cc + + - name : deezer + engine : deezer + shortcut : dz + disabled: True + + - name : deviantart + engine : deviantart + shortcut : da + timeout: 3.0 + disabled: True + + - name : ddg definitions + engine : duckduckgo_definitions + shortcut : ddd + weight : 2 + disabled : True + + - name : wikidata + engine : wikidata + shortcut : wd + timeout : 3.0 + weight : 2 + disabled: True + + - name : duckduckgo + engine : duckduckgo + shortcut : ddg + + - name : duckduckgo images + engine : duckduckgo_images + shortcut : ddi + timeout: 3.0 + disabled : True + + - name : flickr + categories : images + shortcut : fl +# You can use the engine using the official stable API, but you need an API key +# See : https://www.flickr.com/services/apps/create/ +# engine : flickr +# api_key: 'apikey' # required! +# Or you can use the html non-stable engine, activated by default + engine : flickr_noapi + disabled: True + + - name : github + engine : github + shortcut : gh + + - name : google + engine : google + shortcut : go + + - name : google images + engine : google_images + shortcut : goi + + - name : library genesis + engine : xpath + search_url : https://libgen.is/search.php?req={query} + url_xpath : //a[contains(@href,"bookfi.net")]/@href + title_xpath : //a[contains(@href,"book/")]/text()[1] + content_xpath : //td/a[1][contains(@href,"=author")]/text() + categories : general + timeout : 7.0 + disabled : True + shortcut : lg + + - name : npm + engine : json_engine + paging : True + search_url : https://api.npms.io/v2/search?q={query}&size=25&from={pageno} + results_query : results + url_query : package/links/npm + title_query : package/name + content_query : package/description + page_size : 25 + categories : it + disabled: True + timeout: 5.0 + shortcut : npm + + - name : openstreetmap + engine : openstreetmap + shortcut : osm + disabled : True + + + - name : reddit + engine : reddit + shortcut : re + page_size : 25 + timeout : 10.0 + disabled : True + + - name : stackoverflow + engine : stackoverflow + shortcut : st + + - name : startpage + engine : startpage + shortcut : sp + timeout : 6.0 + + - name : youtube + shortcut : yt + # You can use the engine using the official stable API, but you need an API key + # See : https://console.developers.google.com/project + # engine : youtube_api + # api_key: 'apikey' # required! + # Or you can use the html non-stable engine, activated by default + engine : youtube_noapi + + - name : vimeo + engine : vimeo + shortcut : vm + + - name : 1337x + engine : 1337x + shortcut : 1337x + disabled : True + + - name : peertube + engine: peertube + shortcut: ptb + paging : True + base_url : https://peer.tube/ + categories: videos + disabled : True + + +locales: + en : English + pl : Polski (Polish) + +doi_resolvers : + oadoi.org : 'https://oadoi.org/' + doi.org : 'https://doi.org/' + doai.io : 'https://dissem.in/' + sci-hub.tw : 'https://sci-hub.tw/' + +default_doi_resolver : 'sci-hub.tw' diff --git a/apps/search/searx.md b/apps/search/searx.md new file mode 100644 index 0000000..44512b0 --- /dev/null +++ b/apps/search/searx.md @@ -0,0 +1,93 @@ +# Searx + +- Simple & good looking UI +- Configurable +- Poor keyboard support + +
+ +- [Homepage](https://searx.github.io/searx/) +- [Github repo](https://github.com/searx/searx) +- [Github repo for Docker](https://github.com/searx/searx-docker) + +## Configuration +[settings.yml](searx-settings.yml) + +## docker-compose.yml +```yml +version: '3.7' + +services: + + filtron: + container_name: filtron + image: dalf/filtron + restart: unless-stopped + ports: + - "4040:4040" + - "4041:4041" + networks: + - searx + command: -listen 0.0.0.0:4040 -api 0.0.0.0:4041 -target searx:8080 + volumes: + - ./rules.json:/etc/filtron/rules.json:rw + read_only: true + cap_drop: + - ALL + + searx: + container_name: searx + image: searx/searx:latest + restart: unless-stopped + networks: + - searx + command: ${SEARX_COMMAND:-} + volumes: + - ./searx:/etc/searx:rw + environment: + - BIND_ADDRESS=0.0.0.0:8080 + - BASE_URL=https://${SEARX_HOSTNAME:-localhost}/ + - MORTY_URL=https://morty.example.com/ + - MORTY_KEY=${MORTY_KEY} + cap_drop: + - ALL + cap_add: + - CHOWN + - SETGID + - SETUID + - DAC_OVERRIDE + + morty: + container_name: morty + image: dalf/morty + restart: unless-stopped + ports: + - "4045:3000" + networks: + - searx + command: -timeout 6 -ipv6 + environment: + - MORTY_KEY=${MORTY_KEY} + - MORTY_ADDRESS=0.0.0.0:3000 + logging: + driver: none + read_only: true + cap_drop: + - ALL + + searx-checker: + container_name: searx-checker + image: searx/searx-checker + restart: unless-stopped + networks: + - searx + command: -cron -o html/data/status.json http://searx:8080 + volumes: + - ./searx-checker:/usr/local/searx-checker/html/data:rw + + +networks: + searx: + ipam: + driver: default +``` diff --git a/apps/search/whoogle.md b/apps/search/whoogle.md new file mode 100644 index 0000000..d305d03 --- /dev/null +++ b/apps/search/whoogle.md @@ -0,0 +1,23 @@ +# Whoogle + +- a bit ugly +- no keyboard support + +
+ +- [Homepage](https://benbusby.com/projects/whoogle-search/) +- [Github repo](https://github.com/benbusby/whoogle-search) + + +## docker-compose.yml +```yml +version: "3" + +services: + whoogle-search: + image: benbusby/whoogle-search + container_name: whoogle-search + restart: unless-stopped + ports: + - 3123:5000 +```