Commit 87eef9f0 authored by Leo Iannacone's avatar Leo Iannacone

Merge remote-tracking branch 'github/master' into portable

parents 0bfc52d3 cd7f5c26
......@@ -2,6 +2,7 @@
* [new] [module] add parser for blhc log file
* [new] show file size for package files
* [new] disable autoscroll pressing on "back on top" panel
* [new] log files can be now showed directly in the browsers
* [fix] [module] use readline while parsing piuparts log file
* [fix] add support to sourceupload.changes
* [fix] add support to source format 1.0 - closes #6
......
......@@ -5,6 +5,7 @@ app = module.exports = require("express")()
server = require("http").createServer(app)
io = require("socket.io")(server)
path = require("path")
serve_static = require("serve-static")
serve_index = require("serve-index")
errorhandler = require("errorhandler")
......@@ -44,25 +45,26 @@ if config.routes.commands
# debomatic static page
if config.routes.debomatic
app.all config.routes.debomatic + "*", (req, res, next) ->
# send 403 status when users want to browse the chroots:
# - unstable/unstable
# - unstable/build/*
# this prevents system crashes
base = config.routes.debomatic
base += "/" if base[base.length - 1] isnt "/" # append /
match = req.url.replace(base, "").split("/")
match.pop() if match[match.length - 1] is ""
if match.length >= 2 and
((match[0] is match[1]) or # case unstable/unstable
(match[1] is "build" and match.length > 2)) # case unstable/build/*
res.status(403).send """<h1>403 Forbidden</h1>
<h2>You cannot see the chroot internals</h2>
"""
else # call next() here to move on to next middleware/router
chroot_forbidden = (res) ->
res.status(403).send """<h1>403 Forbidden</h1>
<h2>You cannot see the chroot internals</h2>"""
app.get config.routes.debomatic + '/:distribution/:subdir', (req, res, next) ->
if req.params.distribution == req.params.subdir
chroot_forbidden(res)
else
next()
return
app.get config.routes.debomatic + '/:distribution/build/:subdir', (req, res) ->
chroot_forbidden(res)
app.get config.routes.debomatic + '/:distribution/logs/:file', (req, res) ->
distribution = req.params.distribution
file = req.params.file
full_path = path.join(config.debomatic.path, distribution, 'logs', file)
res.set('Content-Type', 'text/plain')
res.sendFile(full_path)
app.use(config.routes.debomatic, serve_static(config.debomatic.path))
app.use(config.routes.debomatic, serve_index(config.debomatic.path,
......
......@@ -65,15 +65,15 @@ pre {
margin: 10px;
}
aside .nav-pills li {
aside#sidebar .nav-pills li {
line-height: 10px;
}
#sidebar {
aside#sidebar {
position: relative;
}
#sidebar .fixed {
aside#sidebar .fixed {
position: fixed;
min-width: 220px !important;
top: 0;
......
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