From af26421b71d0ac145c7d66da1f208174da9bb6ee Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Wed, 28 Mar 2018 20:20:08 +0200 Subject: [PATCH] add server_name config option #657 --- extra/motioneye.conf.sample | 3 +++ motioneye/handlers.py | 2 +- motioneye/settings.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) 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() -- 2.39.5