Documentation ¶
Index ¶
- Constants
- Variables
- func AdminServerAddr() string
- func CouchURL() *url.URL
- func FindConfigFile(name string) (string, error)
- func FsURL() *url.URL
- func GetOIDC(contextName string) (map[string]interface{}, bool)
- func GetSwiftConnection() *swift.Connection
- func InitDefaultSwiftConnection() error
- func InitSwiftConnection(fs Fs) error
- func MakeVault(c *Config) error
- func Normalize(input map[string]interface{}) map[string]interface{}
- func PasswordResetInterval() time.Duration
- func ServerAddr() string
- func Setup(cfgFile string) (err error)
- func SplitCozyHost(host string) (instanceHost, appSlug, siblings string)
- func UseTestFile()
- func UseViper(v *viper.Viper) error
- type Config
- type CouchDB
- type Fs
- type FsVersioning
- type Jobs
- type Konnectors
- type Matomo
- type Move
- type Notifications
- type Office
- type RedisConfig
- type SMS
- type SubdomainType
- type Vault
- type Worker
Constants ¶
const ( // SchemeFile is the URL scheme used to configure a file filesystem. SchemeFile = "file" // SchemeMem is the URL scheme used to configure an in-memory filesystem. SchemeMem = "mem" // SchemeSwift is the URL scheme used to configure a swift filesystem. SchemeSwift = "swift" // SchemeSwiftSecure is the URL scheme used to configure the swift filesystem // in secure mode (HTTPS). SchemeSwiftSecure = "swift+https" )
const DefaultInstanceContext = "default"
DefaultInstanceContext is the default context name for an instance
const Filename = "cozy"
Filename is the default configuration filename that cozy search for
Variables ¶
var Paths = []string{
".",
".cozy",
"$HOME/.cozy",
"/etc/cozy",
}
Paths is the list of directories used to search for a configuration file
Functions ¶
func AdminServerAddr ¶
func AdminServerAddr() string
AdminServerAddr returns the address on which the administration is listening
func FindConfigFile ¶
FindConfigFile search in the Paths directories for the file with the given name. It returns an error if it cannot find it or if an error occurs while searching.
func GetOIDC ¶
GetOIDC returns the OIDC config for the given context (with a boolean to say if OIDC is enabled).
func GetSwiftConnection ¶
func GetSwiftConnection() *swift.Connection
GetSwiftConnection returns a swift.Connection pointer created from the actual configuration.
func InitDefaultSwiftConnection ¶
func InitDefaultSwiftConnection() error
InitDefaultSwiftConnection initializes the default swift handler.
func InitSwiftConnection ¶
InitSwiftConnection initialize the global swift handler connection. This is not a thread-safe method.
func Normalize ¶
Normalize can be used on a config loaded from a Yaml file so that it can encoded as JSON. Go doesn't want to encode map[interface{}]interface{} to JSON, so we need to do some tricks to have a type that is accepted by Go.
func PasswordResetInterval ¶
PasswordResetInterval returns the minimal delay between two password reset
func SplitCozyHost ¶
SplitCozyHost returns a splitted host domain taking into account the subdomains configuration mode used.
func UseTestFile ¶
func UseTestFile()
UseTestFile can be used in a test file to inject a configuration from a cozy.test.* file. If it can not find this file in your $HOME/.cozy directory it will use the default one.
Types ¶
type Config ¶
type Config struct { Host string Port int AdminHost string AdminPort int AdminSecretFileName string Assets string Doctypes string Subdomains SubdomainType AlertAddr string NoReplyAddr string NoReplyName string ReplyTo string Hooks string GeoDB string PasswordResetInterval time.Duration CredentialsEncryptorKey string CredentialsDecryptorKey string RemoteAssets map[string]string Fs Fs CouchDB CouchDB Jobs Jobs Konnectors Konnectors Mail *gomail.DialerOptions MailPerContext map[string]interface{} Matomo Matomo Move Move Notifications Notifications Logger logger.Options Lock RedisConfig SessionStorage RedisConfig DownloadStorage RedisConfig OauthStateStorage RedisConfig RateLimitingStorage RedisConfig Realtime RedisConfig CacheStorage cache.Cache Contexts map[string]interface{} Authentication map[string]interface{} Office map[string]Office Registries map[string][]*url.URL Clouderies map[string]interface{} RemoteAllowCustomPort bool CSPDisabled bool CSPAllowList map[string]string CSPPerContext map[string]map[string]string AssetsPollingDisabled bool AssetsPollingInterval time.Duration }
Config contains the configuration values of the application
type Fs ¶
type Fs struct { Auth *url.Userinfo URL *url.URL Transport http.RoundTripper DefaultLayout int CanQueryInfo bool AutoCleanTrashedAfter map[string]string Versioning FsVersioning }
Fs contains the configuration values of the file-system
type FsVersioning ¶
FsVersioning contains the configuration for the versioning of files
type Jobs ¶
type Jobs struct { RedisConfig NoWorkers bool AllowList bool Workers []Worker ImageMagickConvertCmd string // XXX for retro-compatibility NbWorkers int DefaultDurationToKeep string }
Jobs contains the configuration values for the jobs and triggers synchronization
type Konnectors ¶
type Konnectors struct {
Cmd string
}
Konnectors contains the configuration values for the konnectors
type Notifications ¶
type Notifications struct { Development bool AndroidAPIKey string FCMServer string IOSCertificateKeyPath string IOSCertificatePassword string IOSKeyID string IOSTeamID string Contexts map[string]SMS }
Notifications contains the configuration for the mobile push-notification center, for Android and iOS
type RedisConfig ¶
type RedisConfig struct {
// contains filtered or unexported fields
}
RedisConfig contains the configuration values for a redis system
func GetRedisConfig ¶
func GetRedisConfig(v *viper.Viper, mainOpt *redis.UniversalOptions, key, ptr string) (conf RedisConfig, err error)
GetRedisConfig returns a
func NewRedisConfig ¶
func NewRedisConfig(u string) (conf RedisConfig, err error)
NewRedisConfig creates a redis configuration and its associated client.
func (*RedisConfig) Client ¶
func (rc *RedisConfig) Client() redis.UniversalClient
Client returns the redis.Client for a RedisConfig
type SubdomainType ¶
type SubdomainType int
SubdomainType specify how subdomains are structured.
const ( // FlatSubdomains is the value for apps subdomains like // https://<user>-<app>.<domain>/ FlatSubdomains SubdomainType = iota + 1 // NestedSubdomains is the value for apps subdomains like // https://<app>.<user>.<domain>/ (used by default) NestedSubdomains )
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault contains security keys used for various encryption or signing of critical assets.
func (*Vault) CredentialsDecryptorKey ¶
CredentialsDecryptorKey returns the key used to decrypt credentials values, stored in accounts.
func (*Vault) CredentialsEncryptorKey ¶
CredentialsEncryptorKey returns the key used to encrypt credentials values, stored in accounts.