瀏覽代碼

[db] Update postgres jail

Colin Powell 4 年之前
父節點
當前提交
d28d2ae063

+ 5 - 1
ansible/hosts

@@ -20,6 +20,7 @@ tor.local
 ttrss.local
 fifteen5.local
 mailhog.local
+shibboleth.local
 
 [vms]
 mopidy.local
@@ -89,8 +90,11 @@ pbp.local
 [fifteen5]
 fifteen5.local
 
-[pgadmin]
+[db]
 db.local
 
 [mailhog]
 mailhog.local
+
+[shibboleth]
+shibboleth.local

+ 6 - 1
ansible/playbook.yml

@@ -7,8 +7,9 @@
   roles:
     - role: mailhog
 
-- hosts: pgadmin
+- hosts: db
   roles:
+    - role: postgres
     - role: pgadmin4
 
 - hosts: proxy
@@ -24,3 +25,7 @@
   roles:
     - role: postgres
     - role: fifteen5
+
+- hosts: searx
+  roles:
+    - role: searx

+ 1 - 1
ansible/roles/avahi/tasks/main.yml

@@ -4,7 +4,7 @@
 
 - name: DBus and Avahi packages installed
   pkgng:
-    name: "avahi-app nss_mdns dbus"
+    name: "avahi-app nss_mdns dbus ca_root_nss"
     state: present
 
 - name: DBus enabled

+ 39 - 0
ansible/roles/caddy/files/Caddyfile

@@ -6,6 +6,11 @@ search.unbl.ink {
 		transparent
 	}
 }
