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
4b85b75d
Commit
4b85b75d
authored
Jun 04, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into portable
parents
cfe34a20
a6c6a245
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
74 deletions
+74
-74
debomatic-webui/debomatic-webui
debomatic-webui/debomatic-webui
+57
-59
debomatic-webui/lib/config.js
debomatic-webui/lib/config.js
+1
-1
debomatic-webui/package.json
debomatic-webui/package.json
+15
-12
debomatic-webui/scripts/install/patch_css_directory_listing.sh
...atic-webui/scripts/install/patch_css_directory_listing.sh
+1
-2
No files found.
debomatic-webui/debomatic-webui
View file @
4b85b75d
#!/usr/bin/env nodejs
#!/usr/bin/env nodejs
'use strict';
/**
/**
* Module dependencies.
* Module dependencies.
*/
*/
var express = require('express')
var express = require('express'),
, routes = require('./routes')
serve_static = require('serve-static'),
, config = require('./lib/config.js')
serve_index = require('serve-index'),
, utils = require('./lib/utils.js')
errorhandler = require('errorhandler'),
, http = require('http')
routes = require('./routes'),
, app = module.exports = express()
config = require('./lib/config.js'),
, Client = require('./lib/client.js')
utils = require('./lib/utils.js'),
, Broadcaster = require('./lib/broadcaster.js')
http = require('http'),
app = module.exports = express(),
Client = require('./lib/client.js'),
Broadcaster = require('./lib/broadcaster.js');
// Configuration
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
app.use(config.routes.debomatic, express.directory(config.debomatic.path));
app.use(config.routes.debomatic, express.static(config.debomatic.path));
//app.enable('trust proxy');
});
app.configure('development', function(){
app.set('views', __dirname + '/views');
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
app.set('view engine', 'ejs');
});
app.use(serve_static(__dirname + '/public'));
app.use(config.routes.debomatic, serve_index(config.debomatic.path));
app.use(config.routes.debomatic, serve_static(config.debomatic.path));
app.configure('production', function(){
var env = process.env.NODE_ENV || 'development';
app.use(express.errorHandler());
if ('development' == env) {
});
app.use(errorhandler({
dumpExceptions: true,
showStack: true
}));
} else if ('development' == env) {
app.use(errorhandler());
}
// Routes
// Routes
app.get('/', routes.index);
app.get('/', routes.index);
app.get(config.routes.distribution, routes.distribution)
app.get(config.routes.distribution, routes.distribution)
;
if (config.routes.preferences)
if (config.routes.preferences)
app.get(config.routes.preferences, routes.preferences)
app.get(config.routes.preferences, routes.preferences);
var server = http.createServer(app)
var server = http.createServer(app)
,
, io = require('socket.io').listen(server, config.socket)
io = require('socket.io').listen(server, config.socket);
// Listening
// Listening
server.listen(config.port, config.host, null, function
(err)
{
server.listen(config.port, config.host, null, function
(err)
{
// Checking nodejs with sudo:
// Checking nodejs with sudo:
// Find out which user used sudo through the environment variable
// Find out which user used sudo through the environment variable
// and set his user id
// and set his user id
var uid = parseInt(process.env.SUDO_UID);
var uid = parseInt(process.env.SUDO_UID);
if (uid) {
if (uid) {
console.log("Please do not run nodejs with sudo. Changing user to %d", uid)
console.log('Please do not run nodejs with sudo. Changing user to %d', uid);
process.setgid(uid);
process.setgid(uid);
process.setuid(uid);
process.setuid(uid);
}
}
// statuses
// statuses
var status = []
var status = [];
var broadcast = new Broadcaster(io.sockets, status)
var broadcast = new Broadcaster(io.sockets, status);
io.sockets.on('connection', function
(socket) {
io.sockets.on('connection', function
(socket) {
var client = new Client(socket)
var client = new Client(socket);
client.start()
client.start();
if (status.length > 0)
if (status.length > 0)
client.send_status(status)
client.send_status(status);
});
});
console.log("Debomatic-webui listening on %s:%d in %s mode"
, server.address().address, server.address().port, app.settings.env);
console.log('Debomatic-webui listening on %s:%d in %s mode'
, server.address().address, server.address().port, app.settings.env);
});
});
server.on('error', function (e) {
server.on('error', function (e) {
if (e.code == 'EADDRINUSE') {
if (e.code == 'EADDRINUSE') {
console.log('Address in use %s:%d. Exit.', config.host, config.port);
console.log('Address in use %s:%d. Exit.', config.host, config.port);
process.exit(1);
process.exit(1);
}
} else {
else {
console.error(e);
console.error(e);
}
}
});
});
debomatic-webui/lib/config.js
View file @
4b85b75d
...
@@ -61,7 +61,7 @@ config.web.preferences.debug = 0 // debug level - 0 means disabled
...
@@ -61,7 +61,7 @@ config.web.preferences.debug = 0 // debug level - 0 means disabled
// DO NOT TOUCH these ones
// DO NOT TOUCH these ones
config
.
version
=
'
0.2.
1
'
config
.
version
=
'
0.2.
2
'
// A simple function to quickly have
// A simple function to quickly have
// get and set strings for client events
// get and set strings for client events
...
...
debomatic-webui/package.json
View file @
4b85b75d
{
{
"name"
:
"debomatic-webui"
"name"
:
"debomatic-webui"
,
,
"version"
:
"0.0.1"
"version"
:
"0.0.1"
,
,
"private"
:
true
"private"
:
true
,
,
"dependencies"
:
{
"dependencies"
:
{
"express"
:
"3.x"
"express"
:
"4.x"
,
,
"ejs"
:
">= 0.0.1"
"serve-index"
:
"*"
,
,
"socket.io"
:
"*"
"serve-static"
:
"*"
,
,
"tail"
:
"*"
"errorhandler "
:
"*"
,
}
"ejs"
:
">= 0.0.1"
,
,
"scripts"
:
{
"socket.io"
:
"0.*"
,
"tail"
:
"*"
},
"scripts"
:
{
"install"
:
"bash scripts/install.sh"
"install"
:
"bash scripts/install.sh"
}
}
}
}
debomatic-webui/scripts/install/patch_css_directory_listing.sh
View file @
4b85b75d
#!/bin/bash
#!/bin/bash
CSS
=
"
${
SCRIPTS_DIR
}
/../node_modules/
express/node_modules/connect/node_modules/
serve-index/public/style.css"
CSS
=
"
${
SCRIPTS_DIR
}
/../node_modules/serve-index/public/style.css"
if
[
"
`
grep
debomatic-webui
$CSS
`
"
==
""
]
;
then
if
[
"
`
grep
debomatic-webui
$CSS
`
"
==
""
]
;
then
echo
"Patching directory listing style.css"
echo
"Patching directory listing style.css"
cp
$CSS
$CSS
.orig
cp
$CSS
$CSS
.orig
echo
"
echo
"
...
...
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