mirror of
https://github.com/azukaar/Cosmos-Server.git
synced 2026-05-05 19:30:15 -05:00
[release] v0.15.1-unstable3
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.15.1-unstable2",
|
||||
"version": "0.15.1-unstable3",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -167,6 +167,7 @@ type HTTPConfig struct {
|
||||
AcceptAllInsecureHostname bool
|
||||
DNSChallengeConfig map[string]string `json:"DNSChallengeConfig,omitempty"`
|
||||
UseForwardedFor bool
|
||||
AllowSearchEngine bool
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user