From c26ee0f90042084e12f7ead4526261275b353b2d Mon Sep 17 00:00:00 2001 From: Arpad Kiss Date: Tue, 23 Apr 2024 14:05:52 +0200 Subject: [PATCH 1/2] Align env vars Signed-off-by: Arpad Kiss --- README.md | 12 ++++++++++++ main.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a53a3f..5c6b521 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,18 @@ You can build the docker container by running: docker build . ``` +# Usage + +## Environment config + +* `NSM_LISTEN_ON` - url to listen on. (default: "unix:///listen.on.socket") +* `NSM_MAX_TOKEN_LIFETIME` - maximum lifetime of tokens (default: "10m") +* `NSM_REGISTRY_SERVER_POLICIES` - paths to files and directories that contain registry server policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/server/.*.rego") +* `NSM_REGISTRY_CLIENT_POLICIES` - paths to files and directories that contain registry client policies (default: "etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego") +* `NSM_LOG_LEVEL` - Log level (default: "INFO") +* `NSM_OPEN_TELEMETRY_ENDPOINT` - OpenTelemetry Collector Endpoint (default: "otel-collector.observability.svc.cluster.local:4317") +* `NSM_METRICS_EXPORT_INTERVAL` - interval between mertics exports (default: "10s") + # Testing ## Testing Docker container diff --git a/main.go b/main.go index 59581b9..082a0e5 100644 --- a/main.go +++ b/main.go @@ -61,7 +61,7 @@ type Config struct { RegistryServerPolicies []string `default:"etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/server/.*.rego" desc:"paths to files and directories that contain registry server policies" split_words:"true"` RegistryClientPolicies []string `default:"etc/nsm/opa/common/.*.rego,etc/nsm/opa/registry/.*.rego,etc/nsm/opa/client/.*.rego" desc:"paths to files and directories that contain registry client policies" split_words:"true"` LogLevel string `default:"INFO" desc:"Log level" split_words:"true"` - OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint"` + OpenTelemetryEndpoint string `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint" split_words:"true"` MetricsExportInterval time.Duration `default:"10s" desc:"interval between mertics exports" split_words:"true"` } From 328e972857c3d56db1c2df993a6bcc393faef4db Mon Sep 17 00:00:00 2001 From: Arpad Kiss Date: Tue, 14 May 2024 17:32:21 +0200 Subject: [PATCH 2/2] Update license Signed-off-by: Arpad Kiss --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 082a0e5..bffaf5f 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ // // Copyright (c) 2023 Cisco and/or its affiliates. // +// Copyright (c) 2024 OpenInfra Foundation Europe. All rights reserved. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License");