summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
Diffstat (limited to 'searx')
-rw-r--r--searx/__init__.py46
-rw-r--r--searx/brand.py9
2 files changed, 46 insertions, 9 deletions
diff --git a/searx/__init__.py b/searx/__init__.py
index 08e67f69d..7f76022e1 100644
--- a/searx/__init__.py
+++ b/searx/__init__.py
@@ -60,3 +60,49 @@ if 'SEARX_SECRET' in environ:
settings['server']['secret_key'] = environ['SEARX_SECRET']
if 'SEARX_BIND_ADDRESS' in environ:
settings['server']['bind_address'] = environ['SEARX_BIND_ADDRESS']
+
+
+class _brand_namespace:
+
+ @classmethod
+ def get_val(cls, group, name, default=''):
+ return settings[group].get(name, False) or ''
+
+ @property
+ def SEARX_URL(self):
+ return self.get_val('server', 'base_url')
+
+ @property
+ def GIT_URL(self):
+ return self.get_val('general', 'git_url')
+
+ @property
+ def GIT_BRANCH(self):
+ return self.get_val('general', 'git_branch')
+
+ @property
+ def ISSUE_URL(self):
+ return self.get_val('general', 'issue_url')
+
+ @property
+ def DOCS_URL(self):
+ return self.get_val('general', 'docs_url')
+
+ @property
+ def PUBLIC_INSTANCES(self):
+ return self.get_val('general', 'public_instances')
+
+ @property
+ def CONTACT_URL(self):
+ return self.get_val('general', 'contact_url')
+
+ @property
+ def WIKI_URL(self):
+ return self.get_val('general', 'wiki_url')
+
+ @property
+ def TWITTER_URL(self):
+ return self.get_val('general', 'twitter_url')
+
+
+brand = _brand_namespace()
diff --git a/searx/brand.py b/searx/brand.py
deleted file mode 100644
index cede5a270..000000000
--- a/searx/brand.py
+++ /dev/null
@@ -1,9 +0,0 @@
-SEARX_URL = ''
-GIT_URL = 'https://github.com/searx/searx'
-GIT_BRANCH = 'master'
-ISSUE_URL = 'https://github.com/searx/searx/issues'
-DOCS_URL = 'https://searx.github.io/searx'
-PUBLIC_INSTANCES = 'https://searx.space'
-CONTACT_URL = ''
-WIKI_URL = 'https://github.com/searx/searx/wiki'
-TWITTER_URL = 'https://twitter.com/Searx_engine'