From 64661cb5d96456bbeb7db76bc46ad268bd11f4a9 Mon Sep 17 00:00:00 2001 From: Jan Gottschick Date: Sun, 6 Oct 2024 18:06:19 +0200 Subject: [PATCH] * added environment.md --- core/version | 2 +- templates/ENVIRONMENT.md.tmpl | 22 ++++++++++++++++++++++ templates/core/config.go.tmpl | 4 ++-- templates/middleware/authz.rego.tmpl | 20 ++++++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/core/version b/core/version index 0f82685..6678432 100644 --- a/core/version +++ b/core/version @@ -1 +1 @@ -0.3.7 +0.3.8 diff --git a/templates/ENVIRONMENT.md.tmpl b/templates/ENVIRONMENT.md.tmpl index 601d3c7..bdad774 100644 --- a/templates/ENVIRONMENT.md.tmpl +++ b/templates/ENVIRONMENT.md.tmpl @@ -1 +1,23 @@ +{{ upper ( snakecase .ModuleName ) }}_DEBUG enable debug level for logging +{{ upper ( snakecase .ModuleName ) }}_TRACING enable tracing level for logging +{{ upper ( snakecase .ModuleName ) }}_NAME set the name of the instance of the service +{{ upper ( snakecase .ModuleName ) }}_TITLE set the title in the web page {{ upper ( snakecase .ModuleName ) }}_PORT_NB the local port of the web service (default=8080) +{{ upper ( snakecase .ModuleName ) }}_APIKEYS space separated list of valid API keys +{{ upper ( snakecase .ModuleName ) }}_SESSIONKEY +{{ upper ( snakecase .ModuleName ) }}_POLICY OPA policy for access control +{{ upper ( snakecase .ModuleName ) }}_OPASVC OPA service port to get the OPA policy for access control +{{ upper ( snakecase .ModuleName ) }}_REALM Basic authentication realm +{{ upper ( snakecase .ModuleName ) }}_STAFFUSER username of the administrator +{{ upper ( snakecase .ModuleName ) }}_STAFFPASSWORD password of the administrator +{{ upper ( snakecase .ModuleName ) }}_PARTICIPANTUSER username of the user +{{ upper ( snakecase .ModuleName ) }}_PARTICIPANTPASSWORD password of the user +{{ upper ( snakecase .ModuleName ) }}_CERTPEM certificate for TLS (HTTPS) communication +{{ upper ( snakecase .ModuleName ) }}_KEYPEM key for TLS (HTTPS) communication +{{ upper ( snakecase .ModuleName ) }}_LOGFILE filename of the logging file +{{ upper ( snakecase .ModuleName ) }}_LANGUAGE +{{ upper ( snakecase .ModuleName ) }}_LANGUAGES +{{ upper ( snakecase .ModuleName ) }}_USESSE enable support for _server side event_ communication (default=false) +{{ upper ( snakecase .ModuleName ) }}_PROGRESSDURATION default duration of the progress bar (default=100ms) +{{ upper ( snakecase .ModuleName ) }}_RAPIDOCDOC enable Rapidoc for the OpenAPI viewer (default=false) +{{ upper ( snakecase .ModuleName ) }}_ELEMENTSDOC enable Elements for the OpenAPI viewer (default=false) diff --git a/templates/core/config.go.tmpl b/templates/core/config.go.tmpl index 4407c78..77bb643 100644 --- a/templates/core/config.go.tmpl +++ b/templates/core/config.go.tmpl @@ -14,8 +14,8 @@ import ( type Config struct { Debug bool `default:"false"` - Version bool `default:"false"` - Service string `default:"{{.ModuleName}}"` + Version bool `default:"false" ignored:"true"` + Service string `default:"{{.ModuleName}}" ignored:"true"` Sid string `ignored:"true"` Name string `default:"{{.ModuleName}}"` Title string diff --git a/templates/middleware/authz.rego.tmpl b/templates/middleware/authz.rego.tmpl index 8202498..5f108b4 100644 --- a/templates/middleware/authz.rego.tmpl +++ b/templates/middleware/authz.rego.tmpl @@ -102,6 +102,26 @@ allowAccess { input.path == "/readyz" } +allowEntrypoint { + getMethod + input.path == "/infoz" +} + +allowAccess { + getMethod + input.path == "/infoz" +} + +allowEntrypoint { + getMethod + input.path == "/robots.txt" +} + +allowAccess { + getMethod + input.path == "/robots.txt" +} + allowEntrypoint { user # getMethod