mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
Merge pull request #97 from pointhi/https
Implementing https rewrite support
This commit is contained in:
commit
20400c40c3
40 changed files with 4691 additions and 13 deletions
|
|
@ -17,6 +17,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
|
|||
|
||||
from os import environ
|
||||
from os.path import realpath, dirname, join, abspath
|
||||
from searx.https_rewrite import load_https_rules
|
||||
try:
|
||||
from yaml import load
|
||||
except:
|
||||
|
|
@ -34,7 +35,16 @@ if 'SEARX_SETTINGS_PATH' in environ:
|
|||
else:
|
||||
settings_path = join(searx_dir, 'settings.yml')
|
||||
|
||||
if 'SEARX_HTTPS_REWRITE_PATH' in environ:
|
||||
https_rewrite_path = environ['SEARX_HTTPS_REWRITE_PATH']
|
||||
else:
|
||||
https_rewrite_path = join(searx_dir, 'https_rules')
|
||||
|
||||
# load settings
|
||||
with open(settings_path) as settings_yaml:
|
||||
settings = load(settings_yaml)
|
||||
|
||||
# load https rules only if https rewrite is enabled
|
||||
if settings.get('server', {}).get('https_rewrite'):
|
||||
# loade https rules
|
||||
load_https_rules(https_rewrite_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue