From: hobbyquaker Date: Wed, 28 Mar 2018 18:20:08 +0000 (+0200) Subject: add server_name config option #657 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=af26421b71d0ac145c7d66da1f208174da9bb6ee;p=motioneye-debian add server_name config option #657 --- diff --git a/extra/motioneye.conf.sample b/extra/motioneye.conf.sample index 5a90428..9bbb751 100644 --- a/extra/motioneye.conf.sample +++ b/extra/motioneye.conf.sample @@ -92,3 +92,6 @@ add_remove_cameras true # enables HTTP basic authentication scheme (in addition to, not instead of the signature mechanism) http_basic_auth false + +# overrides the hostname (useful if motionEye runs behind a reverse proxy) +# server_name motionEye diff --git a/motioneye/handlers.py b/motioneye/handlers.py index 4fe9125..6cc14cd 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -244,7 +244,7 @@ class MainHandler(BaseHandler): add_remove_cameras=settings.ADD_REMOVE_CAMERAS, main_sections=main_sections, camera_sections=camera_sections, - hostname=socket.gethostname(), + hostname=settings.SERVER_NAME, title=self.get_argument('title', None), admin_username=config.get_main().get('@admin_username'), has_streaming_auth=motionctl.has_streaming_auth(), diff --git a/motioneye/settings.py b/motioneye/settings.py index 999c6b8..a25a003 100644 --- a/motioneye/settings.py +++ b/motioneye/settings.py @@ -2,6 +2,7 @@ import logging import os.path import sys +import socket import motioneye @@ -131,3 +132,6 @@ PASSWORD_HOOK = None # enables HTTP basic authentication scheme (in addition to, not instead of the signature mechanism) HTTP_BASIC_AUTH = False + +# provides the possibility to override the hostname +SERVER_NAME = socket.gethostname()