+morty.unbl.ink {
+	proxy / search.local:3000 {
+		transparent
+	}
+}
 git.unbl.ink {
 	proxy / git.local:3000 {
 		transparent
@@ -39,6 +44,12 @@ admin.five.unbl.ink {
 		websocket
 	}
 }
+bamboohr.five.unbl.ink {
+	proxy / fifteen5.local:8000 {
+		transparent
+		websocket
+	}
+}
 my.five.unbl.ink {
 	proxy / fifteen5.local:8000 {
 		transparent
@@ -57,6 +68,18 @@ saml-okta.five.unbl.ink {
 		websocket
 	}
 }
+scim-okta.five.unbl.ink {
+	proxy / fifteen5.local:8000 {
+		transparent
+		websocket
+	}
+}
+sftp-workday.five.unbl.ink {
+	proxy / fifteen5.local:8000 {
+		transparent
+		websocket
+	}
+}
 play.unbl.ink {
 	proxy / mopidy.local:6680 {
 		transparent
@@ -120,3 +143,19 @@ db.unbl.ink {
 		websocket
 	}
 }
+db.unbl.ink:5432 {
+	proxy / db.local:5432 {
+		transparent
+	}
+}
+mailhog.unbl.ink {
+	proxy / mailhog.local {
+		transparent
+		websocket
+	}
+}
+mailhog.unbl.ink:1025 {
+	proxy / mailhog.local:1025 {
+		transparent
+	}
+}

+ 1 - 1
ansible/roles/pgadmin4/tasks/main.yml

@@ -11,7 +11,7 @@
   shell: sysrc supervisord_enable="YES"
 
 - name: pgAdmin4 package installed
-  shell: "pip install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.25/pip/pgadmin4-4.25-py3-none-any.whl"
+  shell: "pip install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.29/pip/pgadmin4-4.29-py3-none-any.whl"
 
 - name: Supervisor config file patched
   patch:

+ 67 - 1
ansible/roles/postgres/tasks/main.yml

@@ -4,7 +4,7 @@
 
 - name: PostgreSQL packages installed
   pkgng:
-    name: "postgresql12-server postgresql12-client"
+    name: "postgresql12-server postgresql12-client postgresql12-contrib py37-psycopg2"
     state: present
 
 - name: PostgreSQL enabled
@@ -23,3 +23,69 @@
     dest: /var/db/postgres/data12/postgresql.conf
   become_user: postgres
   notify: PostgreSQL restarted
+
+- name: PBP database exists
+  postgresql_db:
+    name: "pbp"
+    state: present
+  become_user: postgres
+
+- name: 15Five database exists
+  postgresql_db:
+    name: "fifteen5"
+    state: present
+  become_user: postgres
+
+- name: 15Five database has btree_gist extension
+  postgresql_ext:
+    name: btree_gist
+    db: fifteen5
+  become_user: postgres
+
+- name: 15Five database has btree_gin extension
+  postgresql_ext:
+    name: btree_gin
+    db: fifteen5
+  become_user: postgres
+
+- name: 15Five database has ltree extension
+  postgresql_ext:
+    name: ltree
+    db: fifteen5
+  become_user: postgres
+
+- name: 15Five database has hstore extension
+  postgresql_ext:
+    name: hstore
+    db: fifteen5
+  become_user: postgres
+
+- name: 15Five database exists
+  postgresql_db:
+    name: "fifteen5_jail"
+    state: present
+  become_user: postgres
+
+- name: 15Five database has btree_gist extension
+  postgresql_ext:
+    name: btree_gist
+    db: fifteen5_jail
+  become_user: postgres
+
+- name: 15Five database has btree_gin extension
+  postgresql_ext:
+    name: btree_gin
+    db: fifteen5_jail
+  become_user: postgres
+
+- name: 15Five database has ltree extension
+  postgresql_ext:
+    name: ltree
+    db: fifteen5_jail
+  become_user: postgres
+
+- name: 15Five database has hstore extension
+  postgresql_ext:
+    name: hstore
+    db: fifteen5_jail
+  become_user: postgres

+ 93 - 0
ansible/roles/searx/files/filtron-rules.json

@@ -0,0 +1,93 @@
+[{
+   "name":"search request",
+   "filters":[
+      "Param:q",
+      "Path=^(/|/search)$"
+   ],
+   "interval":60,
+   "limit":10,
+   "subrules":[
+      {
+         "name":"roboagent limit",
+         "interval": 60,
+         "limit": 0, 
+         "filters":[
+            "Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"
+         ],
+         "actions":[
+            {
+               "name":"block",
+               "params":{
+                  "message":"Rate limit exceeded"
+               }
+            }
+         ]
+      },
+      {
+         "name":"botlimit",
+         "limit":0,
+         "stop":true,
+         "filters":[
+            "Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"
+         ],
+         "actions":[
+            {
+               "name":"block",
+               "params":{
+                  "message":"Rate limit exceeded"
+               }
+            }
+         ]
+      },
+      {
+         "name":"IP limit",
+         "interval": 300,
+         "limit": 256,
+         "stop":true,
+         "aggregations":[
+            "Header:X-Forwarded-For"
+         ],
+         "actions":[
+            {
+               "name":"block",
+               "params":{
+                  "message":"Rate limit exceeded"
+               }
+            }
+         ]
+      },
+      {
+         "name":"rss/json limit",
+         "interval": 600,
+         "limit": 4,
+         "stop":true,
+         "filters":[
+            "Param:format=(csv|json|rss)"
+         ],
+         "actions":[
+            {
+               "name":"block",
+               "params":{
+                  "message":"Rate limit exceeded"
+               }
+            }
+         ]
+      },
+      {
+         "name":"useragent limit",
+         "interval": 300,
+         "limit": 128,
+         "aggregations":[
+            "Header:User-Agent"
+         ],
+         "actions":[
+            {
+               "name":"block",
+               "params":{
+                  "message":"Rate limit exceeded"
+               }
+            }
+         ]
+      }
+   ]
+}]

+ 45 - 0
ansible/roles/searx/files/filtron.rc

@@ -0,0 +1,45 @@
+#!/bin/sh
+# $FreeBSD: branches/2020Q1/www/filtron/files/filtron.in 463944 2018-03-09 08:34:57Z yuri $
+
+# PROVIDE: filtron
+# REQUIRE: DAEMON NETWORKING
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable filtron:
+# filtron_enable="YES"
+#
+# filtron_enable (bool):	Set to YES to enable filtron
+#				Default: NO
+# filtron_conf (str):		filtron configuration file
+#				Default: ${PREFIX}/etc/filtron.conf
+# filtron_user (str):		filtron daemon user
+#				Default: filtron
+# filtron_group (str):		filtron daemon group
+#				Default: filtron
+# filtron_flags (str):		Extra flags passed to filtron
+
+. /etc/rc.subr
+
+name="filtron"
+rcvar=filtron_enable
+
+: ${filtron_enable:="NO"}
+: ${filtron_user:="www"}
+: ${filtron_group:="www"}
+: ${filtron_flags:=""}
+
+# daemon
+pidfile="/var/run/${name}.pid"
+command=/usr/local/bin/filtron
+procname="daemon"
+command_args=" -rules /usr/local/etc/filtron/rules.json -listen 0.0.0.0:4004 &"
+start_precmd="filtron_precmd"
+
+filtron_precmd()
+{
+    install -o ${filtron_user} /dev/null ${pidfile}
+}
+
+load_rc_config $name
+run_rc_command "$1"

+ 46 - 0
ansible/roles/searx/files/morty.rc

@@ -0,0 +1,46 @@
+#!/bin/sh
+# $FreeBSD: branches/2020Q1/www/morty/files/morty.in 463944 2018-03-09 08:34:57Z yuri $
+
+# PROVIDE: morty
+# REQUIRE: DAEMON NETWORKING
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable morty:
+# morty_enable="YES"
+#
+
+# morty_enable (bool):	Set to YES to enable morty
+#				Default: NO
+# morty_conf (str):		morty configuration file
+#				Default: ${PREFIX}/etc/morty.conf
+# morty_user (str):		morty daemon user
+#				Default: morty
+# morty_group (str):		morty daemon group
+#				Default: morty
+# morty_flags (str):		Extra flags passed to morty
+
+. /etc/rc.subr
+
+name="morty"
+rcvar=morty_enable
+
+: ${morty_enable:="NO"}
+: ${morty_user:="www"}
+: ${morty_group:="www"}
+: ${morty_flags:=""}
+
+# daemon
+pidfile="/var/run/${name}.pid"
+command="/usr/local/bin/${name}"
+procname="morty"
+command_args=" -listen 0.0.0.0:3000 -key f4ea81d8dcf92569047b35da554c781b &"
+start_precmd="morty_precmd"
+
+morty_precmd()
+{
+    install -o ${morty_user} /dev/null ${pidfile}
+}
+
+load_rc_config $name
+run_rc_command "$1"

+ 755 - 0
ansible/roles/searx/files/searx-settings.yml

@@ -0,0 +1,755 @@
+general:
+  debug: False # Debug mode, only for development
+  instance_name: "Search @ Unbl.ink" # displayed name
+
+search:
+  safe_search: 0
+  autocomplete: "duckduckgo"
+  language: "en-US"
+  ban_time_on_fail: 5
+  max_ban_time_on_fail: 20
+  method: "GET"
+
+server:
+  port: 8888
+  bind_address: "127.0.0.1"
+  secret_key: "9823ljasd0fj20jlxdzl;kjsdf"
+  base_url: False
+  image_proxy: True
+  http_protocol_version: "1.0"
+
+ui:
+  static_path: ""
+  templates_path: ""
+  default_theme: courgette
+  default_locale: ""
+  theme_args:
+    courgette_style: blue
+
+result_proxy:
+  url: https://morty.unbl.ink/
+  key: f4ea81d8dcf92569047b35da554c781
+
+outgoing: 
+  request_timeout: 3.0
+  useragent_suffix: ""
+  pool_connections: 100
+  pool_maxsize: 10
+
+engines:
+  - name: arch linux wiki
+    engine: archlinux
+    shortcut: al
+
+  - name: archive is
+    engine: xpath
+    search_url: https://archive.is/{query}
+    url_xpath: (//div[@class="TEXT-BLOCK"]/a)/@href
+    title_xpath: (//div[@class="TEXT-BLOCK"]/a)
+    content_xpath: //div[@class="TEXT-BLOCK"]/ul/li
+    categories: general
+    timeout: 7.0
+    disabled: True
+    shortcut: ai
+
+  - name: arxiv
+    engine: arxiv
+    shortcut: arx
+    categories: science
+    timeout: 4.0
+
+  - name: base
+    engine: base
+    shortcut: bs
+
+  - name: wikipedia
+    engine: wikipedia
+    shortcut: wp
+    base_url: "https://{language}.wikipedia.org/"
+
+  - name: bing
+    engine: bing
+    shortcut: bi
+
+  - name: bing images
+    engine: bing_images
+    shortcut: bii
+
+  - name: bing news
+    engine: bing_news
+    shortcut: bin
+
+  - name: bing videos
+    engine: bing_videos
+    shortcut: biv
+
+  - name: bitbucket
+    engine: xpath
+    paging: True
+    search_url: https://bitbucket.org/repo/all/{pageno}?name={query}
+    url_xpath: //article[@class="repo-summary"]//a[@class="repo-link"]/@href
+    title_xpath: //article[@class="repo-summary"]//a[@class="repo-link"]
+    content_xpath: //article[@class="repo-summary"]/p
+    categories: it
+    timeout: 4.0
+    disabled: True
+    shortcut: bb
+
+  - name: ccc-tv
+    engine: xpath
+    paging: False
+    search_url: https://media.ccc.de/search/?q={query}
+    url_xpath: //div[@class="caption"]/h3/a/@href
+    title_xpath: //div[@class="caption"]/h3/a/text()
+    content_xpath: //div[@class="caption"]/h4/@title
+    categories: videos
+    disabled: True
+    shortcut: c3tv
+
+  - name: crossref
+    engine: json_engine
+    paging: True
+    search_url: http://search.crossref.org/dois?q={query}&page={pageno}
+    url_query: doi
+    title_query: title
+    content_query: fullCitation
+    categories: science
+    shortcut: cr
+
+  - name: currency
+    engine: currency_convert
+    categories: general
+    shortcut: cc
+
+  - name: deezer
+    engine: deezer
+    shortcut: dz
+
+  - name: deviantart
+    engine: deviantart
+    shortcut: da
+    timeout: 3.0
+
+  - name: ddg definitions
+    engine: duckduckgo_definitions
+    shortcut: ddd
+    weight: 2
+    disabled: False
+
+  - name: digbt
+    engine: digbt
+    shortcut: dbt
+    timeout: 6.0
+    disabled: True
+
+  - name: digg
+    engine: digg
+    shortcut: dg
+
+  - name: erowid
+    engine: xpath
+    paging: True
+    first_page_num: 0
+    page_size: 30
+    search_url: https://www.erowid.org/search.php?q={query}&s={pageno}
+    url_xpath: //dl[@class="results-list"]/dt[@class="result-title"]/a/@href
+    title_xpath: //dl[@class="results-list"]/dt[@class="result-title"]/a/text()
+    content_xpath: //dl[@class="results-list"]/dd[@class="result-details"]
+    categories: general
+    shortcut: ew
+    disabled: True
+
+  - name: wikidata
+    engine: wikidata
+    shortcut: wd
+    timeout: 3.0
+    weight: 2
+
+  - name: duckduckgo
+    engine: duckduckgo
+    shortcut: ddg
+    disabled: False
+
+  - name: duckduckgo images
+    engine: duckduckgo_images
+    shortcut: ddi
+    timeout: 3.0
+    disabled: True
+
+  - name: etymonline
+    engine: xpath
+    paging: True
+    search_url: http://etymonline.com/?search={query}&p={pageno}
+    url_xpath: //a[contains(@class, "word--")]/@href
+    title_xpath: //p[contains(@class, "word__name--")]/text()
+    content_xpath: //section[contains(@class, "word__defination")]/object
+    first_page_num: 0
+    shortcut: et
+    disabled: True
+
+  - name: faroo
+    engine: faroo
+    shortcut: fa
+    disabled: True
+
+  - name: 1x
+    engine: www1x
+    shortcut: 1x
+    disabled: True
+
+  - name: fdroid
+    engine: fdroid
+    shortcut: fd
+    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
+
+  - name: free software directory
+    engine: mediawiki
+    shortcut: fsd
+    categories: it
+    base_url: https://directory.fsf.org/
+    number_of_results: 5
+    # what part of a page matches the query string: title, text, nearmatch
+    # title - query matches title, text - query matches the text of page, nearmatch - nearmatch in title
+    search_type: title
+    timeout: 5.0
+    disabled: True
+
+  - name: frinkiac
+    engine: frinkiac
+    shortcut: frk
+    disabled: True
+
+  - name: genius
+    engine: genius
+    shortcut: gen
+
+  - name: gigablast
+    engine: gigablast
+    shortcut: gb
+    timeout: 3.0
+    disabled: True
+
+  - name: gentoo
+    engine: gentoo
+    shortcut: ge
+
+  - name: gitlab
+    engine: json_engine
+    paging: True
+    search_url: https://gitlab.com/api/v4/projects?search={query}&page={pageno}
+    url_query: web_url
+    title_query: name_with_namespace
+    content_query: description
+    page_size: 20
+    categories: it
+    shortcut: gl
+    timeout: 10.0
+    disabled: False
+
+  - name: github
+    engine: github
+    shortcut: gh
+
+  - name: google
+    engine: google
+    shortcut: go
+
+  - name: google images
+    engine: google_images
+    shortcut: goi
+
+  - name: google news
+    engine: google_news
+    shortcut: gon
+
+  - name: google videos
+    engine: google_videos
+    shortcut: gov
+
+  - name: google scholar
+    engine: xpath
+    paging: True
+    search_url: https://scholar.google.com/scholar?start={pageno}&q={query}&hl=en&as_sdt=0,5&as_vis=1
+    results_xpath: //div[contains(@class, "gs_r")]/div[@class="gs_ri"]
+    url_xpath: .//h3/a/@href
+    title_xpath: .//h3/a
+    content_xpath: .//div[@class="gs_rs"]
+    suggestion_xpath: //div[@id="gs_qsuggest"]/ul/li
+    page_size: 10
+    first_page_num: 0
+    categories: science
+    shortcut: gos
+
+  - name: google play apps
+    engine: xpath
+    search_url: https://play.google.com/store/search?q={query}&c=apps
+    url_xpath: //a[@class="title"]/@href
+    title_xpath: //a[@class="title"]
+    content_xpath: //a[@class="subtitle"]
+    categories: files
+    shortcut: gpa
+    disabled: True
+
+  - name: google play movies
+    engine: xpath
+    search_url: https://play.google.com/store/search?q={query}&c=movies
+    url_xpath: //a[@class="title"]/@href
+    title_xpath: //a[@class="title"]/@title
+    content_xpath: //a[contains(@class, "subtitle")]
+    categories: videos
+    shortcut: gpm
+    disabled: True
+
+  - name: google play music
+    engine: xpath
+    search_url: https://play.google.com/store/search?q={query}&c=music
+    url_xpath: //a[@class="title"]/@href
+    title_xpath: //a[@class="title"]
+    content_xpath: //a[@class="subtitle"]
+    categories: music
+    shortcut: gps
+    disabled: True
+
+  - name: geektimes
+    engine: xpath
+    paging: True
+    search_url: https://geektimes.ru/search/page{pageno}/?q={query}
+    url_xpath: //article[contains(@class, "post")]//a[@class="post__title_link"]/@href
+    title_xpath: //article[contains(@class, "post")]//a[@class="post__title_link"]
+    content_xpath: //article[contains(@class, "post")]//div[contains(@class, "post__text")]
+    categories: it
+    timeout: 4.0
+    disabled: True
+    shortcut: gt
+
+  - name: habrahabr
+    engine: xpath
+    paging: True
+    search_url: https://habrahabr.ru/search/page{pageno}/?q={query}
+    url_xpath: //article[contains(@class, "post")]//a[@class="post__title_link"]/@href
+    title_xpath: //article[contains(@class, "post")]//a[@class="post__title_link"]
+    content_xpath: //article[contains(@class, "post")]//div[contains(@class, "post__text")]
+    categories: it
+    timeout: 4.0
+    disabled: True
+    shortcut: habr
+
+  - name: hoogle
+    engine: json_engine
+    paging: True
+    search_url: https://www.haskell.org/hoogle/?mode=json&hoogle={query}&start={pageno}
+    results_query: results
+    url_query: location
+    title_query: self
+    content_query: docs
+    page_size: 20
+    categories: it
+    shortcut: ho
+
+  - name: ina
+    engine: ina
+    shortcut: in
+    timeout: 6.0
+    disabled: True
+
+  - name: kickass
+    engine: kickass
+    shortcut: kc
+    timeout: 4.0
+    disabled: True
+
+  - name: library genesis
+    engine: xpath
+    search_url: http://libgen.io/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: lobste.rs
+    engine: xpath
+    search_url: https://lobste.rs/search?utf8=%E2%9C%93&q={query}&what=stories&order=relevance
+    results_xpath: //li[contains(@class, "story")]
+    url_xpath: .//span[@class="link"]/a/@href
+    title_xpath: .//span[@class="link"]/a
+    content_xpath: .//a[@class="domain"]
+    categories: it
+    shortcut: lo
+
+  - name: microsoft academic
+    engine: microsoft_academic
+    categories: science
+    shortcut: ma
+
+  - name: mixcloud
+    engine: mixcloud
+    shortcut: mc
+
+  - name: nyaa
+    engine: nyaa
+    shortcut: nt
+    disabled: True
+
+  - name: acgsou
+    engine: acgsou
+    shortcut: acg
+    disabled: True
+    timeout: 5.0
+
+  - name: openairedatasets
+    engine: json_engine
+    paging: True
+    search_url: http://api.openaire.eu/search/datasets?format=json&page={pageno}&size=10&title={query}
+    results_query: response/results/result
+    url_query: metadata/oaf:entity/oaf:result/children/instance/webresource/url/$
+    title_query: metadata/oaf:entity/oaf:result/title/$
+    content_query: metadata/oaf:entity/oaf:result/description/$
+    categories: science
+    shortcut: oad
+    timeout: 5.0
+
+  - name: openairepublications
+    engine: json_engine
+    paging: True
+    search_url: http://api.openaire.eu/search/publications?format=json&page={pageno}&size=10&title={query}
+    results_query: response/results/result
+    url_query: metadata/oaf:entity/oaf:result/children/instance/webresource/url/$
+    title_query: metadata/oaf:entity/oaf:result/title/$
+    content_query: metadata/oaf:entity/oaf:result/description/$
+    categories: science
+    shortcut: oap
+    timeout: 5.0
+
+  - name: openstreetmap
+    engine: openstreetmap
+    shortcut: osm
+
+  - name: openrepos
+    engine: xpath
+    paging: True
+    search_url: https://openrepos.net/search/node/{query}?page={pageno}
+    url_xpath: //li[@class="search-result"]//h3[@class="title"]/a/@href
+    title_xpath: //li[@class="search-result"]//h3[@class="title"]/a
+    content_xpath: //li[@class="search-result"]//div[@class="search-snippet-info"]//p[@class="search-snippet"]
+    categories: files
+    timeout: 4.0
+    disabled: True
+    shortcut: or
+
+  - name: pdbe
+    engine: pdbe
+    shortcut: pdb
+  # Hide obsolete PDB entries.
+  # Default is not to hide obsolete structures
+  #    hide_obsolete : False
+
+  - name: photon
+    engine: photon
+    shortcut: ph
+
+  - name: piratebay
+    engine: piratebay
+    shortcut: tpb
+    url: https://pirateproxy.red/
+    timeout: 3.0
+
+  - name: pubmed
+    engine: pubmed
+    shortcut: pub
+    categories: science
+    timeout: 3.0
+
+  - name: qwant
+    engine: qwant
+    shortcut: qw
+    categories: general
+    disabled: True
+
+  - name: qwant images
+    engine: qwant
+    shortcut: qwi
+    categories: images
+
+  - name: qwant news
+    engine: qwant
+    shortcut: qwn
+    categories: news
+
+  - name: qwant social
+    engine: qwant
+    shortcut: qws
+    categories: social media
+
+  - name: reddit
+    engine: reddit
+    shortcut: re
+    page_size: 25
+    timeout: 10.0
+    disabled: True
+
+  - name: scanr structures
+    shortcut: scs
+    engine: scanr_structures
+    disabled: True
+
+  - name: soundcloud
+    engine: soundcloud
+    shortcut: sc
+
+  - name: stackoverflow
+    engine: stackoverflow
+    shortcut: st
+
+  - name: searchcode doc
+    engine: searchcode_doc
+    shortcut: scd
+
+  - name: searchcode code
+    engine: searchcode_code
+    shortcut: scc
+    disabled: True
+
+  - name: framalibre
+    engine: framalibre
+    shortcut: frl
+    disabled: True
+
+  #  - name : searx
+  #    engine : searx_engine
+  #    shortcut : se
+  #    instance_urls :
+  #        - http://127.0.0.1:8888/
+  #        - ...
+  #    disabled : True
+
+  - name: semantic scholar
+    engine: xpath
+    paging: True
+    search_url: https://www.semanticscholar.org/search?q={query}&sort=relevance&page={pageno}&ae=false
+    results_xpath: //article
+    url_xpath: .//div[@class="search-result-title"]/a/@href
+    title_xpath: .//div[@class="search-result-title"]/a
+    content_xpath: .//div[@class="search-result-abstract"]
+    shortcut: se
+    categories: science
+
+  - name: startpage
+    engine: startpage
+    shortcut: sp
+    timeout: 6.0
+    disabled: True
+  - name: tokyotoshokan
+    engine: tokyotoshokan
+    shortcut: tt
+    timeout: 6.0
+    disabled: True
+
+  - name: torrentz
+    engine: torrentz
+    shortcut: tor
+    url: https://torrentz2.eu/
+    timeout: 3.0
+
+  - name: twitter
+    engine: twitter
+    shortcut: tw
+
+  # maybe in a fun category
+  #  - name : uncyclopedia
+  #    engine : mediawiki
+  #    shortcut : unc
+  #    base_url : https://uncyclopedia.wikia.com/
+  #    number_of_results : 5
+
+  # tmp suspended - too slow, too many errors
+  #  - name : urbandictionary
+  #    engine        : xpath
+  #    search_url    : http://www.urbandictionary.com/define.php?term={query}
+  #    url_xpath     : //*[@class="word"]/@href
+  #    title_xpath   : //*[@class="def-header"]
+  #    content_xpath : //*[@class="meaning"]
+  #    shortcut : ud
+
+  - name: yahoo
+    engine: yahoo
+    shortcut: yh
+    disabled: True
+
+  - name: yandex
+    engine: yandex
+    shortcut: yn
+    disabled: True
+
+  - name: yahoo news
+    engine: yahoo_news
+    shortcut: yhn
+
+  - 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: dailymotion
+    engine: dailymotion
+    shortcut: dm
+
+  - name: vimeo
+    engine: vimeo
+    shortcut: vm
+
+  - name: wolframalpha
+    shortcut: wa
+    # You can use the engine using the official stable API, but you need an API key
+    # See : http://products.wolframalpha.com/api/
+    # engine : wolframalpha_api
+    # api_key: '' # required!
+    engine: wolframalpha_noapi
+    timeout: 6.0
+    categories: science
+
+  - name: seedpeer
+    engine: seedpeer
+    shortcut: speu
+    categories: files, music, videos
+    disabled: True
+
+  - name: dictzone
+    engine: dictzone
+    shortcut: dc
+
+  - name: mymemory translated
+    engine: translated
+    shortcut: tl
+    timeout: 5.0
+    disabled: True
+    # You can use without an API key, but you are limited to 1000 words/day
+    # See : http://mymemory.translated.net/doc/usagelimits.php
+    # api_key : ''
+
+  - name: voat
+    engine: xpath
+    shortcut: vo
+    categories: social media
+    search_url: https://searchvoat.co/?t={query}
+    url_xpath: //div[@class="entry"]/p/a[@class="title"]/@href
+    title_xpath: //div[@class="entry"]/p/a[@class="title"]
+    content_xpath: //div[@class="entry"]/p/span[@class="domain"]
+    timeout: 10.0
+    disabled: True
+
+  - name: 1337x
+    engine: 1337x
+    shortcut: 1337x
+    disabled: True
+
+  - name: Duden
+    engine: duden
+    shortcut: du
+    disabled: True
+
+  - name: seznam
+    shortcut: szn
+    engine: xpath
+    paging: True
+    search_url: https://search.seznam.cz/?q={query}&count=10&from={pageno}
+    results_xpath: //div[@class="Page-content"]//div[@class="Result "]
+    url_xpath: ./h3/a/@href
+    title_xpath: ./h3
+    content_xpath: .//p[@class="Result-description"]
+    first_page_num: 0
+    page_size: 10
+    disabled: True
+
+  - name: mojeek
+    shortcut: mjk
+    engine: xpath
+    paging: True
+    search_url: https://www.mojeek.com/search?q={query}&s={pageno}
+    results_xpath: /html/body//div[@class="results"]/ul[@class="results-standard"]/li
+    url_xpath: ./h2/a/@href
+    title_xpath: ./h2
+    content_xpath: ./p[@class="s"]
+    suggestion_xpath: /html/body//div[@class="top-info"]/p[@class="top-info spell"]/a
+    first_page_num: 1
+    page_size: 10
+    disabled: True
+
+#  - name : yacy
+#    engine : yacy
+#    shortcut : ya
+#    base_url : 'http://localhost:8090'
+#    number_of_results : 5
+#    timeout : 3.0
+
+# Doku engine lets you access to any Doku wiki instance:
+# A public one or a privete/corporate one.
+#  - name : ubuntuwiki
+#    engine : doku
+#    shortcut : uw
+#    base_url : 'http://doc.ubuntu-fr.org'
+
+locales:
+  en: English
+  ar: العَرَبِيَّة (Arabic)
+  bg: Български (Bulgarian)
+  ca: Català (Catalan)
+  cs: Čeština (Czech)
+  cy: Cymraeg (Welsh)
+  da: Dansk (Danish)
+  de: Deutsch (German)
+  el_GR: Ελληνικά (Greek_Greece)
+  eo: Esperanto (Esperanto)
+  es: Español (Spanish)
+  eu: Euskara (Basque)
+  fa_IR: (fārsī) فارسى (Persian)
+  fi: Suomi (Finnish)
+  fil: Wikang Filipino (Filipino)
+  fr: Français (French)
+  gl: Galego (Galician)
+  he: עברית (Hebrew)
+  hr: Hrvatski (Croatian)
+  hu: Magyar (Hungarian)
+  it: Italiano (Italian)
+  ja: 日本語 (Japanese)
+  nl: Nederlands (Dutch)
+  nl_BE: Vlaams (Dutch_Belgium)
+  pl: Polski (Polish)
+  pt: Português (Portuguese)
+  pt_BR: Português (Portuguese_Brazil)
+  ro: Română (Romanian)
+  ru: Русский (Russian)
+  sk: Slovenčina (Slovak)
+  sl: Slovenski (Slovene)
+  sr: српски (Serbian)
+  sv: Svenska (Swedish)
+  te: తెలుగు (telugu)
+  tr: Türkçe (Turkish)
+  uk: українська мова (Ukrainian)
+  vi: tiếng việt (㗂越)
+  zh: 中文 (Chinese)
+  zh_TW: 國語 (Taiwanese Mandarin)
+
+doi_resolvers:
+  oadoi.org: "https://oadoi.org/"
+  doi.org: "https://doi.org/"
+  doai.io: "http://doai.io/"
+  sci-hub.tw: "http://sci-hub.tw/"
+
+default_doi_resolver: "oadoi.org"

+ 49 - 0
ansible/roles/searx/files/searx.rc

@@ -0,0 +1,49 @@
+#!/bin/sh
+# $FreeBSD: branches/2020Q4/www/searx/files/searx.in 463944 2018-03-09 08:34:57Z yuri $
+
+# PROVIDE: searx
+# REQUIRE: DAEMON NETWORKING
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable searx:
+# searx_enable="YES"
+#
+# searx_enable (bool):	Set to YES to enable searx
+#				Default: NO
+# searx_conf (str):		searx configuration file
+#				Default: ${PREFIX}/etc/searx.conf
+# searx_user (str):		searx daemon user
+#				Default: searx
+# searx_group (str):		searx daemon group
+#				Default: searx
+# searx_flags (str):		Extra flags passed to searx
+
+. /etc/rc.subr
+
+name="searx"
+rcvar=searx_enable
+
+: ${searx_enable:="NO"}
+: ${searx_user:="www"}
+: ${searx_group:="www"}
+: ${searx_flags:=""}
+
+export SEARX_SETTINGS_FILE="/usr/local/etc/searx-settings.yml"
+# daemon
+pidfile="/var/run/${name}.pid"
+python="/usr/local/bin/python3.7"
+script_py="/usr/local/lib/python3.7/site-packages/${name}/webapp.py"
+command=/usr/sbin/daemon
+procname="daemon"
+command_args=" -c -f -P ${pidfile} ${python} ${script_py}"
+start_precmd="searx_precmd"
+
+searx_precmd()
+{
+    install -o ${searx_user} /dev/null ${pidfile}
+}
+
+load_rc_config $name
+run_rc_command "$1"
+

+ 15 - 0
ansible/roles/searx/handlers/main.yml

@@ -0,0 +1,15 @@
+
+- name: Filtron restarted
+  service:
+    name: filtron
+    state: restarted
+
+- name: Morty restarted
+  service:
+    name: morty
+    state: restarted
+
+- name: Searx restarted
+  service:
+    name: searx
+    state: restarted

+ 70 - 0
ansible/roles/searx/tasks/main.yml

@@ -0,0 +1,70 @@
+---
+- name: Package cache updated
+  shell: pkg update -f
+
+- name: Dependencies installed
+  pkgng:
+    name: "py37-pip filtron morty"
+    state: present
+
+- name: Searx installed
+  pip:
+    executable: pip
+    name: searx
+
+- name: Searx enabled
+  shell: sysrc searx_enable="YES"
+
+- name: Filtron enabled
+  shell: sysrc filtron_enable="YES"
+
+- name: Morty enabled
+  shell: sysrc morty_enable="YES"
+
+- name: Filtron rules installed
+  copy:
+    src: filtron-rules.json
+    dest: /usr/local/etc/filtron-rules.json
+    owner: root
+    mode: 0700
+  notify: Filtron restarted
+
+- name: Filtron rc script installed
+  copy:
+    src: filtron.rc
+    dest: /usr/local/etc/rc.d/filtron
+    owner: root
+    mode: 0700
+  notify: Filtron restarted
+
+- name: Searx settings installed
+  copy:
+    src: searx-settings.yml
+    dest: /usr/local/etc/searx-settings.yml
+    owner: root
+    mode: 0600
+  notify: Searx restarted
+
+- name: Searx rc script installed
+  copy:
+    src: searx.rc
+    dest: /usr/local/etc/rc.d/searx
+    owner: root
+    mode: 0700
+  notify: Searx restarted
+
+- name: Morty rc script installed
+  copy:
+    src: morty.rc
+    dest: /usr/local/etc/rc.d/morty
+    owner: root
+    mode: 0644
+  notify: Morty restarted
+
+- name: Morty rc script installed
+  copy:
+    src: morty.rc
+    dest: /usr/local/etc/rc.d/morty
+    owner: root
+    mode: 0644
+  notify: Morty restarted