Commit 13af9a0b authored by Leo Iannacone's avatar Leo Iannacone

update config debomatic variables

parent 9f520661
......@@ -23,8 +23,8 @@ app.configure(function(){
app.use(require('stylus').middleware({ src: __dirname + '/public' }));
app.use(app.router);
app.use(express.static(__dirname + '/public'));
app.use(config.debomatic_webpath, express.directory(config.debomatic_path));
app.use(config.debomatic_webpath, express.static(config.debomatic_path));
app.use(config.debomatic.webpath, express.directory(config.debomatic.path));
app.use(config.debomatic.webpath, express.static(config.debomatic.path));
});
app.configure('development', function(){
......@@ -80,7 +80,7 @@ io.sockets.on('connection', function(socket) {
socket.on('get_distribution_packages', function (data) {
if (! utils.check_data_distribution(data))
return
distribution_path = path.join(config.debomatic_path, data.distribution.name, 'pool')
distribution_path = path.join(config.debomatic.path, data.distribution.name, 'pool')
watch_path_onsocket('get_distribution_packages', socket, data, distribution_path, send.distribution_packages)
send.distribution_packages(socket, data);
})
......@@ -107,7 +107,7 @@ io.sockets.on('disconnect', function(socket){
});
fs.watch(config.debomatic_path, { persistent: true }, function (event, fileName) {
fs.watch(config.debomatic.path, { persistent: true }, function (event, fileName) {
send.distributions(io.sockets);
});
......
var config = {}
config.debomatic_path = '/srv/debomatic-amd64'
config.debomatic_webpath = '/debomatic'
config.debomatic = {}
config.debomatic.path = '/srv/debomatic-amd64'
config.debomatic.webpath = '/debomatic'
config.host = 'localhost'
config.port = 3000
config.web = {}
config.web.title = "deb-o-matic web.ui"
config.web.description = "This is a web interface for debomatic"
module.exports = config
......@@ -35,7 +35,7 @@ function __get_files_list_from_package(data, callback) {
data.package.archives = []
files.forEach(function (f) {
file = {}
file.path = path.join(package_path, f).replace(config.debomatic_path, config.debomatic_webpath)
file.path = path.join(package_path, f).replace(config.debomatic.path, config.debomatic.webpath)
file.orig_name = f
file.name = f.split('_')[0]
file.label = f.replace(file.name + '_', '')
......@@ -89,10 +89,10 @@ function __send_file (socket, data) {
});
}
debomatic_sender = {
sender = {
distributions: function(socket) {
__get_files_list(config.debomatic_path, true, function(distros){
__get_files_list(config.debomatic.path, true, function(distros){
socket.emit('distributions', distros);
});
},
......@@ -114,4 +114,4 @@ debomatic_sender = {
}
}
module.exports = debomatic_sender
module.exports = sender
......@@ -14,7 +14,7 @@ function __check_data_file(data) {
}
function __get_distribution_pool_path(data) {
return path.join(config.debomatic_path, data.distribution.name, 'pool')
return path.join(config.debomatic.path, data.distribution.name, 'pool')
}
function __get_package_path(data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment