diff --git a/README.md b/README.md index 5617ed6..7146720 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ docker run -p 9340:9340 -e AWS_SDK_LOAD_CONFIG=true -e HOME=/ -v $HOME/.aws:/.aw * __`--web.metrics-path`:__ The path metrics are exposed under (default "/metrics") * __`--web.probe-path`:__ The path the probe endpoint is exposed under (default "/probe") * __`--s3.endpoint-url`:__ A [custom endpoint URL](https://docs.aws.amazon.com/general/latest/gr/rande.html) (optional) + * __`--s3.disable-ssl`:__ Disable SSL (default "false") + * __`--s3.force-path-style`:__ Force path style (default "false") Flags can also be set as environment variables, prefixed by `S3_EXPORTER_`. For example: `S3_EXPORTER_S3_ENDPOINT_URL=http://s3.example.local`. diff --git a/s3_exporter.go b/s3_exporter.go index cddba55..5d695cc 100644 --- a/s3_exporter.go +++ b/s3_exporter.go @@ -144,11 +144,13 @@ func init() { func main() { var ( - app = kingpin.New(namespace+"_exporter", "Export metrics for S3 certificates").DefaultEnvars() - listenAddress = app.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9340").String() - metricsPath = app.Flag("web.metrics-path", "Path under which to expose metrics").Default("/metrics").String() - probePath = app.Flag("web.probe-path", "Path under which to expose the probe endpoint").Default("/probe").String() - endpointURL = app.Flag("s3.endpoint-url", "Custom endpoint URL").Default("").String() + app = kingpin.New(namespace+"_exporter", "Export metrics for S3 certificates").DefaultEnvars() + listenAddress = app.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9340").String() + metricsPath = app.Flag("web.metrics-path", "Path under which to expose metrics").Default("/metrics").String() + probePath = app.Flag("web.probe-path", "Path under which to expose the probe endpoint").Default("/probe").String() + endpointURL = app.Flag("s3.endpoint-url", "Custom endpoint URL").Default("").String() + disableSSL = app.Flag("s3.disable-ssl", "Custom disable SSL").Bool() + forcePathStyle = app.Flag("s3.force-path-style", "Custom force path style").Bool() ) log.AddFlags(kingpin.CommandLine) @@ -169,6 +171,9 @@ func main() { cfg.WithEndpoint(*endpointURL) } + cfg.WithDisableSSL(*disableSSL) + cfg.WithS3ForcePathStyle(*forcePathStyle) + svc := s3.New(sess, cfg) log.Infoln("Starting "+namespace+"_exporter", version.Info())