From 6923f0d200d790dc25324b164a357965b18a5c18 Mon Sep 17 00:00:00 2001 From: Toby Chui Date: Wed, 23 Oct 2024 21:31:06 +0800 Subject: [PATCH] Fixed #328 - Fixed register enter not working - Updated all link to new project domain (aroz.org) --- src/mod/email/email.go | 2 +- src/mod/webserv/templates/index.html | 2 +- src/start.go | 2 +- src/web/components/cert.html | 25 +++++++++++++--- src/web/components/httprp.html | 45 +++++++++++++++++++++++----- src/web/components/rules.html | 10 +++---- src/web/components/utils.html | 2 +- src/web/index.html | 2 +- src/web/login.html | 27 ++++++++++++----- src/web/reset.html | 2 +- 10 files changed, 89 insertions(+), 30 deletions(-) diff --git a/src/mod/email/email.go b/src/mod/email/email.go index 978af60..cb9a42c 100644 --- a/src/mod/email/email.go +++ b/src/mod/email/email.go @@ -16,7 +16,7 @@ type Sender struct { Port int //E.g. 587 Username string //Username of the email account Password string //Password of the email account - SenderAddr string //e.g. admin@arozos.com + SenderAddr string //e.g. admin@aroz.org } // Create a new email sender object diff --git a/src/mod/webserv/templates/index.html b/src/mod/webserv/templates/index.html index 8716959..f9f3310 100644 --- a/src/mod/webserv/templates/index.html +++ b/src/mod/webserv/templates/index.html @@ -51,7 +51,7 @@ You can upload your html files to your web directory via the Web Directory Manager.

- For online documentation, please refer to zoraxy.arozos.com or the project wiki.
+ For online documentation, please refer to zoraxy.aroz.org or the project wiki.
Thank you for using Zoraxy!

