1
0

change searxng role variable structure

This commit is contained in:
cuqmbr 2025-07-02 00:08:54 +03:00
parent 993fc0b1d0
commit 1a04e81df0
Signed by: cuqmbr
GPG Key ID: 1F62396D020F375C
7 changed files with 162 additions and 173 deletions

View File

@ -29,98 +29,90 @@ users:
opendoas_settings: "permit nopass ansible" opendoas_settings: "permit nopass ansible"
searxng_homedir: /opt/searxng
searxng_git_commit: 60be0f453e9e4a5fc48aeb4706e75af0a4047b36
searxng_settings: searxng_settings:
use_default_settings: true homedir: /opt/searxng
git_commit: 39c50dc013944a0a27b4354c23f406956ac45971
general: config:
debug: false use_default_settings: true
instance_name: "cuqmbr's SearXNG"
donation_url: "https://cuqmbr.xyz/en/donate"
contact_url: "https://cuqmbr.xyz/en/contact"
enable_metrics: true
search:
safe_search: 0
autocomplete: ""
formats:
- html
- csv
- json
server:
base_url: "https://searxng.dev.cuqmbr.xyz"
bind_address: "0.0.0.0"
port: 8888
secret_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
36303663616233326563336237336164383966613633373735363562346533663933393936643036
6237626332643263386530306139383866353739616261650a376236663962643962653335313237
38313232363839383030373338643666333135613838366363363565643530336331613464386236
3039376137306339310a346139613363303433366362336539316632346232636663346664336334
35346366376262316134636262393262386364356336376333383664313637366630376463303232
64383765663032616633346231653563613065653961646666346461613732646233363266373065
33326563383238613135616431323661373165383431646337653361633065626638313937393361
62303634643662313637
image_proxy: true
method: "POST"
default_http_headers:
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Robots-Tag: noindex, nofollow
Referrer-Policy: no-referrer
limiter: true
redis:
url: !vault |
$ANSIBLE_VAULT;1.1;AES256
66323631326264383161376136303730353336663065346235313464333237356436356566373233
3165633436383130383364303865666534313139666163640a316664653239373464366239343961
32653631323337633738626464633662313631636631623538376638656161356434633261383138
6163353138343135370a643034343837633534626237656263656138386135303661343837663166
38343839373564643964663630616230623962646164313732316631323263666231343931653634
66326234333163636331666230656530396262623037316136643534323338633630616134656464
36353633633065313666366331316238393134393035346232353462666161653162333632393233
62646332393065346434343636636131386136313938653539663865376661303238396563313633
38616138343337306233373733636634326334326635386361666662363834366166646337393266
34653739623364373135313638643938626635373362343966343664306661363334353061623434
36373135616561653133653066336464383737336134626337393261356630616532343233376264
62386135356263346562313034386334316532343038366435386564623038343634663033643963
62353363643163653763333335386235626666393434343136373832363566323730306134646130
37313163613733333835303363363932343264356662633262373661346463653936316162636332
33633237656362363938653735313834376537333532343039653038326563633063323965633463
37366662313263396637
ui:
static_use_hash: true
results_on_new_tab: true
categories_as_tabs:
general: general:
images: debug: false
videos: instance_name: "cuqmbr's SearXNG"
files: donation_url: "https://cuqmbr.xyz/en/donate"
contact_url: "https://cuqmbr.xyz/en/contact"
plugins: enable_metrics: true
searx.plugins.calculator.SXNGPlugin: search:
active: true safe_search: 0
searx.plugins.hash_plugin.SXNGPlugin: autocomplete: ""
active: true formats:
searx.plugins.self_info.SXNGPlugin: - html
active: true - csv
searx.plugins.tracker_url_remover.SXNGPlugin: - json
active: true server:
searx.plugins.unit_converter.SXNGPlugin: base_url: "https://searxng.dev.cuqmbr.xyz"
active: true bind_address: "0.0.0.0"
searx.plugins.ahmia_filter.SXNGPlugin: port: 8888
active: true secret_key: !vault |
searx.plugins.hostnames.SXNGPlugin: $ANSIBLE_VAULT;1.1;AES256
active: true 36303663616233326563336237336164383966613633373735363562346533663933393936643036
searx.plugins.tor_check.SXNGPlugin: 6237626332643263386530306139383866353739616261650a376236663962643962653335313237
active: true 38313232363839383030373338643666333135613838366363363565643530336331613464386236
3039376137306339310a346139613363303433366362336539316632346232636663346664336334
35346366376262316134636262393262386364356336376333383664313637366630376463303232
64383765663032616633346231653563613065653961646666346461613732646233363266373065
33326563383238613135616431323661373165383431646337653361633065626638313937393361
62303634643662313637
image_proxy: true
method: "POST"
default_http_headers:
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Robots-Tag: noindex, nofollow
Referrer-Policy: no-referrer
limiter: true
redis:
url: !vault |
$ANSIBLE_VAULT;1.1;AES256
66323631326264383161376136303730353336663065346235313464333237356436356566373233
3165633436383130383364303865666534313139666163640a316664653239373464366239343961
32653631323337633738626464633662313631636631623538376638656161356434633261383138
6163353138343135370a643034343837633534626237656263656138386135303661343837663166
38343839373564643964663630616230623962646164313732316631323263666231343931653634
66326234333163636331666230656530396262623037316136643534323338633630616134656464
36353633633065313666366331316238393134393035346232353462666161653162333632393233
62646332393065346434343636636131386136313938653539663865376661303238396563313633
38616138343337306233373733636634326334326635386361666662363834366166646337393266
34653739623364373135313638643938626635373362343966343664306661363334353061623434
36373135616561653133653066336464383737336134626337393261356630616532343233376264
62386135356263346562313034386334316532343038366435386564623038343634663033643963
62353363643163653763333335386235626666393434343136373832363566323730306134646130
37313163613733333835303363363932343264356662633262373661346463653936316162636332
33633237656362363938653735313834376537333532343039653038326563633063323965633463
37366662313263396637
ui:
static_use_hash: true
results_on_new_tab: true
categories_as_tabs:
general:
images:
videos:
files:
plugins:
searx.plugins.calculator.SXNGPlugin:
active: true
searx.plugins.hash_plugin.SXNGPlugin:
active: true
searx.plugins.self_info.SXNGPlugin:
active: true
searx.plugins.tracker_url_remover.SXNGPlugin:
active: true
searx.plugins.unit_converter.SXNGPlugin:
active: true
searx.plugins.ahmia_filter.SXNGPlugin:
active: true
searx.plugins.hostnames.SXNGPlugin:
active: true
searx.plugins.tor_check.SXNGPlugin:
active: true
fluentbit_settings: fluentbit_settings:

