config

package
v0.0.0-...-6aa0337 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ENV = struct {
	Debug bool `env:"OPV_DEBUG" envDefault:"false"`

	Host              string        `env:"OPV_HOST" envDefault:"0.0.0.0"`
	Port              int           `env:"OPV_PORT" envDefault:"28001"`
	ReadTimeout       time.Duration `env:"OPV_READ_TIMEOUT" envDefault:"10000ms"`
	WriteTimeout      time.Duration `env:"OPV_WRITE_TIMEOUT" envDefault:"10000ms"`
	ReadHeaderTimeout time.Duration `env:"OPV_READ_HEADER_TIMEOUT" envDefault:"10000ms"`
	IdleTimeout       time.Duration `env:"OPV_IDLE_TIMEOUT" envDefault:"10000ms"`

	JwtURL  string `env:"OPV_JWT_URL" envDefault:"https://example.com/jwk.json"`
	JwtAuth bool   `env:"OPV_JWT_AUTH" envDefault:"false"`

	DBDriver             string        `env:"OPV_DB_DRIVER" envDefault:"sqlite3"`
	DBSetupRetryAttempts uint          `env:"OPV_DB_SETUP_RETRY_ATTEMPTS" envDefault:"9"`
	DBSetupRetryDelay    time.Duration `env:"OPV_DB_SETUP_RETRY_DELAY" envDefault:"100ms"`
	DBConnectionStr      string        `env:"OPV_DB_CONNECTION_STR" envDefault:"./_opv.sqlite?cache=shared&_fk=1"`

	PrometheusEnabled bool `env:"OPV_PROMETHEUS_ENABLED" envDefault:"true"`

	GracefullyShutdownTimeout time.Duration `env:"OPV_GRACEFULLY_SHUTDOWN_TIMEOUT" envDefault:"3s"`

	EncryptorName          string   `env:"OPV_ENCRYPTOR_NAME" envDefault:"secretbox"`
	EncryptorSecretboxKeys []string `env:"OPV_ENCRYPTOR_SECRETBOX_KEYS" envDefault:"please_change_to_random_32bytes,old_key_rotation_32bytes" envSeparator:","`

	// HasherName represents the hashing algorithm to be used
	// Supported algorithms: scrypt, keccak256
	HasherName    string `env:"OPV_HASHER_NAME" envDefault:"keccak256"`
	HasherScryptN int    `env:"OPV_HASHER_SCRYPT_N" envDefault:"32768"`

	ControlPlanePort                   int      `env:"OPV_CONTROL_PLANE_PORT" envDefault:"27999"`
	ControlPlaneCORSEnabled            bool     `env:"OPV_CONTROL_PLANE_CORS_ENABLED" envDefault:"true"`
	ControlPlaneSwaggerHostOverride    string   `env:"OPV_CONTROL_PLANE_SWAGGER_HOST_OVERRIDE" envDefault:""`
	ControlPlaneSwaggerSchemesOverride []string `env:"OPV_CONTROL_PLANE_SWAGGER_SCHEMES_OVERRIDE" envDefault:"http,https" envSeparator:","`

	DataPlanePort                   int      `env:"OPV_DATA_PLANE_PORT" envDefault:"28000"`
	DataPlaneCORSEnabled            bool     `env:"OPV_DATA_PLANE_CORS_ENABLED" envDefault:"true"`
	DataPlaneSwaggerHostOverride    string   `env:"OPV_DATA_PLANE_SWAGGER_HOST_OVERRIDE" envDefault:""`
	DataPlaneSwaggerSchemesOverride []string `env:"OPV_DATA_PLANE_SWAGGER_SCHEMES_OVERRIDE" envDefault:"http,https" envSeparator:","`

	AuthzCasbinAutoloadInterval time.Duration `env:"OPV_AUTHZ_CASBIN_AUTOLOAD_INTERVAL" envDefault:"3s"`

	ProxyPlaneHTTPPort            int    `env:"OPV_PROXY_PLANE_HTTP_PORT" envDefault:"28001"`
	ProxyPlaneRulesConfig         string `env:"OPV_PROXY_PLANE_RULES_CONFIG" envDefault:"./cmd/proxyplane/opv-proxyplane-rules.example.json"`
	ProxyPlaneDefaultDPBaseURL    string `env:"OPV_PROXY_PLANE_DEFAULT_DP_BASE_URL" envDefault:"http://127.0.0.1:28000"`
	ProxyPlaneDefaultDPGrantToken string `env:"OPV_PROXY_PLANE_DEFAULT_DP_GRANT_TOKEN" envDefault:""`
	SentryDSN                     string `env:"OPV_SENTRY_DSN" envDefault:"Please add DSN"`
}{}

ENV is the whole configuration of the app

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL