From 507c2ab46880a71778d40dc4f5be9642fbce5c64 Mon Sep 17 00:00:00 2001 From: Toby Chui Date: Sat, 9 Sep 2023 12:28:24 +0800 Subject: [PATCH] Updated 2.6.7 init --- src/acme.go | 2 +- src/main.go | 4 +- src/mod/acme/acme.go | 9 +++- src/mod/acme/ca.go | 1 - src/web/components/webserv.html | 75 +++++++++++++++++++++++++++++++++ src/web/index.html | 6 +++ src/web/snippet/acme.html | 5 ++- 7 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 src/web/components/webserv.html diff --git a/src/acme.go b/src/acme.go index 72e5883..27553e8 100644 --- a/src/acme.go +++ b/src/acme.go @@ -38,7 +38,7 @@ func initACME() *acme.ACMEHandler { port = getRandomPort(30000) } - return acme.NewACME("https://acme-staging-v02.api.letsencrypt.org/directory", strconv.Itoa(port)) + return acme.NewACME("https://acme-v02.api.letsencrypt.org/directory", strconv.Itoa(port)) } // create the special routing rule for ACME diff --git a/src/main.go b/src/main.go index edff546..797dfc1 100644 --- a/src/main.go +++ b/src/main.go @@ -43,9 +43,9 @@ var acmeAutoRenewInterval = flag.Int("autorenew", 86400, "ACME auto TLS/SSL cert var enableHighSpeedGeoIPLookup = flag.Bool("fastgeoip", false, "Enable high speed geoip lookup, require 1GB extra memory (Not recommend for low end devices)") var ( name = "Zoraxy" - version = "2.6.6" + version = "2.6.7" nodeUUID = "generic" - development = false //Set this to false to use embedded web fs + development = true //Set this to false to use embedded web fs bootTime = time.Now().Unix() /* diff --git a/src/mod/acme/acme.go b/src/mod/acme/acme.go index d82cf05..a127a3b 100644 --- a/src/mod/acme/acme.go +++ b/src/mod/acme/acme.go @@ -303,18 +303,23 @@ func (a *ACMEHandler) HandleRenewCertificate(w http.ResponseWriter, r *http.Requ ca, err := utils.PostPara(r, "ca") if err != nil { - log.Println("CA not set. Using default") + log.Println("[INFO] CA not set. Using default") ca, caUrl = "", "" } if ca == "custom" { caUrl, err = utils.PostPara(r, "caURL") if err != nil { - log.Println("Custom CA set but no URL provide, Using default") + log.Println("[INFO] Custom CA set but no URL provide, Using default") ca, caUrl = "", "" } } + if ca == "" { + //default. Use Let's Encrypt + ca = "Let's Encrypt" + } + var skipTLS bool if skipTLSString, err := utils.PostPara(r, "skipTLS"); err != nil { diff --git a/src/mod/acme/ca.go b/src/mod/acme/ca.go index e2a9b96..205771e 100644 --- a/src/mod/acme/ca.go +++ b/src/mod/acme/ca.go @@ -32,7 +32,6 @@ func init() { } caDef = runtimeCaDef - } // Get the CA ACME server endpoint and error if not found diff --git a/src/web/components/webserv.html b/src/web/components/webserv.html new file mode 100644 index 0000000..fcd8637 --- /dev/null +++ b/src/web/components/webserv.html @@ -0,0 +1,75 @@ +
+
+

Static Web Server

+

A simple static web server that serve html css and js files

+
+
+

Web Server Settings

+
+
+
+ + +
+
+
+
+ + + If this folder do not contains any index files, list the directory of this folder. +
+
+
+ + + + The web server root folder can only be changed via startup flags of zoraxy for security reasons. + See the -webserv flag for more details. + +
+
+ + + Use http://127.0.0.1:8081 in proxy rules to access the web server +
+
+
+
+
+
+ + How to access the static web server? +
+
+ There are three ways to access the static web server.
+
+
+ If you are using Zoraxy as your gateway reverse proxy server, + you can add a new subdomain proxy rule that points to + http://127.0.0.1:8081 +
+
+ If you are using Zoraxy under another reverse proxy server, + add http://127.0.0.1:8081 to the config of your upper layer reverse proxy server's config file. +
+
+ Directly access the web server via http://{zoraxy_host_ip}:8081 (Not recommended) +
+
+
+ +
+
+
+ +
+ + + +
\ No newline at end of file diff --git a/src/web/index.html b/src/web/index.html index 19760bf..d95acef 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -69,6 +69,9 @@ TCP Proxy + + Static Web Server + Uptime Monitor @@ -117,6 +120,9 @@
+ +
+
diff --git a/src/web/snippet/acme.html b/src/web/snippet/acme.html index be1a8f9..d9131ce 100644 --- a/src/web/snippet/acme.html +++ b/src/web/snippet/acme.html @@ -124,7 +124,7 @@ - +
First time setting up HTTPS?
Try out our wizard
@@ -323,7 +323,8 @@ var filename = $("#filenameInput").val(); var email = $("#caRegisterEmail").val(); if (email == ""){ - parent.msgbox("ACME renew email is not set") + parent.msgbox("ACME renew email is not set", false) + $("#obtainButton").removeClass("loading").removeClass("disabled"); return; } if (filename.trim() == "" && !domains.includes(",")){