mirror of https://github.com/cloudreve/Cloudreve
feat(captcha): update static asset source option (#2589)
* feat(captcha): Add captcha_cap_asset_server configuration option to support static asset server settings (#2584) * fix(captcha): Backend default: cdn → jsdelivrpull/2603/head
parent
f38f32f9f5
commit
6106b57bc7
|
@ -395,6 +395,7 @@ var DefaultSettings = map[string]string{
|
||||||
"captcha_cap_instance_url": "",
|
"captcha_cap_instance_url": "",
|
||||||
"captcha_cap_site_key": "",
|
"captcha_cap_site_key": "",
|
||||||
"captcha_cap_secret_key": "",
|
"captcha_cap_secret_key": "",
|
||||||
|
"captcha_cap_asset_server": "jsdelivr",
|
||||||
"thumb_width": "400",
|
"thumb_width": "400",
|
||||||
"thumb_height": "300",
|
"thumb_height": "300",
|
||||||
"thumb_entity_suffix": "._thumb",
|
"thumb_entity_suffix": "._thumb",
|
||||||
|
|
|
@ -671,6 +671,7 @@ func (s *settingProvider) CapCaptcha(ctx context.Context) *Cap {
|
||||||
InstanceURL: s.getString(ctx, "captcha_cap_instance_url", ""),
|
InstanceURL: s.getString(ctx, "captcha_cap_instance_url", ""),
|
||||||
SiteKey: s.getString(ctx, "captcha_cap_site_key", ""),
|
SiteKey: s.getString(ctx, "captcha_cap_site_key", ""),
|
||||||
SecretKey: s.getString(ctx, "captcha_cap_secret_key", ""),
|
SecretKey: s.getString(ctx, "captcha_cap_secret_key", ""),
|
||||||
|
AssetServer: s.getString(ctx, "captcha_cap_asset_server", "jsdelivr"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ type Cap struct {
|
||||||
InstanceURL string
|
InstanceURL string
|
||||||
SiteKey string
|
SiteKey string
|
||||||
SecretKey string
|
SecretKey string
|
||||||
|
AssetServer string
|
||||||
}
|
}
|
||||||
|
|
||||||
type SMTP struct {
|
type SMTP struct {
|
||||||
|
|
|
@ -31,6 +31,7 @@ type SiteConfig struct {
|
||||||
TurnstileSiteID string `json:"turnstile_site_id,omitempty"`
|
TurnstileSiteID string `json:"turnstile_site_id,omitempty"`
|
||||||
CapInstanceURL string `json:"captcha_cap_instance_url,omitempty"`
|
CapInstanceURL string `json:"captcha_cap_instance_url,omitempty"`
|
||||||
CapSiteKey string `json:"captcha_cap_site_key,omitempty"`
|
CapSiteKey string `json:"captcha_cap_site_key,omitempty"`
|
||||||
|
CapAssetServer string `json:"captcha_cap_asset_server,omitempty"`
|
||||||
RegisterEnabled bool `json:"register_enabled,omitempty"`
|
RegisterEnabled bool `json:"register_enabled,omitempty"`
|
||||||
TosUrl string `json:"tos_url,omitempty"`
|
TosUrl string `json:"tos_url,omitempty"`
|
||||||
PrivacyPolicyUrl string `json:"privacy_policy_url,omitempty"`
|
PrivacyPolicyUrl string `json:"privacy_policy_url,omitempty"`
|
||||||
|
@ -138,6 +139,7 @@ func (s *GetSettingService) GetSiteConfig(c *gin.Context) (*SiteConfig, error) {
|
||||||
ReCaptchaKey: reCaptcha.Key,
|
ReCaptchaKey: reCaptcha.Key,
|
||||||
CapInstanceURL: capCaptcha.InstanceURL,
|
CapInstanceURL: capCaptcha.InstanceURL,
|
||||||
CapSiteKey: capCaptcha.SiteKey,
|
CapSiteKey: capCaptcha.SiteKey,
|
||||||
|
CapAssetServer: capCaptcha.AssetServer,
|
||||||
AppPromotion: appSetting.Promotion,
|
AppPromotion: appSetting.Promotion,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue