[release] v0.15.1-unstable3

This commit is contained in:
Yann Stepienik
2024-03-30 19:35:24 +00:00
parent 090ddf6c67
commit 1a50f24656
5 changed files with 18 additions and 5 deletions
@@ -104,6 +104,7 @@ const ConfigManagement = () => {
ForceHTTPSCertificateRenewal: config.HTTPConfig.ForceHTTPSCertificateRenewal,
OverrideWildcardDomains: config.HTTPConfig.OverrideWildcardDomains,
UseForwardedFor: config.HTTPConfig.UseForwardedFor,
AllowSearchEngine: config.HTTPConfig.AllowSearchEngine,
Email_Enabled: config.EmailConfig.Enabled,
Email_Host: config.EmailConfig.Host,
@@ -185,6 +186,7 @@ const ConfigManagement = () => {
ForceHTTPSCertificateRenewal: values.ForceHTTPSCertificateRenewal,
OverrideWildcardDomains: values.OverrideWildcardDomains.replace(/\s/g, ''),
UseForwardedFor: values.UseForwardedFor,
AllowSearchEngine: values.AllowSearchEngine,
},
EmailConfig: {
...config.EmailConfig,
@@ -562,6 +564,13 @@ const ConfigManagement = () => {
)}
</Stack>
</Grid>
<Grid item xs={12}>
<CosmosCheckbox
label="Allow search engines to index your server"
name="AllowSearchEngine"
formik={formik}
/>
</Grid>
</Grid>
</MainCard>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.15.1-unstable2",
"version": "0.15.1-unstable3",
"description": "",
"main": "test-server.js",
"bugs": {
+1
View File
@@ -16,6 +16,7 @@
<a href="https://github.com/AstroMando"><img src="https://avatars.githubusercontent.com/AstroMando" style="border-radius:48px" width="48" height="48" alt="null" title="null" /></a>
<a href="https://github.com/riczescaran"><img src="https://avatars.githubusercontent.com/riczescaran" style="border-radius:48px" width="48" height="48" alt="Ricardo Escaran" title="Ricardo Escaran" /></a>
<a href="https://github.com/l33xu"><img src="https://avatars.githubusercontent.com/l33xu" style="border-radius:48px" width="48" height="48" alt="null" title="null" /></a>
<a href="https://github.com/AKAHackoon"><img src="https://avatars.githubusercontent.com/AKAHackoon" style="border-radius:48px" width="48" height="48" alt="null" title="null" /></a>
<a href="https://github.com/lebenitza"><img src="https://avatars.githubusercontent.com/lebenitza" style="border-radius:48px" width="48" height="48" alt="Mihai A." title="Mihai A." /></a>
</p><!-- /sponsors -->
+6 -4
View File
@@ -348,10 +348,12 @@ func InitServer() *mux.Router {
}
// robots.txt
router.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte("User-agent: *\nDisallow: /"))
})
if !config.HTTPConfig.AllowSearchEngine {
router.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte("User-agent: *\nDisallow: /"))
})
}
logoAPI := router.PathPrefix("/logo").Subrouter()
SecureAPI(logoAPI, true, true)
+1
View File
@@ -167,6 +167,7 @@ type HTTPConfig struct {
AcceptAllInsecureHostname bool
DNSChallengeConfig map[string]string `json:"DNSChallengeConfig,omitempty"`
UseForwardedFor bool
AllowSearchEngine bool
}
const (