1
0
mirror of https://github.com/helm/chartmuseum.git synced 2026-02-05 15:45:50 +01:00

263 Commits

Author SHA1 Message Date
Zhizhen He
60554419e2 fix: correct flag for storage.amazon.forcepathstyle (#1102)
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
2025-11-20 10:59:53 -05:00
alexberry
dee42f20db Fix per-chart limits for form-data based uploads. (#1051)
* Ensure uploads using form-data utilise server.PutWithLimit
* Add tests
* Fixes https://github.com/helm/chartmuseum/issues/1050

Signed-off-by: alexberry <alex.berry@mpb.com>
2025-03-14 12:06:35 +08:00
Nace Sc
5e32c8d336 router: fix prometheus metrics high cardinality issue (#789)
* router: fix prometheus metrics high cardinality issue

Closes #448
Refers to [CVE(internal)](https://github.com/helm/chartmuseum/security/advisories/GHSA-67g5-8r7h-h9qv)

Signed-off-by: scbizu <scbizu@gmail.com>

* mod: bump

Signed-off-by: scbizu <scbizu@gmail.com>

* ci: build PR workflow bumps to Go 1.23

Signed-off-by: scbizu <scbizu@gmail.com>

* server: fixup tests

Signed-off-by: scbizu <scbizu@gmail.com>

* router: move prometheus middleware inside CM

* deprecate the external dependency of go-gin-prometheus
* use zap logger(cm) replace of logrus logger(go-gin-prometheus) for better investigation

Signed-off-by: scbizu <scbizu@gmail.com>

---------

Signed-off-by: scbizu <scbizu@gmail.com>
2025-03-05 10:22:46 +08:00
guillaumem
90e47f6336 Add support for creating repository indexes in JSON format (#739)
* repo: add support for JSON marshalling

Signed-off-by: MeurillonGuillaume <MeurillonGuillaume@users.noreply.github.com>

* cfg: add configuration for json index

Signed-off-by: MeurillonGuillaume <MeurillonGuillaume@users.noreply.github.com>

* repo: add tests for json and yaml index options

Signed-off-by: MeurillonGuillaume <MeurillonGuillaume@users.noreply.github.com>

---------

Signed-off-by: MeurillonGuillaume <MeurillonGuillaume@users.noreply.github.com>
Co-authored-by: MeurillonGuillaume <MeurillonGuillaume@users.noreply.github.com>
2024-01-29 19:03:01 +08:00
warjiang
0cfeb2e008 feat: allow user set forcePathStyle for s3 storage (#731)
* feat: update storage lib and export cmd params

Signed-off-by: warjiang <1096409085@qq.com>

* feat: upgrade chartmuseum/storage to v0.14.1

Signed-off-by: warjiang <1096409085@qq.com>

* doc: update usage of force-path-style

Signed-off-by: warjiang <1096409085@qq.com>

---------

Signed-off-by: warjiang <1096409085@qq.com>
2023-11-03 16:44:33 +08:00
Nace Sc
73e75ce517 pkg/repo,pkg/chartmuseum/server: per-limit-chart chart expiration removes prefix mathching for chartpath preparing (#721)
Fix #714

Signed-off-by: scbizu <scbizu@gmail.com>
2023-09-18 20:43:22 -05:00
Casey Buto
d459f513c0 fix: lock tenant map to avoid race (#702)
Signed-off-by: Casey Buto <cbuto@d2iq.com>
2023-06-29 12:21:38 -05:00
Casey Buto
e1d98a8141 test: Use eventually to avoid flakey test (#700)
Signed-off-by: Casey Buto <cbuto@d2iq.com>
2023-06-23 16:29:05 -05:00
Eng Zer Jun
6c0976ff6b chore: replace github.com/ghodss/yaml with sigs.k8s.io/yaml (#692)
At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.

`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-09 16:10:37 -05:00
smoky
a238f4a0fc replace io/ioutil package with os package (#685)
Signed-off-by: 0xff-dev <stevenshuang521@gmail.com>
2023-05-24 16:26:00 -04:00
Casey Buto
5d9b509e93 feat: Remove NetEase object storage provider (#656)
Signed-off-by: Casey Buto <cbuto@d2iq.com>

Signed-off-by: Casey Buto <cbuto@d2iq.com>
2023-01-11 14:22:02 -06:00
Skiepp
09dfc9c2e3 Added HEAD route for index.yaml (#630)
* Added HEAD route for index.yaml

Signed-off-by: Skiepp <skiepp93@hotmail.it>

* Requested by scbizu

Signed-off-by: Skiepp <skiepp93@hotmail.it>

Signed-off-by: Skiepp <skiepp93@hotmail.it>
2022-10-20 10:40:08 +08:00
Obinna Odirionye
3b0f27ac4c Feat/add-golang-lint (#623)
* feat: add support to lint files

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* chore: fix issues with formatting

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* chore: fix misspelling

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* chore: restructure how imports are called. According to goimports lib, Import should be Stdlib, third party and other packages of this project.

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* chore: fix gosimple

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* chore: fix struct literal uses unkeyed fields(govet)

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* chore: remove unnecessary linters

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* ci: fix tests

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>

* signed commits

Signed-off-by: Obinna Odirionye <odirionye@gmail.com>
2022-09-25 18:51:59 +08:00
Nace Sc
3ae6ed2d93 pkg/chartmuseum,cmd: introduce the new keep-chart-always-up-to-date flag and the default cache interval when not set. (#593)
* pkg/chartmuseum,cmd: introduce the new `keep-chart-always-up-to-date` flag and the default cache interval when not set.

* The flags works to always get the realtime index for the chart repository(which is the behavior before v0.13.0), it will cost more fs I/O.
* Default interval is now set to 5m when `cache-interval` flag not set which we suggests in the issue list.

The patch includes:

* increases most of the museum api throughout by wrapping the event
  emitter into goroutine since the event listener already holds on the
  concurrent lock(#396).

* adds the new server option `keep-chart-always-up-to-date` to force use
  the latest version.

* `getIndexFile` rollbacks to fully reload index only if cacheinterval
  not set for better backward compatibility before v0.13.0(#444).

Signed-off-by: scnace <scbizu@gmail.com>
Signed-off-by: scbizu <scbizu@gmail.com>

* pkg/chartmuseum/server: `getRepoObjectSlice` adds the read lock when index refresher works.

Signed-off-by: scbizu <scbizu@gmail.com>

* pkg/chartmuseum: rebuildIndex adds tenant lock

Signed-off-by: scbizu <scbizu@gmail.com>

* pkg/config: clarify the usage of always-regenerate-chart-index

Co-authored-by: Casey Buto <cbuto@d2iq.com>

Signed-off-by: Nace Sc <scbizu@icloud.com>
Signed-off-by: scbizu <scbizu@gmail.com>
2022-08-01 13:27:29 -05:00
Casey Buto
68771af376 feat: Add support for hosting an artifacthub-repo.yml file (#579)
* feat: Add support for hosting an artifacthub-repo.yml file

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* feat: Add multitenancy support for artifacthub

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* refactor: check if map is empty before adding the route

Signed-off-by: Casey Buto <cbuto@d2iq.com>
2022-05-30 20:57:08 -04:00
Zhizhen He
a8efa0b3a0 fix: fix typo (#588)
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
2022-05-30 11:53:02 +08:00
Casey Buto
bc596c0f02 fix: Avoid data races for cacheEntries and index files (#556)
* fix: Avoid data races for cacheEntries and index files

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* test: Update to the latest locust version

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* refactor: remove unecessary lock

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* refactor: no need to return error from load function

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* fix: Add additional tenant cache locking

Signed-off-by: Casey Buto <cbuto@d2iq.com>
2022-04-08 15:16:51 -04:00
Nace Sc
9790250f1b pkg/chartmuseum: re-fmt import path (#573)
Signed-off-by: scnace <scbizu@gmail.com>
2022-04-07 11:42:47 +08:00
zzhzero
315ddf9346 feature add chart template and value api (#551)
* feature add chart template and value api

Signed-off-by: zerohzz <zzhzero@qq.com>

* fix latest chart get template and value

Signed-off-by: zerohzz <zzhzero@qq.com>

* fix template value style and test http code

Signed-off-by: zerohzz <zzhzero@qq.com>

* break redundant loop

Signed-off-by: zzhzero <zzhzero@qq.com>
2022-04-07 11:27:10 +08:00
Engin Diri
1de4aa3d3a feat: customize welcome page (#557)
Signed-off-by: Engin Diri <engin.diri@mail.schwarz>
2022-03-15 10:15:06 +08:00
Obinna Odirionye
49b460d5ff refactor: remove disablemetrics for enablemetrics (#554)
* refactor: remove disablemetrics for enablemetrics

Signed-off-by: nerdeveloper <odirionye@gmail.com>

* chore: set defaults to true as it does the reverse in the config

Signed-off-by: nerdeveloper <odirionye@gmail.com>

* chore: make defaults cleaner

Signed-off-by: nerdeveloper <odirionye@gmail.com>

* docs: update docs on the prometheus metrics

Signed-off-by: nerdeveloper <odirionye@gmail.com>

* chore: fix typo

Signed-off-by: nerdeveloper <odirionye@gmail.com>
2022-02-23 10:54:51 -06:00
Casey Buto
20a3a09efb fix: avoid panic with dynamic depth configured (#543)
* fix: avoid panic with dynamic depth configured

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* test: Add test for dynamic depth route

Signed-off-by: Casey Buto <cbuto@d2iq.com>
2022-02-03 11:24:39 -06:00
Nace Sc
b0326d6b38 cmd/chartmuseum,pkg/chartmuseum,pkg/config: add new per-chart-limit-option , impls #316 (#466)
Signed-off-by: scnace <scbizu@gmail.com>

Co-authored-by: Josh Dolitsky <josh@dolit.ski>
2022-01-28 10:58:12 -06:00
Casey Buto
c76aed0a36 feat: Add configuration deprecation warning logs (#533)
* feat: Add configuration deprecation warning logs

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* docs: add deprecated comments

Signed-off-by: Casey Buto <cbuto@d2iq.com>
2022-01-28 10:38:45 -06:00
Josh Dolitsky
4412d39346 Various v0.14.0 prep items (#527)
- Update version to v0.14.0
- Fix readme for push plugin (in place of #513)
- Upgrade Go modules, Go version in CI
- Use Helm 3.8 in acceptance tests
- Remove bad semever chart tests and testdata
- Support for M1 Macs local dev
- Add SECURITY.md

Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2022-01-25 08:18:40 -06:00
Casey Buto
c08bf65f2f feat: deprecate enforcesemver2 config option (#522)
* feat: deprecate enforcesemver2 config option

Signed-off-by: Casey Buto <cbuto@d2iq.com>

* refactor: skip getting the chart version

Signed-off-by: Casey Buto <cbuto@d2iq.com>
2022-01-24 18:05:58 -06:00
Marco Klaassen
8ebb2045c7 feat(jmespath): add jmespath support (#381)
* feat(jmespath): add jmespath support

Signed-off-by: Marco Klaassen <klaassen.marco@googlemail.com>

* fix formatting

Signed-off-by: Josh Dolitsky <josh@dolit.ski>

Co-authored-by: Josh Dolitsky <josh@dolit.ski>
2022-01-24 08:18:43 -06:00
Niklas Walter
1229856c6d Do not fetch chart content, when not needed (#504)
Signed-off-by: Niklas Walter <niklas.walter@volkswagen.de>
2022-01-24 08:07:04 -06:00
Nace Sc
619e85de24 pkg/chartmuseum/router: fix potential CRLF log injection by constructing vulnerable request (#519)
Fixes #518

Signed-off-by: scnace <scbizu@gmail.com>

Co-authored-by: Josh Dolitsky <josh@dolit.ski>
2022-01-21 17:33:08 -06:00
Josh Dolitsky
9f42822dd4 Update Go dependencies, fix broken tests (#482)
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2022-01-21 17:27:29 -06:00
Qian Deng
670c99e718 Fix duplicate versions for same chart (#492)
* Fix duplicate versions for same chart

* The detailed issue is described in #450
* And there is a PR #454 fixed one scenario of this issue
* But there is another ocassion in which users upload chart with prov
* in this PR is to handle this situation with the way similar with #454

Signed-off-by: DQ <dengq@vmware.com>

* Enhance: optimize loop in `getChartAndProvFiles`

* If conflict, it didn't need to do the left logic, just return the file
* move out file format check logic out of `validateChartOrProv`
* these changes are discussed in https://github.com/helm/chartmuseum/pull/492#discussion_r716032288

Signed-off-by: DQ <dengq@vmware.com>
2021-10-01 00:23:53 +08:00
Nace Sc
d311914e61 pkg/chartmuseum/server: upload chart should emit updateChart event with overwrite option is set (#454)
* pkg/chartmuseum/server: add tests for cover duplicate index entry cases

Signed-off-by: scnace <scbizu@gmail.com>

* pkg/chartmuseum/server/multitenant: fix the bad action type when upload
package when overwrite option is set ,index entry addChart should be updateChart under the overwrite cases.

Signed-off-by: scnace <scbizu@gmail.com>
2021-05-05 09:28:42 -04:00
Josh Dolitsky
79bb39c260 Prep for v0.13.1 release (#429)
* Prep for v0.13.1 release

Signed-off-by: Josh Dolitsky <josh@dolit.ski>

* package bad charts during setup

Signed-off-by: Josh Dolitsky <josh@dolit.ski>

* downgrade to helm 3.5.1, fix tests

Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-03-12 00:09:35 -05:00
Josh Dolitsky
7a62a239e6 Merge pull request #423 from scbizu/fix/multi-tenant-object-path
pkg/chartmuseum/server: fix chart object path invalid
2021-03-10 15:55:21 -05:00
scnace
b1d0cf40c0 pkg/chartmuseum/server: ut covers multi tenants server
Signed-off-by: scnace <scbizu@gmail.com>
2021-02-27 19:14:13 +08:00
scnace
6990830952 pkg/chartmuseum/server: fix chart object path invalid(missing repo prefix) in multi-tenant server and fix #421.
Signed-off-by: scnace <scbizu@gmail.com>
2021-02-24 01:42:12 +08:00
Josh Dolitsky
c7f1620ca7 prepare for v0.13.0 release
- update to Go 1.15.7
- add release artifacts script (copied from Helm)
- add KEYS file containing maintainer signing keys
- update Makefile to follow Helm release process
- update dependencies (including auth and storage)
- rename masterHandler to rootHandler
- add get-chartmuseum script (based on get-helm-3 script)
- remove unused scripts and make targets for old release process
- modify README with new install instructions and docker image
- rename scripts to use dashes vs underscores

Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-02-01 23:05:08 -05:00
scnace
ff22877341 pkg/repo: inject chart metadata(name/version) into storage object (#362)
* pkg/repo,pkg/chartmuseum: use object metadata to correctly get the chart version

Signed-off-by: scnace <scbizu@gmail.com>

* pkg/chartmuseum/server: log error rather than panic if mutitant reponame not found

Signed-off-by: scnace <scbizu@gmail.com>

* mod: bump storage to v0.10.0

Signed-off-by: scnace <scbizu@gmail.com>
2020-11-12 00:15:35 -05:00
Dean Coakley
f5c5fddf72 Add /info endpoint (#358)
* Add /info endpoint

* Returns version information about the ChartMuseum server

Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>

* Add docs for /info endpoint

Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>

* Make docs more specific

Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>

* Make version handler dynamic

Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>

Co-authored-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>
2020-09-14 18:18:18 -04:00
jdolitsky
c9b0d04e0b Cleanup latest cache changes
- Add info to README
- Turn off by default
- Fix issue with hanging deletes
- Reorganize/rename code
- Verify functionality
- Make unit tests pass

Signed-off-by: jdolitsky <393494+jdolitsky@users.noreply.github.com>
2020-09-14 17:56:20 -04:00
Ailsa-Wu
68532a8639 Improve performance when dealing with thousands of charts (#339)
* resolve https://github.com/helm/chartmuseum/issues/332

Signed-off-by: Ailsa <ailsa.wu@sap.com>

* fix bug since conflict resolution is uncareful

Signed-off-by: Ailsa <ailsa.wu@sap.com>

* add flag cache-interval and encapsulate func InitCacheTimer

Signed-off-by: Ailsa <ailsa.wu@sap.com>

* Update vars.go

Signed-off-by: Ailsa <ailsa.wu@sap.com>
2020-09-13 19:37:30 -04:00
jayme-github
b5bb97f674 Allow to bind chartmuseum to a specific interface (#345)
* Allow to bind chartmuseum to a specific interface

The new config option "listen.host" ("--listen-host", "LISTEN_HOST") may
be used to bind  chartmuseum to a specific interface rather than 0.0.0.0.

Default is 0.0.0.0 to stick with current behaviour.

Fixes #255

Signed-off-by: jayme-github <jayme-github@users.noreply.github.com>

* Refactor to make host a field of router

Signed-off-by: jayme-github <jayme-github@users.noreply.github.com>
2020-07-14 11:20:26 -05:00
jayme-github
136f4894ea Add support for Swift V1 Auth (#346)
This adds support for Swift V1 Auth sharing all of the config options
with openstack. I've added a new option (--storage-openstack-auth) to
switch to V1 Auth.

This depends on https://github.com/chartmuseum/storage/pull/45

Signed-off-by: jayme-github <jayme-github@users.noreply.github.com>
2020-07-13 21:17:27 -05:00
jayme-github
bad463a806 Fix a typo in config key disabldelete -> disabledelete
Signed-off-by: jayme-github <tuxnet@gmail.com>
2020-06-17 10:51:29 +02:00
Lisheng Zheng
a258b600c1 chore(status code): use constant status code instead of raw (#338)
Signed-off-by: Lisheng Zheng <zls1129@gmail.com>
2020-06-10 12:57:21 -05:00
Grégoire Leroy
101e26aeb1 Add --log-latency-integer option (#324)
Signed-off-by: gleroy2 <gregoire.leroy2@ubisoft.com>
2020-04-27 12:54:55 -05:00
Josh Dolitsky
a0e31d134b maint: fix broken unit test
Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>
2020-04-15 20:01:36 -05:00
scnace
2ac8b5df65 chartmuseum: add semver2 validation (#322)
Signed-off-by: scnace <scbizu@gmail.com>
2020-04-15 17:26:39 -05:00
Josh Dolitsky
d9b42502e4 remove amazon nearest second flag
Signed-off-by: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com>
2020-03-25 22:27:40 -05:00
Raj Perera
8d7034a1a9 Add flag for storage timestamp tolerance for invalidating cached index (#314)
Signed-off-by: Raj Perera <rajiteh@gmail.com>
2020-03-25 19:50:56 -05:00