diff --git a/client/src/pages/newInstall/newInstall.jsx b/client/src/pages/newInstall/newInstall.jsx index 8539ebb..ee3aa54 100644 --- a/client/src/pages/newInstall/newInstall.jsx +++ b/client/src/pages/newInstall/newInstall.jsx @@ -226,6 +226,7 @@ const NewInstall = () => { initialValues={{ HTTPSCertificateMode: "LETSENCRYPT", UseWildcardCertificate: false, + DNSChallengeProvider: '', }} validationSchema={Yup.object().shape({ SSLEmail: Yup.string().when('HTTPSCertificateMode', { @@ -258,6 +259,7 @@ const NewInstall = () => { TLSKey: values.HTTPSCertificateMode === "PROVIDED" ? values.TLSKey : '', TLSCert: values.HTTPSCertificateMode === "PROVIDED" ? values.TLSCert : '', Hostname: values.Hostname, + DNSChallengeProvider: values.DNSChallengeProvider, }); if(res.status == "OK") { setStatus({ success: true }); @@ -287,7 +289,8 @@ const NewInstall = () => { <> If you are using Cloudflare, make sure the DNS record is NOT set to Proxied (you should not see the orange cloud but a grey one). - Otherwise Cloudflare will not allow Let's Encrypt to verify your domain. + Otherwise Cloudflare will not allow Let's Encrypt to verify your domain.
+ Alternatively, you can also use the DNS challenge.
{ placeholder={"email@domain.com"} formik={formik} /> + {formik.values.DNSChallengeProvider && formik.values.DNSChallengeProvider != '' && ( + + You have enabled the DNS challenge. Make sure you have set the environment variables for your DNS provider. + You can enable it now, but make sure you have set up your API tokens accordingly before attempting to access + Cosmos after this installer. See doc here: https://go-acme.github.io/lego/dns/ + + )} + )} {formik.values.HTTPSCertificateMode === "PROVIDED" && ( @@ -323,9 +339,15 @@ const NewInstall = () => { formik={formik} /> + {formik.values.HTTPSCertificateMode === "LETSENCRYPT" && formik.values.UseWildcardCertificate && (!formik.values.DNSChallengeProvider || formik.values.DNSChallengeProvider == '') && ( + + You have enabled wildcard certificates with Let's Encrypt. This only works if you use the DNS challenge! + Please edit the DNS Provider text input. + + )} diff --git a/package.json b/package.json index 8ec3cb3..c3fbdc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.5.3", + "version": "0.5.4", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/newInstall.go b/src/newInstall.go index 68bfed0..f53eed5 100644 --- a/src/newInstall.go +++ b/src/newInstall.go @@ -33,6 +33,7 @@ type NewInstallJSON struct { Step string `json:"step"` SSLEmail string `json:"sslEmail",validate:"omitempty,email"` UseWildcardCertificate bool `json:"useWildcardCertificate",validate:"omitempty"` + DNSChallengeProvider string `json:"dnsChallengeProvider",validate:"omitempty"` } type AdminJSON struct { @@ -108,6 +109,7 @@ func NewInstallRoute(w http.ResponseWriter, req *http.Request) { newConfig.HTTPConfig.HTTPSCertificateMode = request.HTTPSCertificateMode newConfig.HTTPConfig.SSLEmail = request.SSLEmail newConfig.HTTPConfig.UseWildcardCertificate = request.UseWildcardCertificate + newConfig.HTTPConfig.DNSChallengeProvider = request.DNSChallengeProvider newConfig.HTTPConfig.TLSCert = request.TLSCert newConfig.HTTPConfig.TLSKey = request.TLSKey diff --git a/src/utils/utils.go b/src/utils/utils.go index 483db41..ecebe1c 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -169,7 +169,7 @@ func ReadConfigFromFile() Config { return config } -func LoadBaseMainConfig(config Config){ +func LoadBaseMainConfig(config Config) { BaseMainConfig = config MainConfig = config @@ -211,6 +211,10 @@ func LoadBaseMainConfig(config Config){ if os.Getenv("COSMOS_SERVER_COUNTRY") != "" { MainConfig.ServerCountry = os.Getenv("COSMOS_SERVER_COUNTRY") } + + // if BaseMainConfig.NewInstall { + // MainConfig.HTTPConfig.HTTPSCertificateMode = "DISABLED" + // } } func GetMainConfig() Config {