From 01fd20d7ed4ee9f45ec55f36244c1a08bc1c8fad Mon Sep 17 00:00:00 2001 From: John Warburton Date: Mon, 24 Jun 2024 12:01:52 +1000 Subject: [PATCH] update doco --- README.md | 7 +++++-- cmd/serve.go | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b4139ef..8c05086 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Flags: --cachedir string cache directory (default "~/.gorge/cache") --cors string allowed cors origins separated by comma (default "*") --dev enables dev mode - --fallback-proxy string optional fallback upstream proxy url + --fallback-proxy string optional comma separated list of fallback upstream proxy urls -h, --help help for serve --import-proxied-releases add every proxied modules to local store --jwt-secret string jwt secret (default "changeme") @@ -80,6 +80,9 @@ gorge serve # use fallback forge and cache request of modules and files gorge serve --fallback-proxy https://forge.puppetlabs.com --cache-prefixes /v3/files,/v3/modules + +# use internal forge server and fallback forge and cache request of modules and files +gorge serve --fallback-proxy https://internal-forge.example.com,https://forge.puppetlabs.com --cache-prefixes /v3/files,/v3/modules ``` ## 🍰 Configuration @@ -108,7 +111,7 @@ cachedir: ~/.gorge/cache cors: "*" # Enables the dev mode. dev: false -# Upstream forge to use when local requests return 404 +# List of comma separated upstream forge(s) to use when local requests return 404 fallback-proxy: # Import proxied modules into local backend. import-proxied-releases: false diff --git a/cmd/serve.go b/cmd/serve.go index 1ad93cf..1cc2115 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -46,7 +46,7 @@ var serveCmd = &cobra.Command{ Use: "serve", Short: "Start the puppet forge webserver", Long: `Run this command to start serving your own puppet modules. -You can also enable a fallback proxy to forward the requests to +You can also enable fallback proxies to forward the requests to when you don't have the requested module in your local module set yet. @@ -238,7 +238,7 @@ func init() { serveCmd.Flags().IntVar(&config.ModulesScanSec, "modules-scan-sec", 0, "seconds between scans of directory containing all the modules. (default 0 means only scan at startup)") serveCmd.Flags().StringVar(&config.Backend, "backend", "filesystem", "backend to use") serveCmd.Flags().StringVar(&config.CORSOrigins, "cors", "*", "allowed cors origins separated by comma") - serveCmd.Flags().StringVar(&config.FallbackProxyUrl, "fallback-proxy", "", "optional fallback upstream proxy url") + serveCmd.Flags().StringVar(&config.FallbackProxyUrl, "fallback-proxy", "", "optional comma separated list of fallback upstream proxy urls") serveCmd.Flags().BoolVar(&config.Dev, "dev", false, "enables dev mode") serveCmd.Flags().StringVar(&config.CacheDir, "cachedir", "~/.gorge/cache", "cache directory") serveCmd.Flags().StringVar(&config.CachePrefixes, "cache-prefixes", "/v3/files", "url prefixes to cache")