diff --git a/.gitignore b/.gitignore index 661e9208..8a1138f8 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ target/ # known_hosts file known_hosts +venv/ diff --git a/README.md b/README.md index c8e96b34..0ccdf161 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,12 @@ wssh --logging=debug # log to file wssh --log-file-prefix=main.log +# specify alternative location for template material +wssh --template_path=/templates + +# specify alternative location for static material +wssh --static_path=/static + # more options wssh --help ``` diff --git a/webssh/settings.py b/webssh/settings.py index bf75c2d3..beb43c8b 100644 --- a/webssh/settings.py +++ b/webssh/settings.py @@ -54,9 +54,12 @@ def print_version(flag): define('version', type=bool, help='Show version information', callback=print_version) - base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) font_dirs = ['webssh', 'static', 'css', 'fonts'] + +define('template_path', default=os.path.join(base_dir, 'webssh', 'templates')) +define('static_path', default=os.path.join(base_dir, 'webssh', 'static')) + max_body_size = 1 * 1024 * 1024 @@ -75,8 +78,8 @@ def get_url(self, filename, dirs): def get_app_settings(options): settings = dict( - template_path=os.path.join(base_dir, 'webssh', 'templates'), - static_path=os.path.join(base_dir, 'webssh', 'static'), + template_path=options.template_path, + static_path=options.static_path, websocket_ping_interval=options.wpintvl, debug=options.debug, xsrf_cookies=options.xsrf,