Add option for socketio admin ui

This commit is contained in:
Christoph Stahl 2025-01-01 13:03:06 +01:00
parent fdcae7edab
commit 935add9144
2 changed files with 5 additions and 1 deletions

View file

@ -11,7 +11,8 @@ run the client or server functions.
Client usage: syng client [-h] [--room ROOM] [--secret SECRET] \
[--config-file CONFIG_FILE] [--server SERVER]
Server usage: syng server [-h] [--host HOST] [--port PORT] [--root-folder ROOT_FOLDER] \
[--registration-keyfile REGISTRATION_KEYFILE] [--private] [--restricted]
[--registration-keyfile REGISTRATION_KEYFILE] [--private] [--restricted] \
[--admin-password PASSWORD]
GUI usage: syng gui
The config file for the client should be a yaml file in the following style::
@ -108,6 +109,7 @@ def main() -> None:
server_parser.add_argument("--registration-keyfile", "-k", default=None)
server_parser.add_argument("--private", "-P", action="store_true", default=False)
server_parser.add_argument("--restricted", "-R", action="store_true", default=False)
server_parser.add_argument("--admin-password", "-A", default=None)
args = parser.parse_args()

View file

@ -1227,6 +1227,8 @@ class Server:
self.app.router.add_route("*", "/{room}/", self.root_handler)
self.app.cleanup_ctx.append(self.background_tasks)
if args.admin_password:
self.sio.instrument(auth={"username": "admin", "password": args.admin_password})
web.run_app(self.app, host=args.host, port=args.port)