mirror of
https://github.com/cmur2/openvpn-status-web.git
synced 2026-10-25 00:45:17 +02:00
Allow dropping privs
This commit is contained in:
1 parent
c885e875ad
commit
e0c3073d82
2 files changed
+7
No files matched your search
@@ -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