View File

@ -1,5 +1,7 @@
--- ---
forgejo_runner_settings:
forgejo_runner_default_settings: forgejo_runner_default_settings:
clean_binaries: false clean_binaries: false
force_register: false force_register: false

View File

@ -0,0 +1 @@
tasks/main.yml no-handler

View File

@ -1,49 +1,41 @@
--- ---
searxng_homedir: /opt/searxng
searxng_git_commit: c185d076894ebbdb5db921c448c240d04915847b
searxng_settings: searxng_settings:
# SearXNG settings
use_default_settings: true searxng_default_settings:
homedir: /opt/searxng
general: git_commit: c185d076894ebbdb5db921c448c240d04915847b
debug: false config:
instance_name: "cuqmbr's SearXNG" # SearXNG settings
use_default_settings: true
search: general:
safe_search: 2 debug: false
autocomplete: 'duckduckgo' instance_name: "cuqmbr's SearXNG"
search:
server: safe_search: 2
secret_key: "ultrasecretkey_change_me" autocomplete: 'duckduckgo'
limiter: false server:
image_proxy: true secret_key: "ultrasecretkey_change_me"
# public URL of the instance, to ensure correct inbound links. limiter: false
# Is overwritten by ${SEARXNG_URL}. image_proxy: true
base_url: http://example.com/location # public URL of the instance, to ensure correct inbound links.
# Is overwritten by ${SEARXNG_URL}.
# redis: base_url: http://example.com/location
# URL to connect redis database. Is overwritten by ${SEARXNG_REDIS_URL}. # redis:
# url: unix:///usr/local/searxng-redis/run/redis.sock?db=0 # URL to connect redis database. Is overwritten by ${SEARXNG_REDIS_URL}.
# url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
ui: ui:
static_use_hash: true static_use_hash: true
# preferences:
# preferences: # lock:
# lock: # - autocomplete
# - autocomplete # - method
# - method enabled_plugins:
- 'Hash plugin'
enabled_plugins: - 'Self Information'
- 'Hash plugin' - 'Tracker URL remover'
- 'Self Information' - 'Ahmia blacklist'
- 'Tracker URL remover' # - 'Hostnames plugin' # see 'hostnames' configuration below
- 'Ahmia blacklist' # - 'Open Access DOI rewrite'
# - 'Hostnames plugin' # see 'hostnames' configuration below # plugins:
# - 'Open Access DOI rewrite' # - only_show_green_results
# plugins:
# - only_show_green_results

