Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bruce Flynn
chart-server
Commits
e19a70a2
Commit
e19a70a2
authored
Oct 24, 2018
by
Bruce Flynn
Browse files
use basic file server rather than custom handler
parent
909508cb
Pipeline
#4186
passed with stage
in 52 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.sh
View file @
e19a70a2
...
...
@@ -4,4 +4,4 @@ sha=$(git rev-parse HEAD)
dt
=
"
$(
date
+%Y-%m-%d
)
T
$(
date
+%H:%M:%S
)
Z"
buildStr
=
"v
${
ver
}
(
${
dt
}
)"
pkg
=
gitlab.ssec.wisc.edu/brucef/chart-server
go
install
--ldflags
"-X 'main.buildStr=
${
buildStr
}
'"
${
pkg
}
/...
go
install
-v
--ldflags
"-X 'main.buildStr=
${
buildStr
}
'"
${
pkg
}
/...
main.go
View file @
e19a70a2
...
...
@@ -87,6 +87,12 @@ helm repo add <name> %s
<dt>GET /<version>-<version>.tgz</dt>
<dd>Get a Heml chart package</dd>
<dt>PUT /<version>-<version>.tgz</dt>
<dd>Upload a new chart package to the index</dd>
<dt>GET /files</dt>
<dd>Basic file listing of chart directory</code></dd>
<dt>GET /status</dt>
<dd>Health check that simply returns <code>OK!</code></dd>
...
...
@@ -172,9 +178,8 @@ Options can also be specified as environment variables $CHART_SVR_<name>
r
:=
mux
.
NewRouter
()
r
.
HandleFunc
(
"/status"
,
handleStatus
)
.
Methods
(
"GET"
)
// Limit to only index.yaml and chart (.tgz) files
r
.
HandleFunc
(
`/{filename:(?:index.yaml|.*-.*.tgz)}`
,
handleGetFile
)
.
Methods
(
"GET"
)
r
.
HandleFunc
(
`/{chart:.*-.*.tgz}`
,
handleUpload
)
.
Methods
(
"PUT"
)
r
.
HandleFunc
(
"/"
,
h
andle
GetHome
)
r
.
PathPrefix
(
"/"
)
.
H
andle
r
(
http
.
FileServer
(
http
.
Dir
(
dir
))
)
h
:=
handlers
.
CombinedLoggingHandler
(
os
.
Stdout
,
handlers
.
CORS
()(
r
))
...
...
Write
Preview
Supports
Markdown
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