Documentation
¶
Index ¶
- Variables
- func ExportVars(conf *Config)
- func WriteConfigFile(filename string) error
- type AuthNBasicConfig
- type AuthNConfig
- type AuthNOIDCConfig
- type AuthNProxyConfig
- type AvatarConfig
- type Config
- type DatabaseConfig
- type EventConfig
- type Flags
- type HTTPConfig
- type HashConfig
- type ImageConfig
- type IntegrationConfig
- type LogConfig
- type MetricsConfig
- type PDFConfig
- type PocketConfiguration
- type RateLimiting
- type RateLimitingConfig
- type SMTPConfig
- type ScrapingConfig
- type SecretsConfig
- type SentryConfiguration
- type UIConfig
- type UserPlan
Constants ¶
This section is empty.
Variables ¶
var ConfigFile embed.FS
Content assets
var InitConfigFile = flag.String("init-config", "", "Initialize configuration file")
InitConfigFile initialize the config file
Functions ¶
func ExportVars ¶
func ExportVars(conf *Config)
ExportVars export some configuration variables to expvar
func WriteConfigFile ¶
WriteConfigFile write configuration file
Types ¶
type AuthNBasicConfig ¶ added in v1.0.0
type AuthNBasicConfig struct {
HtpasswdFile string `toml:"htpasswd_file"`
}
AuthBasicConfig for basci authentication configuration section
type AuthNConfig ¶ added in v1.0.0
type AuthNConfig struct {
Method string `toml:"method"`
Admins string `toml:"admins"`
Basic AuthNBasicConfig
OIDC AuthNOIDCConfig
Proxy AuthNProxyConfig
}
AuthNConfig for authentication configuration section
type AuthNOIDCConfig ¶ added in v1.0.0
type AuthNOIDCConfig struct {
Issuer string `toml:"issuer"`
}
AuthNOIDCConfig for OpenID Connect authentication configuration section
type AuthNProxyConfig ¶ added in v1.0.0
type AuthNProxyConfig struct {
Headers string `toml:"headers"`
}
AuthNProxyConfig for proxy authentication configuration section
type AvatarConfig ¶ added in v1.0.0
type AvatarConfig struct {
ServiceProvider string `toml:"service_provider"`
}
AvatarConfig for avatar configuration section
type Config ¶
type Config struct {
Log LogConfig `toml:"log"`
Database DatabaseConfig `toml:"database"`
HTTP HTTPConfig `toml:"http"`
Metrics MetricsConfig `toml:"metrics"`
SMTP SMTPConfig `toml:"smtp"`
AuthN AuthNConfig `toml:"authn"`
UI UIConfig `toml:"ui"`
Hash HashConfig `toml:"hash"`
Scraping ScrapingConfig `toml:"scraping"`
Avatar AvatarConfig `toml:"avatar"`
Image ImageConfig `toml:"image"`
PDF PDFConfig `toml:"pdf"`
Secrets SecretsConfig `toml:"secrets"`
Event EventConfig `toml:"event"`
Integration IntegrationConfig `toml:"integration"`
RateLimiting RateLimitingConfig `toml:"rate_limiting"`
UserPlans []UserPlan `toml:"user_plans"`
}
Config is the root of the configuration
func (Config) GetUserPlan ¶
GetUserPlan return an user plan by its name and fallback to first plan if missing
type DatabaseConfig ¶ added in v1.0.0
type DatabaseConfig struct {
URI string `toml:"uri"`
}
DatabaseConfig for database configuration section
type EventConfig ¶ added in v1.0.0
type EventConfig struct {
BrokerURI string `toml:"broker_uri"`
}
EventConfig for event configuration section
type Flags ¶
type Flags struct {
Config string `flag:"config" desc:"Configuration file to load" default:""`
}
Flags of the command line
type HTTPConfig ¶ added in v1.0.0
type HTTPConfig struct {
ListenAddr string `toml:"listen_addr"`
PublicURL string `toml:"public_url"`
}
HTTPConfig for HTTP configuration section
type HashConfig ¶ added in v1.0.0
type HashConfig struct {
SecretSalt string `toml:"secret_salt"`
}
HashConfig for hash configuration section
type ImageConfig ¶ added in v1.0.0
type ImageConfig struct {
ProxyURL string `toml:"proxy_url"`
}
ImageConfig for image configuration section
type IntegrationConfig ¶
type IntegrationConfig struct {
Sentry SentryConfiguration
Pocket PocketConfiguration
}
IntegrationConfig for integration configuration section
type MetricsConfig ¶ added in v1.0.0
type MetricsConfig struct {
ListenAddr string `toml:"listen_addr"`
}
MetricsConfig for metrics configuration section
type PDFConfig ¶ added in v1.0.0
type PDFConfig struct {
ServiceProvider string `toml:"service_provider"`
}
PDFConfig for PDF configuration section
type PocketConfiguration ¶
type PocketConfiguration struct {
ConsumerKey string `toml:"consumer_key"`
}
PocketConfiguration for Pocket's integration configuration
type RateLimiting ¶
type RateLimiting struct {
// Provider of the rate limiting store
Provider string `toml:"provider"`
//Tokens allowed per interval
Tokens int `toml:"tokens"`
// Interval until tokens reset
Interval duration `toml:"interval"`
}
RateLimiterConfig for rate-limiter configuration section
type RateLimitingConfig ¶
type RateLimitingConfig struct {
Notification RateLimiting
Webhook RateLimiting
}
RateLimitingConfig for rate-limiting configuration section
type SMTPConfig ¶ added in v1.0.0
SMTPConfig for SMTP configuration section
type ScrapingConfig ¶ added in v1.0.0
type ScrapingConfig struct {
ServiceProvider string `toml:"service_provider"`
BlockList string `toml:"block_list"`
}
ScrapingConfig for scraping configuration section
type SecretsConfig ¶ added in v1.0.0
type SecretsConfig struct {
ServiceProvider string `toml:"service_provider"`
}
SecretsConfig for secrets configuration section
type SentryConfiguration ¶
type SentryConfiguration struct {
DSN string `toml:"dsn_url"`
}
SentryConfiguration for Sentry's integration configuration
type UserPlan ¶
type UserPlan struct {
Name string `toml:"name" json:"name"`
ArticlesLimit uint `toml:"articles_limit" json:"articles_limit"`
CategoriesLimit uint `toml:"categories_limit" json:"categories_limit"`
IncomingWebhooksLimit uint `toml:"incoming_webhooks_limit" json:"incoming_webhooks_limit"`
OutgoingWebhooksLimit uint `toml:"outgoing_webhooks_limit" json:"outgoing_webhooks_limit"`
OutgoingWebhooksTimeout duration `toml:"outgoing_webhooks_timeout" json:"outgoing_webhooks_timeout"`
}
UserPlanConfig for user-plan configuration sections