Commit 600e512f authored by Leo Iannacone's avatar Leo Iannacone

update configuration to coffee and add some comments about

parent 167f5484
# ###
# * Please DO NOT edit this file. Please DO NOT edit this file.
# * Edit auto-generated 'user.config.js' file instead.
# * Edit auto-generated 'user.config.js' file instead. ###
# *
#
extend = require('extend') extend = require('extend')
# #start config-auto-export #start config-auto-export
###
Init some values, do not touch these
###
config = {} config = {}
config.debomatic = {}
config.web = {}
config.web.debomatic = {}
config.web.debomatic.admin = {}
config.web.debomatic.dput = {}
config.web.file = {}
config.web.preferences = {}
# ###
# * Configure host and port. Configure host and port
# * Please for ports < 1000 use authbind. DO NOT RUN nodejs as root. ###
# * $ authbind nodejs index.js
#
config.host = "localhost" config.host = "localhost"
config.port = 3000 config.port = 3000
config.debomatic = {} ###
Deb-O-Matic settings
###
config.debomatic.path = "/srv/debomatic-amd64" config.debomatic.path = "/srv/debomatic-amd64"
config.debomatic.jsonfile = "/var/log/debomatic-json.log" config.debomatic.jsonfile = "/var/log/debomatic-json.log"
config.routes = {}
config.routes.debomatic = "/debomatic"
config.routes.distribution = "/distribution"
config.routes.preferences = "/preferences"
config.routes.commands = "/commands"
# web configuration ###
config.web = {} Web template configuration
config.web.debomatic = {} Title and description for the header
config.web.debomatic.admin = {} ###
config.web.debomatic.admin.name = "Your Name"
# please use this SPAMFREE form - it will be converted client side by javascript
config.web.debomatic.admin.email = "you AT debian DOT org"
config.web.debomatic.architecture = "amd64" config.web.debomatic.architecture = "amd64"
config.web.debomatic.dput = {} config.web.title = "Deb-o-Matic web.ui"
config.web.description = "This is a web interface for debomatic over " +
config.web.debomatic.architecture
###
Admin email and name to show in the home page.
For the email address please use the SPAMFREE form "you AT host DOT org",
it will be converted client side by javascript
###
config.web.debomatic.admin.email = "you AT debian DOT org"
config.web.debomatic.admin.name = "Your Name"
###
Configuration of dput to show the home page.
###
config.web.debomatic.dput.incoming = config.debomatic.path config.web.debomatic.dput.incoming = config.debomatic.path
config.web.debomatic.dput.host = config.host config.web.debomatic.dput.host = config.host
config.web.debomatic.dput.login = "debomatic" config.web.debomatic.dput.login = "debomatic"
config.web.debomatic.dput.method = "scp" config.web.debomatic.dput.method = "scp"
config.web.debomatic.dput.unsigned_uploads = false config.web.debomatic.dput.unsigned_uploads = false
# header title and description
config.web.title = "Deb-o-Matic web.ui" ###
config.web.description = "This is a web interface for debomatic over " + List of files to get a simple preview and number of lines
config.web.debomatic.architecture of the preview
# list of files get preview ###
config.web.file = {}
config.web.file.preview = ["buildlog"] config.web.file.preview = ["buildlog"]
config.web.file.num_lines = 25 config.web.file.num_lines = 25
# default ui settings ###
config.web.preferences = {} The default preferences
###
config.web.preferences.autoscroll = true config.web.preferences.autoscroll = true
config.web.preferences.header = true config.web.preferences.header = true
config.web.preferences.sidebar = true config.web.preferences.sidebar = true
config.web.preferences.glossy_theme = true config.web.preferences.glossy_theme = true
config.web.preferences.file_background = true config.web.preferences.file_background = true
# valid values are [13..16] config.web.preferences.file_fontsize = 13 # valid values are [13..16]
config.web.preferences.file_fontsize = 13 config.web.preferences.debug = 0 # debug level - 0 means disabled
# debug level - 0 means disabled
config.web.preferences.debug = 0
# #end config-auto-export
# DO NOT TOUCH these ones #end config-auto-export
###
The version
###
config.version = "0.6.0" config.version = "0.6.0"
###
List of files to not show in webui
###
config.debomatic.excluded_files = [ config.debomatic.excluded_files = [
"datestamp" "datestamp"
"json" "json"
] ]
###
The routes, that are the pages urls
###
config.routes = {}
config.routes.debomatic = "/debomatic"
config.routes.distribution = "/distribution"
config.routes.preferences = "/preferences"
config.routes.commands = "/commands"
###
The events
###
config.events = {} config.events = {}
config.events.error = "server-error" config.events.error = "server-error"
config.events.broadcast = {} config.events.broadcast = {}
...@@ -87,7 +116,9 @@ config.events.client.file = "c.file" ...@@ -87,7 +116,9 @@ config.events.client.file = "c.file"
config.events.client.file_newcontent = "c.file_newcontent" config.events.client.file_newcontent = "c.file_newcontent"
config.events.client.status = "c.status" config.events.client.status = "c.status"
# debomatic status according with JSONLogger.py module ###
The status according with JSONLogger.py module
###
config.status = {} config.status = {}
config.status.build = "build" config.status.build = "build"
config.status.create = "create" config.status.create = "create"
...@@ -95,35 +126,35 @@ config.status.update = "update" ...@@ -95,35 +126,35 @@ config.status.update = "update"
config.status.success = true config.status.success = true
config.status.fail = false config.status.fail = false
# Merge the configuration
try try
Parser = require("./parser") Parser = require("./parser")
parser = new Parser() parser = new Parser()
user_config = parser.getUserConfig() user_config = parser.getUserConfig()
if user_config if user_config
console.log "Reading user configutation ..." console.log "Reading user configutation ..."
# * update object1 with object2 values
config = extend(true, {}, config, require(user_config)) config = extend(true, {}, config, require(user_config))
else else
console.log "No user config specified. Using global settings." console.log "No user config specified. Using global settings."
catch err
if err.code is "MODULE_NOT_FOUND"
console.log "File %s not found.", user_config
process.exit 1
else
console.error "Error reading user configutation", err
process.exit 1
finally
# export some variable # export some variable to web
config.web.paths = config.routes config.web.paths = config.routes
config.web.events = config.events config.web.events = config.events
config.web.status = config.status config.web.status = config.status
config.web.host = config.host config.web.host = config.host
# calculate pidfile # get the debomatic pidfile
config.debomatic.pidfile = "/var/run/debomatic-" + config.debomatic.pidfile = "/var/run/debomatic-" +
require("crypto") require("crypto")
.createHash("sha256") .createHash("sha256")
.update(config.debomatic.path) .update(config.debomatic.path)
.digest("hex") .digest("hex")
module.exports = config module.exports = config
catch err
if err.code is "MODULE_NOT_FOUND"
console.log "File %s not found.", user_config
else
console.error "Error reading user configutation", err
process.exit 1
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