Skip to content
Snippets Groups Projects
Commit e19a70a2 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

use basic file server rather than custom handler

parent 909508cb
Branches main
No related tags found
No related merge requests found
Pipeline #4186 passed with stage
in 52 seconds
......@@ -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}/...
......@@ -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("/", handleGetHome)
r.PathPrefix("/").Handler(http.FileServer(http.Dir(dir)))
h := handlers.CombinedLoggingHandler(os.Stdout, handlers.CORS()(r))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment