summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-12-21 00:37:45 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-01-11 22:12:38 +0100
commit9485179064b4eb28f2813eba3c295edca3b0db7f (patch)
treee9f5f003e9887aa130a3f19d82a1d9ace898504b /utils
parentdbfd5567aaa06a5f9792bb0839af74877ed5258c (diff)
downloadsearxng-9485179064b4eb28f2813eba3c295edca3b0db7f.tar.gz
searxng-9485179064b4eb28f2813eba3c295edca3b0db7f.zip
[mod] move brand options from Makefile to settings.yml
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
-rw-r--r--utils/brand.env4
-rw-r--r--utils/build_env.py42
2 files changed, 45 insertions, 1 deletions
diff --git a/utils/brand.env b/utils/brand.env
index 2e763159d..2136d278f 100644
--- a/utils/brand.env
+++ b/utils/brand.env
@@ -1,7 +1,9 @@
+export SEARX_URL=''
export GIT_URL='https://github.com/searx/searx'
export GIT_BRANCH='master'
export ISSUE_URL='https://github.com/searx/searx/issues'
-export SEARX_URL='https://searx.me'
export DOCS_URL='https://searx.github.io/searx'
export PUBLIC_INSTANCES='https://searx.space'
export CONTACT_URL=''
+export WIKI_URL='https://github.com/searx/searx/wiki'
+export TWITTER_URL='https://twitter.com/Searx_engine'
diff --git a/utils/build_env.py b/utils/build_env.py
new file mode 100644
index 000000000..0a210e8de
--- /dev/null
+++ b/utils/build_env.py
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+"""build environment used by shell scripts
+"""
+
+# set path
+import sys
+from os.path import realpath, dirname, join, sep
+repo_root = realpath(dirname(realpath(__file__)) + sep + '..')
+sys.path.insert(0, repo_root)
+
+from searx.settings_loader import load_settings
+
+settings, settings_load_message = load_settings()
+print(settings_load_message)
+
+brand_env = 'utils' + sep + 'brand.env'
+brand_py = 'searx' + sep + 'brand.py'
+
+def get_val(group, name, default=''):
+ return settings[group].get(name, False) or ''
+
+name_val = [
+ ('SEARX_URL' , get_val('server', 'base_url')),
+ ('GIT_URL' , get_val('general','git_url')),
+ ('GIT_BRANCH' , get_val('general','git_branch')),
+ ('ISSUE_URL' , get_val('general','issue_url')),
+ ('DOCS_URL' , get_val('general','docs_url')),
+ ('PUBLIC_INSTANCES' , get_val('general','public_instances')),
+ ('CONTACT_URL' , get_val('general','contact_url')),
+ ('WIKI_URL' , get_val('general','wiki_url')),
+ ('TWITTER_URL' , get_val('general','twitter_url')),
+]
+
+print('build %s' % brand_env)
+with open(repo_root + sep + brand_env, 'w', encoding='utf-8') as f:
+ for name, val in name_val:
+ print("export %s='%s'" % (name, val), file=f)
+
+print('build %s' % brand_py)
+with open(repo_root + sep + brand_py, 'w', encoding='utf-8') as f:
+ for name, val in name_val:
+ print("%s = '%s'" % (name, val), file=f)