Disable Gfycat by default during Beta and move default keys to server (#9027)

* Update default.json

* Update diagnostics.go

* Added default Gfycat API credentials to server

* Fixed default Gfycat credentials
Этот коммит содержится в:
Jason Blais
2018-07-03 05:26:08 -04:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 4ccb8b7cff
Коммит 8821fee6c2
3 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@@ -208,6 +208,9 @@ func (a *App) trackConfig() {
"enable_user_access_tokens": *cfg.ServiceSettings.EnableUserAccessTokens, "enable_user_access_tokens": *cfg.ServiceSettings.EnableUserAccessTokens,
"enable_custom_emoji": *cfg.ServiceSettings.EnableCustomEmoji, "enable_custom_emoji": *cfg.ServiceSettings.EnableCustomEmoji,
"enable_emoji_picker": *cfg.ServiceSettings.EnableEmojiPicker, "enable_emoji_picker": *cfg.ServiceSettings.EnableEmojiPicker,
"enable_gif_picker": *cfg.ServiceSettings.EnableGifPicker,
"gfycat_api_key": isDefault(*cfg.ServiceSettings.GfycatApiKey, model.SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY),
"gfycat_api_secret": isDefault(*cfg.ServiceSettings.GfycatApiSecret, model.SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET),
"experimental_enable_authentication_transfer": *cfg.ServiceSettings.ExperimentalEnableAuthenticationTransfer, "experimental_enable_authentication_transfer": *cfg.ServiceSettings.ExperimentalEnableAuthenticationTransfer,
"restrict_custom_emoji_creation": *cfg.ServiceSettings.RestrictCustomEmojiCreation, "restrict_custom_emoji_creation": *cfg.ServiceSettings.RestrictCustomEmojiCreation,
"enable_testing": cfg.ServiceSettings.EnableTesting, "enable_testing": cfg.ServiceSettings.EnableTesting,

Просмотреть файл

@@ -44,9 +44,9 @@
"WebserverMode": "gzip", "WebserverMode": "gzip",
"EnableCustomEmoji": false, "EnableCustomEmoji": false,
"EnableEmojiPicker": true, "EnableEmojiPicker": true,
"EnableGifPicker": true, "EnableGifPicker": false,
"GfycatApiKey": "", "GfycatApiKey": "2_KtH_W5",
"GfycatApiSecret": "", "GfycatApiSecret": "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof",
"RestrictCustomEmojiCreation": "all", "RestrictCustomEmojiCreation": "all",
"RestrictPostDelete": "all", "RestrictPostDelete": "all",
"AllowEditPost": "always", "AllowEditPost": "always",

Просмотреть файл

@@ -87,6 +87,8 @@ const (
SERVICE_SETTINGS_DEFAULT_MAX_LOGIN_ATTEMPTS = 10 SERVICE_SETTINGS_DEFAULT_MAX_LOGIN_ATTEMPTS = 10
SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM = "" SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM = ""
SERVICE_SETTINGS_DEFAULT_LISTEN_AND_ADDRESS = ":8065" SERVICE_SETTINGS_DEFAULT_LISTEN_AND_ADDRESS = ":8065"
SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY = "2_KtH_W5"
SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET = "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof"
TEAM_SETTINGS_DEFAULT_MAX_USERS_PER_TEAM = 50 TEAM_SETTINGS_DEFAULT_MAX_USERS_PER_TEAM = 50
TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT = "" TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT = ""
@@ -417,15 +419,15 @@ func (s *ServiceSettings) SetDefaults() {
} }
if s.EnableGifPicker == nil { if s.EnableGifPicker == nil {
s.EnableGifPicker = NewBool(true) s.EnableGifPicker = NewBool(false)
} }
if s.GfycatApiKey == nil { if s.GfycatApiKey == nil || *s.GfycatApiKey == "" {
s.GfycatApiKey = NewString("") s.GfycatApiKey = NewString(SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY)
} }
if s.GfycatApiSecret == nil { if s.GfycatApiSecret == nil || *s.GfycatApiSecret == "" {
s.GfycatApiSecret = NewString("") s.GfycatApiSecret = NewString(SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET)
} }
if s.RestrictCustomEmojiCreation == nil { if s.RestrictCustomEmojiCreation == nil {