1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-02-01 19:14:35 +02:00

Prevent plugin from crashing if SiteURL is not set (#677)

* Prevent plugin from crashing if SiteURL is not set

* Change default baseURL to be . instead of empty string

* Revert "Change default baseURL to be . instead of empty string"

This reverts commit cceb3801679b65bb14336e91909ea4b02f448903.
This commit is contained in:
Miguel de la Cruz 2021-07-07 06:43:06 +02:00 committed by GitHub
parent 6e214ebc3d
commit 4328375324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,8 +99,13 @@ func (p *Plugin) OnActivate() error {
return fmt.Errorf("error initializing the DB: %v", err)
}
baseURL := ""
if mmconfig.ServiceSettings.SiteURL != nil {
baseURL = *mmconfig.ServiceSettings.SiteURL
}
cfg := &config.Configuration{
ServerRoot: *mmconfig.ServiceSettings.SiteURL + "/plugins/focalboard",
ServerRoot: baseURL + "/plugins/focalboard",
Port: -1,
DBType: *mmconfig.SqlSettings.DriverName,
DBConfigString: *mmconfig.SqlSettings.DataSource,
@ -174,7 +179,7 @@ func defaultLoggingConfig() string {
"delim": " ",
"min_level_len": 5,
"min_msg_len": 40,
"enable_color": true
"enable_color": true
},
"levels": [
{"id": 5, "name": "debug"},