@@ -140,10 +153,12 @@
const Cache = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Cache')
const Importer = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Importer')
const Variables = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Variables')
+ const Configs = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Configs')
export default {
name: 'Settings',
components: {
+ Configs,
Importer,
Variables,
OAuth,
diff --git a/go.mod b/go.mod
index a3ba74b1..4316ede4 100644
--- a/go.mod
+++ b/go.mod
@@ -6,6 +6,7 @@ go 1.14
require (
github.com/GeertJohan/go.rice v1.0.0
github.com/aws/aws-sdk-go v1.30.20
+ github.com/coreos/go-oidc v2.2.1+incompatible
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fatih/structs v1.1.0
github.com/foomo/simplecert v1.7.5
@@ -17,12 +18,13 @@ require (
github.com/jinzhu/gorm v1.9.12
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/pkg/errors v0.9.1
+ github.com/pquerna/cachecontrol v0.0.0-20200819021114-67c6ae64274f // indirect
github.com/prometheus/client_golang v1.1.0
github.com/sirupsen/logrus v1.5.0
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.6.3
github.com/statping/emails v1.0.0
- github.com/stretchr/testify v1.5.1
+ github.com/stretchr/testify v1.6.1
github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1
github.com/tensorflow/tensorflow v2.3.0+incompatible // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
diff --git a/go.sum b/go.sum
index 18cc1f5f..c49f49fe 100755
--- a/go.sum
+++ b/go.sum
@@ -131,6 +131,8 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
+github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=
+github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -552,6 +554,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pquerna/cachecontrol v0.0.0-20200819021114-67c6ae64274f h1:JDEmUDtyiLMyMlFwiaDOv2hxUp35497fkwePcLeV7j4=
+github.com/pquerna/cachecontrol v0.0.0-20200819021114-67c6ae64274f/go.mod h1:hoLfEwdY11HjRfKFH6KqnPsfxlo3BP6bJehpDv8t6sQ=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8=
@@ -652,6 +656,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1 h1:HGVkRrwDCbmSP6h1CoBDj6l/mhnvsP5JbYaQ4ss0R6o=
@@ -1047,6 +1052,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/mysql v1.0.1 h1:omJoilUzyrAp0xNoio88lGJCroGdIOen9hq2A/+3ifw=
gorm.io/driver/mysql v1.0.1/go.mod h1:KtqSthtg55lFp3S5kUXqlGaelnWpKitn4k1xZTnoiPw=
gorm.io/driver/postgres v1.0.0 h1:Yh4jyFQ0a7F+JPU0Gtiam/eKmpT/XFc1FKxotGqc6FM=
diff --git a/handlers/dashboard.go b/handlers/dashboard.go
index ca7ddceb..4d50323d 100644
--- a/handlers/dashboard.go
+++ b/handlers/dashboard.go
@@ -10,11 +10,13 @@ import (
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/errors"
"github.com/statping/statping/types/groups"
+ "github.com/statping/statping/types/incidents"
"github.com/statping/statping/types/messages"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/services"
"github.com/statping/statping/types/users"
"github.com/statping/statping/utils"
+ "gopkg.in/yaml.v2"
"io"
"io/ioutil"
"net/http"
@@ -162,14 +164,16 @@ func apiThemeRemoveHandler(w http.ResponseWriter, r *http.Request) {
}
type ExportData struct {
- Config *configs.DbConfig `json:"config,omitempty"`
- Core *core.Core `json:"core"`
- Services []services.Service `json:"services"`
- Messages []*messages.Message `json:"messages"`
- Checkins []*checkins.Checkin `json:"checkins"`
- Users []*users.User `json:"users"`
- Groups []*groups.Group `json:"groups"`
- Notifiers []notifications.Notification `json:"notifiers"`
+ Config *configs.DbConfig `json:"config,omitempty"`
+ Core *core.Core `json:"core"`
+ Services []services.Service `json:"services"`
+ Messages []*messages.Message `json:"messages"`
+ Incidents []*incidents.Incident `json:"incidents"`
+ IncidentUpdates []*incidents.IncidentUpdate `json:"incident_updates"`
+ Checkins []*checkins.Checkin `json:"checkins"`
+ Users []*users.User `json:"users"`
+ Groups []*groups.Group `json:"groups"`
+ Notifiers []notifications.Notification `json:"notifiers"`
}
func (e *ExportData) JSON() []byte {
@@ -261,6 +265,44 @@ func settingsImportHandler(w http.ResponseWriter, r *http.Request) {
sendJsonAction(exportData, "import", w, r)
}
+func configsSaveHandler(w http.ResponseWriter, r *http.Request) {
+ data, err := ioutil.ReadAll(r.Body)
+ if err != nil {
+ sendErrorJson(err, w, r)
+ return
+ }
+ defer r.Body.Close()
+
+ var cfg *configs.DbConfig
+ if err := yaml.Unmarshal(data, &cfg); err != nil {
+ sendErrorJson(err, w, r)
+ return
+ }
+
+ oldCfg, err := configs.LoadConfigs(utils.Directory + "/configs.yml")
+ if err != nil {
+ sendErrorJson(err, w, r)
+ return
+ }
+
+ newCfg := cfg.Merge(oldCfg)
+ if err := newCfg.Save(utils.Directory); err != nil {
+ sendErrorJson(err, w, r)
+ return
+ }
+
+ sendJsonAction(newCfg.Clean(), "updated", w, r)
+}
+
+func configsViewHandler(w http.ResponseWriter, r *http.Request) {
+ db, err := configs.LoadConfigs(utils.Directory + "/configs.yml")
+ if err != nil {
+ sendErrorJson(err, w, r)
+ return
+ }
+ w.Write(db.Clean().ToYAML())
+}
+
func settingsExportHandler(w http.ResponseWriter, r *http.Request) {
exported, err := ExportSettings()
if err != nil {
diff --git a/handlers/oauth_custom.go b/handlers/oauth_custom.go
index fb595617..09e0e03f 100644
--- a/handlers/oauth_custom.go
+++ b/handlers/oauth_custom.go
@@ -11,9 +11,7 @@ import (
func customOAuth(r *http.Request) (*oAuth, error) {
auth := core.App.OAuth
code := r.URL.Query().Get("code")
-
scopes := strings.Split(auth.CustomScopes, ",")
-
config := &oauth2.Config{
ClientID: auth.CustomClientID,
ClientSecret: auth.CustomClientSecret,
diff --git a/handlers/routes.go b/handlers/routes.go
index e8448739..ed233d0e 100644
--- a/handlers/routes.go
+++ b/handlers/routes.go
@@ -103,6 +103,8 @@ func Router() *mux.Router {
api.Handle("/api/logs/last", authenticated(logsLineHandler, false)).Methods("GET")
api.Handle("/api/settings/import", authenticated(settingsImportHandler, false)).Methods("POST")
api.Handle("/api/settings/export", authenticated(settingsExportHandler, false)).Methods("GET")
+ api.Handle("/api/settings/configs", authenticated(configsViewHandler, false)).Methods("GET")
+ api.Handle("/api/settings/configs", authenticated(configsSaveHandler, false)).Methods("POST")
// API OAUTH Routes
api.Handle("/api/oauth", scoped(apiOAuthHandler)).Methods("GET")
diff --git a/handlers/setup.go b/handlers/setup.go
index 17148b06..4c663eb2 100644
--- a/handlers/setup.go
+++ b/handlers/setup.go
@@ -59,7 +59,7 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) {
return
}
- if err := configs.CreateAdminUser(confgs); err != nil {
+ if err := configs.CreateAdminUser(); err != nil {
sendErrorJson(err, w, r)
return
}
diff --git a/notifiers/discord.go b/notifiers/discord.go
index 3443a323..da1e8d18 100644
--- a/notifiers/discord.go
+++ b/notifiers/discord.go
@@ -22,7 +22,7 @@ type discord struct {
var Discorder = &discord{¬ifications.Notification{
Method: "discord",
- Title: "discord",
+ Title: "Discord",
Description: "Send notifications to your discord channel using discord webhooks. Insert your discord channel Webhook URL to receive notifications. Based on the
discord webhooker API.",
Author: "Hunter Long",
AuthorUrl: "https://github.com/hunterlong",
diff --git a/notifiers/slack.go b/notifiers/slack.go
index f476da66..b95973cf 100644
--- a/notifiers/slack.go
+++ b/notifiers/slack.go
@@ -29,7 +29,7 @@ func (s *slack) Select() *notifications.Notification {
var slacker = &slack{¬ifications.Notification{
Method: slackMethod,
- Title: "slack",
+ Title: "Slack",
Description: "Send notifications to your slack channel when a service is offline. Insert your Incoming webhook URL for your channel to receive notifications. Based on the
Slack API.",
Author: "Hunter Long",
AuthorUrl: "https://github.com/hunterlong",
diff --git a/types/configs/connection.go b/types/configs/connection.go
index c2fb2d96..1067b068 100644
--- a/types/configs/connection.go
+++ b/types/configs/connection.go
@@ -20,6 +20,7 @@ import (
"time"
)
+// initModels sets the database for each Statping type packages
func initModels(db database.Database) {
core.SetDB(db)
services.SetDB(db)
@@ -67,6 +68,10 @@ func Connect(configs *DbConfig, retry bool) error {
log.Infoln(fmt.Sprintf("Database %s connection was successful.", configs.DbConn))
}
+ if utils.Params.GetBool("READ_ONLY") {
+ log.Warnln("Running in READ ONLY MODE")
+ }
+
configs.Db = dbSession
initModels(configs.Db)
@@ -74,7 +79,9 @@ func Connect(configs *DbConfig, retry bool) error {
return err
}
-func CreateAdminUser(c *DbConfig) error {
+// CreateAdminUser will create the default admin user "admin", "admin", or use the
+// environment variables ADMIN_USER, ADMIN_PASSWORD, and ADMIN_EMAIL if set.
+func CreateAdminUser() error {
adminUser := utils.Params.GetString("ADMIN_USER")
adminPass := utils.Params.GetString("ADMIN_PASSWORD")
adminEmail := utils.Params.GetString("ADMIN_EMAIL")
diff --git a/types/configs/file.go b/types/configs/file.go
index 9c71e075..87ff21e6 100644
--- a/types/configs/file.go
+++ b/types/configs/file.go
@@ -8,8 +8,9 @@ import (
"strings"
)
-var log = utils.Log
+var log = utils.Log.WithField("type", "configs")
+// ConnectConfigs will connect to the database and save the config.yml file
func ConnectConfigs(configs *DbConfig, retry bool) error {
err := Connect(configs, retry)
if err != nil {
@@ -21,6 +22,8 @@ func ConnectConfigs(configs *DbConfig, retry bool) error {
return nil
}
+// findDbFile will attempt to find the "statping.db" database file in the current
+// working directory, or from STATPING_DIR env.
func findDbFile(configs *DbConfig) (string, error) {
location := utils.Directory + "/" + SqliteFilename
if configs == nil {
@@ -37,6 +40,7 @@ func findDbFile(configs *DbConfig) (string, error) {
return location, nil
}
+// findSQLin walks the current walking directory for statping.db
func findSQLin(path string) (string, error) {
filename := SqliteFilename
var found []string
diff --git a/types/configs/methods.go b/types/configs/methods.go
index bbb08705..b0e549f3 100644
--- a/types/configs/methods.go
+++ b/types/configs/methods.go
@@ -18,6 +18,37 @@ func (d *DbConfig) Save(directory string) error {
return nil
}
+// Merge will merge the database connection info into the input
+func (d *DbConfig) Merge(newCfg *DbConfig) *DbConfig {
+ d.DbConn = newCfg.DbConn
+ d.DbHost = newCfg.DbHost
+ d.DbPort = newCfg.DbPort
+ d.DbData = newCfg.DbData
+ d.DbUser = newCfg.DbUser
+ d.DbPass = newCfg.DbPass
+ return d
+}
+
+// Clean hides all sensitive database information for API requests
+func (d *DbConfig) Clean() *DbConfig {
+ d.DbConn = ""
+ d.DbHost = ""
+ d.DbPort = 0
+ d.DbData = ""
+ d.DbUser = ""
+ d.DbPass = ""
+ return d
+}
+
+func (d *DbConfig) ToYAML() []byte {
+ c, err := yaml.Marshal(d)
+ if err != nil {
+ log.Errorln(err)
+ return nil
+ }
+ return c
+}
+
func (d *DbConfig) ConnectionString() string {
var conn string
postgresSSL := utils.Params.GetString("POSTGRES_SSLMODE")
diff --git a/types/configs/migration.go b/types/configs/migration.go
index 976639b3..1a3704f4 100644
--- a/types/configs/migration.go
+++ b/types/configs/migration.go
@@ -38,7 +38,7 @@ func (d *DbConfig) ResetCore() error {
if err := d.CreateDatabase(); err != nil {
return errors.Wrap(err, "error creating database")
}
- if err := CreateAdminUser(d); err != nil {
+ if err := CreateAdminUser(); err != nil {
return errors.Wrap(err, "error creating default admin user")
}
if utils.Params.GetBool("SAMPLE_DATA") {
diff --git a/types/configs/struct.go b/types/configs/struct.go
index 93ec5ef6..2917b5e7 100644
--- a/types/configs/struct.go
+++ b/types/configs/struct.go
@@ -6,15 +6,15 @@ const SqliteFilename = "statping.db"
// DbConfig struct is used for the Db connection and creates the 'config.yml' file
type DbConfig struct {
- DbConn string `yaml:"connection" json:"connection"`
- DbHost string `yaml:"host" json:"-"`
- DbUser string `yaml:"user" json:"-"`
- DbPass string `yaml:"password" json:"-"`
- DbData string `yaml:"database" json:"-"`
- DbPort int `yaml:"port" json:"-"`
- ApiSecret string `yaml:"api_secret" json:"-"`
- Language string `yaml:"language" json:"language"`
- AllowReports bool `yaml:"allow_reports" json:"allow_reports"`
+ DbConn string `yaml:"connection,omitempty" json:"connection"`
+ DbHost string `yaml:"host,omitempty" json:"-"`
+ DbUser string `yaml:"user,omitempty" json:"-"`
+ DbPass string `yaml:"password,omitempty" json:"-"`
+ DbData string `yaml:"database,omitempty" json:"-"`
+ DbPort int `yaml:"port,omitempty" json:"-"`
+ ApiSecret string `yaml:"api_secret,omitempty" json:"-"`
+ Language string `yaml:"language,omitempty" json:"language"`
+ AllowReports bool `yaml:"allow_reports,omitempty" json:"allow_reports"`
Project string `yaml:"-" json:"-"`
Description string `yaml:"-" json:"-"`
Domain string `yaml:"-" json:"-"`
@@ -22,7 +22,7 @@ type DbConfig struct {
Password string `yaml:"-" json:"-"`
Email string `yaml:"-" json:"-"`
Error error `yaml:"-" json:"-"`
- Location string `yaml:"location" json:"-"`
+ Location string `yaml:"location,omitempty" json:"-"`
SqlFile string `yaml:"sqlfile,omitempty" json:"-"`
LetsEncryptHost string `yaml:"letsencrypt_host,omitempty" json:"letsencrypt_host"`
LetsEncryptEmail string `yaml:"letsencrypt_email,omitempty" json:"letsencrypt_email"`
@@ -33,21 +33,21 @@ type DbConfig struct {
DemoMode bool `yaml:"demo_mode" json:"demo_mode"`
DisableLogs bool `yaml:"disable_logs" json:"disable_logs"`
UseAssets bool `yaml:"use_assets" json:"use_assets"`
- BasePath string `yaml:"base_path" json:"base_path"`
+ BasePath string `yaml:"base_path,omitempty" json:"base_path"`
- AdminUser string `yaml:"admin_user" json:"admin_user"`
- AdminPassword string `yaml:"admin_password" json:"admin_password"`
- AdminEmail string `yaml:"admin_email" json:"admin_email"`
+ AdminUser string `yaml:"admin_user,omitempty" json:"admin_user"`
+ AdminPassword string `yaml:"admin_password,omitempty" json:"admin_password"`
+ AdminEmail string `yaml:"admin_email,omitempty" json:"admin_email"`
- MaxOpenConnections int `yaml:"db_open_connections" json:"db_open_connections"`
- MaxIdleConnections int `yaml:"db_idle_connections" json:"db_idle_connections"`
- MaxLifeConnections int `yaml:"db_max_life_connections" json:"db_max_life_connections"`
+ MaxOpenConnections int `yaml:"db_open_connections,omitempty" json:"db_open_connections"`
+ MaxIdleConnections int `yaml:"db_idle_connections,omitempty" json:"db_idle_connections"`
+ MaxLifeConnections int `yaml:"db_max_life_connections,omitempty" json:"db_max_life_connections"`
SampleData bool `yaml:"sample_data" json:"sample_data"`
UseCDN bool `yaml:"use_cdn" json:"use_cdn"`
DisableColors bool `yaml:"disable_colors" json:"disable_colors"`
- PostgresSSLMode string `yaml:"postgres_ssl" json:"postgres_ssl"`
+ PostgresSSLMode string `yaml:"postgres_ssl,omitempty" json:"postgres_ssl"`
Db database.Database `yaml:"-" json:"-"`
}
diff --git a/types/core/struct.go b/types/core/struct.go
index c54739dc..fdb0cd7c 100644
--- a/types/core/struct.go
+++ b/types/core/struct.go
@@ -45,24 +45,25 @@ type Core struct {
}
type OAuth struct {
- Providers string `gorm:"column:oauth_providers;" json:"oauth_providers"`
- GithubClientID string `gorm:"column:gh_client_id" json:"gh_client_id"`
- GithubClientSecret string `gorm:"column:gh_client_secret" json:"gh_client_secret" scope:"admin"`
- GithubUsers string `gorm:"column:gh_users" json:"gh_users" scope:"admin"`
- GithubOrgs string `gorm:"column:gh_orgs" json:"gh_orgs" scope:"admin"`
- GoogleClientID string `gorm:"column:google_client_id" json:"google_client_id"`
- GoogleClientSecret string `gorm:"column:google_client_secret" json:"google_client_secret" scope:"admin"`
- GoogleUsers string `gorm:"column:google_users" json:"google_users" scope:"admin"`
- SlackClientID string `gorm:"column:slack_client_id" json:"slack_client_id"`
- SlackClientSecret string `gorm:"column:slack_client_secret" json:"slack_client_secret" scope:"admin"`
- SlackTeam string `gorm:"column:slack_team" json:"slack_team" scope:"admin"`
- SlackUsers string `gorm:"column:slack_users" json:"slack_users" scope:"admin"`
- CustomName string `gorm:"column:custom_name" json:"custom_name"`
- CustomClientID string `gorm:"column:custom_client_id" json:"custom_client_id"`
- CustomClientSecret string `gorm:"column:custom_client_secret" json:"custom_client_secret" scope:"admin"`
- CustomEndpointAuth string `gorm:"column:custom_endpoint_auth" json:"custom_endpoint_auth"`
- CustomEndpointToken string `gorm:"column:custom_endpoint_token" json:"custom_endpoint_token" scope:"admin"`
- CustomScopes string `gorm:"column:custom_scopes" json:"custom_scopes"`
+ Providers string `gorm:"column:oauth_providers;" json:"oauth_providers"`
+ GithubClientID string `gorm:"column:gh_client_id" json:"gh_client_id"`
+ GithubClientSecret string `gorm:"column:gh_client_secret" json:"gh_client_secret" scope:"admin"`
+ GithubUsers string `gorm:"column:gh_users" json:"gh_users" scope:"admin"`
+ GithubOrgs string `gorm:"column:gh_orgs" json:"gh_orgs" scope:"admin"`
+ GoogleClientID string `gorm:"column:google_client_id" json:"google_client_id"`
+ GoogleClientSecret string `gorm:"column:google_client_secret" json:"google_client_secret" scope:"admin"`
+ GoogleUsers string `gorm:"column:google_users" json:"google_users" scope:"admin"`
+ SlackClientID string `gorm:"column:slack_client_id" json:"slack_client_id"`
+ SlackClientSecret string `gorm:"column:slack_client_secret" json:"slack_client_secret" scope:"admin"`
+ SlackTeam string `gorm:"column:slack_team" json:"slack_team" scope:"admin"`
+ SlackUsers string `gorm:"column:slack_users" json:"slack_users" scope:"admin"`
+ CustomName string `gorm:"column:custom_name" json:"custom_name"`
+ CustomClientID string `gorm:"column:custom_client_id" json:"custom_client_id"`
+ CustomClientSecret string `gorm:"column:custom_client_secret" json:"custom_client_secret" scope:"admin"`
+ CustomEndpointAuth string `gorm:"column:custom_endpoint_auth" json:"custom_endpoint_auth"`
+ CustomEndpointToken string `gorm:"column:custom_endpoint_token" json:"custom_endpoint_token" scope:"admin"`
+ CustomScopes string `gorm:"column:custom_scopes" json:"custom_scopes"`
+ CustomIsOpenID null.NullBool `gorm:"column:custom_open_id" json:"custom_open_id"`
}
// AllNotifiers contains all the Notifiers loaded
diff --git a/utils/env.go b/utils/env.go
index d823fba0..a7bf9c12 100644
--- a/utils/env.go
+++ b/utils/env.go
@@ -30,6 +30,7 @@ func InitEnvs() {
Params.SetDefault("DEBUG", false)
Params.SetDefault("DEMO_MODE", false)
Params.SetDefault("DB_CONN", "")
+ Params.SetDefault("DB_DSN", "")
Params.SetDefault("DISABLE_LOGS", false)
Params.SetDefault("USE_ASSETS", false)
Params.SetDefault("BASE_PATH", "")
@@ -53,6 +54,7 @@ func InitEnvs() {
Params.SetDefault("LETSENCRYPT_EMAIL", "")
Params.SetDefault("LETSENCRYPT_LOCAL", false)
Params.SetDefault("LETSENCRYPT_ENABLE", false)
+ Params.SetDefault("READ_ONLY", false)
Params.SetDefault("LOGS_MAX_COUNT", 5)
Params.SetDefault("LOGS_MAX_AGE", 28)
Params.SetDefault("LOGS_MAX_SIZE", 16)
diff --git a/version.txt b/version.txt
index b102d03f..3e32a973 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.90.67
\ No newline at end of file
+0.90.68
\ No newline at end of file