[release] v0.5.4 - Add DNS challenge to installer
This commit is contained in:
parent
84ceae0591
commit
5fb4ce9d99
|
@ -226,6 +226,7 @@ const NewInstall = () => {
|
||||||
initialValues={{
|
initialValues={{
|
||||||
HTTPSCertificateMode: "LETSENCRYPT",
|
HTTPSCertificateMode: "LETSENCRYPT",
|
||||||
UseWildcardCertificate: false,
|
UseWildcardCertificate: false,
|
||||||
|
DNSChallengeProvider: '',
|
||||||
}}
|
}}
|
||||||
validationSchema={Yup.object().shape({
|
validationSchema={Yup.object().shape({
|
||||||
SSLEmail: Yup.string().when('HTTPSCertificateMode', {
|
SSLEmail: Yup.string().when('HTTPSCertificateMode', {
|
||||||
|
@ -258,6 +259,7 @@ const NewInstall = () => {
|
||||||
TLSKey: values.HTTPSCertificateMode === "PROVIDED" ? values.TLSKey : '',
|
TLSKey: values.HTTPSCertificateMode === "PROVIDED" ? values.TLSKey : '',
|
||||||
TLSCert: values.HTTPSCertificateMode === "PROVIDED" ? values.TLSCert : '',
|
TLSCert: values.HTTPSCertificateMode === "PROVIDED" ? values.TLSCert : '',
|
||||||
Hostname: values.Hostname,
|
Hostname: values.Hostname,
|
||||||
|
DNSChallengeProvider: values.DNSChallengeProvider,
|
||||||
});
|
});
|
||||||
if(res.status == "OK") {
|
if(res.status == "OK") {
|
||||||
setStatus({ success: true });
|
setStatus({ success: true });
|
||||||
|
@ -287,7 +289,8 @@ const NewInstall = () => {
|
||||||
<>
|
<>
|
||||||
<Alert severity="warning">
|
<Alert severity="warning">
|
||||||
If you are using Cloudflare, make sure the DNS record is <strong>NOT</strong> set to <b>Proxied</b> (you should not see the orange cloud but a grey one).
|
If you are using Cloudflare, make sure the DNS record is <strong>NOT</strong> set to <b>Proxied</b> (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. <br />
|
||||||
|
Alternatively, you can also use the DNS challenge.
|
||||||
</Alert>
|
</Alert>
|
||||||
<CosmosInputText
|
<CosmosInputText
|
||||||
name="SSLEmail"
|
name="SSLEmail"
|
||||||
|
@ -295,6 +298,19 @@ const NewInstall = () => {
|
||||||
placeholder={"email@domain.com"}
|
placeholder={"email@domain.com"}
|
||||||
formik={formik}
|
formik={formik}
|
||||||
/>
|
/>
|
||||||
|
{formik.values.DNSChallengeProvider && formik.values.DNSChallengeProvider != '' && (
|
||||||
|
<Alert severity="info">
|
||||||
|
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: <a target="_blank" href="https://go-acme.github.io/lego/dns/">https://go-acme.github.io/lego/dns/</a>
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
|
<CosmosInputText
|
||||||
|
label={"DNS Provider (only set if you want to use the DNS challenge)"}
|
||||||
|
name="DNSChallengeProvider"
|
||||||
|
placeholder={"provider"}
|
||||||
|
formik={formik}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{formik.values.HTTPSCertificateMode === "PROVIDED" && (
|
{formik.values.HTTPSCertificateMode === "PROVIDED" && (
|
||||||
|
@ -323,9 +339,15 @@ const NewInstall = () => {
|
||||||
formik={formik}
|
formik={formik}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{formik.values.HTTPSCertificateMode === "LETSENCRYPT" && formik.values.UseWildcardCertificate && (!formik.values.DNSChallengeProvider || formik.values.DNSChallengeProvider == '') && (
|
||||||
|
<Alert severity="error">
|
||||||
|
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.
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
|
|
||||||
<CosmosCheckbox
|
<CosmosCheckbox
|
||||||
label={"Use Wildcard Certificate for *." + formik.values.Hostname}
|
label={"Use Wildcard Certificate for *." + (formik.values.Hostname || "")}
|
||||||
name="UseWildcardCertificate"
|
name="UseWildcardCertificate"
|
||||||
formik={formik}
|
formik={formik}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.5.3",
|
"version": "0.5.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -33,6 +33,7 @@ type NewInstallJSON struct {
|
||||||
Step string `json:"step"`
|
Step string `json:"step"`
|
||||||
SSLEmail string `json:"sslEmail",validate:"omitempty,email"`
|
SSLEmail string `json:"sslEmail",validate:"omitempty,email"`
|
||||||
UseWildcardCertificate bool `json:"useWildcardCertificate",validate:"omitempty"`
|
UseWildcardCertificate bool `json:"useWildcardCertificate",validate:"omitempty"`
|
||||||
|
DNSChallengeProvider string `json:"dnsChallengeProvider",validate:"omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AdminJSON struct {
|
type AdminJSON struct {
|
||||||
|
@ -108,6 +109,7 @@ func NewInstallRoute(w http.ResponseWriter, req *http.Request) {
|
||||||
newConfig.HTTPConfig.HTTPSCertificateMode = request.HTTPSCertificateMode
|
newConfig.HTTPConfig.HTTPSCertificateMode = request.HTTPSCertificateMode
|
||||||
newConfig.HTTPConfig.SSLEmail = request.SSLEmail
|
newConfig.HTTPConfig.SSLEmail = request.SSLEmail
|
||||||
newConfig.HTTPConfig.UseWildcardCertificate = request.UseWildcardCertificate
|
newConfig.HTTPConfig.UseWildcardCertificate = request.UseWildcardCertificate
|
||||||
|
newConfig.HTTPConfig.DNSChallengeProvider = request.DNSChallengeProvider
|
||||||
newConfig.HTTPConfig.TLSCert = request.TLSCert
|
newConfig.HTTPConfig.TLSCert = request.TLSCert
|
||||||
newConfig.HTTPConfig.TLSKey = request.TLSKey
|
newConfig.HTTPConfig.TLSKey = request.TLSKey
|
||||||
|
|
||||||
|
|
|
@ -211,6 +211,10 @@ func LoadBaseMainConfig(config Config){
|
||||||
if os.Getenv("COSMOS_SERVER_COUNTRY") != "" {
|
if os.Getenv("COSMOS_SERVER_COUNTRY") != "" {
|
||||||
MainConfig.ServerCountry = os.Getenv("COSMOS_SERVER_COUNTRY")
|
MainConfig.ServerCountry = os.Getenv("COSMOS_SERVER_COUNTRY")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if BaseMainConfig.NewInstall {
|
||||||
|
// MainConfig.HTTPConfig.HTTPSCertificateMode = "DISABLED"
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMainConfig() Config {
|
func GetMainConfig() Config {
|
||||||
|
|
Loading…
Reference in a new issue