varaprasad-brainmage commited on
Commit
620aebf
·
1 Parent(s): 365fc54
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .coveragerc +11 -0
  2. .devcontainer/Dockerfile +4 -0
  3. .devcontainer/devcontainer.json +32 -0
  4. .dir-locals-template.el +163 -0
  5. .dockerignore +44 -0
  6. .editorconfig +49 -0
  7. .gitattributes +13 -35
  8. .github/ISSUE_TEMPLATE/bug-report.md +39 -0
  9. .github/ISSUE_TEMPLATE/config.yml +5 -0
  10. .github/ISSUE_TEMPLATE/engine-request.md +31 -0
  11. .github/ISSUE_TEMPLATE/feature-request.md +21 -0
  12. .github/dependabot.yml +22 -0
  13. .github/workflows/checker.yml +31 -0
  14. .github/workflows/data-update.yml +67 -0
  15. .github/workflows/integration.yml +179 -0
  16. .github/workflows/security.yml +28 -0
  17. .github/workflows/translations-update.yml +59 -0
  18. .gitignore +28 -0
  19. .nvmrc +1 -0
  20. .pylintrc +408 -0
  21. .tool-versions +4 -0
  22. .vscode/launch.json +23 -0
  23. .vscode/settings.json +11 -0
  24. .vscode/tasks.json +36 -0
  25. .weblate +3 -0
  26. .yamllint.yml +16 -0
  27. AUTHORS.rst +178 -0
  28. CHANGELOG.rst +14 -0
  29. CONTRIBUTING.md +49 -0
  30. Dockerfile +91 -0
  31. LICENSE +661 -0
  32. Makefile +102 -0
  33. PULL_REQUEST_TEMPLATE.md +25 -0
  34. README.rst +130 -0
  35. SECURITY.md +10 -0
  36. babel.cfg +6 -0
  37. client/simple/.gitignore +3 -0
  38. client/simple/.stylelintrc.json +17 -0
  39. client/simple/README.rst +24 -0
  40. client/simple/eslint.config.js +34 -0
  41. client/simple/generated/pygments.less +173 -0
  42. client/simple/package-lock.json +0 -0
  43. client/simple/package.json +40 -0
  44. client/simple/src/brand/img_load_error.svg +0 -0
  45. client/simple/src/brand/searxng-wordmark.svg +0 -0
  46. client/simple/src/brand/searxng.svg +0 -0
  47. client/simple/src/js/head/00_init.js +20 -0
  48. client/simple/src/js/main/00_toolkit.js +165 -0
  49. client/simple/src/js/main/infinite_scroll.js +88 -0
  50. client/simple/src/js/main/keyboard.js +461 -0
