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 permissionsmain
parent
b5ae07613b
commit
70dc750c7a
|
@ -626,6 +626,11 @@ def run_app() -> None:
|
||||||
default='',
|
default='',
|
||||||
metavar='</path/to/unix.sock>',
|
metavar='</path/to/unix.sock>',
|
||||||
help='Listen for app on unix socket instead of host:port')
|
help='Listen for app on unix socket instead of host:port')
|
||||||
|
parser.add_argument(
|
||||||
|
'--unix-socket-perms',
|
||||||
|
default='600',
|
||||||
|
metavar='<octal permissions>',
|
||||||
|
help='Octal permissions to use for the Unix domain socket (default 600)')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--debug',
|
'--debug',
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -677,7 +682,7 @@ def run_app() -> None:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
app.run(host=args.host, port=args.port, debug=args.debug)
|
app.run(host=args.host, port=args.port, debug=args.debug)
|
||||||
elif args.unix_socket:
|
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:
|
else:
|
||||||
waitress.serve(
|
waitress.serve(
|
||||||
app,
|
app,
|
||||||
|
|
Loading…
Reference in New Issue