View File

@ -10,3 +10,5 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw - /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host cgroupns_mode: host
privileged: true privileged: true
published_ports:
- 127.0.0.1:80:8888

View File

@ -1,5 +1,11 @@
--- ---
- name: Combine default and user settings, decrypt vault.
ansible.builtin.set_fact:
searxng_settings: "{{ searxng_default_settings |
ansible.builtin.combine(searxng_settings, recursive=true) }}"
no_log: true
- name: Install dependencies. - name: Install dependencies.
ansible.builtin.apt: ansible.builtin.apt:
name: name:
@ -23,14 +29,14 @@
password: ! password: !
system: true system: true
create_home: true create_home: true
home: "{{ searxng_homedir }}" home: "{{ searxng_settings.homedir }}"
shell: /usr/sbin/nologin shell: /usr/sbin/nologin
- name: Set searxng_source and searxng_pyenv variable. - name: Set searxng_source and searxng_pyenv variable.
ansible.builtin.set_fact: ansible.builtin.set_fact:
searxng_source: "{{ searxng_homedir }}/src" searxng_source: "{{ searxng_settings.homedir }}/src"
searxng_pyenv: "{{ searxng_homedir }}/pyenv" searxng_pyenv: "{{ searxng_settings.homedir }}/pyenv"
searxng_compiled: "{{ searxng_homedir }}/compiled" searxng_compiled: "{{ searxng_settings.homedir }}/compiled"
- name: Clone searxng git repository. - name: Clone searxng git repository.
ansible.builtin.git: ansible.builtin.git:
@ -38,7 +44,7 @@
repo: https://github.com/searxng/searxng.git repo: https://github.com/searxng/searxng.git
dest: "{{ searxng_source }}" dest: "{{ searxng_source }}"
depth: 1 depth: 1
version: "{{ searxng_git_commit }}" version: "{{ searxng_settings.git_commit }}"
force: true force: true
single_branch: true single_branch: true
register: git_clone_result register: git_clone_result
@ -54,35 +60,35 @@
- pyyaml - pyyaml
state: present state: present
- name: Remove searxng settings file.
ansible.builtin.file:
path: /etc/searxng/settings.yml
state: absent
when: git_clone_result.changed
- name: Compile searxng. - name: Compile searxng.
ansible.builtin.pip: when: git_clone_result.changed
virtualenv: "{{ searxng_pyenv }}" block:
requirements: "{{ searxng_source }}/requirements.txt" - name: Remove searxng settings file.
extra_args: "--use-pep517 --no-build-isolation \ ansible.builtin.file:
-e {{ searxng_source }}" path: /etc/searxng/settings.yml
state: present state: absent
- name: Remove old program files. - name: Compile searxng.
ansible.builtin.file: ansible.builtin.pip:
path: "{{ searxng_compiled }}" virtualenv: "{{ searxng_pyenv }}"
state: absent requirements: "{{ searxng_source }}/requirements.txt"
changed_when: false extra_args: "--use-pep517 --no-build-isolation \
-e {{ searxng_source }}"
state: present
- name: Install new program files. - name: Remove old program files.
ansible.builtin.copy: ansible.builtin.file:
remote_src: true path: "{{ searxng_compiled }}"
src: "{{ searxng_source }}/" state: absent
dest: "{{ searxng_compiled }}"
owner: searxng - name: Install new program files.
group: searxng ansible.builtin.copy:
mode: "0775" remote_src: true
changed_when: false src: "{{ searxng_source }}/"
dest: "{{ searxng_compiled }}"
owner: searxng
group: searxng
mode: "0775"
- name: Create searxng settings directory. - name: Create searxng settings directory.
ansible.builtin.file: ansible.builtin.file:
@ -92,12 +98,6 @@
mode: "0775" mode: "0775"
path: /etc/searxng path: /etc/searxng
- name: Decrypt secrets in settings file.
ansible.builtin.set_fact:
searxng_settings: >-
{{ searxng_settings | combine(searxng_settings, recursive=true) }}
no_log: true
- name: Install searxng settings file. - name: Install searxng settings file.
ansible.builtin.template: ansible.builtin.template:
src: settings.yml.j2 src: settings.yml.j2

View File

@ -1,4 +1,4 @@
--- ---
# Managed with Ansible # Managed with Ansible
{{ searxng_settings | ansible.builtin.to_nice_yaml(indent=2, width=80) }} {{ searxng_settings.config | ansible.builtin.to_nice_yaml(indent=2, width=80) }}