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
994d5513
Commit
994d5513
authored
Feb 26, 2015
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always download log files (and dsc, changes) and set text/plain as content-type to compress them
parent
0c77a1cb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
debomatic-webui/lib/app.coffee
debomatic-webui/lib/app.coffee
+9
-3
debomatic-webui/lib/client.coffee
debomatic-webui/lib/client.coffee
+3
-2
debomatic-webui/lib/utils.coffee
debomatic-webui/lib/utils.coffee
+9
-0
No files found.
debomatic-webui/lib/app.coffee
View file @
994d5513
...
...
@@ -70,6 +70,15 @@ if config.routes.debomatic
res
.
set
(
'Content-Type'
,
'text/plain'
)
next
()
# always download log files and some source files, like .dsc and .changes ones
app
.
all
config
.
routes
.
debomatic
+
'/:distribution/pool/:package/:file'
,
(
req
,
res
,
next
)
->
type
=
utils
.
file_type
(
req
.
params
.
file
)
ext
=
req
.
params
.
file
.
split
(
'.'
).
pop
()
if
type
is
"log"
or
ext
in
[
"changes"
,
"dsc"
]
res
.
set
(
'Content-Type'
,
'text/plain'
)
res
.
set
(
'Content-Disposition'
,
'attachment; filename='
+
req
.
params
.
file
)
next
()
app
.
use
(
config
.
routes
.
debomatic
,
serve_static
(
config
.
debomatic
.
path
))
app
.
use
(
config
.
routes
.
debomatic
,
serve_index
(
config
.
debomatic
.
path
,
{
view
:
"details"
,
icons
:
true
}))
...
...
@@ -77,9 +86,6 @@ if config.routes.debomatic
# serve stylesheet-javascript
app
.
use
(
serve_static
(
__dirname
+
"/../public"
))
# serve dsc files as octet-stream
serve_static
.
mime
.
define
(
"application/octet-stream"
:
[
"dsc"
])
# Listening
server
.
listen
config
.
port
,
config
.
host
,
null
,
(
err
)
->
...
...
debomatic-webui/lib/client.coffee
View file @
994d5513
...
...
@@ -20,9 +20,10 @@ get_files_list_from_package = (data, callback) ->
config
.
routes
.
debomatic
)
file
.
orig_name
=
f
file
.
name
=
f
.
split
(
"_"
)[
0
]
if
file
.
extension
in
[
"deb"
,
"ddeb"
,
"udeb"
]
type
=
utils
.
file_type
(
f
)
if
type
is
"deb"
data
.
package
.
debs
.
push
(
file
)
else
if
file
.
extension
in
[
"changes"
,
"dsc"
]
or
f
.
indexOf
(
'.tar.'
)
>
0
or
f
.
indexOf
(
'.diff.'
)
>
0
else
if
type
is
"source"
file
.
name
=
f
.
replace
(
data
.
package
.
orig_name
+
"."
,
""
)
if
file
.
extension
is
"changes"
file
.
name
=
f
.
split
(
'_'
).
pop
()
...
...
debomatic-webui/lib/utils.coffee
View file @
994d5513
...
...
@@ -117,6 +117,14 @@ errors_handler = (from, err, socket) ->
socket
.
emit
config
.
events
.
error
,
msg
if
socket
return
file_type
=
(
filename
)
->
extension
=
filename
.
split
(
"."
).
pop
()
if
extension
in
[
"deb"
,
"ddeb"
,
"udeb"
]
return
"deb"
if
extension
in
[
"changes"
,
"dsc"
]
or
filename
.
indexOf
(
'.tar.'
)
>
0
or
filename
.
indexOf
(
'.diff.'
)
>
0
return
"source"
return
"log"
Tail
::
watchEvent
=
(
e
)
->
_this
=
this
if
e
is
"change"
...
...
@@ -152,5 +160,6 @@ module.exports.get_file_path = get_file_path
module
.
exports
.
get_files_list
=
get_files_list
module
.
exports
.
watch_path_onsocket
=
watch_path_onsocket
module
.
exports
.
errors_handler
=
errors_handler
module
.
exports
.
file_type
=
file_type
module
.
exports
.
arrayEqual
=
arrayEqual
module
.
exports
.
Tail
=
Tail
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