diff options
author | Steve <nilslice@gmail.com> | 2017-01-24 10:35:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 10:35:18 -0800 |
commit | 3a897e4db97cc6f5e47f395662499402eb4c2bda (patch) | |
tree | 61350d459fb5cbf044e878042c0239acb060c7da /system/admin/config/config.go | |
parent | 0cf0d36f7613bbb2e13c0c8406689de3be9ee8d5 (diff) |
[core] System backups (uploads, system.db, analytics.db) (#42)
Diffstat (limited to 'system/admin/config/config.go')
-rw-r--r-- | system/admin/config/config.go | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/system/admin/config/config.go b/system/admin/config/config.go index 0d55700..3a21e16 100644 --- a/system/admin/config/config.go +++ b/system/admin/config/config.go @@ -9,18 +9,27 @@ import ( type Config struct { item.Item - Name string `json:"name"` - Domain string `json:"domain"` - HTTPPort string `json:"http_port"` - HTTPSPort string `json:"https_port"` - AdminEmail string `json:"admin_email"` - ClientSecret string `json:"client_secret"` - Etag string `json:"etag"` - DisableCORS bool `json:"cors_disabled"` - DisableGZIP bool `json:"gzip_disabled"` - CacheInvalidate []string `json:"cache"` + Name string `json:"name"` + Domain string `json:"domain"` + HTTPPort string `json:"http_port"` + HTTPSPort string `json:"https_port"` + AdminEmail string `json:"admin_email"` + ClientSecret string `json:"client_secret"` + Etag string `json:"etag"` + DisableCORS bool `json:"cors_disabled"` + DisableGZIP bool `json:"gzip_disabled"` + CacheInvalidate []string `json:"cache"` + BackupBasicAuthUser string `json:"backup_basic_auth_user"` + BackupBasicAuthPassword string `json:"backup_basic_auth_password"` } +const ( + dbBackupInfo = ` + <p class="flow-text">Database Backup Credentials:</p> + <p>Add a user name and password to download a backup of your data via HTTP.</p> + ` +) + // String partially implements item.Identifiable and overrides Item's String() func (c *Config) String() string { return c.Name } @@ -97,6 +106,23 @@ func (c *Config) MarshalEditor() ([]byte, error) { "invalidate": "Invalidate Cache", }), }, + editor.Field{ + View: []byte(dbBackupInfo), + }, + editor.Field{ + View: editor.Input("BackupBasicAuthUser", c, map[string]string{ + "label": "HTTP Basic Auth User", + "placeholder": "Enter a user name for Basic Auth access", + "type": "text", + }), + }, + editor.Field{ + View: editor.Input("BackupBasicAuthPassword", c, map[string]string{ + "label": "HTTP Basic Auth Password", + "placeholder": "Enter a password for Basic Auth access", + "type": "password", + }), + }, ) if err != nil { return nil, err |