mirror of
https://github.com/cmur2/openvpn-status-web.git
synced 2025-06-29 00:30:24 +02:00
Allow dropping privs
This commit is contained in:
@ -105,6 +105,10 @@ module OpenVPNStatusWeb
|
||||
|
||||
OpenVPNStatusWeb.logger.info "Starting..."
|
||||
|
||||
# drop privs (first change group than user)
|
||||
Process::Sys.setgid(Etc.getgrnam(config['group']).gid) if config['group']
|
||||
Process::Sys.setuid(Etc.getpwnam(config['user']).uid) if config['user']
|
||||
|
||||
# configure rack
|
||||
app = Daemon.new(config['vpns'])
|
||||
if ENV['RACK_ENV'] == "development"
|
||||
|
Reference in New Issue
Block a user