Documentation ¶
Overview ¶
Package configs provides tools for managing configurations
Index ¶
- Variables
- func ApplicationDataDir() string
- func ConfigureCaddyfile(t string, v interface{}) error
- func Del(path ...string)
- func Get(path ...string) reader.Value
- func GetDatabase(name string) (string, string)
- func GetDefaultDatabase() (string, string)
- func GetJsonPath() string
- func InitCaddyFile(tpl string, tplData interface{}) error
- func Save(ctxUser string, ctxMessage string) error
- func ServiceDataDir(serviceName string) (string, error)
- func Set(val interface{}, path ...string)
- func UpgradeConfigsIfRequired(config *Config) (bool, error)
- type CaddyTemplateConf
- type Config
- type Map
- func (c Map) Bool(key string, def ...bool) bool
- func (c Map) Database(k string) (string, string)
- func (c Map) Del(key string) error
- func (c Map) Get(key string) interface{}
- func (c Map) Int(key string, def ...int) int
- func (c Map) Int64(key string, defaultValue ...int64) int64
- func (c Map) Map(key string) map[string]interface{}
- func (c Map) Set(key string, value interface{}) error
- func (c Map) String(key string) string
- func (c Map) StringArray(key string) []string
- func (c Map) StringMap(key string) map[string]string
- type Value
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var ( CaddyTemplate = `` /* 2102-byte string literal not displayed */ DefaultCaddyfile = filepath.Join(ApplicationDataDir(), "Caddyfile") DefaultCaUrl = "https://acme-v01.api.letsencrypt.org/directory" )
var ( PydioConfigDir = ApplicationDataDir() PydioConfigFile = "pydio.json" VersionsStore file2.VersionsStore )
var SampleConfig = `{ "ports":{ "nats": 4222 }, "frontend":{ "secureHeaders":{ "X-XSS-Protection": "1; mode=block" }, "plugin": { "editor.libreoffice": { "LIBREOFFICE_HOST": "localhost", "LIBREOFFICE_PORT": "9980", "LIBREOFFICE_SSL": true } } }, "services":{ "consul": { "data_dir": "/tmp/consul", "server": true, "bootstrap": true }, "pydio.grpc.config":{ "dsn": "default" }, "pydio.grpc.user":{ "dsn": "default", "tables":{ "tree": "idm_user_tree", "nodes":"idm_user_nodes", "roles":"idm_user_roles", "attributes":"idm_user_attributes" } }, "pydio.grpc.mailer": { "queue": { "@value": "boltdb" }, "sender": { "@value": "smtp", "host": "my.smtp.server", "password": "user", "port": 465, "user": "name" } }, "pydio.grpc.role":{ "dsn": "default" }, "pydio.grpc.workspace":{ "dsn": "default" }, "pydio.grpc.acl":{ "dsn": "default" }, "pydio.grpc.auth":{ "dsn": "default", "dex" : { "issuer": "http://127.0.0.1:5556/dex", "web" : { "http": "0.0.0.0:5556" }, "frontend" : { "Dir" : "idm/auth/web" }, "logger" : { "level" : "debug", "format": "text" }, "expiry": { "idTokens": "10m" }, "oauth2" : { "responseTypes": ["code", "token", "id_token"] }, "staticClients" : [ { "id": "example-app", "redirectURIs" : ["http://127.0.0.1:5555/callback"], "name" : "Example App", "secret" : "ZXhhbXBsZS1hcHAtc2VjcmV0" } ], "connectors": [ { "type": "pydio", "id" : "pydio", "name": "Pydio Aggregation Connector", "config": { "pydioconnectors": [ { "type": "pydio-api", "name": "pydioapi", "id" : 1 } ] } } ] } }, "pydio.grpc.tree":{ "dsn":"default" }, "pydio.grpc.meta":{ "dsn":"default" }, "pydio.thumbs_store":{ "datasource" : "default", "bucket" : "thumbs" }, "pydio.docstore-binaries":{ "datasource" : "default", "bucket" : "binaries" }, "pydio.versions-store":{ "datasource" : "default", "bucket" : "versions" }, "pydio.grpc.search": { "indexContent": false }, "pydio.grpc.policy": { "dsn": "databaseParseTime" }, "pydio.grpc.data-key": { "dsn": "default" }, "pydio.grpc.user-key": { "dsn": "default" }, "pydio.grpc.changes": { "dsn": "default" }, "pydio.grpc.update" : { "channel": "` + common.UpdateDefaultChannel + `", "publicKey": "` + common.UpdateDefaultPublicKey + `", "updateUrl": "` + common.UpdateDefaultServerUrl + `" }, "pydio.grpc.user-meta": { "dsn": "default" }, "pydio.grpc.tasks": { "fork": true } } }`
Functions ¶
func ApplicationDataDir ¶
func ApplicationDataDir() string
ApplicationDataDir creates a local file to store pydio system data
func ConfigureCaddyfile ¶
func GetDatabase ¶
GetDatabase retrieves the database data from the config
func GetDefaultDatabase ¶
GetDefaultDatabase returns the information for the default database
func GetJsonPath ¶ added in v1.0.1
func GetJsonPath() string
GetJsonPath build path for json that contain the local config
func InitCaddyFile ¶
InitCaddyFile creates a caddy LoaderFunc with the correct contents
func ServiceDataDir ¶
ServiceDataDir returns the applicationdir/services/serviceName and creates it if it does not exists
func UpgradeConfigsIfRequired ¶ added in v1.2.1
UpgradeConfigsIfRequired applies all registered configMigration functions Returns true if there was a change and save is required, error if something nasty happened
Types ¶
type CaddyTemplateConf ¶
type CaddyTemplateConf struct { // Main site URL Bind *url.URL // Micro REST API dispatcher Micro *url.URL // Open ID Connect Service Dex *url.URL // S3 Gateway Gateway *url.URL // WebSocket server WebSocket *url.URL // Plugins loader for frontend FrontPlugins *url.URL // WebDAV server DAV *url.URL // WOPI server WOPI *url.URL // Collabora definition from plugins Collabora *url.URL // Dedicated log file for caddy errors to ease debugging Logs string // Caddy compliant TLS string, either "self_signed" or paths to "cert key" TLS string // If TLS is enabled, also enable auto-redirect from http to https HttpRedirectSource *url.URL HttpRedirectTarget *url.URL }
CaddyTemplateConf feeds Caddy template file with data
func LoadCaddyConf ¶
func LoadCaddyConf() (*CaddyTemplateConf, error)
LoadCaddyConf reads the pydio config and fill a CaddyTemplateConf object ready to be executed by template
type Map ¶
type Map map[string]interface{}
Map structure to store configuration
func (Map) Get ¶
Get retrieves the first value associated with the given key. If there are no values associated with the key, Get returns the empty string. To access multiple values, use the map directly.
func (Map) Int ¶
Int retrieves the value at the given key if it exists and performs best effort to cast it as an int. If no such key exists or if it cannot be cast as an int, it returns the default value if defined and 0 otherwise.
func (Map) Int64 ¶
Int64 retrieves the value at the given key if it exists and performs best effort to cast it as an int64. If no such key exists or if it cannot be cast as an int64, it returns the default value if defined and 0 otherwise.
func (Map) StringArray ¶
type Value ¶
type Value interface { Bool(def bool) bool Int(def int) int Int64(def int64) int64 String(def string) string Float64(def float64) float64 Duration(def time.Duration) time.Duration StringSlice(def []string) []string StringMap(def map[string]string) map[string]string Scan(val interface{}) error Bytes() []byte }
Value Represent a value retrieved from the values loaded
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package envvar implements Pydio specific interface for dynamic configurations that are backed by OS environment variables.
|
Package envvar implements Pydio specific interface for dynamic configurations that are backed by OS environment variables. |
Package source implements a configuration client backed by a config server
|
Package source implements a configuration client backed by a config server |