|
@@ -48,6 +48,34 @@ searx_variables=(SEARX_REPO
|
48
|
48
|
MY_USERNAME
|
49
|
49
|
SYSTEM_TYPE)
|
50
|
50
|
|
|
51
|
+function remove_user_friendica {
|
|
52
|
+ remove_username="$1"
|
|
53
|
+
|
|
54
|
+ ${PROJECT_NAME}-pass -u $remove_username --rmapp searx
|
|
55
|
+ if grep -q "$remove_username:" /etc/nginx/.htpasswd; then
|
|
56
|
+ sed -i "/$remove_username:/d" /etc/nginx/.htpasswd
|
|
57
|
+ fi
|
|
58
|
+}
|
|
59
|
+
|
|
60
|
+function add_user_friendica {
|
|
61
|
+ if [[ $(app_is_installed searx) == "0" ]]; then
|
|
62
|
+ echo '0'
|
|
63
|
+ return
|
|
64
|
+ fi
|
|
65
|
+
|
|
66
|
+ new_username="$1"
|
|
67
|
+ new_user_password="$2"
|
|
68
|
+
|
|
69
|
+ ${PROJECT_NAME}-pass -u $new_username -a searx -p "$new_user_password"
|
|
70
|
+
|
|
71
|
+ if grep -q "$new_username:" /etc/nginx/.htpasswd; then
|
|
72
|
+ sed -i "/$new_username:/d" /etc/nginx/.htpasswd
|
|
73
|
+ fi
|
|
74
|
+ echo "$new_user_password" | htpasswd -i -s -c /etc/nginx/.htpasswd $new_username
|
|
75
|
+
|
|
76
|
+ echo '0'
|
|
77
|
+}
|
|
78
|
+
|
51
|
79
|
function install_interactive_searx {
|
52
|
80
|
echo -n ''
|
53
|
81
|
APP_INSTALLED=1
|
|
@@ -61,25 +89,533 @@ function reconfigure_searx {
|
61
|
89
|
echo -n ''
|
62
|
90
|
}
|
63
|
91
|
|
|
92
|
+function create_searx_config {
|
|
93
|
+ settings_file=${SEARX_PATH}/searx/searx/settings.yml
|
|
94
|
+ if [ -f $settings_file ]; then
|
|
95
|
+ return
|
|
96
|
+ fi
|
|
97
|
+
|
|
98
|
+ SEARX_ONION_HOSTNAME=$(echo /var/lib/tor/hidden_service_searx/hostname)
|
|
99
|
+ SEARX_SECRET_KEY=$(get_completion_param "searx key")
|
|
100
|
+
|
|
101
|
+ echo 'general:' > $settings_file
|
|
102
|
+ echo ' debug : False' >> $settings_file
|
|
103
|
+ echo ' instance_name : "Freedombone Metasearch"' >> $settings_file
|
|
104
|
+ echo '' >> $settings_file
|
|
105
|
+ echo 'search:' >> $settings_file
|
|
106
|
+ echo ' safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict' >> $settings_file
|
|
107
|
+ echo ' autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "startpage", "wikipedia" - leave blank to turn it off by default' >> $settings_file
|
|
108
|
+ echo ' language : "all"' >> $settings_file
|
|
109
|
+ echo '' >> $settings_file
|
|
110
|
+ echo 'server:' >> $settings_file
|
|
111
|
+ echo ' port : 8888' >> $settings_file
|
|
112
|
+ echo ' bind_address : "127.0.0.1" # address to listen on' >> $settings_file
|
|
113
|
+ echo " secret_key : \"${SEARX_SECRET_KEY}\"" >> $settings_file
|
|
114
|
+ echo " base_url : http://${SEARX_ONION_HOSTNAME}/" >> $settings_file
|
|
115
|
+ echo ' image_proxy : True # Proxying image results through searx' >> $settings_file
|
|
116
|
+ echo ' http_protocol_version : "1.1" # 1.0 and 1.1 are supported' >> $settings_file
|
|
117
|
+ echo '' >> $settings_file
|
|
118
|
+ echo 'ui:' >> $settings_file
|
|
119
|
+ echo ' themes_path : "" # Custom ui themes path' >> $settings_file
|
|
120
|
+ echo ' default_theme : oscar # ui theme' >> $settings_file
|
|
121
|
+ echo ' default_locale : "" # Default interface locale - leave blank to detect from browser information or use codes from the 'locales' config section' >> $settings_file
|
|
122
|
+ echo '' >> $settings_file
|
|
123
|
+ echo 'outgoing: # communication with search engines' >> $settings_file
|
|
124
|
+ echo ' request_timeout : 10.0 # seconds' >> $settings_file
|
|
125
|
+ echo ' useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administrator' >> $settings_file
|
|
126
|
+ echo ' pool_connections : 100 # Number of different hosts' >> $settings_file
|
|
127
|
+ echo ' pool_maxsize : 10 # Number of simultaneous requests by host' >> $settings_file
|
|
128
|
+ echo ' proxies :' >> $settings_file
|
|
129
|
+ echo ' http : socks5://127.0.0.1:9050' >> $settings_file
|
|
130
|
+ echo '' >> $settings_file
|
|
131
|
+ echo 'engines:' >> $settings_file
|
|
132
|
+ echo ' - name : arch linux wiki' >> $settings_file
|
|
133
|
+ echo ' engine : archlinux' >> $settings_file
|
|
134
|
+ echo ' categories : general' >> $settings_file
|
|
135
|
+ echo ' shortcut : al' >> $settings_file
|
|
136
|
+ echo '' >> $settings_file
|
|
137
|
+ echo ' - name : archive is' >> $settings_file
|
|
138
|
+ echo ' engine : xpath' >> $settings_file
|
|
139
|
+ echo ' search_url : https://archive.is/{query}' >> $settings_file
|
|
140
|
+ echo ' url_xpath : (//div[@class="TEXT-BLOCK"]/a)/@href' >> $settings_file
|
|
141
|
+ echo ' title_xpath : (//div[@class="TEXT-BLOCK"]/a)' >> $settings_file
|
|
142
|
+ echo ' content_xpath : //div[@class="TEXT-BLOCK"]/ul/li' >> $settings_file
|
|
143
|
+ echo ' categories : general' >> $settings_file
|
|
144
|
+ echo ' timeout : 7.0' >> $settings_file
|
|
145
|
+ echo ' disabled : True' >> $settings_file
|
|
146
|
+ echo ' shortcut : ai' >> $settings_file
|
|
147
|
+ echo '' >> $settings_file
|
|
148
|
+ echo ' - name : base' >> $settings_file
|
|
149
|
+ echo ' engine : base' >> $settings_file
|
|
150
|
+ echo ' shortcut : bs' >> $settings_file
|
|
151
|
+ echo '' >> $settings_file
|
|
152
|
+ echo ' - name : wikipedia' >> $settings_file
|
|
153
|
+ echo ' engine : wikipedia' >> $settings_file
|
|
154
|
+ echo ' shortcut : wp' >> $settings_file
|
|
155
|
+ echo ' categories : general' >> $settings_file
|
|
156
|
+ echo ' base_url : "https://{language}.wikipedia.org/"' >> $settings_file
|
|
157
|
+ echo '' >> $settings_file
|
|
158
|
+ echo ' - name : bitbucket' >> $settings_file
|
|
159
|
+ echo ' engine : xpath' >> $settings_file
|
|
160
|
+ echo ' paging : True' >> $settings_file
|
|
161
|
+ echo ' search_url : https://bitbucket.org/repo/all/{pageno}?name={query}' >> $settings_file
|
|
162
|
+ echo ' url_xpath : //article[@class="repo-summary"]//a[@class="repo-link"]/@href' >> $settings_file
|
|
163
|
+ echo ' title_xpath : //article[@class="repo-summary"]//a[@class="repo-link"]' >> $settings_file
|
|
164
|
+ echo ' content_xpath : //article[@class="repo-summary"]/p' >> $settings_file
|
|
165
|
+ echo ' categories : it' >> $settings_file
|
|
166
|
+ echo ' timeout : 4.0' >> $settings_file
|
|
167
|
+ echo ' disabled : True' >> $settings_file
|
|
168
|
+ echo ' shortcut : bb' >> $settings_file
|
|
169
|
+ echo '' >> $settings_file
|
|
170
|
+ echo ' - name : ccc-tv' >> $settings_file
|
|
171
|
+ echo ' engine : xpath' >> $settings_file
|
|
172
|
+ echo ' paging : False' >> $settings_file
|
|
173
|
+ echo ' search_url : https://media.ccc.de/search/?q={query}' >> $settings_file
|
|
174
|
+ echo ' url_xpath : //div[@class="caption"]/h3/a/@href' >> $settings_file
|
|
175
|
+ echo ' title_xpath : //div[@class="caption"]/h3/a/text()' >> $settings_file
|
|
176
|
+ echo ' content_xpath : //div[@class="caption"]/h4/@title' >> $settings_file
|
|
177
|
+ echo ' categories : videos' >> $settings_file
|
|
178
|
+ echo ' shortcut : c3tv' >> $settings_file
|
|
179
|
+ echo '' >> $settings_file
|
|
180
|
+ echo ' - name : crossref' >> $settings_file
|
|
181
|
+ echo ' engine : json_engine' >> $settings_file
|
|
182
|
+ echo ' paging : True' >> $settings_file
|
|
183
|
+ echo ' search_url : http://search.crossref.org/dois?q={query}&page={pageno}' >> $settings_file
|
|
184
|
+ echo ' url_query : doi' >> $settings_file
|
|
185
|
+ echo ' title_query : title' >> $settings_file
|
|
186
|
+ echo ' content_query : fullCitation' >> $settings_file
|
|
187
|
+ echo ' categories : science' >> $settings_file
|
|
188
|
+ echo ' shortcut : cr' >> $settings_file
|
|
189
|
+ echo '' >> $settings_file
|
|
190
|
+ echo ' - name : currency' >> $settings_file
|
|
191
|
+ echo ' engine : currency_convert' >> $settings_file
|
|
192
|
+ echo ' categories : general' >> $settings_file
|
|
193
|
+ echo ' shortcut : cc' >> $settings_file
|
|
194
|
+ echo '' >> $settings_file
|
|
195
|
+ echo ' - name : deezer' >> $settings_file
|
|
196
|
+ echo ' engine : deezer' >> $settings_file
|
|
197
|
+ echo ' shortcut : dz' >> $settings_file
|
|
198
|
+ echo '' >> $settings_file
|
|
199
|
+ echo ' - name : deviantart' >> $settings_file
|
|
200
|
+ echo ' engine : deviantart' >> $settings_file
|
|
201
|
+ echo ' shortcut : da' >> $settings_file
|
|
202
|
+ echo ' timeout: 3.0' >> $settings_file
|
|
203
|
+ echo '' >> $settings_file
|
|
204
|
+ echo ' - name : ddg definitions' >> $settings_file
|
|
205
|
+ echo ' engine : duckduckgo_definitions' >> $settings_file
|
|
206
|
+ echo ' shortcut : ddd' >> $settings_file
|
|
207
|
+ echo ' weight : 2' >> $settings_file
|
|
208
|
+ echo ' disabled : True' >> $settings_file
|
|
209
|
+ echo '' >> $settings_file
|
|
210
|
+ echo ' - name : digbt' >> $settings_file
|
|
211
|
+ echo ' engine : digbt' >> $settings_file
|
|
212
|
+ echo ' shortcut : dbt' >> $settings_file
|
|
213
|
+ echo ' timeout : 6.0' >> $settings_file
|
|
214
|
+ echo ' disabled : True' >> $settings_file
|
|
215
|
+ echo '' >> $settings_file
|
|
216
|
+ echo ' - name : erowid' >> $settings_file
|
|
217
|
+ echo ' engine : xpath' >> $settings_file
|
|
218
|
+ echo ' paging : True' >> $settings_file
|
|
219
|
+ echo ' first_page_num : 0' >> $settings_file
|
|
220
|
+ echo ' page_size : 30' >> $settings_file
|
|
221
|
+ echo ' search_url : https://www.erowid.org/search.php?q={query}&s={pageno}' >> $settings_file
|
|
222
|
+ echo ' url_xpath : //dl[@class="results-list"]/dt[@class="result-title"]/a/@href' >> $settings_file
|
|
223
|
+ echo ' title_xpath : //dl[@class="results-list"]/dt[@class="result-title"]/a/text()' >> $settings_file
|
|
224
|
+ echo ' content_xpath : //dl[@class="results-list"]/dd[@class="result-details"]' >> $settings_file
|
|
225
|
+ echo ' categories : general' >> $settings_file
|
|
226
|
+ echo ' shortcut : ew' >> $settings_file
|
|
227
|
+ echo ' disabled : True' >> $settings_file
|
|
228
|
+ echo '' >> $settings_file
|
|
229
|
+ echo ' - name : wikidata' >> $settings_file
|
|
230
|
+ echo ' engine : wikidata' >> $settings_file
|
|
231
|
+ echo ' shortcut : wd' >> $settings_file
|
|
232
|
+ echo ' weight : 2' >> $settings_file
|
|
233
|
+ echo '' >> $settings_file
|
|
234
|
+ echo ' - name : duckduckgo' >> $settings_file
|
|
235
|
+ echo ' engine : duckduckgo' >> $settings_file
|
|
236
|
+ echo ' shortcut : ddg' >> $settings_file
|
|
237
|
+ echo ' categories : general' >> $settings_file
|
|
238
|
+ echo '' >> $settings_file
|
|
239
|
+ echo ' - name : etymonline' >> $settings_file
|
|
240
|
+ echo ' engine : xpath' >> $settings_file
|
|
241
|
+ echo ' paging : True' >> $settings_file
|
|
242
|
+ echo ' search_url : http://etymonline.com/?search={query}&p={pageno}' >> $settings_file
|
|
243
|
+ echo ' url_xpath : //dt/a[1]/@href' >> $settings_file
|
|
244
|
+ echo ' title_xpath : //dt' >> $settings_file
|
|
245
|
+ echo ' content_xpath : //dd' >> $settings_file
|
|
246
|
+ echo ' suggestion_xpath : //a[@class="crossreference"]' >> $settings_file
|
|
247
|
+ echo ' first_page_num : 0' >> $settings_file
|
|
248
|
+ echo ' shortcut : et' >> $settings_file
|
|
249
|
+ echo ' disabled : True' >> $settings_file
|
|
250
|
+ echo '' >> $settings_file
|
|
251
|
+ echo ' - name : 500px' >> $settings_file
|
|
252
|
+ echo ' engine : www500px' >> $settings_file
|
|
253
|
+ echo ' shortcut : px' >> $settings_file
|
|
254
|
+ echo '' >> $settings_file
|
|
255
|
+ echo ' - name : 1x' >> $settings_file
|
|
256
|
+ echo ' engine : www1x' >> $settings_file
|
|
257
|
+ echo ' shortcut : 1x' >> $settings_file
|
|
258
|
+ echo ' disabled : True' >> $settings_file
|
|
259
|
+ echo '' >> $settings_file
|
|
260
|
+ echo ' - name : fdroid' >> $settings_file
|
|
261
|
+ echo ' engine : fdroid' >> $settings_file
|
|
262
|
+ echo ' shortcut : fd' >> $settings_file
|
|
263
|
+ echo ' disabled : True' >> $settings_file
|
|
264
|
+ echo '' >> $settings_file
|
|
265
|
+ echo ' - name : flickr' >> $settings_file
|
|
266
|
+ echo ' categories : images' >> $settings_file
|
|
267
|
+ echo ' shortcut : fl' >> $settings_file
|
|
268
|
+ echo '# You can use the engine using the official stable API, but you need an API key' >> $settings_file
|
|
269
|
+ echo '# See : https://www.flickr.com/services/apps/create/' >> $settings_file
|
|
270
|
+ echo '# engine : flickr' >> $settings_file
|
|
271
|
+ echo '# api_key: 'apikey' # required!' >> $settings_file
|
|
272
|
+ echo '# Or you can use the html non-stable engine, activated by default' >> $settings_file
|
|
273
|
+ echo ' engine : flickr_noapi' >> $settings_file
|
|
274
|
+ echo '' >> $settings_file
|
|
275
|
+ echo ' - name : frinkiac' >> $settings_file
|
|
276
|
+ echo ' engine : frinkiac' >> $settings_file
|
|
277
|
+ echo ' shortcut : frk' >> $settings_file
|
|
278
|
+ echo ' disabled : True' >> $settings_file
|
|
279
|
+ echo '' >> $settings_file
|
|
280
|
+ echo ' - name : gigablast' >> $settings_file
|
|
281
|
+ echo ' engine : gigablast' >> $settings_file
|
|
282
|
+ echo ' shortcut : gb' >> $settings_file
|
|
283
|
+ echo ' timeout : 3.0' >> $settings_file
|
|
284
|
+ echo ' disabled: True' >> $settings_file
|
|
285
|
+ echo '' >> $settings_file
|
|
286
|
+ echo ' - name : gitlab' >> $settings_file
|
|
287
|
+ echo ' engine : xpath' >> $settings_file
|
|
288
|
+ echo ' paging : True' >> $settings_file
|
|
289
|
+ echo ' search_url : https://gitlab.com/search?page={pageno}&search={query}' >> $settings_file
|
|
290
|
+ echo ' url_xpath : //li[@class="project-row"]//a[@class="project"]/@href' >> $settings_file
|
|
291
|
+ echo ' title_xpath : //li[@class="project-row"]//span[contains(@class, "project-full-name")]' >> $settings_file
|
|
292
|
+ echo ' content_xpath : //li[@class="project-row"]//div[@class="description"]/p' >> $settings_file
|
|
293
|
+ echo ' categories : it' >> $settings_file
|
|
294
|
+ echo ' shortcut : gl' >> $settings_file
|
|
295
|
+ echo ' timeout : 5.0' >> $settings_file
|
|
296
|
+ echo ' disabled : True' >> $settings_file
|
|
297
|
+ echo '' >> $settings_file
|
|
298
|
+ echo ' - name : github' >> $settings_file
|
|
299
|
+ echo ' engine : github' >> $settings_file
|
|
300
|
+ echo ' shortcut : gh' >> $settings_file
|
|
301
|
+ echo '' >> $settings_file
|
|
302
|
+ echo ' - name : geektimes' >> $settings_file
|
|
303
|
+ echo ' engine : xpath' >> $settings_file
|
|
304
|
+ echo ' paging : True' >> $settings_file
|
|
305
|
+ echo ' search_url : https://geektimes.ru/search/page{pageno}/?q={query}' >> $settings_file
|
|
306
|
+ echo ' url_xpath : //div[@class="search_results"]//a[@class="post__title_link"]/@href' >> $settings_file
|
|
307
|
+ echo ' title_xpath : //div[@class="search_results"]//a[@class="post__title_link"]' >> $settings_file
|
|
308
|
+ echo ' content_xpath : //div[@class="search_results"]//div[contains(@class, "content")]' >> $settings_file
|
|
309
|
+ echo ' categories : it' >> $settings_file
|
|
310
|
+ echo ' timeout : 4.0' >> $settings_file
|
|
311
|
+ echo ' disabled : True' >> $settings_file
|
|
312
|
+ echo ' shortcut : gt' >> $settings_file
|
|
313
|
+ echo '' >> $settings_file
|
|
314
|
+ echo ' - name : habrahabr' >> $settings_file
|
|
315
|
+ echo ' engine : xpath' >> $settings_file
|
|
316
|
+ echo ' paging : True' >> $settings_file
|
|
317
|
+ echo ' search_url : https://habrahabr.ru/search/page{pageno}/?q={query}' >> $settings_file
|
|
318
|
+ echo ' url_xpath : //div[@class="search_results"]//a[contains(@class, "post__title_link")]/@href' >> $settings_file
|
|
319
|
+ echo ' title_xpath : //div[@class="search_results"]//a[contains(@class, "post__title_link")]' >> $settings_file
|
|
320
|
+ echo ' content_xpath : //div[@class="search_results"]//div[contains(@class, "content")]' >> $settings_file
|
|
321
|
+ echo ' categories : it' >> $settings_file
|
|
322
|
+ echo ' timeout : 4.0' >> $settings_file
|
|
323
|
+ echo ' disabled : True' >> $settings_file
|
|
324
|
+ echo ' shortcut : habr' >> $settings_file
|
|
325
|
+ echo '' >> $settings_file
|
|
326
|
+ echo ' - name : hoogle' >> $settings_file
|
|
327
|
+ echo ' engine : json_engine' >> $settings_file
|
|
328
|
+ echo ' paging : True' >> $settings_file
|
|
329
|
+ echo ' search_url : https://www.haskell.org/hoogle/?mode=json&hoogle={query}&start={pageno}' >> $settings_file
|
|
330
|
+ echo ' results_query : results' >> $settings_file
|
|
331
|
+ echo ' url_query : location' >> $settings_file
|
|
332
|
+ echo ' title_query : self' >> $settings_file
|
|
333
|
+ echo ' content_query : docs' >> $settings_file
|
|
334
|
+ echo ' page_size : 20' >> $settings_file
|
|
335
|
+ echo ' categories : it' >> $settings_file
|
|
336
|
+ echo ' shortcut : ho' >> $settings_file
|
|
337
|
+ echo '' >> $settings_file
|
|
338
|
+ echo ' - name : ina' >> $settings_file
|
|
339
|
+ echo ' engine : ina' >> $settings_file
|
|
340
|
+ echo ' shortcut : in' >> $settings_file
|
|
341
|
+ echo ' timeout : 6.0' >> $settings_file
|
|
342
|
+ echo ' disabled : True' >> $settings_file
|
|
343
|
+ echo '' >> $settings_file
|
|
344
|
+ echo ' - name: kickass' >> $settings_file
|
|
345
|
+ echo ' engine : kickass' >> $settings_file
|
|
346
|
+ echo ' shortcut : kc' >> $settings_file
|
|
347
|
+ echo ' timeout : 4.0' >> $settings_file
|
|
348
|
+ echo ' disabled : True' >> $settings_file
|
|
349
|
+ echo '' >> $settings_file
|
|
350
|
+ echo ' - name : library genesis' >> $settings_file
|
|
351
|
+ echo ' engine : xpath' >> $settings_file
|
|
352
|
+ echo ' search_url : http://libgen.io/search.php?req={query}' >> $settings_file
|
|
353
|
+ echo ' url_xpath : //a[contains(@href,"bookfi.net")]/@href' >> $settings_file
|
|
354
|
+ echo ' title_xpath : //a[contains(@href,"book/")]/text()[1]' >> $settings_file
|
|
355
|
+ echo ' content_xpath : //td/a[1][contains(@href,"=author")]/text()' >> $settings_file
|
|
356
|
+ echo ' categories : general' >> $settings_file
|
|
357
|
+ echo ' timeout : 7.0' >> $settings_file
|
|
358
|
+ echo ' disabled : True' >> $settings_file
|
|
359
|
+ echo ' shortcut : lg' >> $settings_file
|
|
360
|
+ echo '' >> $settings_file
|
|
361
|
+ echo ' - name : lobste.rs' >> $settings_file
|
|
362
|
+ echo ' engine : xpath' >> $settings_file
|
|
363
|
+ echo ' search_url : https://lobste.rs/search?utf8=%E2%9C%93&q={query}&what=stories&order=relevance' >> $settings_file
|
|
364
|
+ echo ' results_xpath : //li[contains(@class, "story")]' >> $settings_file
|
|
365
|
+ echo ' url_xpath : .//span[@class="link"]/a/@href' >> $settings_file
|
|
366
|
+ echo ' title_xpath : .//span[@class="link"]/a' >> $settings_file
|
|
367
|
+ echo ' content_xpath : .//a[@class="domain"]' >> $settings_file
|
|
368
|
+ echo ' categories : it' >> $settings_file
|
|
369
|
+ echo ' shortcut : lo' >> $settings_file
|
|
370
|
+ echo '' >> $settings_file
|
|
371
|
+ echo ' - name : mixcloud' >> $settings_file
|
|
372
|
+ echo ' engine : mixcloud' >> $settings_file
|
|
373
|
+ echo ' shortcut : mc' >> $settings_file
|
|
374
|
+ echo '' >> $settings_file
|
|
375
|
+ echo ' - name : nyaa' >> $settings_file
|
|
376
|
+ echo ' engine : nyaa' >> $settings_file
|
|
377
|
+ echo ' shortcut : nt' >> $settings_file
|
|
378
|
+ echo ' disabled : True' >> $settings_file
|
|
379
|
+ echo '' >> $settings_file
|
|
380
|
+ echo ' - name : openstreetmap' >> $settings_file
|
|
381
|
+ echo ' engine : openstreetmap' >> $settings_file
|
|
382
|
+ echo ' shortcut : osm' >> $settings_file
|
|
383
|
+ echo '' >> $settings_file
|
|
384
|
+ echo ' - name : openrepos' >> $settings_file
|
|
385
|
+ echo ' engine : xpath' >> $settings_file
|
|
386
|
+ echo ' paging : True' >> $settings_file
|
|
387
|
+ echo ' search_url : https://openrepos.net/search/node/{query}?page={pageno}' >> $settings_file
|
|
388
|
+ echo ' url_xpath : //li[@class="search-result"]//h3[@class="title"]/a/@href' >> $settings_file
|
|
389
|
+ echo ' title_xpath : //li[@class="search-result"]//h3[@class="title"]/a' >> $settings_file
|
|
390
|
+ echo ' content_xpath : //li[@class="search-result"]//div[@class="search-snippet-info"]//p[@class="search-snippet"]' >> $settings_file
|
|
391
|
+ echo ' categories : files' >> $settings_file
|
|
392
|
+ echo ' timeout : 4.0' >> $settings_file
|
|
393
|
+ echo ' disabled : True' >> $settings_file
|
|
394
|
+ echo ' shortcut : or' >> $settings_file
|
|
395
|
+ echo '' >> $settings_file
|
|
396
|
+ echo ' - name : pdbe' >> $settings_file
|
|
397
|
+ echo ' engine : pdbe' >> $settings_file
|
|
398
|
+ echo ' shortcut : pdb' >> $settings_file
|
|
399
|
+ echo '' >> $settings_file
|
|
400
|
+ echo ' - name : photon' >> $settings_file
|
|
401
|
+ echo ' engine : photon' >> $settings_file
|
|
402
|
+ echo ' shortcut : ph' >> $settings_file
|
|
403
|
+ echo '' >> $settings_file
|
|
404
|
+ echo ' - name : piratebay' >> $settings_file
|
|
405
|
+ echo ' engine : piratebay' >> $settings_file
|
|
406
|
+ echo ' shortcut : tpb' >> $settings_file
|
|
407
|
+ echo ' url: https://pirateproxy.red/' >> $settings_file
|
|
408
|
+ echo ' timeout : 3.0' >> $settings_file
|
|
409
|
+ echo '' >> $settings_file
|
|
410
|
+ echo ' - name : qwant' >> $settings_file
|
|
411
|
+ echo ' engine : qwant' >> $settings_file
|
|
412
|
+ echo ' shortcut : qw' >> $settings_file
|
|
413
|
+ echo ' categories : general' >> $settings_file
|
|
414
|
+ echo ' disabled : True' >> $settings_file
|
|
415
|
+ echo '' >> $settings_file
|
|
416
|
+ echo ' - name : qwant images' >> $settings_file
|
|
417
|
+ echo ' engine : qwant' >> $settings_file
|
|
418
|
+ echo ' shortcut : qwi' >> $settings_file
|
|
419
|
+ echo ' categories : images' >> $settings_file
|
|
420
|
+ echo '' >> $settings_file
|
|
421
|
+ echo ' - name : qwant news' >> $settings_file
|
|
422
|
+ echo ' engine : qwant' >> $settings_file
|
|
423
|
+ echo ' shortcut : qwn' >> $settings_file
|
|
424
|
+ echo ' categories : news' >> $settings_file
|
|
425
|
+ echo '' >> $settings_file
|
|
426
|
+ echo ' - name : qwant social' >> $settings_file
|
|
427
|
+ echo ' engine : qwant' >> $settings_file
|
|
428
|
+ echo ' shortcut : qws' >> $settings_file
|
|
429
|
+ echo ' categories : social media' >> $settings_file
|
|
430
|
+ echo '' >> $settings_file
|
|
431
|
+ echo ' - name : reddit' >> $settings_file
|
|
432
|
+ echo ' engine : reddit' >> $settings_file
|
|
433
|
+ echo ' shortcut : re' >> $settings_file
|
|
434
|
+ echo ' page_size : 25' >> $settings_file
|
|
435
|
+ echo ' timeout : 10.0' >> $settings_file
|
|
436
|
+ echo ' disabled : True' >> $settings_file
|
|
437
|
+ echo '' >> $settings_file
|
|
438
|
+ echo ' - name : scanr structures' >> $settings_file
|
|
439
|
+ echo ' shortcut: scs' >> $settings_file
|
|
440
|
+ echo ' engine : scanr_structures' >> $settings_file
|
|
441
|
+ echo ' disabled : True' >> $settings_file
|
|
442
|
+ echo '' >> $settings_file
|
|
443
|
+ echo ' - name : soundcloud' >> $settings_file
|
|
444
|
+ echo ' engine : soundcloud' >> $settings_file
|
|
445
|
+ echo ' shortcut : sc' >> $settings_file
|
|
446
|
+ echo '' >> $settings_file
|
|
447
|
+ echo ' - name : stackoverflow' >> $settings_file
|
|
448
|
+ echo ' engine : stackoverflow' >> $settings_file
|
|
449
|
+ echo ' shortcut : st' >> $settings_file
|
|
450
|
+ echo '' >> $settings_file
|
|
451
|
+ echo ' - name : searchcode doc' >> $settings_file
|
|
452
|
+ echo ' engine : searchcode_doc' >> $settings_file
|
|
453
|
+ echo ' shortcut : scd' >> $settings_file
|
|
454
|
+ echo '' >> $settings_file
|
|
455
|
+ echo ' - name : searchcode code' >> $settings_file
|
|
456
|
+ echo ' engine : searchcode_code' >> $settings_file
|
|
457
|
+ echo ' shortcut : scc' >> $settings_file
|
|
458
|
+ echo ' disabled : True' >> $settings_file
|
|
459
|
+ echo '' >> $settings_file
|
|
460
|
+ echo ' - name : framalibre' >> $settings_file
|
|
461
|
+ echo ' engine : framalibre' >> $settings_file
|
|
462
|
+ echo ' shortcut : frl' >> $settings_file
|
|
463
|
+ echo ' disabled : True' >> $settings_file
|
|
464
|
+ echo '' >> $settings_file
|
|
465
|
+ echo ' - name : semantic scholar' >> $settings_file
|
|
466
|
+ echo ' engine : xpath' >> $settings_file
|
|
467
|
+ echo ' paging : True' >> $settings_file
|
|
468
|
+ echo ' search_url : https://www.semanticscholar.org/search?q={query}&sort=relevance&page={pageno}&ae=false' >> $settings_file
|
|
469
|
+ echo ' results_xpath : //article' >> $settings_file
|
|
470
|
+ echo ' url_xpath : .//div[@class="search-result-title"]/a/@href' >> $settings_file
|
|
471
|
+ echo ' title_xpath : .//div[@class="search-result-title"]/a' >> $settings_file
|
|
472
|
+ echo ' content_xpath : .//div[@class="search-result-abstract"]' >> $settings_file
|
|
473
|
+ echo ' shortcut : se' >> $settings_file
|
|
474
|
+ echo ' categories : science' >> $settings_file
|
|
475
|
+ echo '' >> $settings_file
|
|
476
|
+ echo ' - name : spotify' >> $settings_file
|
|
477
|
+ echo ' engine : spotify' >> $settings_file
|
|
478
|
+ echo ' shortcut : stf' >> $settings_file
|
|
479
|
+ echo '' >> $settings_file
|
|
480
|
+ echo ' - name : subtitleseeker' >> $settings_file
|
|
481
|
+ echo ' engine : subtitleseeker' >> $settings_file
|
|
482
|
+ echo ' shortcut : ss' >> $settings_file
|
|
483
|
+ echo '# The language is an option. You can put any language written in english' >> $settings_file
|
|
484
|
+ echo '# Examples : English, French, German, Hungarian, Chinese...' >> $settings_file
|
|
485
|
+ echo '# language : English' >> $settings_file
|
|
486
|
+ echo '' >> $settings_file
|
|
487
|
+ echo ' - name : startpage' >> $settings_file
|
|
488
|
+ echo ' engine : startpage' >> $settings_file
|
|
489
|
+ echo ' shortcut : sp' >> $settings_file
|
|
490
|
+ echo ' timeout : 6.0' >> $settings_file
|
|
491
|
+ echo ' disabled : True' >> $settings_file
|
|
492
|
+ echo '' >> $settings_file
|
|
493
|
+ echo ' - name : ixquick' >> $settings_file
|
|
494
|
+ echo ' engine : startpage' >> $settings_file
|
|
495
|
+ echo " base_url : 'https://www.ixquick.eu/'" >> $settings_file
|
|
496
|
+ echo " search_url : 'https://www.ixquick.eu/do/search'" >> $settings_file
|
|
497
|
+ echo ' shortcut : iq' >> $settings_file
|
|
498
|
+ echo ' timeout : 6.0' >> $settings_file
|
|
499
|
+ echo '' >> $settings_file
|
|
500
|
+ echo ' - name : swisscows' >> $settings_file
|
|
501
|
+ echo ' engine : swisscows' >> $settings_file
|
|
502
|
+ echo ' shortcut : sw' >> $settings_file
|
|
503
|
+ echo ' disabled : True' >> $settings_file
|
|
504
|
+ echo '' >> $settings_file
|
|
505
|
+ echo ' - name : tokyotoshokan' >> $settings_file
|
|
506
|
+ echo ' engine : tokyotoshokan' >> $settings_file
|
|
507
|
+ echo ' shortcut : tt' >> $settings_file
|
|
508
|
+ echo ' timeout : 6.0' >> $settings_file
|
|
509
|
+ echo ' disabled : True' >> $settings_file
|
|
510
|
+ echo '' >> $settings_file
|
|
511
|
+ echo ' - name : twitter' >> $settings_file
|
|
512
|
+ echo ' engine : twitter' >> $settings_file
|
|
513
|
+ echo ' shortcut : tw' >> $settings_file
|
|
514
|
+ echo '' >> $settings_file
|
|
515
|
+ echo ' - name : urbandictionary' >> $settings_file
|
|
516
|
+ echo ' engine : xpath' >> $settings_file
|
|
517
|
+ echo ' search_url : http://www.urbandictionary.com/define.php?term={query}' >> $settings_file
|
|
518
|
+ echo ' url_xpath : //*[@class="word"]/@href' >> $settings_file
|
|
519
|
+ echo ' title_xpath : //*[@class="def-header"]' >> $settings_file
|
|
520
|
+ echo ' content_xpath : //*[@class="meaning"]' >> $settings_file
|
|
521
|
+ echo ' shortcut : ud' >> $settings_file
|
|
522
|
+ echo '' >> $settings_file
|
|
523
|
+ echo ' - name : yandex' >> $settings_file
|
|
524
|
+ echo ' engine : yandex' >> $settings_file
|
|
525
|
+ echo ' shortcut : yn' >> $settings_file
|
|
526
|
+ echo ' disabled : True' >> $settings_file
|
|
527
|
+ echo '' >> $settings_file
|
|
528
|
+ echo ' - name : youtube' >> $settings_file
|
|
529
|
+ echo ' shortcut : yt' >> $settings_file
|
|
530
|
+ echo ' # You can use the engine using the official stable API, but you need an API key' >> $settings_file
|
|
531
|
+ echo ' # See : https://console.developers.google.com/project' >> $settings_file
|
|
532
|
+ echo ' # engine : youtube_api' >> $settings_file
|
|
533
|
+ echo ' # api_key: apikey # required!' >> $settings_file
|
|
534
|
+ echo ' # Or you can use the html non-stable engine, activated by default' >> $settings_file
|
|
535
|
+ echo ' engine : youtube_noapi' >> $settings_file
|
|
536
|
+ echo '' >> $settings_file
|
|
537
|
+ echo ' - name : dailymotion' >> $settings_file
|
|
538
|
+ echo ' engine : dailymotion' >> $settings_file
|
|
539
|
+ echo ' shortcut : dm' >> $settings_file
|
|
540
|
+ echo '' >> $settings_file
|
|
541
|
+ echo ' - name : vimeo' >> $settings_file
|
|
542
|
+ echo ' engine : vimeo' >> $settings_file
|
|
543
|
+ echo ' shortcut : vm' >> $settings_file
|
|
544
|
+ echo '' >> $settings_file
|
|
545
|
+ echo ' - name : wolframalpha' >> $settings_file
|
|
546
|
+ echo ' shortcut : wa' >> $settings_file
|
|
547
|
+ echo ' # You can use the engine using the official stable API, but you need an API key' >> $settings_file
|
|
548
|
+ echo ' # See : http://products.wolframalpha.com/api/' >> $settings_file
|
|
549
|
+ echo ' # engine : wolframalpha_api' >> $settings_file
|
|
550
|
+ echo ' # api_key: '' # required!' >> $settings_file
|
|
551
|
+ echo ' engine : wolframalpha_noapi' >> $settings_file
|
|
552
|
+ echo ' timeout: 6.0' >> $settings_file
|
|
553
|
+ echo ' categories : science' >> $settings_file
|
|
554
|
+ echo '' >> $settings_file
|
|
555
|
+ echo ' - name : seedpeer' >> $settings_file
|
|
556
|
+ echo ' engine : seedpeer' >> $settings_file
|
|
557
|
+ echo ' shortcut: speu'
|
|
558
|
+ echo ' categories: files, music, videos'
|
|
559
|
+ echo ' disabled: True' >> $settings_file
|
|
560
|
+ echo '' >> $settings_file
|
|
561
|
+ echo ' - name : dictzone' >> $settings_file
|
|
562
|
+ echo ' engine : dictzone' >> $settings_file
|
|
563
|
+ echo ' shortcut : dc' >> $settings_file
|
|
564
|
+ echo '' >> $settings_file
|
|
565
|
+ echo ' - name : mymemory translated' >> $settings_file
|
|
566
|
+ echo ' engine : translated' >> $settings_file
|
|
567
|
+ echo ' shortcut : tl' >> $settings_file
|
|
568
|
+ echo ' timeout : 5.0' >> $settings_file
|
|
569
|
+ echo ' disabled : True' >> $settings_file
|
|
570
|
+ echo ' # You can use without an API key, but you are limited to 1000 words/day' >> $settings_file
|
|
571
|
+ echo ' # See : http://mymemory.translated.net/doc/usagelimits.php' >> $settings_file
|
|
572
|
+ echo ' # api_key : ""' >> $settings_file
|
|
573
|
+ echo '' >> $settings_file
|
|
574
|
+ echo ' - name : voat' >> $settings_file
|
|
575
|
+ echo ' engine: xpath' >> $settings_file
|
|
576
|
+ echo ' shortcut: vo' >> $settings_file
|
|
577
|
+ echo ' categories: social media' >> $settings_file
|
|
578
|
+ echo ' search_url : https://voat.co/search?q={query}' >> $settings_file
|
|
579
|
+ echo ' url_xpath : //p[contains(@class, "title")]/a/@href' >> $settings_file
|
|
580
|
+ echo ' title_xpath : //p[contains(@class, "title")]/a' >> $settings_file
|
|
581
|
+ echo ' content_xpath : //span[@class="domain"]' >> $settings_file
|
|
582
|
+ echo ' timeout : 10.0' >> $settings_file
|
|
583
|
+ echo ' disabled : True' >> $settings_file
|
|
584
|
+ echo '' >> $settings_file
|
|
585
|
+ echo ' - name : 1337x' >> $settings_file
|
|
586
|
+ echo ' engine : 1337x' >> $settings_file
|
|
587
|
+ echo ' shortcut : 1337x' >> $settings_file
|
|
588
|
+ echo ' disabled : True' >> $settings_file
|
|
589
|
+ echo '' >> $settings_file
|
|
590
|
+ echo 'locales:' >> $settings_file
|
|
591
|
+ echo ' en : English' >> $settings_file
|
|
592
|
+ echo ' bg : Български (Bulgarian)' >> $settings_file
|
|
593
|
+ echo ' cs : Čeština (Czech)' >> $settings_file
|
|
594
|
+ echo ' de : Deutsch (German)' >> $settings_file
|
|
595
|
+ echo ' de_DE : Deutsch (German_Germany)' >> $settings_file
|
|
596
|
+ echo ' el_GR : Ελληνικά (Greek_Greece)' >> $settings_file
|
|
597
|
+ echo ' eo : Esperanto (Esperanto)' >> $settings_file
|
|
598
|
+ echo ' es : Español (Spanish)' >> $settings_file
|
|
599
|
+ echo ' fi : Suomi (Finnish)' >> $settings_file
|
|
600
|
+ echo ' fr : Français (French)' >> $settings_file
|
|
601
|
+ echo ' he : עברית (Hebrew)' >> $settings_file
|
|
602
|
+ echo ' hu : Magyar (Hungarian)' >> $settings_file
|
|
603
|
+ echo ' it : Italiano (Italian)' >> $settings_file
|
|
604
|
+ echo ' ja : 日本語 (Japanese)' >> $settings_file
|
|
605
|
+ echo ' nl : Nederlands (Dutch)' >> $settings_file
|
|
606
|
+ echo ' pt : Português (Portuguese)' >> $settings_file
|
|
607
|
+ echo ' pt_BR : Português (Portuguese_Brazil)' >> $settings_file
|
|
608
|
+ echo ' ro : Română (Romanian)' >> $settings_file
|
|
609
|
+ echo ' ru : Русский (Russian)' >> $settings_file
|
|
610
|
+ echo ' sk : Slovenčina (Slovak)' >> $settings_file
|
|
611
|
+ echo ' sv : Svenska (Swedish)' >> $settings_file
|
|
612
|
+ echo ' tr : Türkçe (Turkish)' >> $settings_file
|
|
613
|
+ echo ' uk : українська мова (Ukrainian)' >> $settings_file
|
|
614
|
+ echo ' zh : 中文 (Chinese)' >> $settings_file
|
|
615
|
+}
|
|
616
|
+
|
64
|
617
|
function upgrade_searx {
|
65
|
618
|
set_repo_commit $SEARX_PATH/searx "Search engine commit" "$SEARX_COMMIT" $SEARX_REPO
|
66
|
|
- if grep "Search engine key" $COMPLETION_FILE; then
|
67
|
|
- if [ -f ${SEARX_PATH}/searx/searx/settings.yml ]; then
|
68
|
|
- # note: this might change to a --tor option in a later version
|
69
|
|
- if ! grep 'socks5://127.0.0.1:9050' ${SEARX_PATH}/searx/searx/settings.yml; then
|
70
|
|
- echo 'outgoing: # communication with search engines' >> ${SEARX_PATH}/searx/searx/settings.yml
|
71
|
|
- echo ' proxies:' >> ${SEARX_PATH}/searx/searx/settings.yml
|
72
|
|
- echo ' http : socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
|
73
|
|
- echo ' https: socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
|
74
|
|
- fi
|
75
|
|
- SEARX_SECRET_KEY=$(get_completion_param "searx key")
|
76
|
|
- sed -i "s|secret_key.*|secret_key : \"${SEARX_SECRET_KEY}\"|g" ${SEARX_PATH}/searx/searx/settings.yml
|
77
|
|
- if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then
|
78
|
|
- SEARX_ONION_HOSTNAME=$(echo /var/lib/tor/hidden_service_searx/hostname)
|
79
|
|
- sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARX_ONION_HOSTNAME}\/' ${SEARX_PATH}/searx/searx/settings.yml
|
80
|
|
- fi
|
81
|
|
- fi
|
82
|
|
- fi
|
83
|
619
|
}
|
84
|
620
|
|
85
|
621
|
function backup_local_searx {
|
|
@@ -114,9 +650,7 @@ function remove_searx {
|
114
|
650
|
fi
|
115
|
651
|
remove_completion_param install_searx
|
116
|
652
|
sed -i '/Search engine /d' $COMPLETION_FILE
|
117
|
|
- sed -i '/Search Engine /d' /home/$MY_USERNAME/README
|
118
|
|
- sed -i '/Search engine /d' /home/$MY_USERNAME/README
|
119
|
|
- sed -i '/search engine /d' /home/$MY_USERNAME/README
|
|
653
|
+ sed -i '/searx /d' $COMPLETION_FILE
|
120
|
654
|
}
|
121
|
655
|
|
122
|
656
|
function install_searx {
|
|
@@ -213,13 +747,6 @@ function install_searx {
|
213
|
747
|
function_check nginx_limits
|
214
|
748
|
nginx_limits searx '1M'
|
215
|
749
|
echo ' proxy_pass http://localhost:8888;' >> /etc/nginx/sites-available/searx
|
216
|
|
- echo ' proxy_set_header Host $host;' >> /etc/nginx/sites-available/searx
|
217
|
|
- echo ' proxy_set_header X-Real-IP $remote_addr;' >> /etc/nginx/sites-available/searx
|
218
|
|
- echo ' proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> /etc/nginx/sites-available/searx
|
219
|
|
- echo ' proxy_set_header X-Remote-Port $remote_port;' >> /etc/nginx/sites-available/searx
|
220
|
|
- echo ' proxy_set_header X-Forwarded-Proto $scheme;' >> /etc/nginx/sites-available/searx
|
221
|
|
- echo ' proxy_redirect off;' >> /etc/nginx/sites-available/searx
|
222
|
|
-
|
223
|
750
|
echo " auth_basic \"${SEARX_LOGIN_TEXT}\";" >> /etc/nginx/sites-available/searx
|
224
|
751
|
echo ' auth_basic_user_file /etc/nginx/.htpasswd;' >> /etc/nginx/sites-available/searx
|
225
|
752
|
echo ' }' >> /etc/nginx/sites-available/searx
|
|
@@ -239,21 +766,11 @@ function install_searx {
|
239
|
766
|
# replace the secret key
|
240
|
767
|
if ! grep "searx key" $COMPLETION_FILE; then
|
241
|
768
|
SEARX_SECRET_KEY="$(create_password 30)"
|
242
|
|
- fi
|
243
|
|
- set_completion_param "searx key" "${SEARX_SECRET_KEY}"
|
244
|
|
- sed -i "s|secret_key.*|secret_key : \"${SEARX_SECRET_KEY}\"|g" ${SEARX_PATH}/searx/searx/settings.yml
|
245
|
|
- sed -i "s|secret_key.*|secret_key : \"${SEARX_SECRET_KEY}\"|g" ${SEARX_PATH}/searx/searx/settings_robot.yml
|
246
|
|
- sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARX_ONION_HOSTNAME}\/' ${SEARX_PATH}/searx/searx/settings.yml
|
247
|
|
- sed -i '0,/RE/s/base_url.*/base_url : \"http://${SEARX_ONION_HOSTNAME}\/' ${SEARX_PATH}/searx/searx/settings_robot.yml
|
248
|
|
-
|
249
|
|
- # note: this might change to a --tor option in a later version
|
250
|
|
- if ! grep 'socks5://127.0.0.1:9050' ${SEARX_PATH}/searx/searx/settings.yml; then
|
251
|
|
- echo 'outgoing: # communication with search engines' >> ${SEARX_PATH}/searx/searx/settings.yml
|
252
|
|
- echo ' proxies:' >> ${SEARX_PATH}/searx/searx/settings.yml
|
253
|
|
- echo ' http : socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
|
254
|
|
- echo ' https: socks5://127.0.0.1:9050' >> ${SEARX_PATH}/searx/searx/settings.yml
|
|
769
|
+ set_completion_param "searx key" "${SEARX_SECRET_KEY}"
|
255
|
770
|
fi
|
256
|
771
|
|
|
772
|
+ create_searx_config
|
|
773
|
+
|
257
|
774
|
chown -R searx:searx ${SEARX_PATH}/searx
|
258
|
775
|
|
259
|
776
|
# enable the site
|
|
@@ -268,23 +785,13 @@ function install_searx {
|
268
|
785
|
systemctl daemon-reload
|
269
|
786
|
systemctl start searx.service
|
270
|
787
|
|
271
|
|
- if ! grep -q "Your search engine password is" /home/$MY_USERNAME/README; then
|
272
|
|
- if [ ${#SEARX_PASSWORD} -lt 8 ]; then
|
273
|
|
- if [ -f $IMAGE_PASSWORD_FILE ]; then
|
274
|
|
- SEARX_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
275
|
|
- else
|
276
|
|
- SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
277
|
|
- fi
|
278
|
|
- fi
|
279
|
|
- echo "$SEARX_PASSWORD" | htpasswd -i -s -c /etc/nginx/.htpasswd $MY_USERNAME
|
280
|
|
- echo '' >> /home/$MY_USERNAME/README
|
281
|
|
- echo '' >> /home/$MY_USERNAME/README
|
282
|
|
- echo $'# Search Engine' >> /home/$MY_USERNAME/README
|
283
|
|
- echo $"Search engine onion domain: ${SEARX_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
284
|
|
- echo $"Your search engine password is: $SEARX_PASSWORD" >> /home/$MY_USERNAME/README
|
285
|
|
- chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
286
|
|
- chmod 600 /home/$MY_USERNAME/README
|
|
788
|
+ SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
|
789
|
+ ${PROJECT_NAME}-pass -u $MY_USERNAME -a searx -p "$SEARX_PASSWORD"
|
|
790
|
+ if grep -q "$MY_USERNAME:" /etc/nginx/.htpasswd; then
|
|
791
|
+ sed -i "/$MY_USERNAME:/d" /etc/nginx/.htpasswd
|
287
|
792
|
fi
|
|
793
|
+ echo "$SEARX_PASSWORD" | htpasswd -i -s -c /etc/nginx/.htpasswd $MY_USERNAME
|
|
794
|
+
|
288
|
795
|
APP_INSTALLED=1
|
289
|
796
|
}
|
290
|
797
|
|