diff --git a/src/start.go b/src/start.go index d9aef94..5052020 100644 --- a/src/start.go +++ b/src/start.go @@ -205,7 +205,7 @@ func startupSequence() { mdnsScanner, err = mdns.NewMDNS(mdns.NetworkHost{ HostName: hostName, Port: portInt, - Domain: "zoraxy.arozos.com", + Domain: "zoraxy.aroz.org", Model: "Network Gateway", UUID: nodeUUID, Vendor: "imuslab.com", diff --git a/src/web/components/cert.html b/src/web/components/cert.html index 31d38a0..64c2ac5 100644 --- a/src/web/components/cert.html +++ b/src/web/components/cert.html @@ -61,7 +61,7 @@

Current list of loaded certificates

- +
@@ -161,7 +161,9 @@ msgbox("Requesting certificate via " + defaultCA +"..."); //Request ACME for certificate + let buttonOriginalHTML = ""; if (btn != undefined){ + buttonOriginalHTML = $(btn).html(); $(btn).addClass('disabled'); $(btn).html(``); } @@ -169,11 +171,26 @@ obtainCertificate(domain, dns, defaultCA.trim(), function(succ){ if (btn != undefined){ $(btn).removeClass('disabled'); - if (succ){ - $(btn).html(``); + if ($(btn).hasClass("icon")){ + //Only change the button icon + if (succ){ + $(btn).html(``); + }else{ + $(btn).html(``); + } }else{ - $(btn).html(``); + //Show error or success icon with text + if (succ){ + $(btn).html(` Requested`); + }else{ + $(btn).html(` Error`); + } } + + //Restore the button after 3 seconds + setTimeout(function(){ + $(btn).html(buttonOriginalHTML); + }, 3000); setTimeout(function(){ initManagedDomainCertificateList(); diff --git a/src/web/components/httprp.html b/src/web/components/httprp.html index 28007bb..237e305 100644 --- a/src/web/components/httprp.html +++ b/src/web/components/httprp.html @@ -350,15 +350,27 @@ let originalContent = $(column).html(); //Check if this host is covered within one of the certificates. If not, show the icon - let domainIsCovered = true; + let enableQuickRequestButton = true; let domains = [payload.RootOrMatchingDomain]; //Domain for getting certificate if needed for (var i = 0; i < payload.MatchingDomainAlias.length; i++){ let thisAliasName = payload.MatchingDomainAlias[i]; domains.push(thisAliasName); } - if (true){ - domainIsCovered = false; + + //Check if the domain or alias contains wildcard, if yes, disabled the get certificate button + if (payload.RootOrMatchingDomain.indexOf("*") > -1){ + enableQuickRequestButton = false; } + + if (payload.MatchingDomainAlias != undefined){ + for (var i = 0; i < payload.MatchingDomainAlias.length; i++){ + if (payload.MatchingDomainAlias[i].indexOf("*") > -1){ + enableQuickRequestButton = false; + break; + } + } + } + //encode the domain to DOM let certificateDomains = encodeURIComponent(JSON.stringify(domains)); @@ -371,9 +383,8 @@
- + `); - $(".hostAccessRuleSelector").dropdown(); }else{ @@ -536,9 +547,29 @@ Certificate Shortcut */ - function requestCertificateForExistingHost(hostUUID, RootAndAliasDomains){ + function requestCertificateForExistingHost(hostUUID, RootAndAliasDomains, btn=undefined){ RootAndAliasDomains = JSON.parse(decodeURIComponent(RootAndAliasDomains)) - alert(RootAndAliasDomains.join(", ")) + let renewDomainKey = RootAndAliasDomains.join(","); + let preferedACMEEmail = $("#prefACMEEmail").val(); + if (preferedACMEEmail == ""){ + msgbox("Preferred email for ACME registration not set", false); + return; + } + let defaultCA = $("#defaultCA").dropdown("get value"); + if (defaultCA == ""){ + defaultCA = "Let's Encrypt"; + } + + //Check if the root or the alias domain contain wildcard character, if yes, return error + for (var i = 0; i < RootAndAliasDomains.length; i++){ + if (RootAndAliasDomains[i].indexOf("*") != -1){ + msgbox("Wildcard domain can only be setup via ACME tool", false); + return; + } + } + + //Renew the certificate + renewCertificate(renewDomainKey, false, btn); } //Bind on tab switch events diff --git a/src/web/components/rules.html b/src/web/components/rules.html index 5683c60..fa4b078 100644 --- a/src/web/components/rules.html +++ b/src/web/components/rules.html @@ -165,18 +165,18 @@
Domain
Example of domain matching keyword:
- arozos.com
Any acess requesting arozos.com will be proxy to the IP address below
+ aroz.org
Any acess requesting aroz.org will be proxy to the IP address below
Subdomain
Example of subdomain matching keyword:
- s1.arozos.com
Any request starting with s1.arozos.com will be proxy to the IP address below
+ s1.aroz.org
Any request starting with s1.aroz.org will be proxy to the IP address below
Wildcard
Example of wildcard matching keyword:
- *.arozos.com
Any request with a host name matching *.arozos.com will be proxy to the IP address below. Here are some examples.
+ *.aroz.org
Any request with a host name matching *.aroz.org will be proxy to the IP address below. Here are some examples.
-
www.arozos.com
-
foo.bar.arozos.com
+
www.aroz.org
+
foo.bar.aroz.org

diff --git a/src/web/components/utils.html b/src/web/components/utils.html index 138ccbe..524ec35 100644 --- a/src/web/components/utils.html +++ b/src/web/components/utils.html @@ -46,7 +46,7 @@
- +

Connection setup for email service provider

diff --git a/src/web/index.html b/src/web/index.html index c80e54e..a767e32 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -160,7 +160,7 @@

-

Zoraxy © 2021 - tobychui. Licensed under AGPL

+

Zoraxy © 2021 - tobychui. Licensed under AGPL

diff --git a/src/web/login.html b/src/web/login.html index b779c8a..b96990e 100644 --- a/src/web/login.html +++ b/src/web/login.html @@ -140,7 +140,7 @@
- +
@@ -175,11 +175,11 @@
-

Proudly powered by Zoraxy

+

Proudly powered by Zoraxy

Domain Last Update