Skip to content

Commit

Permalink
Merge pull request liftoff#469 from totakoko/add_unix_socket_mode
Browse files Browse the repository at this point in the history
Added Unix socket mode (permissions) option
  • Loading branch information
liftoff committed May 29, 2015
2 parents c4c4635 + 18c7bd4 commit 77cf3ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions gateone/core/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ def define_options(installed=True, cli_commands=None):
group='gateone',
help=_("Path to the Unix socket (if --enable_unix_socket=True)."),
type=basestring)
define(
"unix_socket_mode",
default="0600",
group='gateone',
help=_("Unix socket mode (if --enable_unix_socket=True)."),
type=basestring)
# Please only use this if Gate One is running behind something with SSL:
define(
"disable_ssl",
Expand Down
15 changes: 12 additions & 3 deletions gateone/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4437,9 +4437,18 @@ def main(installed=True):
if go_settings.get('enable_unix_socket', False):
https_server.add_socket(
tornado.netutil.bind_unix_socket(
go_settings['unix_socket_path']))
logger.info(_("Listening on Unix socket '{socketpath}'".format(
socketpath=go_settings['unix_socket_path'])))
go_settings['unix_socket_path'],
# Tornado uses octal encoding
int(go_settings['unix_socket_mode'], 8)
)
)
logger.info(_(
"Listening on Unix socket '{socketpath}' ({socketmode})"
.format(
socketpath=go_settings['unix_socket_path'],
socketmode=go_settings['unix_socket_mode']
)
))
address = none_fix(go_settings['address'])
if address:
for addr in address.split(';'):
Expand Down

0 comments on commit 77cf3ac

Please sign in to comment.