From 70dc750c7aa5af43af0780a7b16e7a207f70bcb4 Mon Sep 17 00:00:00 2001 From: Vivek Date: Wed, 20 Dec 2023 10:05:38 -0800 Subject: [PATCH] Add arg for configuring unix socket perms (#1103) The default unix socket permissions of 600 is too restrictive for many use cases. Added a new argument --unix-socket-perms which is passed to waitress to allow for user configurable socket permissions --- app/routes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index 3fcd0cf..23edd13 100644 --- a/app/routes.py +++ b/app/routes.py @@ -626,6 +626,11 @@ def run_app() -> None: default='', metavar='', help='Listen for app on unix socket instead of host:port') + parser.add_argument( + '--unix-socket-perms', + default='600', + metavar='', + help='Octal permissions to use for the Unix domain socket (default 600)') parser.add_argument( '--debug', default=False, @@ -677,7 +682,7 @@ def run_app() -> None: if args.debug: app.run(host=args.host, port=args.port, debug=args.debug) elif args.unix_socket: - waitress.serve(app, unix_socket=args.unix_socket) + waitress.serve(app, unix_socket=args.unix_socket, unix_socket_perms=args.unix_socket_perms) else: waitress.serve( app,