From 1a50f24656cb17e49fa185d14a670b2c03c3aa19 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Sat, 30 Mar 2024 19:35:24 +0000 Subject: [PATCH] [release] v0.15.1-unstable3 --- client/src/pages/config/users/configman.jsx | 9 +++++++++ package.json | 2 +- readme.md | 1 + src/httpServer.go | 10 ++++++---- src/utils/types.go | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/src/pages/config/users/configman.jsx b/client/src/pages/config/users/configman.jsx index cc03276..3b5a0af 100644 --- a/client/src/pages/config/users/configman.jsx +++ b/client/src/pages/config/users/configman.jsx @@ -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 = () => { )} + + + diff --git a/package.json b/package.json index 9e103af..e00576b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.15.1-unstable2", + "version": "0.15.1-unstable3", "description": "", "main": "test-server.js", "bugs": { diff --git a/readme.md b/readme.md index 183ec09..35506d5 100644 --- a/readme.md +++ b/readme.md @@ -16,6 +16,7 @@ null Ricardo Escaran null +null Mihai A.

diff --git a/src/httpServer.go b/src/httpServer.go index f1457ff..19a9ccd 100644 --- a/src/httpServer.go +++ b/src/httpServer.go @@ -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) diff --git a/src/utils/types.go b/src/utils/types.go index fcad1b1..a037dd0 100644 --- a/src/utils/types.go +++ b/src/utils/types.go @@ -167,6 +167,7 @@ type HTTPConfig struct { AcceptAllInsecureHostname bool DNSChallengeConfig map[string]string `json:"DNSChallengeConfig,omitempty"` UseForwardedFor bool + AllowSearchEngine bool } const (