From c900b4deee9c99c174273f3791b6af1adb04be0f Mon Sep 17 00:00:00 2001 From: Urban Klinc Date: Wed, 2 Dec 2020 10:34:25 +0100 Subject: [PATCH] Add .adoc files, generated from .yaml --- pkg/options/DB.adoc | 17 +++++++++ pkg/options/HTTPClient.adoc | 23 ++++++++++++ pkg/options/HTTPServer.adoc | 68 ++++++++++++++++++++++++++++++++++++ pkg/options/README.adoc | 25 +++++++------ pkg/options/SMTP.adoc | 36 +++++++++++++++++++ pkg/options/actionLog.adoc | 20 +++++++++++ pkg/options/auth.adoc | 23 ++++++++++++ pkg/options/corredor.adoc | 56 +++++++++++++++++++++++++++++ pkg/options/environment.adoc | 17 +++++++++ pkg/options/eventbus.adoc | 20 +++++++++++ pkg/options/monitor.adoc | 17 +++++++++ pkg/options/objectStore.adoc | 38 ++++++++++++++++++++ pkg/options/provision.adoc | 17 +++++++++ pkg/options/sentry.adoc | 41 ++++++++++++++++++++++ pkg/options/upgrade.adoc | 23 ++++++++++++ pkg/options/waitFor.adoc | 38 ++++++++++++++++++++ pkg/options/websocket.adoc | 23 ++++++++++++ 17 files changed, 491 insertions(+), 11 deletions(-) create mode 100644 pkg/options/DB.adoc create mode 100644 pkg/options/HTTPClient.adoc create mode 100644 pkg/options/HTTPServer.adoc create mode 100644 pkg/options/SMTP.adoc create mode 100644 pkg/options/actionLog.adoc create mode 100644 pkg/options/auth.adoc create mode 100644 pkg/options/corredor.adoc create mode 100644 pkg/options/environment.adoc create mode 100644 pkg/options/eventbus.adoc create mode 100644 pkg/options/monitor.adoc create mode 100644 pkg/options/objectStore.adoc create mode 100644 pkg/options/provision.adoc create mode 100644 pkg/options/sentry.adoc create mode 100644 pkg/options/upgrade.adoc create mode 100644 pkg/options/waitFor.adoc create mode 100644 pkg/options/websocket.adoc diff --git a/pkg/options/DB.adoc b/pkg/options/DB.adoc new file mode 100644 index 000000000..5d7f7379f --- /dev/null +++ b/pkg/options/DB.adoc @@ -0,0 +1,17 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/DB.yaml + += DB + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *DB_DSN* +|`string` +|"sqlite3://file::memory:?cache=shared&mode=memory"|Database connection string. +|=== \ No newline at end of file diff --git a/pkg/options/HTTPClient.adoc b/pkg/options/HTTPClient.adoc new file mode 100644 index 000000000..81aca5ac6 --- /dev/null +++ b/pkg/options/HTTPClient.adoc @@ -0,0 +1,23 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/HTTPClient.yaml + += HTTPClient + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *HTTP_CLIENT_TSL_INSECURE* +|`bool` +|false|Allow insecure (invalid, expired TSL/SSL certificates) connections. +[IMPORTANT] +We strongly recommend keeping this value set to false except for local development or demos. + +3+| *HTTP_CLIENT_TIMEOUT* +|`time.Duration` +|30 * time.Second|Default timeout for clients. +|=== \ No newline at end of file diff --git a/pkg/options/HTTPServer.adoc b/pkg/options/HTTPServer.adoc new file mode 100644 index 000000000..253540666 --- /dev/null +++ b/pkg/options/HTTPServer.adoc @@ -0,0 +1,68 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/HTTPServer.yaml + += HTTPServer + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *HTTP_ADDR* +|`string` +|":80"|IP and port for the HTTP server. +3+| *HTTP_LOG_REQUEST* +|`bool` +|false|Log HTTP requests. +3+| *HTTP_LOG_RESPONSE* +|`bool` +|false|Log HTTP responses. +3+| *HTTP_ERROR_TRACING* +|`bool` +|false| +3+| *HTTP_ENABLE_HEALTHCHECK_ROUTE* +|`bool` +|true| +3+| *HTTP_ENABLE_VERSION_ROUTE* +|`bool` +|true|Enable `/version` route. +3+| *HTTP_ENABLE_DEBUG_ROUTE* +|`bool` +|false|Enable `/debug` route. +3+| *HTTP_METRICS* +|`bool` +|false|Enable (prometheus) metrics. +3+| *HTTP_METRICS_NAME* +|`string` +|"corteza"|Name for metrics endpoint. +3+| *HTTP_METRICS_USERNAME* +|`string` +|"metrics"|Username for the metrics endpoint. +3+| *HTTP_METRICS_PASSWORD* +|`string` +|string(rand.Bytes(5))|Password for the metrics endpoint. +3+| *HTTP_REPORT_PANIC* +|`bool` +|true|Report HTTP panic to Sentry. +3+| *HTTP_API_ENABLED* +|`bool` +|true| +3+| *HTTP_API_BASE_URL* +|`string` +|| +3+| *HTTP_WEBAPP_ENABLED* +|`bool` +|false| +3+| *HTTP_WEBAPP_BASE_URL* +|`string` +|"/"| +3+| *HTTP_WEBAPP_BASE_DIR* +|`string` +|"webapp/public"| +3+| *HTTP_WEBAPP_LIST* +|`string` +|"admin,auth,messaging,compose"| +|=== \ No newline at end of file diff --git a/pkg/options/README.adoc b/pkg/options/README.adoc index c9c87c1f4..849a73d4e 100644 --- a/pkg/options/README.adoc +++ b/pkg/options/README.adoc @@ -2,9 +2,9 @@ This file is meant to help with the creation of a .YAML file inside options package. -The name of the .YAML will dedicate the name of the .gen.go file e.g. fileName1.yaml -> fileName1.gen.go, filename2.yaml -> filename2.gen.go +The name of the *.YAML* will dedicate the name of the *.gen.go* file e.g. fileName1.yaml -> fileName1.gen.go, filename2.yaml -> filename2.gen.go -The contents of the .YAML file should look like this: +The contents of the *.YAML* file should look like this: name: ... @@ -16,17 +16,20 @@ The contents of the .YAML file should look like this: type: ... env: ... default: ... + description: ... -**name** - - It is the name of the struct +**name**: :: +* It is the name of the struct -**imports** - - The list of imports that are needed, if there are no imporsts you may skip this step +**imports**: :: +* The list of imports that are needed, if there are no imporsts you may skip this step + +**props**: :: +* *name* -> name of variable +* *type* -> the type of variable if not given it is "string" by default +* *env* -> environment value that if it is not defined will be auto generated from "name" and "props: - name" +* *default* -> the default value that is asigned to the "prop" strings should be given in double quotations if they are to be qouted +* *description* -> description contains the "comment" for the entire prop line -**props** - - props: - *name* -> name of variable - - props: - *type* -> the type of variable if not given it is "string" by default - - props: - *env* -> environment value that if it is not defined will be auto generated from "name" and "props: - name" - - props: - *default* -> the default value that is asigned to the "prop" strings should be given in double quotations if they are to be qouted diff --git a/pkg/options/SMTP.adoc b/pkg/options/SMTP.adoc new file mode 100644 index 000000000..4b16cc446 --- /dev/null +++ b/pkg/options/SMTP.adoc @@ -0,0 +1,36 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/SMTP.yaml + += SMTP + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *SMTP_HOST* +|`string` +|"localhost"|The SMTP server hostname. + +3+| *SMTP_PORT* +|`int` +|25|The SMTP post. +3+| *SMTP_USER* +|`string` +||The SMTP username. +3+| *SMTP_PASS* +|`string` +||The SMTP password. +3+| *SMTP_FROM* +|`string` +||The SMTP `from` email parameter +3+| *SMTP_TLS_INSECURE* +|`bool` +|false|Allow insecure (invalid, expired TLS certificates) connections. +3+| *SMTP_TLS_SERVER_NAME* +|`string` +|| +|=== \ No newline at end of file diff --git a/pkg/options/actionLog.adoc b/pkg/options/actionLog.adoc new file mode 100644 index 000000000..f109d70d2 --- /dev/null +++ b/pkg/options/actionLog.adoc @@ -0,0 +1,20 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/actionLog.yaml + += ActionLog + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *ACTIONLOG_ENABLED* +|`bool` +|true|Enable action logging. +3+| *ACTIONLOG_DEBUG* +|`bool` +|false|Enable debug action logging. +|=== \ No newline at end of file diff --git a/pkg/options/auth.adoc b/pkg/options/auth.adoc new file mode 100644 index 000000000..b4ebba3ae --- /dev/null +++ b/pkg/options/auth.adoc @@ -0,0 +1,23 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/auth.yaml + += Auth + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *AUTH_JWT_SECRET* +|`string` +||Secret used for signing JWT tokens. +[IMPORTANT] +Make sure to provide a secret. If you don’t, a random value is assigned — this causes all of the tokens to become invalid after a server restart. + +3+| *AUTH_JWT_EXPIRY* +|`time.Duration` +|time.Hour * 24 * 30|Experation time for the auth JWT tokens. +|=== \ No newline at end of file diff --git a/pkg/options/corredor.adoc b/pkg/options/corredor.adoc new file mode 100644 index 000000000..58ad7945b --- /dev/null +++ b/pkg/options/corredor.adoc @@ -0,0 +1,56 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/corredor.yaml + += Corredor + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *CORREDOR_ENABLED* +|`bool` +|true|Enable/disable Corredor integration +3+| *CORREDOR_ADDR* +|`string` +|"localhost:50051"|Hostname and port of the Corredor gRPC server. +3+| *CORREDOR_MAX_BACKOFF_DELAY* +|`time.Duration` +|time.Minute|Max delay for backoff on connection. +3+| *CORREDOR_MAX_RECEIVE_MESSAGE_SIZE* +|`int` +|2 << 23|Max message size that can be recived. +3+| *CORREDOR_DEFAULT_EXEC_TIMEOUT* +|`time.Duration` +|time.Minute| +3+| *CORREDOR_LIST_TIMEOUT* +|`time.Duration` +|time.Second * 2| +3+| *CORREDOR_LIST_REFRESH* +|`time.Duration` +|time.Second * 5| +3+| *CORREDOR_RUN_AS_ENABLED* +|`bool` +|true| +3+| *CORREDOR_CLIENT_CERTIFICATES_ENABLED* +|`bool` +|false| +3+| *CORREDOR_CLIENT_CERTIFICATES_PATH* +|`string` +|"/certs/corredor/client"| +3+| *CORREDOR_CLIENT_CERTIFICATES_CA* +|`string` +|"ca.crt"| +3+| *CORREDOR_CLIENT_CERTIFICATES_PRIVATE* +|`string` +|"private.key"| +3+| *CORREDOR_CLIENT_CERTIFICATES_PUBLIC* +|`string` +|"public.crt"| +3+| *CORREDOR_CLIENT_CERTIFICATES_SERVER_NAME* +|`string` +|| +|=== \ No newline at end of file diff --git a/pkg/options/environment.adoc b/pkg/options/environment.adoc new file mode 100644 index 000000000..8b0f330a0 --- /dev/null +++ b/pkg/options/environment.adoc @@ -0,0 +1,17 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/environment.yaml + += Environment + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *ENVIRONMENT* +|`string` +|"production"| +|=== \ No newline at end of file diff --git a/pkg/options/eventbus.adoc b/pkg/options/eventbus.adoc new file mode 100644 index 000000000..70cf52134 --- /dev/null +++ b/pkg/options/eventbus.adoc @@ -0,0 +1,20 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/eventbus.yaml + += Eventbus + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *EVENTBUS_SCHEDULER_ENABLED* +|`bool` +|true|Enable eventbus sheduler. +3+| *EVENTBUS_SCHEDULER_INTERVAL* +|`time.Duration` +|time.Minute|Set time interval for `eventbus` scheduler. +|=== \ No newline at end of file diff --git a/pkg/options/monitor.adoc b/pkg/options/monitor.adoc new file mode 100644 index 000000000..d1115a568 --- /dev/null +++ b/pkg/options/monitor.adoc @@ -0,0 +1,17 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/monitor.yaml + += Monitor + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *MONITOR_INTERVAL* +|`time.Duration` +|300 * time.Second|Output (log) interval for monitoring. +|=== \ No newline at end of file diff --git a/pkg/options/objectStore.adoc b/pkg/options/objectStore.adoc new file mode 100644 index 000000000..c810a3c81 --- /dev/null +++ b/pkg/options/objectStore.adoc @@ -0,0 +1,38 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/objectStore.yaml + += ObjectStore + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *STORAGE_PATH* +|`string` +|"var/store"|Location where uploaded files are stored. +3+| *MINIO_ENDPOINT* +|`string` +|| +3+| *MINIO_SECURE* +|`bool` +|true| +3+| *MINIO_ACCESS_KEY* +|`string` +|| +3+| *MINIO_SECRET_KEY* +|`string` +|| +3+| *MINIO_SSEC_KEY* +|`string` +|| +3+| *MINIO_BUCKET* +|`string` +|| +3+| *MINIO_STRICT* +|`bool` +|false| +|=== \ No newline at end of file diff --git a/pkg/options/provision.adoc b/pkg/options/provision.adoc new file mode 100644 index 000000000..38f13554e --- /dev/null +++ b/pkg/options/provision.adoc @@ -0,0 +1,17 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/provision.yaml + += Provision + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *PROVISION_ALWAYS* +|`bool` +|true|Controls if provision should run when the server starts. +|=== \ No newline at end of file diff --git a/pkg/options/sentry.adoc b/pkg/options/sentry.adoc new file mode 100644 index 000000000..a18c1dc2f --- /dev/null +++ b/pkg/options/sentry.adoc @@ -0,0 +1,41 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/sentry.yaml + += Sentry + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *SENTRY_DSN* +|`string` +||Set to enable Sentry client. +3+| *SENTRY_DEBUG* +|`bool` +||Print out debugging information. +3+| *SENTRY_ATTACH_STACKTRACE* +|`bool` +|true|Attach stacktraces +3+| *SENTRY_SAMPLE_RATE* +|`float32` +||Sample rate for event submission (0.0 - 1.0. defaults to 1.0) +3+| *SENTRY_MAX_BREADCRUMBS* +|`int` +|0|Maximum number of bredcrumbs. +3+| *SENTRY_SERVERNAME* +|`string` +||Set reported Server name. +3+| *SENTRY_RELEASE* +|`string` +|version.Version|Set reported Release. +3+| *SENTRY_DIST* +|`string` +||Set reported distribution. +3+| *SENTRY_ENVIRONMENT* +|`string` +||Set reported environment. +|=== \ No newline at end of file diff --git a/pkg/options/upgrade.adoc b/pkg/options/upgrade.adoc new file mode 100644 index 000000000..a4559aa69 --- /dev/null +++ b/pkg/options/upgrade.adoc @@ -0,0 +1,23 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/upgrade.yaml + += Upgrade + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *UPGRADE_DEBUG* +|`bool` +|false|Enable/disable debug logging. +To enable debug logging set `UPGRADE_DEBUG=true`. + +3+| *UPGRADE_ALWAYS* +|`bool` +|true|Controls if the upgradable systems should +be upgraded when the server starts. +|=== \ No newline at end of file diff --git a/pkg/options/waitFor.adoc b/pkg/options/waitFor.adoc new file mode 100644 index 000000000..954583813 --- /dev/null +++ b/pkg/options/waitFor.adoc @@ -0,0 +1,38 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/waitFor.yaml + += WaitFor + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *WAIT_FOR* +|`time.Duration` +|0|Delays API startup for the amount of time specified (10s, 2m...). +This delay happens before service (`WAIT_FOR_SERVICES`) probing. + +3+| *WAIT_FOR_STATUS_PAGE* +|`bool` +|true|Show temporary status web page. +3+| *WAIT_FOR_SERVICES* +|`string` +||Space delimited list of hosts and/or URLs to probe. Host format: `host` or +`host:443` (port will default to 80). + +Services are probed in parallel. + +3+| *WAIT_FOR_SERVICES_TIMEOUT* +|`time.Duration` +|time.Minute|Max time for each service probe. +3+| *WAIT_FOR_SERVICES_PROBE_TIMEOUT* +|`time.Duration` +|time.Second * 30|Timeout for each service probe. +3+| *WAIT_FOR_SERVICES_PROBE_INTERVAL* +|`time.Duration` +|time.Second * 5|Interval between service probes. +|=== \ No newline at end of file diff --git a/pkg/options/websocket.adoc b/pkg/options/websocket.adoc new file mode 100644 index 000000000..77ec061c7 --- /dev/null +++ b/pkg/options/websocket.adoc @@ -0,0 +1,23 @@ +// This file is auto-generated. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// Definitions file that controls how this file is generated: +// pkg/options/websocket.yaml + += Websocket + +[cols="2,3,5a"] +|=== +|Type|Default value|Description +3+| *WEBSOCKET_TIMEOUT* +|`time.Duration` +|15 * time.Second|Time before `WsServer` gets timed out. +3+| *WEBSOCKET_PING_TIMEOUT* +|`time.Duration` +|120 * time.Second| +3+| *WEBSOCKET_PING_PERIOD* +|`time.Duration` +|((120 * time.Second) * 9) / 10| +|=== \ No newline at end of file