.coveragerc ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [run]
2
+ branch = True
3
+ source = searx
4
+
5
+ [report]
6
+ show_missing = True
7
+ exclude_lines =
8
+ if __name__ == .__main__.:
9
+
10
+ [html]
11
+ directory = coverage
.devcontainer/Dockerfile ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ FROM mcr.microsoft.com/devcontainers/base:debian
2
+
3
+ RUN apt-get update && \
4
+ apt-get -y install python3 python3-venv redis firefox-esr graphviz imagemagick librsvg2-bin fonts-dejavu shellcheck
.devcontainer/devcontainer.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "build": {
3
+ "dockerfile": "Dockerfile"
4
+ },
5
+ "features": {
6
+ "ghcr.io/devcontainers/features/github-cli": {},
7
+ "ghcr.io/devcontainers/features/docker-in-docker": {}
8
+ },
9
+ "customizations": {
10
+ "vscode": {
11
+ "extensions": [
12
+ "ms-python.python",
13
+ "ms-azuretools.vscode-docker"
14
+ ],
15
+ "remote.otherPortsAttributes": {
16
+ "protocol": "https"
17
+ },
18
+ "settings": {
19
+ "files.autoSave": "off",
20
+ "python.defaultInterpreterPath": "/workspaces/searxng/local/py3/bin/python3",
21
+ "python.formatting.blackPath": "/workspaces/searxng/local/py3/bin/black",
22
+ "python.linting.pylintPath": "/workspaces/searxng/local/py3/bin/pylint"
23
+ }
24
+ }
25
+ },
26
+ "forwardPorts": [8000, 8888],
27
+ "portsAttributes": {
28
+ "8000": {"label": "Sphinx documentation"},
29
+ "8888": {"label": "SearXNG"}
30
+ },
31
+ "postCreateCommand": "git pull && make install"
32
+ }
.dir-locals-template.el ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;;; .dir-locals.el
2
+ ;;
3
+ ;; Per-Directory Local Variables:
4
+ ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
5
+ ;;
6
+ ;; For full fledge developer tools install emacs packages:
7
+ ;;
8
+ ;; M-x package-install ...
9
+ ;;
10
+ ;; magit gitconfig
11
+ ;; nvm lsp-mode lsp-pyright lsp-eslint
12
+ ;; pyvenv pylint pip-requirements
13
+ ;; jinja2-mode
14
+ ;; json-mode
15
+ ;; company company-jedi company-quickhelp company-shell
16
+ ;; realgud
17
+ ;; sphinx-doc markdown-mode graphviz-dot-mode
18
+ ;; apache-mode nginx-mode
19
+ ;;
20
+ ;; To setup a developer environment, build target::
21
+ ;;
22
+ ;; $ make node.env.dev pyenv.install
23
+ ;;
24
+ ;; Some buffer locals are referencing the project environment:
25
+ ;;
26
+ ;; - prj-root --> <repo>/
27
+ ;; - nvm-dir --> <repo>/.nvm
28
+ ;; - python-environment-directory --> <repo>/local
29
+ ;; - python-environment-default-root-name --> py3
30
+ ;; - python-shell-virtualenv-root --> <repo>/local/py3
31
+ ;; When this variable is set with the path of the virtualenv to use,
32
+ ;; `process-environment' and `exec-path' get proper values in order to run
33
+ ;; shells inside the specified virtualenv, example::
34
+ ;; (setq python-shell-virtualenv-root "/path/to/env/")
35
+ ;; - python-shell-interpreter --> <repo>/local/py3/bin/python
36
+ ;;
37
+ ;; Python development:
38
+ ;;
39
+ ;; Jedi, flycheck & other python stuff should use the 'python-shell-interpreter'
40
+ ;; from the local py3 environment.
41
+ ;;
42
+
43
+ ((nil
44
+ . ((fill-column . 80)
45
+ (indent-tabs-mode . nil)
46
+ (eval . (progn
47
+
48
+ (add-to-list 'auto-mode-alist '("\\.html\\'" . jinja2-mode))
49
+
50
+ ;; project root folder is where the `.dir-locals.el' is located
51
+ (setq-local prj-root
52
+ (locate-dominating-file default-directory ".dir-locals.el"))
53
+
54
+ (setq-local python-environment-directory
55
+ (expand-file-name "./local" prj-root))
56
+
57
+ ;; to get in use of NVM environment, install https://github.com/rejeep/nvm.el
58
+ (setq-local nvm-dir (expand-file-name "./.nvm" prj-root))
59
+
60
+ ;; use nodejs from the (local) NVM environment (see nvm-dir)
61
+ (nvm-use-for-buffer)
62
+ (ignore-errors (require 'lsp))
63
+ (setq-local lsp-server-install-dir (car (cdr nvm-current-version)))
64
+ (setq-local lsp-enable-file-watchers nil)
65
+
66
+ ;; use 'py3' environment as default
67
+ (setq-local python-environment-default-root-name
68
+ "py3")
69
+
70
+ (setq-local python-shell-virtualenv-root
71
+ (expand-file-name
72
+ python-environment-default-root-name python-environment-directory))
73
+
74
+ (setq-local python-shell-interpreter
75
+ (expand-file-name
76
+ "bin/python" python-shell-virtualenv-root))))))
77
+ (makefile-gmake-mode
78
+ . ((indent-tabs-mode . t)))
79
+
80
+ (yaml-mode
81
+ . ((eval . (progn
82
+
83
+ ;; flycheck should use the local py3 environment
84
+ (setq-local flycheck-yaml-yamllint-executable
85
+ (expand-file-name "bin/yamllint" python-shell-virtualenv-root))
86
+
87
+ (setq-local flycheck-yamllintrc
88
+ (expand-file-name ".yamllint.yml" prj-root))
89
+
90
+ (flycheck-checker . yaml-yamllint)))))
91
+
92
+ (json-mode
93
+ . ((eval . (progn
94
+ (setq-local js-indent-level 4)
95
+ (flycheck-checker . json-python-json)))))
96
+
97
+ (js-mode
98
+ . ((eval . (progn
99
+ (ignore-errors (require 'lsp-eslint))
100
+ (setq-local js-indent-level 2)
101
+ ;; flycheck should use the eslint checker from developer tools
102
+ (setq-local flycheck-javascript-eslint-executable
103
+ (expand-file-name "node_modules/.bin/eslint" prj-root))
104
+ ;; (flycheck-mode)
105
+
106
+ (if (featurep 'lsp-eslint)
107
+ (lsp))
108
+ ))))
109
+
110
+ (python-mode
111
+ . ((eval . (progn
112
+ (ignore-errors (require 'jedi-core))
113
+ (ignore-errors (require 'lsp-pyright))
114
+ (ignore-errors (sphinx-doc-mode))
115
+ (setq-local python-environment-virtualenv
116
+ (list (expand-file-name "bin/virtualenv" python-shell-virtualenv-root)
117
+ ;;"--system-site-packages"
118
+ "--quiet"))
119
+
120
+ (setq-local pylint-command
121
+ (expand-file-name "bin/pylint" python-shell-virtualenv-root))
122
+
123
+ (if (featurep 'lsp-pyright)
124
+ (lsp))
125
+
126
+ ;; pylint will find the '.pylintrc' file next to the CWD
127
+ ;; https://pylint.readthedocs.io/en/latest/user_guide/run.html#command-line-options
128
+ (setq-local flycheck-pylintrc
129
+ ".pylintrc")
130
+
131
+ ;; flycheck & other python stuff should use the local py3 environment
132
+ (setq-local flycheck-python-pylint-executable
133
+ python-shell-interpreter)
134
+
135
+ ;; use 'M-x jedi:show-setup-info' and 'M-x epc:controller' to inspect jedi server
136
+ ;; https://tkf.github.io/emacs-jedi/latest/#jedi:environment-root -- You
137
+ ;; can specify a full path instead of a name (relative path). In that case,
138
+ ;; python-environment-directory is ignored and Python virtual environment
139
+ ;; is created at the specified path.
140
+ (setq-local jedi:environment-root
141
+ python-shell-virtualenv-root)
142
+
143
+ ;; https://tkf.github.io/emacs-jedi/latest/#jedi:server-command
144
+ (setq-local jedi:server-command
145
+ (list python-shell-interpreter
146
+ jedi:server-script))
147
+
148
+ ;; jedi:environment-virtualenv --> see above 'python-environment-virtualenv'
149
+ ;; is set buffer local! No need to setup jedi:environment-virtualenv:
150
+ ;;
151
+ ;; Virtualenv command to use. A list of string. If it is nil,
152
+ ;; python-environment-virtualenv is used instead. You must set non-nil
153
+ ;; value to jedi:environment-root in order to make this setting work.
154
+ ;;
155
+ ;; https://tkf.github.io/emacs-jedi/latest/#jedi:environment-virtualenv
156
+ ;;
157
+ ;; (setq-local jedi:environment-virtualenv
158
+ ;; (list (expand-file-name "bin/virtualenv" python-shell-virtualenv-root)
159
+ ;; "--python"
160
+ ;; "/usr/bin/python3.4"
161
+ ;; ))
162
+ ))))
163
+ )
.dockerignore ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *~
2
+ */*~
3
+ */*/*~
4
+ */*/*/*~
5
+ */*/*/*/*~
6
+
7
+ # Git
8
+ .git
9
+ .gitignore
10
+
11
+ # CI
12
+ .codeclimate.yml
13
+ .travis.yml
14
+ .taskcluster.yml
15
+
16
+ # Byte-compiled / optimized / DLL files
17
+ __pycache__/
18
+ */__pycache__/
19
+ */*/__pycache__/
20
+ */*/*/__pycache__/
21
+ *.py[cod]
22
+ */*.py[cod]
23
+ */*/*.py[cod]
24
+ */*/*/*.py[cod]
25
+
26
+ # node_modules
27
+ node_modules/
28
+ */node_modules/
29
+ */*/node_modules/
30
+ */*/*/node_modules/
31
+ */*/*/*/node_modules/
32
+
33
+ .tx/
34
+
35
+ # to sync with .gitignore
36
+ geckodriver.log
37
+ .coverage
38
+ coverage/
39
+ cache/
40
+ build/
41
+ dist/
42
+ local/
43
+ gh-pages/
44
+ *.egg-info/
.editorconfig ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://editorconfig.org/
2
+
3
+ root = true
4
+
5
+ [*]
6
+ indent_style = space
7
+ indent_size = 4
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+ end_of_line = lf
11
+ charset = utf-8
12
+
13
+ [*.py]
14
+ max_line_length = 119
15
+
16
+ [*.html]
17
+ indent_size = 4
18
+
19
+ [*.css]
20
+ indent_size = 2
21
+
22
+ [*.less]
23
+ indent_size = 2
24
+
25
+ [*.js]
26
+ indent_size = 2
27
+
28
+ [*.json]
29
+ indent_size = 2
30
+ insert_final_newline = ignore
31
+
32
+ # Minified JavaScript files shouldn't be changed
33
+ [**.min.js]
34
+ indent_style = ignore
35
+ insert_final_newline = ignore
36
+
37
+ # Makefiles always use tabs for indentation
38
+ [Makefile]
39
+ indent_style = tab
40
+
41
+ # Batch files use tabs for indentation
42
+ [*.bat]
43
+ indent_style = tab
44
+
45
+ [docs/**.rst]
46
+ max_line_length = 79
47
+
48
+ [*.yml]
49
+ indent_size = 2
.gitattributes CHANGED
@@ -1,35 +1,13 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.gif -diff
2
+ *.png -diff
3
+ *.min.css -diff
4
+ *.min.js -diff
5
+ *.css.map -diff
6
+ *.js.map -diff
7
+ *.eot -diff
8
+ *.svg -diff
9
+ *.ttf -diff
10
+ *.woff -diff
11
+ *.woff2 -diff
12
+ messages.mo -diff
13
+ searx/data/lid.176.ftz filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/ISSUE_TEMPLATE/bug-report.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug in SearXNG
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+ <!-- PLEASE FILL THESE FIELDS, IT REALLY HELPS THE MAINTAINERS OF SearXNG -->
10
+
11
+ **Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
12
+ <!-- If you are running on master branch using git execute this command
13
+ in order to fetch the latest commit ID:
14
+ ```
15
+ git log -1
16
+ ```
17
+ If you are using searxng-docker then look at the bottom of the SearXNG page
18
+ and check for the version after "Powered by SearXNG"
19
+
20
+ Please also stipulate if you are using a forked version of SearXNG and
21
+ include a link to the fork source code.
22
+ -->
23
+ **How did you install SearXNG?**
24
+ <!-- Did you install SearXNG using the official wiki or using searxng-docker
25
+ or manually by executing the searx/webapp.py file? -->
26
+ **What happened?**
27
+ <!-- A clear and concise description of what the bug is. -->
28
+
29
+ **How To Reproduce**
30
+ <!-- How can we reproduce this issue? (as minimally and as precisely as possible) -->
31
+
32
+ **Expected behavior**
33
+ <!-- A clear and concise description of what you expected to happen. -->
34
+
35
+ **Screenshots & Logs**
36
+ <!-- If applicable, add screenshots, logs to help explain your problem. -->
37
+
38
+ **Additional context**
39
+ <!-- Add any other context about the problem here. -->
.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Questions & Answers (Q&A)
4
+ url: https://github.com/searxng/searxng/discussions/categories/q-a
5
+ about: Ask questions and find answers
.github/ISSUE_TEMPLATE/engine-request.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Engine request
3
+ about: Request a new engine in SearXNG
4
+ title: ''
5
+ labels: enhancement, engine request
6
+ assignees: ''
7
+
8
+ ---
9
+ <!-- PLEASE FILL THESE FIELDS, IT REALLY HELPS THE MAINTAINERS OF SearXNG -->
10
+
11
+ **Working URL to the engine**
12
+ <!-- Please check if the engine is responding correctly before submitting it. -->
13
+
14
+ **Why do you want to add this engine?**
15
+ <!-- What's special about this engine? Is it open source or libre? -->
16
+
17
+ **Features of this engine**
18
+ <!-- Features of this engine: Doesn't track its users, fast, easy to integrate, ... -->
19
+
20
+ **How can SearXNG fetch the information from this engine?**
21
+ <!-- List API URL, example code (using the correct markdown) and more
22
+ that could be useful for the developers in order to implement this engine.
23
+ If you don't know what to write, let this part blank. -->
24
+
25
+ **Applicable category of this engine**
26
+ <!-- Where should this new engine fit in SearXNG? Current categories in SearXNG:
27
+ general, files, images, it, map, music, news, science, social media and videos.
28
+ You can add multiple categories at the same time. -->
29
+
30
+ **Additional context**
31
+ <!-- Add any other context about this engine here. -->
.github/ISSUE_TEMPLATE/feature-request.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Feature request
3
+ about: Request a new feature in SearXNG
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+
8
+ ---
9
+ <!-- PLEASE FILL THESE FIELDS, IT REALLY HELPS THE MAINTAINERS OF SearXNG -->
10
+
11
+ **Is your feature request related to a problem? Please describe.**
12
+ <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
13
+
14
+ **Describe the solution you'd like**
15
+ <!-- A clear and concise description of what you want to happen. -->
16
+
17
+ **Describe alternatives you've considered**
18
+ <!-- A clear and concise description of any alternative solutions or features you've considered. -->
19
+
20
+ **Additional context**
21
+ <!-- Add any other context or screenshots about the feature request here. -->
.github/dependabot.yml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "friday"
9
+ open-pull-requests-limit: 5
10
+ target-branch: "master"
11
+ commit-message:
12
+ prefix: "[upd] pypi:"
13
+
14
+ - package-ecosystem: "npm"
15
+ directory: "/client/simple"
16
+ schedule:
17
+ interval: "weekly"
18
+ day: "friday"
19
+ open-pull-requests-limit: 5
20
+ target-branch: "master"
21
+ commit-message:
22
+ prefix: "[upd] web-client (simple):"
.github/workflows/checker.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Checker"
2
+ on: # yamllint disable-line rule:truthy
3
+ schedule:
4
+ - cron: "0 4 * * 5"
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ checker:
9
+ name: Checker
10
+ runs-on: ubuntu-24.04
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Install Ubuntu packages
16
+ run: |
17
+ sudo ./utils/searxng.sh install packages
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: '3.13'
23
+ architecture: 'x64'
24
+
25
+ - name: Install Python dependencies
26
+ run: |
27
+ make V=1 install
28
+
29
+ - name: Checker
30
+ run: |
31
+ make search.checker
.github/workflows/data-update.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Update searx.data"
2
+ on: # yamllint disable-line rule:truthy
3
+ schedule:
4
+ - cron: "59 23 28 * *"
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ updateData:
9
+ name: Update data - ${{ matrix.fetch }}
10
+ runs-on: ubuntu-24.04
11
+ if: ${{ github.repository_owner == 'searxng'}}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ fetch:
16
+ - update_ahmia_blacklist.py
17
+ - update_currencies.py
18
+ - update_external_bangs.py
19
+ - update_firefox_version.py
20
+ - update_engine_traits.py
21
+ - update_wikidata_units.py
22
+ - update_engine_descriptions.py
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Install Ubuntu packages
28
+ run: |
29
+ sudo ./utils/searxng.sh install packages
30
+
31
+ - name: Set up Python
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: '3.12'
35
+ architecture: 'x64'
36
+
37
+ - name: Install Python dependencies
38
+ run: |
39
+ make V=1 install
40
+
41
+ - name: Fetch data
42
+ env:
43
+ FETCH_SCRIPT: ./searxng_extra/update/${{ matrix.fetch }}
44
+ run: |
45
+ V=1 ./manage pyenv.cmd python "$FETCH_SCRIPT"
46
+
47
+ - name: Create Pull Request
48
+ id: cpr
49
+ uses: peter-evans/create-pull-request@v6
50
+ with:
51
+ commit-message: '[data] update searx.data - ${{ matrix.fetch }}'
52
+ committer: searxng-bot <noreply@github.com>
53
+ author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
54
+ signoff: false
55
+ branch: update_data_${{ matrix.fetch }}
56
+ delete-branch: true
57
+ draft: false
58
+ title: '[data] update searx.data - ${{ matrix.fetch }}'
59
+ body: |
60
+ update searx.data - ${{ matrix.fetch }}
61
+ labels: |
62
+ data
63
+
64
+ - name: Check outputs
65
+ run: |
66
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
67
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
.github/workflows/integration.yml ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Integration
2
+
3
+ on: # yamllint disable-line rule:truthy
4
+ push:
5
+ branches: ["master"]
6
+ pull_request:
7
+ branches: ["master"]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ python:
14
+ name: Python ${{ matrix.python-version }}
15
+ runs-on: ubuntu-24.04
16
+ strategy:
17
+ matrix:
18
+ os: [ubuntu-24.04]
19
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+ - name: Install Ubuntu packages
24
+ run: |
25
+ sudo ./utils/searxng.sh install packages
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ architecture: 'x64'
31
+ - name: Run tests
32
+ run: make V=1 ci.test
33
+
34
+ themes:
35
+ name: Themes
36
+ runs-on: ubuntu-24.04
37
+ steps:
38
+ - name: Checkout
39
+ uses: actions/checkout@v4
40
+ - name: Install Ubuntu packages
41
+ run: sudo ./utils/searxng.sh install buildhost
42
+ - name: Set up Python
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: '3.12'
46
+ architecture: 'x64'
47
+ - name: Build themes
48
+ run: make themes.all
49
+
50
+ documentation:
51
+ name: Documentation
52
+ runs-on: ubuntu-24.04
53
+ permissions:
54
+ contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
55
+ steps:
56
+ - name: Checkout
57
+ uses: actions/checkout@v4
58
+ with:
59
+ fetch-depth: '0'
60
+ persist-credentials: false
61
+ - name: Install Ubuntu packages
62
+ run: sudo ./utils/searxng.sh install buildhost
63
+ - name: Set up Python
64
+ uses: actions/setup-python@v5
65
+ with:
66
+ python-version: '3.12'
67
+ architecture: 'x64'
68
+ - name: Cache Python dependencies
69
+ id: cache-python
70
+ uses: actions/cache@v4
71
+ with:
72
+ path: |
73
+ ./local
74
+ ./.nvm
75
+ ./node_modules
76
+ key: python-ubuntu-24.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
77
+ - name: Build documentation
78
+ run: |
79
+ make V=1 docs.clean docs.html
80
+ - name: Deploy
81
+ if: github.ref == 'refs/heads/master'
82
+ uses: JamesIves/github-pages-deploy-action@3.7.1
83
+ with:
84
+ GITHUB_TOKEN: ${{ github.token }}
85
+ BRANCH: gh-pages
86
+ FOLDER: dist/docs
87
+ CLEAN: true # Automatically remove deleted files from the deploy branch
88
+ SINGLE_COMMIT: true
89
+ COMMIT_MESSAGE: '[doc] build from commit ${{ github.sha }}'
90
+
91
+ babel:
92
+ name: Update translations branch
93
+ runs-on: ubuntu-24.04
94
+ if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
95
+ needs:
96
+ - python
97
+ - themes
98
+ - documentation
99
+ permissions:
100
+ contents: write # for make V=1 weblate.push.translations
101
+ steps:
102
+ - name: Checkout
103
+ uses: actions/checkout@v4
104
+ with:
105
+ fetch-depth: '0'
106
+ token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
107
+ - name: Set up Python
108
+ uses: actions/setup-python@v5
109
+ with:
110
+ python-version: '3.12'
111
+ architecture: 'x64'
112
+ - name: Cache Python dependencies
113
+ id: cache-python
114
+ uses: actions/cache@v4
115
+ with:
116
+ path: |
117
+ ./local
118
+ ./.nvm
119
+ ./node_modules
120
+ key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
121
+ - name: weblate & git setup
122
+ env:
123
+ WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
124
+ run: |
125
+ mkdir -p ~/.config
126
+ echo "${WEBLATE_CONFIG}" > ~/.config/weblate
127
+ git config --global user.email "searxng-bot@users.noreply.github.com"
128
+ git config --global user.name "searxng-bot"
129
+ - name: Update transations
130
+ id: update
131
+ run: |
132
+ make V=1 weblate.push.translations
133
+
134
+ dockers:
135
+ name: Docker
136
+ if: github.ref == 'refs/heads/master'
137
+ needs:
138
+ - python
139
+ - themes
140
+ - documentation
141
+ env:
142
+ DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
143
+ runs-on: ubuntu-24.04
144
+ steps:
145
+ - name: Checkout
146
+ if: env.DOCKERHUB_USERNAME != null
147
+ uses: actions/checkout@v4
148
+ with:
149
+ # make sure "make docker.push" can get the git history
150
+ fetch-depth: '0'
151
+ - name: Set up Python
152
+ uses: actions/setup-python@v5
153
+ with:
154
+ python-version: '3.12'
155
+ architecture: 'x64'
156
+ - name: Cache Python dependencies
157
+ id: cache-python
158
+ uses: actions/cache@v4
159
+ with:
160
+ path: |
161
+ ./local
162
+ ./.nvm
163
+ ./node_modules
164
+ key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
165
+ - name: Set up QEMU
166
+ if: env.DOCKERHUB_USERNAME != null
167
+ uses: docker/setup-qemu-action@v1
168
+ - name: Set up Docker Buildx
169
+ if: env.DOCKERHUB_USERNAME != null
170
+ uses: docker/setup-buildx-action@v1
171
+ - name: Login to DockerHub
172
+ if: env.DOCKERHUB_USERNAME != null
173
+ uses: docker/login-action@v1
174
+ with:
175
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
176
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
177
+ - name: Build and push
178
+ if: env.DOCKERHUB_USERNAME != null
179
+ run: make -e GIT_URL=$(git remote get-url origin) docker.buildx
.github/workflows/security.yml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Security checks"
2
+ on: # yamllint disable-line rule:truthy
3
+ schedule:
4
+ - cron: "42 05 * * *"
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ dockers:
9
+ name: Trivy ${{ matrix.image }}
10
+ runs-on: ubuntu-24.04
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Run Trivy vulnerability scanner
16
+ uses: aquasecurity/trivy-action@master
17
+ with:
18
+ image-ref: 'searxng/searxng:latest'
19
+ ignore-unfixed: false
20
+ vuln-type: 'os,library'
21
+ severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL'
22
+ format: 'sarif'
23
+ output: 'trivy-results.sarif'
24
+
25
+ - name: Upload Trivy scan results to GitHub Security tab
26
+ uses: github/codeql-action/upload-sarif@v2
27
+ with:
28
+ sarif_file: 'trivy-results.sarif'
.github/workflows/translations-update.yml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Update translations"
2
+ on: # yamllint disable-line rule:truthy
3
+ schedule:
4
+ - cron: "05 07 * * 5"
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ babel:
9
+ name: "create PR for additions from weblate"
10
+ runs-on: ubuntu-24.04
11
+ if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: '0'
17
+ token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.12'
22
+ architecture: 'x64'
23
+ - name: Cache Python dependencies
24
+ id: cache-python
25
+ uses: actions/cache@v4
26
+ with:
27
+ path: |
28
+ ./local
29
+ ./.nvm
30
+ ./node_modules
31
+ key: python-ubuntu-24.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
32
+ - name: weblate & git setup
33
+ env:
34
+ WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
35
+ run: |
36
+ mkdir -p ~/.config
37
+ echo "${WEBLATE_CONFIG}" > ~/.config/weblate
38
+ git config --global user.email "searxng-bot@users.noreply.github.com"
39
+ git config --global user.name "searxng-bot"
40
+ - name: Merge and push transation updates
41
+ run: |
42
+ make V=1 weblate.translations.commit
43
+ - name: Create Pull Request
44
+ id: cpr
45
+ uses: peter-evans/create-pull-request@v3
46
+ with:
47
+ token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
48
+ commit-message: '[l10n] update translations from Weblate'
49
+ committer: searxng-bot <searxng-bot@users.noreply.github.com>
50
+ author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
51
+ signoff: false
52
+ branch: translations_update
53
+ delete-branch: true
54
+ draft: false
55
+ title: '[l10n] update translations from Weblate'
56
+ body: |
57
+ update translations from Weblate
58
+ labels: |
59
+ translation
.gitignore ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # to sync with .dockerignore & pyrightconfig.json
2
+
3
+ *.pyc
4
+ */*.pyc
5
+ *~
6
+ *.swp
7
+ geckodriver.log
8
+
9
+ .coverage
10
+ coverage/
11
+
12
+ .nvm/
13
+ cache/
14
+ build/
15
+ dist/
16
+ local/
17
+ gh-pages/
18
+ *.egg-info/
19
+
20
+ /package-lock.json
21
+ /node_modules/
22
+
23
+ .idea/
24
+
25
+ searx/version_frozen.py
26
+ .dir-locals.el
27
+
28
+ .python-version
.nvmrc ADDED
@@ -0,0 +1 @@
 
 
1
+ v23.5
.pylintrc ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8; mode: conf-unix -*-
2
+ # lint Python modules using external checkers.
3
+ #
4
+ # This is the main checker controlling the other ones and the reports
5
+ # generation. It is itself both a raw checker and an astng checker in order
6
+ # to:
7
+ # * handle message activation / deactivation at the module level
8
+ # * handle some basic but necessary stats'data (number of classes, methods...)
9
+ #
10
+ [MASTER]
11
+
12
+ # A comma-separated list of package or module names from where C extensions may
13
+ # be loaded. Extensions are loading into the active Python interpreter and may
14
+ # run arbitrary code
15
+ extension-pkg-whitelist=lxml.etree
16
+
17
+ # Add files or directories to the blacklist. They should be base names, not
18
+ # paths.
19
+ ignore=CVS, .git, .svn
20
+
21
+ # Add files or directories matching the regex patterns to the blacklist. The
22
+ # regex matches against base names, not paths.
23
+ ignore-patterns=
24
+
25
+ # Python code to execute, usually for sys.path manipulation such as
26
+ # pygtk.require().
27
+ #init-hook=
28
+
29
+ # Use multiple processes to speed up Pylint.
30
+ jobs=0
31
+
32
+ # List of plugins (as comma separated values of python modules names) to load,
33
+ # usually to register additional checkers.
34
+ load-plugins=
35
+
36
+ # Pickle collected data for later comparisons.
37
+ persistent=yes
38
+
39
+ # Specify a configuration file.
40
+ #rcfile=
41
+
42
+ # Allow loading of arbitrary C extensions. Extensions are imported into the
43
+ # active Python interpreter and may run arbitrary code.
44
+ unsafe-load-any-extension=no
45
+
46
+
47
+ [MESSAGES CONTROL]
48
+
49
+ # Only show warnings with the listed confidence levels. Leave empty to show
50
+ # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
51
+ confidence=
52
+
53
+ # Disable the message, report, category or checker with the given id(s). You
54
+ # can either give multiple identifiers separated by comma (,) or put this
55
+ # option multiple times (only on the command line, not in the configuration
56
+ # file where it should appear only once).You can also use "--disable=all" to
57
+ # disable everything first and then reenable specific checks. For example, if
58
+ # you want to run only the similarities checker, you can use "--disable=all
59
+ # --enable=similarities". If you want to run only the classes checker, but have
60
+ # no Warning level messages displayed, use"--disable=all --enable=classes
61
+ # --disable=W"
62
+ disable=duplicate-code,
63
+ missing-function-docstring,
64
+ consider-using-f-string,
65
+
66
+ # Enable the message, report, category or checker with the given id(s). You can
67
+ # either give multiple identifier separated by comma (,) or put this option
68
+ # multiple time (only on the command line, not in the configuration file where
69
+ # it should appear only once). See also the "--disable" option for examples.
70
+ enable=
71
+
72
+
73
+ [REPORTS]
74
+
75
+ # Python expression which should return a note less than 10 (10 is the highest
76
+ # note). You have access to the variables errors warning, statement which
77
+ # respectively contain the number of errors / warnings messages and the total
78
+ # number of statements analyzed. This is used by the global evaluation report
79
+ # (RP0004).
80
+ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
81
+
82
+ # Template used to display messages. This is a python new-style format string
83
+ # used to format the message information. See doc for all details
84
+
85
+ # HINT: do not set this here, use argument --msg-template=...
86
+ #msg-template={path}:{line}: [{msg_id}({symbol}),{obj}] {msg}
87
+
88
+ # Set the output format. Available formats are text, parseable, colorized, json
89
+ # and msvs (visual studio).You can also give a reporter class, eg
90
+ # mypackage.mymodule.MyReporterClass.
91
+
92
+ # HINT: do not set this here, use argument --output-format=...
93
+ #output-format=text
94
+
95
+ # Tells whether to display a full report or only the messages
96
+ reports=no
97
+
98
+ # Activate the evaluation score.
99
+ score=yes
100
+
101
+
102
+ [REFACTORING]
103
+
104
+ # Maximum number of nested blocks for function / method body
105
+ max-nested-blocks=5
106
+
107
+
108
+ [BASIC]
109
+
110
+ # Regular expression matching correct argument names
111
+ argument-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*))$
112
+
113
+ # Regular expression matching correct attribute names
114
+ attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*)|([A-Z0-9_]*))$
115
+
116
+ # Bad variable names which should always be refused, separated by a comma
117
+ bad-names=foo,bar,baz,toto,tutu,tata
118
+
119
+ # Regular expression matching correct class attribute names
120
+ class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
121
+
122
+ # Regular expression matching correct class names
123
+ class-rgx=[A-Z_][a-zA-Z0-9]+$
124
+
125
+ # Regular expression matching correct constant names
126
+ const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$
127
+ #const-rgx=[f]?[A-Z_][a-zA-Z0-9_]{2,30}$
128
+
129
+ # Minimum line length for functions/classes that require docstrings, shorter
130
+ # ones are exempt.
131
+ docstring-min-length=-1
132
+
133
+ # Regular expression matching correct function names
134
+ function-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*))$
135
+
136
+ # Good variable names which should always be accepted, separated by a comma
137
+ good-names=i,j,k,ex,Run,_,log,cfg,id
138
+
139
+ # Include a hint for the correct naming format with invalid-name
140
+ include-naming-hint=no
141
+
142
+ # Regular expression matching correct inline iteration names
143
+ inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
144
+
145
+ # Regular expression matching correct method names
146
+ method-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*))$
147
+
148
+ # Regular expression matching correct module names
149
+ #module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
150
+ module-rgx=([a-z_][a-z0-9_]*)$
151
+
152
+ # Colon-delimited sets of names that determine each other's naming style when
153
+ # the name regexes allow several styles.
154
+ name-group=
155
+
156
+ # Regular expression which should only match function or class names that do
157
+ # not require a docstring.
158
+ no-docstring-rgx=^_
159
+
160
+ # List of decorators that produce properties, such as abc.abstractproperty. Add
161
+ # to this list to register other decorators that produce valid properties.
162
+ property-classes=abc.abstractproperty
163
+
164
+ # Regular expression matching correct variable names
165
+ variable-rgx=(([a-z][a-zA-Z0-9_]{2,30})|(_[a-z0-9_]*)|([a-z]))$
166
+
167
+
168
+ [FORMAT]
169
+
170
+ # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
171
+ expected-line-ending-format=
172
+
173
+ # Regexp for a line that is allowed to be longer than the limit.
174
+ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
175
+
176
+ # Number of spaces of indent required inside a hanging or continued line.
177
+ indent-after-paren=4
178
+
179
+ # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
180
+ # tab).
181
+ indent-string=' '
182
+
183
+ # Maximum number of characters on a single line.
184
+ max-line-length=120
185
+
186
+ # Maximum number of lines in a module
187
+ max-module-lines=2000
188
+
189
+ # Allow the body of a class to be on the same line as the declaration if body
190
+ # contains single statement.No config file found, using default configuration
191
+
192
+ single-line-class-stmt=no
193
+
194
+ # Allow the body of an if to be on the same line as the test if there is no
195
+ # else.
196
+ single-line-if-stmt=no
197
+
198
+
199
+ [LOGGING]
200
+
201
+ # Logging modules to check that the string format arguments are in logging
202
+ # function parameter format
203
+ logging-modules=logging
204
+
205
+
206
+ [MISCELLANEOUS]
207
+
208
+ # List of note tags to take in consideration, separated by a comma.
209
+ notes=FIXME,XXX,TODO
210
+
211
+
212
+ [SIMILARITIES]
213
+
214
+ # Ignore comments when computing similarities.
215
+ ignore-comments=yes
216
+
217
+ # Ignore docstrings when computing similarities.
218
+ ignore-docstrings=yes
219
+
220
+ # Ignore imports when computing similarities.
221
+ ignore-imports=no
222
+
223
+ # Minimum lines number of a similarity.
224
+ min-similarity-lines=4
225
+
226
+
227
+ [SPELLING]
228
+
229
+ # Spelling dictionary name. Available dictionaries: none. To make it working
230
+ # install python-enchant package.
231
+ spelling-dict=
232
+
233
+ # List of comma separated words that should not be checked.
234
+ spelling-ignore-words=
235
+
236
+ # A path to a file that contains private dictionary; one word per line.
237
+ spelling-private-dict-file=
238
+
239
+ # Tells whether to store unknown words to indicated private dictionary in
240
+ # --spelling-private-dict-file option instead of raising a message.
241
+ spelling-store-unknown-words=no
242
+
243
+
244
+ [TYPECHECK]
245
+
246
+ # List of decorators that produce context managers, such as
247
+ # contextlib.contextmanager. Add to this list to register other decorators that
248
+ # produce valid context managers.
249
+ contextmanager-decorators=contextlib.contextmanager
250
+
251
+ # List of members which are set dynamically and missed by pylint inference
252
+ # system, and so shouldn't trigger E1101 when accessed. Python regular
253
+ # expressions are accepted.
254
+ generated-members=
255
+
256
+ # Tells whether missing members accessed in mixin class should be ignored. A
257
+ # mixin class is detected if its name ends with "mixin" (case insensitive).
258
+ ignore-mixin-members=yes
259
+
260
+ # This flag controls whether pylint should warn about no-member and similar
261
+ # checks whenever an opaque object is returned when inferring. The inference
262
+ # can return multiple potential results while evaluating a Python object, but
263
+ # some branches might not be evaluated, which results in partial inference. In
264
+ # that case, it might be useful to still emit no-member and other checks for
265
+ # the rest of the inferred objects.
266
+ ignore-on-opaque-inference=yes
267
+
268
+ # List of class names for which member attributes should not be checked (useful
269
+ # for classes with dynamically set attributes). This supports the use of
270
+ # qualified names.
271
+ ignored-classes=optparse.Values,thread._local,_thread._local
272
+
273
+ # List of module names for which member attributes should not be checked
274
+ # (useful for modules/projects where namespaces are manipulated during runtime
275
+ # and thus existing member attributes cannot be deduced by static analysis. It
276
+ # supports qualified module names, as well as Unix pattern matching.
277
+ ignored-modules=
278
+
279
+ # Show a hint with possible names when a member name was not found. The aspect
280
+ # of finding the hint is based on edit distance.
281
+ missing-member-hint=yes
282
+
283
+ # The minimum edit distance a name should have in order to be considered a
284
+ # similar match for a missing member name.
285
+ missing-member-hint-distance=1
286
+
287
+ # The total number of similar names that should be taken in consideration when
288
+ # showing a hint for a missing member.
289
+ missing-member-max-choices=1
290
+
291
+
292
+ [VARIABLES]
293
+
294
+ # List of additional names supposed to be defined in builtins. Remember that
295
+ # you should avoid to define new builtins when possible.
296
+ additional-builtins=
297
+
298
+ # Tells whether unused global variables should be treated as a violation.
299
+ allow-global-unused-variables=yes
300
+
301
+ # List of strings which can identify a callback function by name. A callback
302
+ # name must start or end with one of those strings.
303
+ callbacks=cb_,_cb
304
+
305
+ # A regular expression matching the name of dummy variables (i.e. expectedly
306
+ # not used).
307
+ dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
308
+
309
+ # Argument names that match this expression will be ignored. Default to name
310
+ # with leading underscore
311
+ ignored-argument-names=_.*|^ignored_|^unused_
312
+
313
+ # Tells whether we should check for unused import in __init__ files.
314
+ init-import=no
315
+
316
+ # List of qualified module names which can have objects that can redefine
317
+ # builtins.
318
+ redefining-builtins-modules=six.moves,future.builtins
319
+
320
+
321
+ [CLASSES]
322
+
323
+ # List of method names used to declare (i.e. assign) instance attributes.
324
+ defining-attr-methods=__init__,__new__,setUp
325
+
326
+ # List of member names, which should be excluded from the protected access
327
+ # warning.
328
+ exclude-protected=_asdict,_fields,_replace,_source,_make
329
+
330
+ # List of valid names for the first argument in a class method.
331
+ valid-classmethod-first-arg=cls
332
+
333
+ # List of valid names for the first argument in a metaclass class method.
334
+ valid-metaclass-classmethod-first-arg=mcs
335
+
336
+
337
+ [DESIGN]
338
+
339
+ # Maximum number of arguments for function / method
340
+ max-args=8
341
+ max-positional-arguments=14
342
+
343
+ # Maximum number of attributes for a class (see R0902).
344
+ max-attributes=20
345
+
346
+ # Maximum number of boolean expressions in a if statement
347
+ max-bool-expr=5
348
+
349
+ # Maximum number of branch for function / method body
350
+ max-branches=12
351
+
352
+ # Maximum number of locals for function / method body
353
+ max-locals=20
354
+
355
+ # Maximum number of parents for a class (see R0901).
356
+ max-parents=7
357
+
358
+ # Maximum number of public methods for a class (see R0904).
359
+ max-public-methods=20
360
+
361
+ # Maximum number of return / yield for function / method body
362
+ max-returns=6
363
+
364
+ # Maximum number of statements in function / method body
365
+ max-statements=50
366
+
367
+ # Minimum number of public methods for a class (see R0903).
368
+ min-public-methods=2
369
+
370
+
371
+ [IMPORTS]
372
+
373
+ # Allow wildcard imports from modules that define __all__.
374
+ allow-wildcard-with-all=no
375
+
376
+ # Analyse import fallback blocks. This can be used to support both Python 2 and
377
+ # 3 compatible code, which means that the block might have code that exists
378
+ # only in one or another interpreter, leading to false positives when analysed.
379
+ analyse-fallback-blocks=no
380
+
381
+ # Deprecated modules which should not be used, separated by a comma
382
+ deprecated-modules=optparse,tkinter.tix
383
+
384
+ # Create a graph of external dependencies in the given file (report RP0402 must
385
+ # not be disabled)
386
+ ext-import-graph=
387
+
388
+ # Create a graph of every (i.e. internal and external) dependencies in the
389
+ # given file (report RP0402 must not be disabled)
390
+ import-graph=
391
+
392
+ # Create a graph of internal dependencies in the given file (report RP0402 must
393
+ # not be disabled)
394
+ int-import-graph=
395
+
396
+ # Force import order to recognize a module as part of the standard
397
+ # compatibility libraries.
398
+ known-standard-library=
399
+
400
+ # Force import order to recognize a module as part of a third party library.
401
+ known-third-party=enchant
402
+
403
+
404
+ [EXCEPTIONS]
405
+
406
+ # Exceptions that will emit a warning when being caught. Defaults to
407
+ # "Exception"
408
+ overgeneral-exceptions=builtins.Exception
.tool-versions ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ nodejs 23.5.0
2
+ python 3.13.1
3
+ shellcheck 0.10.0
4
+ sqlite 3.47.2
.vscode/launch.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // See https://go.microsoft.com/fwlink/?linkid=830387
3
+ "version": "0.2.0",
4
+ "configurations": [
5
+ {
6
+ "name": "SearXNG",
7
+ "type": "python",
8
+ "request": "launch",
9
+ "module": "searx.webapp",
10
+ "env": {
11
+ "FLASK_APP": "webapp",
12
+ "FLASK_DEBUG": "1",
13
+ "SEARXNG_DEBUG": "1",
14
+ },
15
+ "args": [
16
+ "run"
17
+ ],
18
+ "jinja": true,
19
+ "justMyCode": true,
20
+ "python": "${workspaceFolder}/local/py3/bin/python",
21
+ }
22
+ ]
23
+ }
.vscode/settings.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "python.testing.unittestArgs": [
3
+ "-v",
4
+ "-s",
5
+ "./tests",
6
+ "-p",
7
+ "test_*.py"
8
+ ],
9
+ "python.testing.pytestEnabled": false,
10
+ "python.testing.unittestEnabled": true,
11
+ }
.vscode/tasks.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
3
+ // for the documentation about the tasks.json format
4
+ "version": "2.0.0",
5
+ "tasks": [
6
+ {
7
+ "label": "make run",
8
+ "type": "shell",
9
+ "command": "make run",
10
+ "problemMatcher": [],
11
+ "isBackground": true,
12
+ "presentation": {
13
+ "reveal": "always",
14
+ "panel": "dedicated"
15
+ },
16
+ "group": {
17
+ "kind": "build",
18
+ "isDefault": true
19
+ }
20
+ },
21
+ {
22
+ "label": "make docs.live",
23
+ "type": "shell",
24
+ "command": "make docs.live",
25
+ "problemMatcher": [],
26
+ "isBackground": true,
27
+ "presentation": {
28
+ "reveal": "always",
29
+ "panel": "dedicated"
30
+ },
31
+ "group": {
32
+ "kind": "build"
33
+ }
34
+ }
35
+ ]
36
+ }
.weblate ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [weblate]
2
+ url = https://translate.codeberg.org/api/
3
+ translation = searxng/searxng
.yamllint.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ extends: default
2
+
3
+ rules:
4
+
5
+ indentation:
6
+ spaces: 2
7
+
8
+ # 120 chars should be enough, but don't fail if a line is longer
9
+ line-length:
10
+ max: 120
11
+ level: warning
12
+ allow-non-breakable-words: true
13
+
14
+ # we don't have multiple document per file
15
+ document-start: disable
16
+ document-end: disable
AUTHORS.rst ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ searxng is a fork from `searx <https://github.com/searx/searx>`_ and is
2
+ maintained by Markus Heiser (`@return42 <https://github.com/return42>`_)
3
+
4
+ People who have submitted patches/translations, reported bugs, consulted
5
+ features or generally made searx better:
6
+
7
+ - Adam Tauber `@asciimoo <https://github.com/asciimoo>`_
8
+ - Matej Cotman `@matejc <https://github.com/matejc>`_
9
+ - Émilien Devos `@unixfox <https://github.com/unixfox>`_
10
+ - Thomas Pointhuber `pointhi <https://github.com/pointhi>`_
11
+ - Noémi Ványi `@kvch <https://github.com/kvch>`_
12
+ - `@Cqoicebordel <https://github.com/Cqoicebordel>`_
13
+ - Marc Abonce Seguin `@MarcAbonce <https://github.com/MarcAbonce>`_
14
+ - `@pofilo <https://github.com/pofilo>`_
15
+
16
+ - Laszlo Hammerl
17
+ - Stefan Marsiske
18
+ - Gabor Nagy
19
+ - @pw3t
20
+ - @rhapsodhy
21
+ - András Veres-Szentkirályi
22
+ - Benjamin Sonntag
23
+ - @HLFH
24
+ - @TheRadialActive
25
+ - @Okhin
26
+ - André Koot
27
+ - Alejandro León Aznar
28
+ - rike
29
+ - dp
30
+ - Martin Zimmermann
31
+ - @courgette
32
+ - @kernc
33
+ - @Reventl0v
34
+ - Caner Başaran
35
+ - Benjamin Sonntag
36
+ - @opi
37
+ - @dimqua
38
+ - Giorgos Logiotatidis
39
+ - Luc Didry
40
+ - Niklas Haas
41
+ - @underr
42
+ - Emmanuel Benazera
43
+ - @GreenLunar
44
+ - Kang-min Liu
45
+ - Kirill Isakov
46
+ - Guilhem Bonnefille
47
+ - @jibe-b
48
+ - Christian Pietsch @pietsch
49
+ - @Maxqia
50
+ - Ashutosh Das @pyprism
51
+ - YuLun Shih @imZack
52
+ - Dmitry Mikhirev @mikhirev
53
+ - David A Roberts `@davidar <https://github.com/davidar>`_
54
+ - Jan Verbeek @blyxxyz
55
+ - Ammar Najjar @ammarnajjar
56
+ - @stepshal
57
+ - François Revol @mmuman
58
+ - Harry Wood @harry-wood
59
+ - Thomas Renard @threnard
60
+ - Pydo `<https://github.com/pydo>`_
61
+ - Athemis `<https://github.com/Athemis>`_
62
+ - Stefan Antoni `<http://stefan.antoni.io>`
63
+ - @firebovine
64
+ - Lorenzo J. Lucchini @luccoj
65
+ - @eig8phei
66
+ - @maxigas
67
+ - Jannik Winkel @kiney
68
+ - @juanitobananas
69
+ - Vache Asatryan @vachi
70
+ - Luca CPZ @lcpz
71
+ - @nikaiw
72
+ - Thirnearez
73
+ - Hypolite Petovan @MrPetovan
74
+ - @woorst
75
+ - @Apply55gx
76
+ - @pyrrh0n1c
77
+ - @cclauss
78
+ - QGW @moon2l
79
+ - Pierre-Alain Toret @daftaupe
80
+ - Matthew Olmsted @icegiant
81
+ - Michael Tran @trankmichael
82
+ - Joseph Nuthalapati @josephkiranbabu
83
+ - @maiki
84
+ - Richard Didier @zeph33
85
+ - Michael Vieria @Themimitoof
86
+ - Richard Nespithal @rndevfx
87
+ - Stanislas @angristan
88
+ - @rinpatch
89
+ - g. s. @usernameisntallowed
90
+ - Léo Bourrel @bourrel
91
+ - @cy8aer
92
+ - @Popolon
93
+ - Alice Ferrazzi @aliceinwire
94
+ - @LiquidLemon
95
+ - @dadosch
96
+ - Václav Zouzalík @Venca24
97
+ - @ZEROF
98
+ - Ivan Skytte Jørgensen @isj-privacore
99
+ - @miicha
100
+ - Étienne Deparis @milouse
101
+ - @pelag0s
102
+ - Denis Wernert @d-tux
103
+ - Robin Hallabro-Kokko @hallabro
104
+ - Jonas Zohren @jfowl
105
+ - Elias Ojala @theel0ja
106
+ - @brunob
107
+ - Nick Espig @nachtalb
108
+ - Rachmadani Haryono @rachmadaniHaryono
109
+ - Frank de Lange @yetangitu
110
+ - Nicolas Gelot @nfk
111
+ - @volth
112
+ - Mathieu Brunot @madmath03
113
+ - @lorddavidiii
114
+ - @x250
115
+ - Robby O'Connor @robbyoconnor
116
+ - Finn @0xhtml
117
+ - @tmikaeld
118
+ - @hobbestigrou
119
+ - Vipul @finn0
120
+ - @CaffeinatedTech
121
+ - Robin Schneider @ypid
122
+ - @splintah
123
+ - Lukas van den Berk @lukasvdberk
124
+ - @piplongrun
125
+ - Jason Kaltsikis @jjasonkal
126
+ - Sion Kazama @KazamaSion
127
+ - @resynth1943
128
+ - Mostafa Ahangarha @ahangarha
129
+ - @gordon-quad
130
+ - Sophie Tauchert @999eagle
131
+ - @bauruine
132
+ - Michael Ilsaas `<https://mikeri.net>`_
133
+ - @renyhp
134
+ - rachmadani haryono @rachmadaniHaryono
135
+ - Mohamad Safadieh @msafadieh
136
+ - @gardouille
137
+ - @resynth1943
138
+ - @Eliesemoule
139
+ - @gardouille
140
+ - @GazoilKerozen
141
+ - Lukáš Kucharczyk @KucharczykL
142
+ - Lynda Lopez @lyndalopez544
143
+ - M. Efe Çetin @efectn
144
+ - Nícholas Kegler @nicholasks
145
+ - @pierrechtux
146
+ - Scott Wallace @scottwallacesh
147
+ - @Singustromo
148
+ - @TheEvilSkeleton
149
+ - @Wonderfall
150
+ - @mrwormo
151
+ - Xiaoyu WEI @xywei
152
+ - @joshu9h
153
+ - Daniel Hones
154
+ - @cyclaero
155
+ - @thezeroalpha
156
+ - @Tobi823
157
+ - @archiecodes
158
+ - @BBaoVanC
159
+ - @datagram1
160
+ - @lucky13820
161
+ - @jhigginbotham
162
+ - @xenrox
163
+ - @OliveiraHermogenes
164
+ - Paul Alcock @Guilvareux
165
+ - Sam A. `<https://samsapti.dev>`_
166
+ - @XavierHorwood
167
+ - Ahmad Alkadri `<https://github.com/ahmad-alkadri>`_
168
+ - Milad Laly @Milad-Laly
169
+ - @llmII
170
+ - @blob42 `<https://blob42.xyz>`_
171
+ - Paolo Basso `<https://github.com/paolobasso99>`
172
+ - Bernie Huang `<https://github.com/BernieHuang2008>`
173
+ - Austin Olacsi `<https://github.com/Austin-Olacsi>`
174
+ - @micsthepick
175
+ - Daniel Kukula `<https://github.com/dkuku>`
176
+ - Patrick Evans `https://github.com/holysoles`
177
+ - Daniel Mowitz `<https://daniel.mowitz.rocks>`
178
+ - `Bearz314 <https://github.com/bearz314>`_
CHANGELOG.rst ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ =======
2
+ SearXNG
3
+ =======
4
+
5
+ SearXNG development has been started in the middle of 2021 as a fork of the
6
+ searx project. Since it beginning its a rolling release pulled from SearXNG's
7
+ master branch:
8
+
9
+ - The CHANGELOG_ is replaced by the commit history of the master branch.
10
+ - Since merged PR-229_, the version number is based on the git commit
11
+
12
+ .. _CHANGELOG: https://github.com/searxng/searxng/commits/master
13
+ .. _PR-229: https://github.com/searxng/searxng/pull/229
14
+
CONTRIBUTING.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # How to contribute
2
+
3
+ ## Resources in the documentation
4
+
5
+ * [Development quickstart](https://docs.searxng.org/dev/quickstart.html)
6
+ * [Contribution guide](https://docs.searxng.org/dev/contribution_guide.html)
7
+
8
+ ## Submitting PRs
9
+
10
+ Please follow the provided PR template when writing a description for your changes.
11
+
12
+ Do not take criticism personally. When you get feedback, it is about your work,
13
+ not your character, personality, etc. Keep in mind we all want to make the project better.
14
+
15
+ When something is not clear, please ask questions to clear things up.
16
+
17
+ If you would like to introduce a big architectural changes or do a refactoring
18
+ either in the codebase or the development tools, please open an issue with a proposal
19
+ first. This way we can think together about the problem and probably come up
20
+ with a better solution.
21
+
22
+ ## Coding conventions and guidelines
23
+
24
+ ### Commit messages
25
+
26
+ * Always write descriptive commit messages ("fix bug" is not acceptable).
27
+ * Use the present tense ("Add feature" not "Added feature").
28
+ * Use the imperative mood ("Move cursor to..." not "Moves cursor to...").
29
+ * Limit the first line to 72 characters or less.
30
+ * Include the number of the issue you are fixing.
31
+
32
+ ### Coding guidelines
33
+
34
+ As a Python project, we must follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) and [PEP 20](https://www.python.org/dev/peps/pep-0020/) guidelines.
35
+
36
+ Furthermore, follow the Clean code conventions. The most important
37
+ in this project are the following rules:
38
+
39
+ * Simpler is better. [KISS principle](https://en.wikipedia.org/wiki/KISS_principle)
40
+ * Be consistent.
41
+ * Every function must do one thing.
42
+ * Use descriptive names for functions and variables.
43
+ * Always look for the root cause.
44
+ * Keep configurable data high level.
45
+ * Avoid negative conditionals.
46
+ * Prefer fewer arguments.
47
+ * Do not add obvious comment to code.
48
+ * Do not comment out code, just delete lines.
49
+
Dockerfile ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:3.20
2
+ ENTRYPOINT ["/sbin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"]
3
+ EXPOSE 8080
4
+ VOLUME /etc/searxng
5
+
6
+ ARG SEARXNG_GID=977
7
+ ARG SEARXNG_UID=977
8
+
9
+ RUN addgroup -g ${SEARXNG_GID} searxng && \
10
+ adduser -u ${SEARXNG_UID} -D -h /usr/local/searxng -s /bin/sh -G searxng searxng
11
+
12
+ ENV INSTANCE_NAME=searxng \
13
+ AUTOCOMPLETE= \
14
+ BASE_URL= \
15
+ MORTY_KEY= \
16
+ MORTY_URL= \
17
+ SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml \
18
+ UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini \
19
+ UWSGI_WORKERS=%k \
20
+ UWSGI_THREADS=4
21
+
22
+ WORKDIR /usr/local/searxng
23
+
24
+ COPY requirements.txt ./requirements.txt
25
+
26
+ RUN apk add --no-cache -t build-dependencies \
27
+ build-base \
28
+ py3-setuptools \
29
+ python3-dev \
30
+ libffi-dev \
31
+ libxslt-dev \
32
+ libxml2-dev \
33
+ openssl-dev \
34
+ tar \
35
+ git \
36
+ && apk add --no-cache \
37
+ ca-certificates \
38
+ python3 \
39
+ py3-pip \
40
+ libxml2 \
41
+ libxslt \
42
+ openssl \
43
+ tini \
44
+ uwsgi \
45
+ uwsgi-python3 \
46
+ brotli \
47
+ && pip3 install --break-system-packages --no-cache -r requirements.txt \
48
+ && apk del build-dependencies \
49
+ && rm -rf /root/.cache
50
+
51
+ COPY --chown=searxng:searxng dockerfiles ./dockerfiles
52
+ COPY --chown=searxng:searxng searx ./searx
53
+
54
+ ARG TIMESTAMP_SETTINGS=0
55
+ ARG TIMESTAMP_UWSGI=0
56
+ ARG VERSION_GITCOMMIT=unknown
57
+
58
+ RUN su searxng -c "/usr/bin/python3 -m compileall -q searx" \
59
+ && touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml \
60
+ && touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini \
61
+ && find /usr/local/searxng/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
62
+ -o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
63
+ -type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
64
+
65
+ HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:8080/healthz || exit 1
66
+
67
+ # Keep these arguments at the end to prevent redundant layer rebuilds
68
+ ARG LABEL_DATE=
69
+ ARG GIT_URL=unknown
70
+ ARG SEARXNG_GIT_VERSION=unknown
71
+ ARG SEARXNG_DOCKER_TAG=unknown
72
+ ARG LABEL_VCS_REF=
73
+ ARG LABEL_VCS_URL=
74
+ LABEL maintainer="searxng <${GIT_URL}>" \
75
+ description="A privacy-respecting, hackable metasearch engine." \
76
+ version="${SEARXNG_GIT_VERSION}" \
77
+ org.label-schema.schema-version="1.0" \
78
+ org.label-schema.name="searxng" \
79
+ org.label-schema.version="${SEARXNG_GIT_VERSION}" \
80
+ org.label-schema.url="${LABEL_VCS_URL}" \
81
+ org.label-schema.vcs-ref=${LABEL_VCS_REF} \
82
+ org.label-schema.vcs-url=${LABEL_VCS_URL} \
83
+ org.label-schema.build-date="${LABEL_DATE}" \
84
+ org.label-schema.usage="https://github.com/searxng/searxng-docker" \
85
+ org.opencontainers.image.title="searxng" \
86
+ org.opencontainers.image.version="${SEARXNG_DOCKER_TAG}" \
87
+ org.opencontainers.image.url="${LABEL_VCS_URL}" \
88
+ org.opencontainers.image.revision=${LABEL_VCS_REF} \
89
+ org.opencontainers.image.source=${LABEL_VCS_URL} \
90
+ org.opencontainers.image.created="${LABEL_DATE}" \
91
+ org.opencontainers.image.documentation="https://github.com/searxng/searxng-docker"
LICENSE ADDED
@@ -0,0 +1,661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
13
+
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ When we speak of free software, we are referring to freedom, not
21
+ price. Our General Public Licenses are designed to make sure that you
22
+ have the freedom to distribute copies of free software (and charge for
23
+ them if you wish), that you receive source code or can get it if you
24
+ want it, that you can change the software or use pieces of it in new
25
+ free programs, and that you know you can do these things.
26
+
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS
60
+
61
+ 0. Definitions.
62
+
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+ "Copyright" also means copyright-like laws that apply to other kinds of
66
+ works, such as semiconductor masks.
67
+
68
+ "The Program" refers to any copyrightable work licensed under this
69
+ License. Each licensee is addressed as "you". "Licensees" and
70
+ "recipients" may be individuals or organizations.
71
+
72
+ To "modify" a work means to copy from or adapt all or part of the work
73
+ in a fashion requiring copyright permission, other than the making of an
74
+ exact copy. The resulting work is called a "modified version" of the
75
+ earlier work or a work "based on" the earlier work.
76
+
77
+ A "covered work" means either the unmodified Program or a work based
78
+ on the Program.
79
+
80
+ To "propagate" a work means to do anything with it that, without
81
+ permission, would make you directly or secondarily liable for
82
+ infringement under applicable copyright law, except executing it on a
83
+ computer or modifying a private copy. Propagation includes copying,
84
+ distribution (with or without modification), making available to the
85
+ public, and in some countries other activities as well.
86
+
87
+ To "convey" a work means any kind of propagation that enables other
88
+ parties to make or receive copies. Mere interaction with a user through
89
+ a computer network, with no transfer of a copy, is not conveying.
90
+
91
+ An interactive user interface displays "Appropriate Legal Notices"
92
+ to the extent that it includes a convenient and prominently visible
93
+ feature that (1) displays an appropriate copyright notice, and (2)
94
+ tells the user that there is no warranty for the work (except to the
95
+ extent that warranties are provided), that licensees may convey the
96
+ work under this License, and how to view a copy of this License. If
97
+ the interface presents a list of user commands or options, such as a
98
+ menu, a prominent item in the list meets this criterion.
99
+
100
+ 1. Source Code.
101
+
102
+ The "source code" for a work means the preferred form of the work
103
+ for making modifications to it. "Object code" means any non-source
104
+ form of a work.
105
+
106
+ A "Standard Interface" means an interface that either is an official
107
+ standard defined by a recognized standards body, or, in the case of
108
+ interfaces specified for a particular programming language, one that
109
+ is widely used among developers working in that language.
110
+
111
+ The "System Libraries" of an executable work include anything, other
112
+ than the work as a whole, that (a) is included in the normal form of
113
+ packaging a Major Component, but which is not part of that Major
114
+ Component, and (b) serves only to enable use of the work with that
115
+ Major Component, or to implement a Standard Interface for which an
116
+ implementation is available to the public in source code form. A
117
+ "Major Component", in this context, means a major essential component
118
+ (kernel, window system, and so on) of the specific operating system
119
+ (if any) on which the executable work runs, or a compiler used to
120
+ produce the work, or an object code interpreter used to run it.
121
+
122
+ The "Corresponding Source" for a work in object code form means all
123
+ the source code needed to generate, install, and (for an executable
124
+ work) run the object code and to modify the work, including scripts to
125
+ control those activities. However, it does not include the work's
126
+ System Libraries, or general-purpose tools or generally available free
127
+ programs which are used unmodified in performing those activities but
128
+ which are not part of the work. For example, Corresponding Source
129
+ includes interface definition files associated with source files for
130
+ the work, and the source code for shared libraries and dynamically
131
+ linked subprograms that the work is specifically designed to require,
132
+ such as by intimate data communication or control flow between those
133
+ subprograms and other parts of the work.
134
+
135
+ The Corresponding Source need not include anything that users
136
+ can regenerate automatically from other parts of the Corresponding
137
+ Source.
138
+
139
+ The Corresponding Source for a work in source code form is that
140
+ same work.
141
+
142
+ 2. Basic Permissions.
143
+
144
+ All rights granted under this License are granted for the term of
145
+ copyright on the Program, and are irrevocable provided the stated
146
+ conditions are met. This License explicitly affirms your unlimited
147
+ permission to run the unmodified Program. The output from running a
148
+ covered work is covered by this License only if the output, given its
149
+ content, constitutes a covered work. This License acknowledges your
150
+ rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+ You may make, run and propagate covered works that you do not
153
+ convey, without conditions so long as your license otherwise remains
154
+ in force. You may convey covered works to others for the sole purpose
155
+ of having them make modifications exclusively for you, or provide you
156
+ with facilities for running those works, provided that you comply with
157
+ the terms of this License in conveying all material for which you do
158
+ not control copyright. Those thus making or running the covered works
159
+ for you must do so exclusively on your behalf, under your direction
160
+ and control, on terms that prohibit them from making any copies of
161
+ your copyrighted material outside their relationship with you.
162
+
163
+ Conveying under any other circumstances is permitted solely under
164
+ the conditions stated below. Sublicensing is not allowed; section 10
165
+ makes it unnecessary.
166
+
167
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+ No covered work shall be deemed part of an effective technological
170
+ measure under any applicable law fulfilling obligations under article
171
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+ similar laws prohibiting or restricting circumvention of such
173
+ measures.
174
+
175
+ When you convey a covered work, you waive any legal power to forbid
176
+ circumvention of technological measures to the extent such circumvention
177
+ is effected by exercising rights under this License with respect to
178
+ the covered work, and you disclaim any intention to limit operation or
179
+ modification of the work as a means of enforcing, against the work's
180
+ users, your or third parties' legal rights to forbid circumvention of
181
+ technological measures.
182
+
183
+ 4. Conveying Verbatim Copies.
184
+
185
+ You may convey verbatim copies of the Program's source code as you
186
+ receive it, in any medium, provided that you conspicuously and
187
+ appropriately publish on each copy an appropriate copyright notice;
188
+ keep intact all notices stating that this License and any
189
+ non-permissive terms added in accord with section 7 apply to the code;
190
+ keep intact all notices of the absence of any warranty; and give all
191
+ recipients a copy of this License along with the Program.
192
+
193
+ You may charge any price or no price for each copy that you convey,
194
+ and you may offer support or warranty protection for a fee.
195
+
196
+ 5. Conveying Modified Source Versions.
197
+
198
+ You may convey a work based on the Program, or the modifications to
199
+ produce it from the Program, in the form of source code under the
200
+ terms of section 4, provided that you also meet all of these conditions:
201
+
202
+ a) The work must carry prominent notices stating that you modified
203
+ it, and giving a relevant date.
204
+
205
+ b) The work must carry prominent notices stating that it is
206
+ released under this License and any conditions added under section
207
+ 7. This requirement modifies the requirement in section 4 to
208
+ "keep intact all notices".
209
+
210
+ c) You must license the entire work, as a whole, under this
211
+ License to anyone who comes into possession of a copy. This
212
+ License will therefore apply, along with any applicable section 7
213
+ additional terms, to the whole of the work, and all its parts,
214
+ regardless of how they are packaged. This License gives no
215
+ permission to license the work in any other way, but it does not
216
+ invalidate such permission if you have separately received it.
217
+
218
+ d) If the work has interactive user interfaces, each must display
219
+ Appropriate Legal Notices; however, if the Program has interactive
220
+ interfaces that do not display Appropriate Legal Notices, your
221
+ work need not make them do so.
222
+
223
+ A compilation of a covered work with other separate and independent
224
+ works, which are not by their nature extensions of the covered work,
225
+ and which are not combined with it such as to form a larger program,
226
+ in or on a volume of a storage or distribution medium, is called an
227
+ "aggregate" if the compilation and its resulting copyright are not
228
+ used to limit the access or legal rights of the compilation's users
229
+ beyond what the individual works permit. Inclusion of a covered work
230
+ in an aggregate does not cause this License to apply to the other
231
+ parts of the aggregate.
232
+
233
+ 6. Conveying Non-Source Forms.
234
+
235
+ You may convey a covered work in object code form under the terms
236
+ of sections 4 and 5, provided that you also convey the
237
+ machine-readable Corresponding Source under the terms of this License,
238
+ in one of these ways:
239
+
240
+ a) Convey the object code in, or embodied in, a physical product
241
+ (including a physical distribution medium), accompanied by the
242
+ Corresponding Source fixed on a durable physical medium
243
+ customarily used for software interchange.
244
+
245
+ b) Convey the object code in, or embodied in, a physical product
246
+ (including a physical distribution medium), accompanied by a
247
+ written offer, valid for at least three years and valid for as
248
+ long as you offer spare parts or customer support for that product
249
+ model, to give anyone who possesses the object code either (1) a
250
+ copy of the Corresponding Source for all the software in the
251
+ product that is covered by this License, on a durable physical
252
+ medium customarily used for software interchange, for a price no
253
+ more than your reasonable cost of physically performing this
254
+ conveying of source, or (2) access to copy the
255
+ Corresponding Source from a network server at no charge.
256
+
257
+ c) Convey individual copies of the object code with a copy of the
258
+ written offer to provide the Corresponding Source. This
259
+ alternative is allowed only occasionally and noncommercially, and
260
+ only if you received the object code with such an offer, in accord
261
+ with subsection 6b.
262
+
263
+ d) Convey the object code by offering access from a designated
264
+ place (gratis or for a charge), and offer equivalent access to the
265
+ Corresponding Source in the same way through the same place at no
266
+ further charge. You need not require recipients to copy the
267
+ Corresponding Source along with the object code. If the place to
268
+ copy the object code is a network server, the Corresponding Source
269
+ may be on a different server (operated by you or a third party)
270
+ that supports equivalent copying facilities, provided you maintain
271
+ clear directions next to the object code saying where to find the
272
+ Corresponding Source. Regardless of what server hosts the
273
+ Corresponding Source, you remain obligated to ensure that it is
274
+ available for as long as needed to satisfy these requirements.
275
+
276
+ e) Convey the object code using peer-to-peer transmission, provided
277
+ you inform other peers where the object code and Corresponding
278
+ Source of the work are being offered to the general public at no
279
+ charge under subsection 6d.
280
+
281
+ A separable portion of the object code, whose source code is excluded
282
+ from the Corresponding Source as a System Library, need not be
283
+ included in conveying the object code work.
284
+
285
+ A "User Product" is either (1) a "consumer product", which means any
286
+ tangible personal property which is normally used for personal, family,
287
+ or household purposes, or (2) anything designed or sold for incorporation
288
+ into a dwelling. In determining whether a product is a consumer product,
289
+ doubtful cases shall be resolved in favor of coverage. For a particular
290
+ product received by a particular user, "normally used" refers to a
291
+ typical or common use of that class of product, regardless of the status
292
+ of the particular user or of the way in which the particular user
293
+ actually uses, or expects or is expected to use, the product. A product
294
+ is a consumer product regardless of whether the product has substantial
295
+ commercial, industrial or non-consumer uses, unless such uses represent
296
+ the only significant mode of use of the product.
297
+
298
+ "Installation Information" for a User Product means any methods,
299
+ procedures, authorization keys, or other information required to install
300
+ and execute modified versions of a covered work in that User Product from
301
+ a modified version of its Corresponding Source. The information must
302
+ suffice to ensure that the continued functioning of the modified object
303
+ code is in no case prevented or interfered with solely because
304
+ modification has been made.
305
+
306
+ If you convey an object code work under this section in, or with, or
307
+ specifically for use in, a User Product, and the conveying occurs as
308
+ part of a transaction in which the right of possession and use of the
309
+ User Product is transferred to the recipient in perpetuity or for a
310
+ fixed term (regardless of how the transaction is characterized), the
311
+ Corresponding Source conveyed under this section must be accompanied
312
+ by the Installation Information. But this requirement does not apply
313
+ if neither you nor any third party retains the ability to install
314
+ modified object code on the User Product (for example, the work has
315
+ been installed in ROM).
316
+
317
+ The requirement to provide Installation Information does not include a
318
+ requirement to continue to provide support service, warranty, or updates
319
+ for a work that has been modified or installed by the recipient, or for
320
+ the User Product in which it has been modified or installed. Access to a
321
+ network may be denied when the modification itself materially and
322
+ adversely affects the operation of the network or violates the rules and
323
+ protocols for communication across the network.
324
+
325
+ Corresponding Source conveyed, and Installation Information provided,
326
+ in accord with this section must be in a format that is publicly
327
+ documented (and with an implementation available to the public in
328
+ source code form), and must require no special password or key for
329
+ unpacking, reading or copying.
330
+
331
+ 7. Additional Terms.
332
+
333
+ "Additional permissions" are terms that supplement the terms of this
334
+ License by making exceptions from one or more of its conditions.
335
+ Additional permissions that are applicable to the entire Program shall
336
+ be treated as though they were included in this License, to the extent
337
+ that they are valid under applicable law. If additional permissions
338
+ apply only to part of the Program, that part may be used separately
339
+ under those permissions, but the entire Program remains governed by
340
+ this License without regard to the additional permissions.
341
+
342
+ When you convey a copy of a covered work, you may at your option
343
+ remove any additional permissions from that copy, or from any part of
344
+ it. (Additional permissions may be written to require their own
345
+ removal in certain cases when you modify the work.) You may place
346
+ additional permissions on material, added by you to a covered work,
347
+ for which you have or can give appropriate copyright permission.
348
+
349
+ Notwithstanding any other provision of this License, for material you
350
+ add to a covered work, you may (if authorized by the copyright holders of
351
+ that material) supplement the terms of this License with terms:
352
+
353
+ a) Disclaiming warranty or limiting liability differently from the
354
+ terms of sections 15 and 16 of this License; or
355
+
356
+ b) Requiring preservation of specified reasonable legal notices or
357
+ author attributions in that material or in the Appropriate Legal
358
+ Notices displayed by works containing it; or
359
+
360
+ c) Prohibiting misrepresentation of the origin of that material, or
361
+ requiring that modified versions of such material be marked in
362
+ reasonable ways as different from the original version; or
363
+
364
+ d) Limiting the use for publicity purposes of names of licensors or
365
+ authors of the material; or
366
+
367
+ e) Declining to grant rights under trademark law for use of some
368
+ trade names, trademarks, or service marks; or
369
+
370
+ f) Requiring indemnification of licensors and authors of that
371
+ material by anyone who conveys the material (or modified versions of
372
+ it) with contractual assumptions of liability to the recipient, for
373
+ any liability that these contractual assumptions directly impose on
374
+ those licensors and authors.
375
+
376
+ All other non-permissive additional terms are considered "further
377
+ restrictions" within the meaning of section 10. If the Program as you
378
+ received it, or any part of it, contains a notice stating that it is
379
+ governed by this License along with a term that is a further
380
+ restriction, you may remove that term. If a license document contains
381
+ a further restriction but permits relicensing or conveying under this
382
+ License, you may add to a covered work material governed by the terms
383
+ of that license document, provided that the further restriction does
384
+ not survive such relicensing or conveying.
385
+
386
+ If you add terms to a covered work in accord with this section, you
387
+ must place, in the relevant source files, a statement of the
388
+ additional terms that apply to those files, or a notice indicating
389
+ where to find the applicable terms.
390
+
391
+ Additional terms, permissive or non-permissive, may be stated in the
392
+ form of a separately written license, or stated as exceptions;
393
+ the above requirements apply either way.
394
+
395
+ 8. Termination.
396
+
397
+ You may not propagate or modify a covered work except as expressly
398
+ provided under this License. Any attempt otherwise to propagate or
399
+ modify it is void, and will automatically terminate your rights under
400
+ this License (including any patent licenses granted under the third
401
+ paragraph of section 11).
402
+
403
+ However, if you cease all violation of this License, then your
404
+ license from a particular copyright holder is reinstated (a)
405
+ provisionally, unless and until the copyright holder explicitly and
406
+ finally terminates your license, and (b) permanently, if the copyright
407
+ holder fails to notify you of the violation by some reasonable means
408
+ prior to 60 days after the cessation.
409
+
410
+ Moreover, your license from a particular copyright holder is
411
+ reinstated permanently if the copyright holder notifies you of the
412
+ violation by some reasonable means, this is the first time you have
413
+ received notice of violation of this License (for any work) from that
414
+ copyright holder, and you cure the violation prior to 30 days after
415
+ your receipt of the notice.
416
+
417
+ Termination of your rights under this section does not terminate the
418
+ licenses of parties who have received copies or rights from you under
419
+ this License. If your rights have been terminated and not permanently
420
+ reinstated, you do not qualify to receive new licenses for the same
421
+ material under section 10.
422
+
423
+ 9. Acceptance Not Required for Having Copies.
424
+
425
+ You are not required to accept this License in order to receive or
426
+ run a copy of the Program. Ancillary propagation of a covered work
427
+ occurring solely as a consequence of using peer-to-peer transmission
428
+ to receive a copy likewise does not require acceptance. However,
429
+ nothing other than this License grants you permission to propagate or
430
+ modify any covered work. These actions infringe copyright if you do
431
+ not accept this License. Therefore, by modifying or propagating a
432
+ covered work, you indicate your acceptance of this License to do so.
433
+
434
+ 10. Automatic Licensing of Downstream Recipients.
435
+
436
+ Each time you convey a covered work, the recipient automatically
437
+ receives a license from the original licensors, to run, modify and
438
+ propagate that work, subject to this License. You are not responsible
439
+ for enforcing compliance by third parties with this License.
440
+
441
+ An "entity transaction" is a transaction transferring control of an
442
+ organization, or substantially all assets of one, or subdividing an
443
+ organization, or merging organizations. If propagation of a covered
444
+ work results from an entity transaction, each party to that
445
+ transaction who receives a copy of the work also receives whatever
446
+ licenses to the work the party's predecessor in interest had or could
447
+ give under the previous paragraph, plus a right to possession of the
448
+ Corresponding Source of the work from the predecessor in interest, if
449
+ the predecessor has it or can get it with reasonable efforts.
450
+
451
+ You may not impose any further restrictions on the exercise of the
452
+ rights granted or affirmed under this License. For example, you may
453
+ not impose a license fee, royalty, or other charge for exercise of
454
+ rights granted under this License, and you may not initiate litigation
455
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
456
+ any patent claim is infringed by making, using, selling, offering for
457
+ sale, or importing the Program or any portion of it.
458
+
459
+ 11. Patents.
460
+
461
+ A "contributor" is a copyright holder who authorizes use under this
462
+ License of the Program or a work on which the Program is based. The
463
+ work thus licensed is called the contributor's "contributor version".
464
+
465
+ A contributor's "essential patent claims" are all patent claims
466
+ owned or controlled by the contributor, whether already acquired or
467
+ hereafter acquired, that would be infringed by some manner, permitted
468
+ by this License, of making, using, or selling its contributor version,
469
+ but do not include claims that would be infringed only as a
470
+ consequence of further modification of the contributor version. For
471
+ purposes of this definition, "control" includes the right to grant
472
+ patent sublicenses in a manner consistent with the requirements of
473
+ this License.
474
+
475
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+ patent license under the contributor's essential patent claims, to
477
+ make, use, sell, offer for sale, import and otherwise run, modify and
478
+ propagate the contents of its contributor version.
479
+
480
+ In the following three paragraphs, a "patent license" is any express
481
+ agreement or commitment, however denominated, not to enforce a patent
482
+ (such as an express permission to practice a patent or covenant not to
483
+ sue for patent infringement). To "grant" such a patent license to a
484
+ party means to make such an agreement or commitment not to enforce a
485
+ patent against the party.
486
+
487
+ If you convey a covered work, knowingly relying on a patent license,
488
+ and the Corresponding Source of the work is not available for anyone
489
+ to copy, free of charge and under the terms of this License, through a
490
+ publicly available network server or other readily accessible means,
491
+ then you must either (1) cause the Corresponding Source to be so
492
+ available, or (2) arrange to deprive yourself of the benefit of the
493
+ patent license for this particular work, or (3) arrange, in a manner
494
+ consistent with the requirements of this License, to extend the patent
495
+ license to downstream recipients. "Knowingly relying" means you have
496
+ actual knowledge that, but for the patent license, your conveying the
497
+ covered work in a country, or your recipient's use of the covered work
498
+ in a country, would infringe one or more identifiable patents in that
499
+ country that you have reason to believe are valid.
500
+
501
+ If, pursuant to or in connection with a single transaction or
502
+ arrangement, you convey, or propagate by procuring conveyance of, a
503
+ covered work, and grant a patent license to some of the parties
504
+ receiving the covered work authorizing them to use, propagate, modify
505
+ or convey a specific copy of the covered work, then the patent license
506
+ you grant is automatically extended to all recipients of the covered
507
+ work and works based on it.
508
+
509
+ A patent license is "discriminatory" if it does not include within
510
+ the scope of its coverage, prohibits the exercise of, or is
511
+ conditioned on the non-exercise of one or more of the rights that are
512
+ specifically granted under this License. You may not convey a covered
513
+ work if you are a party to an arrangement with a third party that is
514
+ in the business of distributing software, under which you make payment
515
+ to the third party based on the extent of your activity of conveying
516
+ the work, and under which the third party grants, to any of the
517
+ parties who would receive the covered work from you, a discriminatory
518
+ patent license (a) in connection with copies of the covered work
519
+ conveyed by you (or copies made from those copies), or (b) primarily
520
+ for and in connection with specific products or compilations that
521
+ contain the covered work, unless you entered into that arrangement,
522
+ or that patent license was granted, prior to 28 March 2007.
523
+
524
+ Nothing in this License shall be construed as excluding or limiting
525
+ any implied license or other defenses to infringement that may
526
+ otherwise be available to you under applicable patent law.
527
+
528
+ 12. No Surrender of Others' Freedom.
529
+
530
+ If conditions are imposed on you (whether by court order, agreement or
531
+ otherwise) that contradict the conditions of this License, they do not
532
+ excuse you from the conditions of this License. If you cannot convey a
533
+ covered work so as to satisfy simultaneously your obligations under this
534
+ License and any other pertinent obligations, then as a consequence you may
535
+ not convey it at all. For example, if you agree to terms that obligate you
536
+ to collect a royalty for further conveying from those to whom you convey
537
+ the Program, the only way you could satisfy both those terms and this
538
+ License would be to refrain entirely from conveying the Program.
539
+
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
552
+
553
+ Notwithstanding any other provision of this License, you have
554
+ permission to link or combine any covered work with a work licensed
555
+ under version 3 of the GNU General Public License into a single
556
+ combined work, and to convey the resulting work. The terms of this
557
+ License will continue to apply to the part which is the covered work,
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
560
+
561
+ 14. Revised Versions of this License.
562
+
563
+ The Free Software Foundation may publish revised and/or new versions of
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
566
+ address new problems or concerns.
567
+
568
+ Each version is given a distinguishing version number. If the
569
+ Program specifies that a certain numbered version of the GNU Affero General
570
+ Public License "or any later version" applies to it, you have the
571
+ option of following the terms and conditions either of that numbered
572
+ version or of any later version published by the Free Software
573
+ Foundation. If the Program does not specify a version number of the
574
+ GNU Affero General Public License, you may choose any version ever published
575
+ by the Free Software Foundation.
576
+
577
+ If the Program specifies that a proxy can decide which future
578
+ versions of the GNU Affero General Public License can be used, that proxy's
579
+ public statement of acceptance of a version permanently authorizes you
580
+ to choose that version for the Program.
581
+
582
+ Later license versions may give you additional or different
583
+ permissions. However, no additional obligations are imposed on any
584
+ author or copyright holder as a result of your choosing to follow a
585
+ later version.
586
+
587
+ 15. Disclaimer of Warranty.
588
+
589
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
+
598
+ 16. Limitation of Liability.
599
+
600
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+ SUCH DAMAGES.
609
+
610
+ 17. Interpretation of Sections 15 and 16.
611
+
612
+ If the disclaimer of warranty and limitation of liability provided
613
+ above cannot be given local legal effect according to their terms,
614
+ reviewing courts shall apply local law that most closely approximates
615
+ an absolute waiver of all civil liability in connection with the
616
+ Program, unless a warranty or assumption of liability accompanies a
617
+ copy of the Program in return for a fee.
618
+
619
+ END OF TERMS AND CONDITIONS
620
+
621
+ How to Apply These Terms to Your New Programs
622
+
623
+ If you develop a new program, and you want it to be of the greatest
624
+ possible use to the public, the best way to achieve this is to make it
625
+ free software which everyone can redistribute and change under these terms.
626
+
627
+ To do so, attach the following notices to the program. It is safest
628
+ to attach them to the start of each source file to most effectively
629
+ state the exclusion of warranty; and each file should have at least
630
+ the "copyright" line and a pointer to where the full notice is found.
631
+
632
+ <one line to give the program's name and a brief idea of what it does.>
633
+ Copyright (C) <year> <name of author>
634
+
635
+ This program is free software: you can redistribute it and/or modify
636
+ it under the terms of the GNU Affero General Public License as published by
637
+ the Free Software Foundation, either version 3 of the License, or
638
+ (at your option) any later version.
639
+
640
+ This program is distributed in the hope that it will be useful,
641
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
+ GNU Affero General Public License for more details.
644
+
645
+ You should have received a copy of the GNU Affero General Public License
646
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
647
+
648
+ Also add information on how to contact you by electronic and paper mail.
649
+
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
657
+
658
+ You should also get your employer (if you work as a programmer) or school,
659
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <http://www.gnu.org/licenses/>.
Makefile ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8; mode: makefile-gmake -*-
2
+ # SPDX-License-Identifier: AGPL-3.0-or-later
3
+
4
+ .DEFAULT_GOAL=help
5
+ export MTOOLS=./manage
6
+
7
+ include utils/makefile.include
8
+
9
+ all: clean install
10
+
11
+ PHONY += help
12
+
13
+ help:
14
+ @./manage --help
15
+ @echo '----'
16
+ @echo 'run - run developer instance'
17
+ @echo 'install - developer install of SearxNG into virtualenv'
18
+ @echo 'uninstall - uninstall developer installation'
19
+ @echo 'clean - clean up working tree'
20
+ @echo 'search.checker - check search engines'
21
+ @echo 'test - run shell & CI tests'
22
+ @echo 'test.shell - test shell scripts'
23
+ @echo 'ci.test - run CI tests'
24
+
25
+
26
+ PHONY += run
27
+ run: install
28
+ $(Q)./manage webapp.run
29
+
30
+ PHONY += install uninstall
31
+ install uninstall:
32
+ $(Q)./manage pyenv.$@
33
+
34
+ PHONY += clean
35
+ clean: py.clean docs.clean node.clean nvm.clean test.clean
36
+ $(Q)./manage build_msg CLEAN "common files"
37
+ $(Q)find . -name '*.orig' -exec rm -f {} +
38
+ $(Q)find . -name '*.rej' -exec rm -f {} +
39
+ $(Q)find . -name '*~' -exec rm -f {} +
40
+ $(Q)find . -name '*.bak' -exec rm -f {} +
41
+
42
+ lxc.clean:
43
+ $(Q)rm -rf lxc-env
44
+
45
+ PHONY += search.checker search.checker.%
46
+ search.checker: install
47
+ $(Q)./manage pyenv.cmd searxng-checker -v
48
+
49
+ search.checker.%: install
50
+ $(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
51
+
52
+ PHONY += test ci.test test.shell
53
+ ci.test: test.yamllint test.black test.types.ci test.pylint test.unit test.robot test.rst test.shell test.pybabel
54
+ test: test.yamllint test.black test.types.dev test.pylint test.unit test.robot test.rst test.shell
55
+ test.shell:
56
+ $(Q)shellcheck -x -s dash \
57
+ dockerfiles/docker-entrypoint.sh
58
+ $(Q)shellcheck -x -s bash \
59
+ utils/brand.sh \
60
+ $(MTOOLS) \
61
+ utils/lib.sh \
62
+ utils/lib_sxng*.sh \
63
+ utils/lib_go.sh \
64
+ utils/lib_nvm.sh \
65
+ utils/lib_redis.sh \
66
+ utils/searxng.sh \
67
+ utils/lxc.sh \
68
+ utils/lxc-searxng.env \
69
+ utils/searx.sh \
70
+ utils/filtron.sh \
71
+ utils/morty.sh
72
+ $(Q)$(MTOOLS) build_msg TEST "$@ OK"
73
+
74
+
75
+ # wrap ./manage script
76
+
77
+ MANAGE += weblate.translations.commit weblate.push.translations
78
+ MANAGE += data.all data.traits data.useragents data.locales data.currencies
79
+ MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
80
+ MANAGE += docker.build docker.push docker.buildx
81
+ MANAGE += gecko.driver
82
+ MANAGE += node.env node.env.dev node.clean
83
+ MANAGE += py.build py.clean
84
+ MANAGE += pyenv pyenv.install pyenv.uninstall
85
+ MANAGE += format.python
86
+ MANAGE += test.yamllint test.pylint test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean test.themes test.types.dev test.types.ci
87
+ MANAGE += themes.all themes.fix themes.test
88
+ MANAGE += static.build.commit static.build.drop static.build.restore
89
+ MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
90
+
91
+ PHONY += $(MANAGE)
92
+
93
+ $(MANAGE):
94
+ $(Q)$(MTOOLS) $@
95
+
96
+ # short hands of selected targets
97
+
98
+ PHONY += docs docker themes
99
+
100
+ docs: docs.html
101
+ docker: docker.build
102
+ themes: themes.all
PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## What does this PR do?
2
+
3
+ <!-- MANDATORY -->
4
+
5
+ <!-- explain the changes in your PR, algorithms, design, architecture -->
6
+
7
+ ## Why is this change important?
8
+
9
+ <!-- MANDATORY -->
10
+
11
+ <!-- explain the motivation behind your PR -->
12
+
13
+ ## How to test this PR locally?
14
+
15
+ <!-- commands to run the tests or instructions to test the changes -->
16
+
17
+ ## Author's checklist
18
+
19
+ <!-- additional notes for reviewers -->
20
+
21
+ ## Related issues
22
+
23
+ <!--
24
+ Closes #234
25
+ -->
README.rst ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .. SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+ ----
4
+
5
+ .. figure:: https://raw.githubusercontent.com/searxng/searxng/master/client/simple/src/brand/searxng.svg
6
+ :target: https://docs.searxng.org/
7
+ :alt: SearXNG
8
+ :width: 100%
9
+ :align: center
10
+
11
+ ----
12
+
13
+ Privacy-respecting, hackable `metasearch engine`_
14
+
15
+ Searx.space_ lists ready-to-use running instances.
16
+
17
+ A user_, admin_ and developer_ handbook is available on the homepage_.
18
+
19
+ |SearXNG install|
20
+ |SearXNG homepage|
21
+ |SearXNG wiki|
22
+ |AGPL License|
23
+ |Issues|
24
+ |commits|
25
+ |weblate|
26
+ |SearXNG logo|
27
+
28
+ ----
29
+
30
+ .. _searx.space: https://searx.space
31
+ .. _user: https://docs.searxng.org/user
32
+ .. _admin: https://docs.searxng.org/admin
33
+ .. _developer: https://docs.searxng.org/dev
34
+ .. _homepage: https://docs.searxng.org/
35
+ .. _metasearch engine: https://en.wikipedia.org/wiki/Metasearch_engine
36
+
37
+ .. |SearXNG logo| image:: https://raw.githubusercontent.com/searxng/searxng/master/client/simple/src/brand/searxng-wordmark.svg
38
+ :target: https://docs.searxng.org/
39
+ :width: 5%
40
+
41
+ .. |SearXNG install| image:: https://img.shields.io/badge/-install-blue
42
+ :target: https://docs.searxng.org/admin/installation.html
43
+
44
+ .. |SearXNG homepage| image:: https://img.shields.io/badge/-homepage-blue
45
+ :target: https://docs.searxng.org/
46
+
47
+ .. |SearXNG wiki| image:: https://img.shields.io/badge/-wiki-blue
48
+ :target: https://github.com/searxng/searxng/wiki
49
+
50
+ .. |AGPL License| image:: https://img.shields.io/badge/license-AGPL-blue.svg
51
+ :target: https://github.com/searxng/searxng/blob/master/LICENSE
52
+
53
+ .. |Issues| image:: https://img.shields.io/github/issues/searxng/searxng?color=yellow&label=issues
54
+ :target: https://github.com/searxng/searxng/issues
55
+
56
+ .. |PR| image:: https://img.shields.io/github/issues-pr-raw/searxng/searxng?color=yellow&label=PR
57
+ :target: https://github.com/searxng/searxng/pulls
58
+
59
+ .. |commits| image:: https://img.shields.io/github/commit-activity/y/searxng/searxng?color=yellow&label=commits
60
+ :target: https://github.com/searxng/searxng/commits/master
61
+
62
+ .. |weblate| image:: https://translate.codeberg.org/widgets/searxng/-/searxng/svg-badge.svg
63
+ :target: https://translate.codeberg.org/projects/searxng/
64
+
65
+
66
+ Contact
67
+ =======
68
+
69
+ Ask questions or chat with the SearXNG community (this not a chatbot) on
70
+
71
+ IRC
72
+ `#searxng on libera.chat <https://web.libera.chat/?channel=#searxng>`_
73
+ which is bridged to Matrix.
74
+
75
+ Matrix
76
+ `#searxng:matrix.org <https://matrix.to/#/#searxng:matrix.org>`_
77
+
78
+
79
+ Setup
80
+ =====
81
+
82
+ - A well maintained `Docker image`_, also built for ARM64 and ARM/v7
83
+ architectures.
84
+ - Alternatively there are *up to date* `installation scripts`_.
85
+ - For individual setup consult our detailed `Step by step`_ instructions.
86
+ - To fine-tune your instance, take a look at the `Administrator documentation`_.
87
+
88
+ .. _Administrator documentation: https://docs.searxng.org/admin/index.html
89
+ .. _Step by step: https://docs.searxng.org/admin/installation-searxng.html
90
+ .. _installation scripts: https://docs.searxng.org/admin/installation-scripts.html
91
+ .. _Docker image: https://github.com/searxng/searxng-docker
92
+
93
+ Translations
94
+ ============
95
+
96
+ .. _Weblate: https://translate.codeberg.org/projects/searxng/searxng/
97
+
98
+ Help translate SearXNG at `Weblate`_
99
+
100
+ .. figure:: https://translate.codeberg.org/widgets/searxng/-/multi-auto.svg
101
+ :target: https://translate.codeberg.org/projects/searxng/
102
+
103
+
104
+ Contributing
105
+ ============
106
+
107
+ .. _development quickstart: https://docs.searxng.org/dev/quickstart.html
108
+ .. _developer documentation: https://docs.searxng.org/dev/index.html
109
+
110
+ Are you a developer? Have a look at our `development quickstart`_ guide, it's
111
+ very easy to contribute. Additionally we have a `developer documentation`_.
112
+
113
+
114
+ Codespaces
115
+ ==========
116
+
117
+ You can contribute from your browser using `GitHub Codespaces`_:
118
+
119
+ - Fork the repository
120
+ - Click on the ``<> Code`` green button
121
+ - Click on the ``Codespaces`` tab instead of ``Local``
122
+ - Click on ``Create codespace on master``
123
+ - VSCode is going to start in the browser
124
+ - Wait for ``git pull && make install`` to appear and then disappear
125
+ - You have `120 hours per month`_ (see also your `list of existing Codespaces`_)
126
+ - You can start SearXNG using ``make run`` in the terminal or by pressing ``Ctrl+Shift+B``
127
+
128
+ .. _GitHub Codespaces: https://docs.github.com/en/codespaces/overview
129
+ .. _120 hours per month: https://github.com/settings/billing
130
+ .. _list of existing Codespaces: https://github.com/codespaces
SECURITY.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Security Policy
2
+
3
+ We love responsible reports of (potential) security issues in SearXNG.
4
+
5
+ You can contact us at security@searxng.org.
6
+
7
+ Be sure to provide as much information as possible and if found
8
+ also reproduction steps of the identified vulnerability. Also
9
+ add the specific URL of the project as well as code you found
10
+ the issue in to your report.
babel.cfg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ [extractors]
2
+ searxng_msg = searx.babel_extract.extract
3
+ [ignore: **/node_modules/**]
4
+ [python: **.py]
5
+ [jinja2: **/templates/**.html]
6
+ [searxng_msg: **/searxng.msg]
client/simple/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ dist
2
+ node_modules
3
+ .stylelintcache
client/simple/.stylelintrc.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "formatter": "unix",
3
+ "plugins": [ "stylelint-prettier" ],
4
+ "extends": [ "stylelint-config-standard-less" ],
5
+ "rules": {
6
+ "prettier/prettier": true,
7
+ "declaration-empty-line-before": null,
8
+ "no-invalid-position-at-import-rule": null,
9
+ "property-no-vendor-prefix": null,
10
+ "selector-no-vendor-prefix": null,
11
+ "selector-attribute-quotes": null,
12
+ "shorthand-property-no-redundant-values": null,
13
+ "at-rule-no-vendor-prefix": null,
14
+ "selector-id-pattern": null,
15
+ "selector-class-pattern": null
16
+ }
17
+ }
client/simple/README.rst ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ =====================
2
+ MEMO vite development
3
+ =====================
4
+
5
+ Local install::
6
+
7
+ # in folder ./client/simple/
8
+ $ npm install
9
+
10
+ Start development server::
11
+
12
+ $ ./manage vite.simple.dev
13
+
14
+ # in folder ./client/simple/
15
+ $ npm exec -- vite
16
+
17
+ Fix source code::
18
+
19
+ # in folder ./client/simple/
20
+ $ npm run fix
21
+
22
+ Fix & Build::
23
+
24
+ $ ./manage vite.simple.build
client/simple/eslint.config.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import globals from "globals";
2
+ import pluginJs from "@eslint/js";
3
+
4
+
5
+ /** @type {import('eslint').Linter.Config[]} */
6
+ export default [
7
+ pluginJs.configs.recommended,
8
+
9
+ // global "ignores"
10
+ // https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
11
+ {
12
+ ignores: ["node_modules/", "dist/"]
13
+ },
14
+
15
+ {
16
+ files: [
17
+ "**/*.js",
18
+ ],
19
+ linterOptions: {
20
+ reportUnusedDisableDirectives: "error",
21
+ // noInlineConfig: true
22
+ },
23
+ languageOptions: {
24
+ sourceType: "module",
25
+ globals: {
26
+ ...globals.browser,
27
+ }
28
+ },
29
+ rules: {
30
+ indent: ["error", 2],
31
+ },
32
+ },
33
+
34
+ ];
client/simple/generated/pygments.less ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ this file is generated automatically by searxng_extra/update/update_pygments.py
3
+ using pygments version 2.19.1
4
+ */
5
+
6
+
7
+ .code-highlight {
8
+
9
+ pre { line-height: 100%; }
10
+ td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
11
+ span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
12
+ td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
13
+ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
14
+ .hll { background-color: #ffffcc }
15
+ .c { color: #3D7B7B; font-style: italic } /* Comment */
16
+ .err { border: 1px solid #F00 } /* Error */
17
+ .k { color: #008000; font-weight: bold } /* Keyword */
18
+ .o { color: #666 } /* Operator */
19
+ .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
20
+ .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
21
+ .cp { color: #9C6500 } /* Comment.Preproc */
22
+ .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
23
+ .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
24
+ .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
25
+ .gd { color: #A00000 } /* Generic.Deleted */
26
+ .ge { font-style: italic } /* Generic.Emph */
27
+ .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
28
+ .gr { color: #E40000 } /* Generic.Error */
29
+ .gh { color: #000080; font-weight: bold } /* Generic.Heading */
30
+ .gi { color: #008400 } /* Generic.Inserted */
31
+ .go { color: #717171 } /* Generic.Output */
32
+ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
33
+ .gs { font-weight: bold } /* Generic.Strong */
34
+ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
35
+ .gt { color: #04D } /* Generic.Traceback */
36
+ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
37
+ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
38
+ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
39
+ .kp { color: #008000 } /* Keyword.Pseudo */
40
+ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
41
+ .kt { color: #B00040 } /* Keyword.Type */
42
+ .m { color: #666 } /* Literal.Number */
43
+ .s { color: #BA2121 } /* Literal.String */
44
+ .na { color: #687822 } /* Name.Attribute */
45
+ .nb { color: #008000 } /* Name.Builtin */
46
+ .nc { color: #00F; font-weight: bold } /* Name.Class */
47
+ .no { color: #800 } /* Name.Constant */
48
+ .nd { color: #A2F } /* Name.Decorator */
49
+ .ni { color: #717171; font-weight: bold } /* Name.Entity */
50
+ .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
51
+ .nf { color: #00F } /* Name.Function */
52
+ .nl { color: #767600 } /* Name.Label */
53
+ .nn { color: #00F; font-weight: bold } /* Name.Namespace */
54
+ .nt { color: #008000; font-weight: bold } /* Name.Tag */
55
+ .nv { color: #19177C } /* Name.Variable */
56
+ .ow { color: #A2F; font-weight: bold } /* Operator.Word */
57
+ .w { color: #BBB } /* Text.Whitespace */
58
+ .mb { color: #666 } /* Literal.Number.Bin */
59
+ .mf { color: #666 } /* Literal.Number.Float */
60
+ .mh { color: #666 } /* Literal.Number.Hex */
61
+ .mi { color: #666 } /* Literal.Number.Integer */
62
+ .mo { color: #666 } /* Literal.Number.Oct */
63
+ .sa { color: #BA2121 } /* Literal.String.Affix */
64
+ .sb { color: #BA2121 } /* Literal.String.Backtick */
65
+ .sc { color: #BA2121 } /* Literal.String.Char */
66
+ .dl { color: #BA2121 } /* Literal.String.Delimiter */
67
+ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
68
+ .s2 { color: #BA2121 } /* Literal.String.Double */
69
+ .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
70
+ .sh { color: #BA2121 } /* Literal.String.Heredoc */
71
+ .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
72
+ .sx { color: #008000 } /* Literal.String.Other */
73
+ .sr { color: #A45A77 } /* Literal.String.Regex */
74
+ .s1 { color: #BA2121 } /* Literal.String.Single */
75
+ .ss { color: #19177C } /* Literal.String.Symbol */
76
+ .bp { color: #008000 } /* Name.Builtin.Pseudo */
77
+ .fm { color: #00F } /* Name.Function.Magic */
78
+ .vc { color: #19177C } /* Name.Variable.Class */
79
+ .vg { color: #19177C } /* Name.Variable.Global */
80
+ .vi { color: #19177C } /* Name.Variable.Instance */
81
+ .vm { color: #19177C } /* Name.Variable.Magic */
82
+ .il { color: #666 } /* Literal.Number.Integer.Long */
83
+ }
84
+
85
+ .code-highlight-dark(){
86
+ .code-highlight {
87
+
88
+ pre { line-height: 100%; }
89
+ td.linenos .normal { color: #3c4354; background-color: transparent; padding-left: 5px; padding-right: 5px; }
90
+ span.linenos { color: #3c4354; background-color: transparent; padding-left: 5px; padding-right: 5px; }
91
+ td.linenos .special { color: #3c4354; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
92
+ span.linenos.special { color: #3c4354; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
93
+ .hll { background-color: #6e7681 }
94
+ .c { color: #7E8AA1 } /* Comment */
95
+ .err { color: #F88F7F } /* Error */
96
+ .esc { color: #D4D2C8 } /* Escape */
97
+ .g { color: #D4D2C8 } /* Generic */
98
+ .k { color: #FFAD66 } /* Keyword */
99
+ .l { color: #D5FF80 } /* Literal */
100
+ .n { color: #D4D2C8 } /* Name */
101
+ .o { color: #FFAD66 } /* Operator */
102
+ .x { color: #D4D2C8 } /* Other */
103
+ .p { color: #D4D2C8 } /* Punctuation */
104
+ .ch { color: #F88F7F; font-style: italic } /* Comment.Hashbang */
105
+ .cm { color: #7E8AA1 } /* Comment.Multiline */
106
+ .cp { color: #FFAD66; font-weight: bold } /* Comment.Preproc */
107
+ .cpf { color: #7E8AA1 } /* Comment.PreprocFile */
108
+ .c1 { color: #7E8AA1 } /* Comment.Single */
109
+ .cs { color: #7E8AA1; font-style: italic } /* Comment.Special */
110
+ .gd { color: #F88F7F; background-color: #3D1E20 } /* Generic.Deleted */
111
+ .ge { color: #D4D2C8; font-style: italic } /* Generic.Emph */
112
+ .ges { color: #D4D2C8 } /* Generic.EmphStrong */
113
+ .gr { color: #F88F7F } /* Generic.Error */
114
+ .gh { color: #D4D2C8 } /* Generic.Heading */
115
+ .gi { color: #6AD4AF; background-color: #19362C } /* Generic.Inserted */
116
+ .go { color: #7E8AA1 } /* Generic.Output */
117
+ .gp { color: #D4D2C8 } /* Generic.Prompt */
118
+ .gs { color: #D4D2C8; font-weight: bold } /* Generic.Strong */
119
+ .gu { color: #D4D2C8 } /* Generic.Subheading */
120
+ .gt { color: #F88F7F } /* Generic.Traceback */
121
+ .kc { color: #FFAD66 } /* Keyword.Constant */
122
+ .kd { color: #FFAD66 } /* Keyword.Declaration */
123
+ .kn { color: #FFAD66 } /* Keyword.Namespace */
124
+ .kp { color: #FFAD66 } /* Keyword.Pseudo */
125
+ .kr { color: #FFAD66 } /* Keyword.Reserved */
126
+ .kt { color: #73D0FF } /* Keyword.Type */
127
+ .ld { color: #D5FF80 } /* Literal.Date */
128
+ .m { color: #DFBFFF } /* Literal.Number */
129
+ .s { color: #D5FF80 } /* Literal.String */
130
+ .na { color: #FFD173 } /* Name.Attribute */
131
+ .nb { color: #FFD173 } /* Name.Builtin */
132
+ .nc { color: #73D0FF } /* Name.Class */
133
+ .no { color: #FFD173 } /* Name.Constant */
134
+ .nd { color: #7E8AA1; font-weight: bold; font-style: italic } /* Name.Decorator */
135
+ .ni { color: #95E6CB } /* Name.Entity */
136
+ .ne { color: #73D0FF } /* Name.Exception */
137
+ .nf { color: #FFD173 } /* Name.Function */
138
+ .nl { color: #D4D2C8 } /* Name.Label */
139
+ .nn { color: #D4D2C8 } /* Name.Namespace */
140
+ .nx { color: #D4D2C8 } /* Name.Other */
141
+ .py { color: #FFD173 } /* Name.Property */
142
+ .nt { color: #5CCFE6 } /* Name.Tag */
143
+ .nv { color: #D4D2C8 } /* Name.Variable */
144
+ .ow { color: #FFAD66 } /* Operator.Word */
145
+ .pm { color: #D4D2C8 } /* Punctuation.Marker */
146
+ .w { color: #D4D2C8 } /* Text.Whitespace */
147
+ .mb { color: #DFBFFF } /* Literal.Number.Bin */
148
+ .mf { color: #DFBFFF } /* Literal.Number.Float */
149
+ .mh { color: #DFBFFF } /* Literal.Number.Hex */
150
+ .mi { color: #DFBFFF } /* Literal.Number.Integer */
151
+ .mo { color: #DFBFFF } /* Literal.Number.Oct */
152
+ .sa { color: #F29E74 } /* Literal.String.Affix */
153
+ .sb { color: #D5FF80 } /* Literal.String.Backtick */
154
+ .sc { color: #D5FF80 } /* Literal.String.Char */
155
+ .dl { color: #D5FF80 } /* Literal.String.Delimiter */
156
+ .sd { color: #7E8AA1 } /* Literal.String.Doc */
157
+ .s2 { color: #D5FF80 } /* Literal.String.Double */
158
+ .se { color: #95E6CB } /* Literal.String.Escape */
159
+ .sh { color: #D5FF80 } /* Literal.String.Heredoc */
160
+ .si { color: #95E6CB } /* Literal.String.Interpol */
161
+ .sx { color: #95E6CB } /* Literal.String.Other */
162
+ .sr { color: #95E6CB } /* Literal.String.Regex */
163
+ .s1 { color: #D5FF80 } /* Literal.String.Single */
164
+ .ss { color: #DFBFFF } /* Literal.String.Symbol */
165
+ .bp { color: #5CCFE6 } /* Name.Builtin.Pseudo */
166
+ .fm { color: #FFD173 } /* Name.Function.Magic */
167
+ .vc { color: #D4D2C8 } /* Name.Variable.Class */
168
+ .vg { color: #D4D2C8 } /* Name.Variable.Global */
169
+ .vi { color: #D4D2C8 } /* Name.Variable.Instance */
170
+ .vm { color: #D4D2C8 } /* Name.Variable.Magic */
171
+ .il { color: #DFBFFF } /* Literal.Number.Integer.Long */
172
+ }
173
+ }
client/simple/package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
client/simple/package.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "simple",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "clean": "rm -Rf node_modules",
7
+ "build": "node theme_icons.js && vite build",
8
+ "fix": "eslint --fix && stylelint --fix strict 'src/**/*.{css,scss,sass,less,styl,vue,svelte}'",
9
+ "icons.html": "node theme_icons.js"
10
+ },
11
+ "devDependencies": {
12
+ "@eslint/js": "^9.22.0",
13
+ "copy-webpack-plugin": "^13.0.0",
14
+ "css-loader": "^7.1.2",
15
+ "edge.js": "^6.2.1",
16
+ "eslint": "^9.22.0",
17
+ "filemanager-webpack-plugin": "^8.0.0",
18
+ "globals": "^16.0.0",
19
+ "ionicons": "^7.4.0",
20
+ "leaflet": "^1.9.4",
21
+ "less": "^4.2.2",
22
+ "less-loader": "^12.2.0",
23
+ "normalize.css": "^8.0.1",
24
+ "sharp": "^0.33.5",
25
+ "style-loader": "^4.0.0",
26
+ "stylelint": "^16.16.0",
27
+ "stylelint-config-standard": "^37.0.0",
28
+ "stylelint-config-standard-less": "^3.0.1",
29
+ "stylelint-prettier": "^5.0.3",
30
+ "svgo": "^3.3.2",
31
+ "vite": "^6.2.3",
32
+ "vite-plugin-static-copy": "^2.3.0",
33
+ "vite-plugin-stylelint": "^6.0.0",
34
+ "webpack": "^5.97.1",
35
+ "webpack-cli": "^6.0.1"
36
+ },
37
+ "dependencies": {
38
+ "autocomplete-js": "^2.7.1"
39
+ }
40
+ }
client/simple/src/brand/img_load_error.svg ADDED
client/simple/src/brand/searxng-wordmark.svg ADDED
client/simple/src/brand/searxng.svg ADDED
client/simple/src/js/head/00_init.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* SPDX-License-Identifier: AGPL-3.0-or-later */
2
+ (function (w, d) {
3
+ 'use strict';
4
+
5
+ // add data- properties
6
+ var script = d.currentScript || (function () {
7
+ var scripts = d.getElementsByTagName('script');
8
+ return scripts[scripts.length - 1];
9
+ })();
10
+
11
+ w.searxng = {
12
+ settings: JSON.parse(atob(script.getAttribute('client_settings')))
13
+ };
14
+
15
+ // update the css
16
+ var htmlElement = d.getElementsByTagName("html")[0];
17
+ htmlElement.classList.remove('no-js');
18
+ htmlElement.classList.add('js');
19
+
20
+ })(window, document);
client/simple/src/js/main/00_toolkit.js ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @license
3
+ * (C) Copyright Contributors to the SearXNG project.
4
+ * (C) Copyright Contributors to the searx project (2014 - 2021).
5
+ * SPDX-License-Identifier: AGPL-3.0-or-later
6
+ */
7
+ window.searxng = (function (w, d) {
8
+
9
+ 'use strict';
10
+
11
+ // not invented here toolkit with bugs fixed elsewhere
12
+ // purposes : be just good enough and as small as possible
13
+
14
+ // from https://plainjs.com/javascript/events/live-binding-event-handlers-14/
15
+ if (w.Element) {
16
+ (function (ElementPrototype) {
17
+ ElementPrototype.matches = ElementPrototype.matches ||
18
+ ElementPrototype.matchesSelector ||
19
+ ElementPrototype.webkitMatchesSelector ||
20
+ ElementPrototype.msMatchesSelector ||
21
+ function (selector) {
22
+ var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
23
+ while (nodes[++i] && nodes[i] != node);
24
+ return !!nodes[i];
25
+ };
26
+ })(Element.prototype);
27
+ }
28
+
29
+ function callbackSafe (callback, el, e) {
30
+ try {
31
+ callback.call(el, e);
32
+ } catch (exception) {
33
+ console.log(exception);
34
+ }
35
+ }
36
+
37
+ var searxng = window.searxng || {};
38
+
39
+ searxng.on = function (obj, eventType, callback, useCapture) {
40
+ useCapture = useCapture || false;
41
+ if (typeof obj !== 'string') {
42
+ // obj HTMLElement, HTMLDocument
43
+ obj.addEventListener(eventType, callback, useCapture);
44
+ } else {
45
+ // obj is a selector
46
+ d.addEventListener(eventType, function (e) {
47
+ var el = e.target || e.srcElement, found = false;
48
+ while (el && el.matches && el !== d && !(found = el.matches(obj))) el = el.parentElement;
49
+ if (found) callbackSafe(callback, el, e);
50
+ }, useCapture);
51
+ }
52
+ };
53
+
54
+ searxng.ready = function (callback) {
55
+ if (document.readyState != 'loading') {
56
+ callback.call(w);
57
+ } else {
58
+ w.addEventListener('DOMContentLoaded', callback.bind(w));
59
+ }
60
+ };
61
+
62
+ searxng.http = function (method, url, data = null) {
63
+ return new Promise(function (resolve, reject) {
64
+ try {
65
+ var req = new XMLHttpRequest();
66
+ req.open(method, url, true);
67
+ req.timeout = 20000;
68
+
69
+ // On load
70
+ req.onload = function () {
71
+ if (req.status == 200) {
72
+ resolve(req.response, req.responseType);
73
+ } else {
74
+ reject(Error(req.statusText));
75
+ }
76
+ };
77
+
78
+ // Handle network errors
79
+ req.onerror = function () {
80
+ reject(Error("Network Error"));
81
+ };
82
+
83
+ req.onabort = function () {
84
+ reject(Error("Transaction is aborted"));
85
+ };
86
+
87
+ req.ontimeout = function () {
88
+ reject(Error("Timeout"));
89
+ }
90
+
91
+ // Make the request
92
+ if (data) {
93
+ req.send(data)
94
+ } else {
95
+ req.send();
96
+ }
97
+ } catch (ex) {
98
+ reject(ex);
99
+ }
100
+ });
101
+ };
102
+
103
+ searxng.loadStyle = function (src) {
104
+ var path = searxng.settings.theme_static_path + "/" + src,
105
+ id = "style_" + src.replace('.', '_'),
106
+ s = d.getElementById(id);
107
+ if (s === null) {
108
+ s = d.createElement('link');
109
+ s.setAttribute('id', id);
110
+ s.setAttribute('rel', 'stylesheet');
111
+ s.setAttribute('type', 'text/css');
112
+ s.setAttribute('href', path);
113
+ d.body.appendChild(s);
114
+ }
115
+ };
116
+
117
+ searxng.loadScript = function (src, callback) {
118
+ var path = searxng.settings.theme_static_path + "/" + src,
119
+ id = "script_" + src.replace('.', '_'),
120
+ s = d.getElementById(id);
121
+ if (s === null) {
122
+ s = d.createElement('script');
123
+ s.setAttribute('id', id);
124
+ s.setAttribute('src', path);
125
+ s.onload = callback;
126
+ s.onerror = function () {
127
+ s.setAttribute('error', '1');
128
+ };
129
+ d.body.appendChild(s);
130
+ } else if (!s.hasAttribute('error')) {
131
+ try {
132
+ callback.apply(s, []);
133
+ } catch (exception) {
134
+ console.log(exception);
135
+ }
136
+ } else {
137
+ console.log("callback not executed : script '" + path + "' not loaded.");
138
+ }
139
+ };
140
+
141
+ searxng.insertBefore = function (newNode, referenceNode) {
142
+ referenceNode.parentNode.insertBefore(newNode, referenceNode);
143
+ };
144
+
145
+ searxng.insertAfter = function (newNode, referenceNode) {
146
+ referenceNode.parentNode.insertAfter(newNode, referenceNode.nextSibling);
147
+ };
148
+
149
+ searxng.on('.close', 'click', function () {
150
+ this.parentNode.classList.add('invisible');
151
+ });
152
+
153
+ function getEndpoint () {
154
+ for (var className of d.getElementsByTagName('body')[0].classList.values()) {
155
+ if (className.endsWith('_endpoint')) {
156
+ return className.split('_')[0];
157
+ }
158
+ }
159
+ return '';
160
+ }
161
+
162
+ searxng.endpoint = getEndpoint();
163
+
164
+ return searxng;
165
+ })(window, document);
client/simple/src/js/main/infinite_scroll.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+ /* global searxng */
4
+
5
+ searxng.ready(function () {
6
+ 'use strict';
7
+
8
+ searxng.infinite_scroll_supported = (
9
+ 'IntersectionObserver' in window &&
10
+ 'IntersectionObserverEntry' in window &&
11
+ 'intersectionRatio' in window.IntersectionObserverEntry.prototype);
12
+
13
+ if (searxng.endpoint !== 'results') {
14
+ return;
15
+ }
16
+
17
+ if (!searxng.infinite_scroll_supported) {
18
+ console.log('IntersectionObserver not supported');
19
+ return;
20
+ }
21
+
22
+ let d = document;
23
+ var onlyImages = d.getElementById('results').classList.contains('only_template_images');
24
+
25
+ function newLoadSpinner () {
26
+ var loader = d.createElement('div');
27
+ loader.classList.add('loader');
28
+ return loader;
29
+ }
30
+
31
+ function replaceChildrenWith (element, children) {
32
+ element.textContent = '';
33
+ children.forEach(child => element.appendChild(child));
34
+ }
35
+
36
+ function loadNextPage (callback) {
37
+ var form = d.querySelector('#pagination form.next_page');
38
+ if (!form) {
39
+ return
40
+ }
41
+ replaceChildrenWith(d.querySelector('#pagination'), [ newLoadSpinner() ]);
42
+ var formData = new FormData(form);
43
+ searxng.http('POST', d.querySelector('#search').getAttribute('action'), formData).then(
44
+ function (response) {
45
+ var nextPageDoc = new DOMParser().parseFromString(response, 'text/html');
46
+ var articleList = nextPageDoc.querySelectorAll('#urls article');
47
+ var paginationElement = nextPageDoc.querySelector('#pagination');
48
+ d.querySelector('#pagination').remove();
49
+ if (articleList.length > 0 && !onlyImages) {
50
+ // do not add <hr> element when there are only images
51
+ d.querySelector('#urls').appendChild(d.createElement('hr'));
52
+ }
53
+ articleList.forEach(articleElement => {
54
+ d.querySelector('#urls').appendChild(articleElement);
55
+ });
56
+ if (paginationElement) {
57
+ d.querySelector('#results').appendChild(paginationElement);
58
+ callback();
59
+ }
60
+ }
61
+ ).catch(
62
+ function (err) {
63
+ console.log(err);
64
+ var e = d.createElement('div');
65
+ e.textContent = searxng.settings.translations.error_loading_next_page;
66
+ e.classList.add('dialog-error');
67
+ e.setAttribute('role', 'alert');
68
+ replaceChildrenWith(d.querySelector('#pagination'), [ e ]);
69
+ }
70
+ )
71
+ }
72
+
73
+ if (searxng.settings.infinite_scroll && searxng.infinite_scroll_supported) {
74
+ const intersectionObserveOptions = {
75
+ rootMargin: "20rem",
76
+ };
77
+ const observedSelector = 'article.result:last-child';
78
+ const observer = new IntersectionObserver(entries => {
79
+ const paginationEntry = entries[0];
80
+ if (paginationEntry.isIntersecting) {
81
+ observer.unobserve(paginationEntry.target);
82
+ loadNextPage(() => observer.observe(d.querySelector(observedSelector), intersectionObserveOptions));
83
+ }
84
+ });
85
+ observer.observe(d.querySelector(observedSelector), intersectionObserveOptions);
86
+ }
87
+
88
+ });
client/simple/src/js/main/keyboard.js ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* SPDX-License-Identifier: AGPL-3.0-or-later */
2
+ /* global searxng */
3
+
4
+ searxng.ready(function () {
5
+
6
+ function isElementInDetail (el) {
7
+ while (el !== undefined) {
8
+ if (el.classList.contains('detail')) {
9
+ return true;
10
+ }
11
+ if (el.classList.contains('result')) {
12
+ // we found a result, no need to go to the root of the document:
13
+ // el is not inside a <div class="detail"> element
14
+ return false;
15
+ }
16
+ el = el.parentNode;
17
+ }
18
+ return false;
19
+ }
20
+
21
+ function getResultElement (el) {
22
+ while (el !== undefined) {
23
+ if (el.classList.contains('result')) {
24
+ return el;
25
+ }
26
+ el = el.parentNode;
27
+ }
28
+ return undefined;
29
+ }
30
+
31
+ function isImageResult (resultElement) {
32
+ return resultElement && resultElement.classList.contains('result-images');
33
+ }
34
+
35
+ searxng.on('.result', 'click', function (e) {
36
+ if (!isElementInDetail(e.target)) {
37
+ highlightResult(this)(true, true);
38
+ let resultElement = getResultElement(e.target);
39
+ if (isImageResult(resultElement)) {
40
+ e.preventDefault();
41
+ searxng.selectImage(resultElement);
42
+ }
43
+ }
44
+ });
45
+
46
+ searxng.on('.result a', 'focus', function (e) {
47
+ if (!isElementInDetail(e.target)) {
48
+ let resultElement = getResultElement(e.target);
49
+ if (resultElement && resultElement.getAttribute("data-vim-selected") === null) {
50
+ highlightResult(resultElement)(true);
51
+ }
52
+ if (isImageResult(resultElement)) {
53
+ searxng.selectImage(resultElement);
54
+ }
55
+ }
56
+ }, true);
57
+
58
+ /* common base for layouts */
59
+ var baseKeyBinding = {
60
+ 'Escape': {
61
+ key: 'ESC',
62
+ fun: removeFocus,
63
+ des: 'remove focus from the focused input',
64
+ cat: 'Control'
65
+ },
66
+ 'c': {
67
+ key: 'c',
68
+ fun: copyURLToClipboard,
69
+ des: 'copy url of the selected result to the clipboard',
70
+ cat: 'Results'
71
+ },
72
+ 'h': {
73
+ key: 'h',
74
+ fun: toggleHelp,
75
+ des: 'toggle help window',
76
+ cat: 'Other'
77
+ },
78
+ 'i': {
79
+ key: 'i',
80
+ fun: searchInputFocus,
81
+ des: 'focus on the search input',
82
+ cat: 'Control'
83
+ },
84
+ 'n': {
85
+ key: 'n',
86
+ fun: GoToNextPage(),
87
+ des: 'go to next page',
88
+ cat: 'Results'
89
+ },
90
+ 'o': {
91
+ key: 'o',
92
+ fun: openResult(false),
93
+ des: 'open search result',
94
+ cat: 'Results'
95
+ },
96
+ 'p': {
97
+ key: 'p',
98
+ fun: GoToPreviousPage(),
99
+ des: 'go to previous page',
100
+ cat: 'Results'
101
+ },
102
+ 'r': {
103
+ key: 'r',
104
+ fun: reloadPage,
105
+ des: 'reload page from the server',
106
+ cat: 'Control'
107
+ },
108
+ 't': {
109
+ key: 't',
110
+ fun: openResult(true),
111
+ des: 'open the result in a new tab',
112
+ cat: 'Results'
113
+ },
114
+ };
115
+ var keyBindingLayouts = {
116
+
117
+ "default": Object.assign(
118
+ { /* SearXNG layout */
119
+ 'ArrowLeft': {
120
+ key: '←',
121
+ fun: highlightResult('up'),
122
+ des: 'select previous search result',
123
+ cat: 'Results'
124
+ },
125
+ 'ArrowRight': {
126
+ key: '→',
127
+ fun: highlightResult('down'),
128
+ des: 'select next search result',
129
+ cat: 'Results'
130
+ },
131
+ }, baseKeyBinding),
132
+
133
+ 'vim': Object.assign(
134
+ { /* Vim-like Key Layout. */
135
+ 'b': {
136
+ key: 'b',
137
+ fun: scrollPage(-window.innerHeight),
138
+ des: 'scroll one page up',
139
+ cat: 'Navigation'
140
+ },
141
+ 'f': {
142
+ key: 'f',
143
+ fun: scrollPage(window.innerHeight),
144
+ des: 'scroll one page down',
145
+ cat: 'Navigation'
146
+ },
147
+ 'u': {
148
+ key: 'u',
149
+ fun: scrollPage(-window.innerHeight / 2),
150
+ des: 'scroll half a page up',
151
+ cat: 'Navigation'
152
+ },
153
+ 'd': {
154
+ key: 'd',
155
+ fun: scrollPage(window.innerHeight / 2),
156
+ des: 'scroll half a page down',
157
+ cat: 'Navigation'
158
+ },
159
+ 'g': {
160
+ key: 'g',
161
+ fun: scrollPageTo(-document.body.scrollHeight, 'top'),
162
+ des: 'scroll to the top of the page',
163
+ cat: 'Navigation'
164
+ },
165
+ 'v': {
166
+ key: 'v',
167
+ fun: scrollPageTo(document.body.scrollHeight, 'bottom'),
168
+ des: 'scroll to the bottom of the page',
169
+ cat: 'Navigation'
170
+ },
171
+ 'k': {
172
+ key: 'k',
173
+ fun: highlightResult('up'),
174
+ des: 'select previous search result',
175
+ cat: 'Results'
176
+ },
177
+ 'j': {
178
+ key: 'j',
179
+ fun: highlightResult('down'),
180
+ des: 'select next search result',
181
+ cat: 'Results'
182
+ },
183
+ 'y': {
184
+ key: 'y',
185
+ fun: copyURLToClipboard,
186
+ des: 'copy url of the selected result to the clipboard',
187
+ cat: 'Results'
188
+ },
189
+ }, baseKeyBinding)
190
+ }
191
+
192
+ var keyBindings = keyBindingLayouts[searxng.settings.hotkeys] || keyBindingLayouts.default;
193
+
194
+ searxng.on(document, "keydown", function (e) {
195
+ // check for modifiers so we don't break browser's hotkeys
196
+ if (
197
+ Object.prototype.hasOwnProperty.call(keyBindings, e.key)
198
+ && !e.ctrlKey && !e.altKey
199
+ && !e.shiftKey && !e.metaKey
200
+ ) {
201
+ var tagName = e.target.tagName.toLowerCase();
202
+ if (e.key === 'Escape') {
203
+ keyBindings[e.key].fun(e);
204
+ } else {
205
+ if (e.target === document.body || tagName === 'a' || tagName === 'button') {
206
+ e.preventDefault();
207
+ keyBindings[e.key].fun();
208
+ }
209
+ }
210
+ }
211
+ });
212
+
213
+ function highlightResult (which) {
214
+ return function (noScroll, keepFocus) {
215
+ var current = document.querySelector('.result[data-vim-selected]'),
216
+ effectiveWhich = which;
217
+ if (current === null) {
218
+ // no selection : choose the first one
219
+ current = document.querySelector('.result');
220
+ if (current === null) {
221
+ // no first one : there are no results
222
+ return;
223
+ }
224
+ // replace up/down actions by selecting first one
225
+ if (which === "down" || which === "up") {
226
+ effectiveWhich = current;
227
+ }
228
+ }
229
+
230
+ var next, results = document.querySelectorAll('.result');
231
+ results = Array.from(results); // convert NodeList to Array for further use
232
+
233
+ if (typeof effectiveWhich !== 'string') {
234
+ next = effectiveWhich;
235
+ } else {
236
+ switch (effectiveWhich) {
237
+ case 'visible':
238
+ var top = document.documentElement.scrollTop || document.body.scrollTop;
239
+ var bot = top + document.documentElement.clientHeight;
240
+
241
+ for (var i = 0; i < results.length; i++) {
242
+ next = results[i];
243
+ var etop = next.offsetTop;
244
+ var ebot = etop + next.clientHeight;
245
+
246
+ if ((ebot <= bot) && (etop > top)) {
247
+ break;
248
+ }
249
+ }
250
+ break;
251
+ case 'down':
252
+ next = results[results.indexOf(current) + 1] || current;
253
+ break;
254
+ case 'up':
255
+ next = results[results.indexOf(current) - 1] || current;
256
+ break;
257
+ case 'bottom':
258
+ next = results[results.length - 1];
259
+ break;
260
+ case 'top':
261
+ /* falls through */
262
+ default:
263
+ next = results[0];
264
+ }
265
+ }
266
+
267
+ if (next) {
268
+ current.removeAttribute('data-vim-selected');
269
+ next.setAttribute('data-vim-selected', 'true');
270
+ if (!keepFocus) {
271
+ var link = next.querySelector('h3 a') || next.querySelector('a');
272
+ if (link !== null) {
273
+ link.focus();
274
+ }
275
+ }
276
+ if (!noScroll) {
277
+ scrollPageToSelected();
278
+ }
279
+ }
280
+ };
281
+ }
282
+
283
+ function reloadPage () {
284
+ document.location.reload(true);
285
+ }
286
+
287
+ function removeFocus (e) {
288
+ const tagName = e.target.tagName.toLowerCase();
289
+ if (document.activeElement && (tagName === 'input' || tagName === 'select' || tagName === 'textarea')) {
290
+ document.activeElement.blur();
291
+ } else {
292
+ searxng.closeDetail();
293
+ }
294
+ }
295
+
296
+ function pageButtonClick (css_selector) {
297
+ return function () {
298
+ var button = document.querySelector(css_selector);
299
+ if (button) {
300
+ button.click();
301
+ }
302
+ };
303
+ }
304
+
305
+ function GoToNextPage () {
306
+ return pageButtonClick('nav#pagination .next_page button[type="submit"]');
307
+ }
308
+
309
+ function GoToPreviousPage () {
310
+ return pageButtonClick('nav#pagination .previous_page button[type="submit"]');
311
+ }
312
+
313
+ function scrollPageToSelected () {
314
+ var sel = document.querySelector('.result[data-vim-selected]');
315
+ if (sel === null) {
316
+ return;
317
+ }
318
+ var wtop = document.documentElement.scrollTop || document.body.scrollTop,
319
+ wheight = document.documentElement.clientHeight,
320
+ etop = sel.offsetTop,
321
+ ebot = etop + sel.clientHeight,
322
+ offset = 120;
323
+ // first element ?
324
+ if ((sel.previousElementSibling === null) && (ebot < wheight)) {
325
+ // set to the top of page if the first element
326
+ // is fully included in the viewport
327
+ window.scroll(window.scrollX, 0);
328
+ return;
329
+ }
330
+ if (wtop > (etop - offset)) {
331
+ window.scroll(window.scrollX, etop - offset);
332
+ } else {
333
+ var wbot = wtop + wheight;
334
+ if (wbot < (ebot + offset)) {
335
+ window.scroll(window.scrollX, ebot - wheight + offset);
336
+ }
337
+ }
338
+ }
339
+
340
+ function scrollPage (amount) {
341
+ return function () {
342
+ window.scrollBy(0, amount);
343
+ highlightResult('visible')();
344
+ };
345
+ }
346
+
347
+ function scrollPageTo (position, nav) {
348
+ return function () {
349
+ window.scrollTo(0, position);
350
+ highlightResult(nav)();
351
+ };
352
+ }
353
+
354
+ function searchInputFocus () {
355
+ window.scrollTo(0, 0);
356
+ var q = document.querySelector('#q');
357
+ q.focus();
358
+ if (q.setSelectionRange) {
359
+ var len = q.value.length;
360
+ q.setSelectionRange(len, len);
361
+ }
362
+ }
363
+
364
+ function openResult (newTab) {
365
+ return function () {
366
+ var link = document.querySelector('.result[data-vim-selected] h3 a');
367
+ if (link === null) {
368
+ link = document.querySelector('.result[data-vim-selected] > a');
369
+ }
370
+ if (link !== null) {
371
+ var url = link.getAttribute('href');
372
+ if (newTab) {
373
+ window.open(url);
374
+ } else {
375
+ window.location.href = url;
376
+ }
377
+ }
378
+ };
379
+ }
380
+
381
+ function initHelpContent (divElement) {
382
+ var categories = {};
383
+
384
+ for (var k in keyBindings) {
385
+ var key = keyBindings[k];
386
+ categories[key.cat] = categories[key.cat] || [];
387
+ categories[key.cat].push(key);
388
+ }
389
+
390
+ var sorted = Object.keys(categories).sort(function (a, b) {
391
+ return categories[b].length - categories[a].length;
392
+ });
393
+
394
+ if (sorted.length === 0) {
395
+ return;
396
+ }
397
+
398
+ var html = '<a href="#" class="close" aria-label="close" title="close">×</a>';
399
+ html += '<h3>How to navigate SearXNG with hotkeys</h3>';
400
+ html += '<table>';
401
+
402
+ for (var i = 0; i < sorted.length; i++) {
403
+ var cat = categories[sorted[i]];
404
+
405
+ var lastCategory = i === (sorted.length - 1);
406
+ var first = i % 2 === 0;
407
+
408
+ if (first) {
409
+ html += '<tr>';
410
+ }
411
+ html += '<td>';
412
+
413
+ html += '<h4>' + cat[0].cat + '</h4>';
414
+ html += '<ul class="list-unstyled">';
415
+
416
+ for (var cj in cat) {
417
+ html += '<li><kbd>' + cat[cj].key + '</kbd> ' + cat[cj].des + '</li>';
418
+ }
419
+
420
+ html += '</ul>';
421
+ html += '</td>'; // col-sm-*
422
+
423
+ if (!first || lastCategory) {
424
+ html += '</tr>'; // row
425
+ }
426
+ }
427
+
428
+ html += '</table>';
429
+
430
+ divElement.innerHTML = html;
431
+ }
432
+
433
+ function toggleHelp () {
434
+ var helpPanel = document.querySelector('#vim-hotkeys-help');
435
+ if (helpPanel === undefined || helpPanel === null) {
436
+ // first call
437
+ helpPanel = document.createElement('div');
438
+ helpPanel.id = 'vim-hotkeys-help';
439
+ helpPanel.className = 'dialog-modal';
440
+ initHelpContent(helpPanel);
441
+ var body = document.getElementsByTagName('body')[0];
442
+ body.appendChild(helpPanel);
443
+ } else {
444
+ // toggle hidden
445
+ helpPanel.classList.toggle('invisible');
446
+ return;
447
+ }
448
+ }
449
+
450
+ function copyURLToClipboard () {
451
+ var currentUrlElement = document.querySelector('.result[data-vim-selected] h3 a');
452
+ if (currentUrlElement === null) return;
453
+
454
+ const url = currentUrlElement.getAttribute('href');
455
+ navigator.clipboard.writeText(url);
456
+ }
457
+
458
+ searxng.scrollPageToSelected = scrollPageToSelected;
459
+ searxng.selectNext = highlightResult('down');
460
+ searxng.selectPrevious = highlightResult('up');
461
+ });