Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
c94025e4
Commit
c94025e4
authored
Mar 15, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added setuid and setgid options - dropping root privileges
parent
5d8de71b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
debomatic-webui/index.js
debomatic-webui/index.js
+14
-0
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+1
-0
No files found.
debomatic-webui/index.js
View file @
c94025e4
...
@@ -39,6 +39,20 @@ if (config.routes.preferences)
...
@@ -39,6 +39,20 @@ if (config.routes.preferences)
// Listening
// Listening
var
server
=
app
.
listen
(
config
.
port
,
config
.
host
,
null
,
function
(){
var
server
=
app
.
listen
(
config
.
port
,
config
.
host
,
null
,
function
(){
// set uid e gid - drop root privileges
try
{
process
.
setuid
(
config
.
user
);
process
.
setgid
(
config
.
user
);
}
catch
(
err
)
{
if
(
err
.
code
==
'
EPERM
'
)
{
console
.
error
(
'
Changing user id %s: permission denied. Running as %s.
'
,
config
.
user
,
process
.
getuid
());
}
else
{
console
.
error
(
'
Error changing user id.
'
,
err
)
process
.
exit
(
1
)
}
}
var
Client
=
require
(
'
./lib/client.js
'
)
var
Client
=
require
(
'
./lib/client.js
'
)
var
Broadcaster
=
require
(
'
./lib/broadcaster.js
'
)
var
Broadcaster
=
require
(
'
./lib/broadcaster.js
'
)
...
...
debomatic-webui/lib/config.js
View file @
c94025e4
...
@@ -2,6 +2,7 @@ var config = {}
...
@@ -2,6 +2,7 @@ var config = {}
config
.
host
=
'
localhost
'
config
.
host
=
'
localhost
'
config
.
port
=
3000
config
.
port
=
3000
config
.
user
=
'
www-data
'
// who will run server
config
.
debomatic
=
{}
config
.
debomatic
=
{}
config
.
debomatic
.
path
=
'
/srv/debomatic-amd64
'
config
.
debomatic
.
path
=
'
/srv/debomatic-amd64
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment