mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-03 06:07:20 +02:00
Fixed #328
- Fixed register enter not working - Updated all link to new project domain (aroz.org)
This commit is contained in:
parent
7255b62e31
commit
6923f0d200
@ -16,7 +16,7 @@ type Sender struct {
|
|||||||
Port int //E.g. 587
|
Port int //E.g. 587
|
||||||
Username string //Username of the email account
|
Username string //Username of the email account
|
||||||
Password string //Password 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
|
// Create a new email sender object
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
You can upload your html files to your web directory via the <b>Web Directory Manager</b>.
|
You can upload your html files to your web directory via the <b>Web Directory Manager</b>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
For online documentation, please refer to <a href="//zoraxy.arozos.com">zoraxy.arozos.com</a> or the <a href="https://github.com/tobychui/zoraxy/wiki">project wiki</a>.<br>
|
For online documentation, please refer to <a href="//zoraxy.aroz.org">zoraxy.aroz.org</a> or the <a href="https://github.com/tobychui/zoraxy/wiki">project wiki</a>.<br>
|
||||||
Thank you for using Zoraxy!
|
Thank you for using Zoraxy!
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -205,7 +205,7 @@ func startupSequence() {
|
|||||||
mdnsScanner, err = mdns.NewMDNS(mdns.NetworkHost{
|
mdnsScanner, err = mdns.NewMDNS(mdns.NetworkHost{
|
||||||
HostName: hostName,
|
HostName: hostName,
|
||||||
Port: portInt,
|
Port: portInt,
|
||||||
Domain: "zoraxy.arozos.com",
|
Domain: "zoraxy.aroz.org",
|
||||||
Model: "Network Gateway",
|
Model: "Network Gateway",
|
||||||
UUID: nodeUUID,
|
UUID: nodeUUID,
|
||||||
Vendor: "imuslab.com",
|
Vendor: "imuslab.com",
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<p>Current list of loaded certificates</p>
|
<p>Current list of loaded certificates</p>
|
||||||
<div tourstep="certTable">
|
<div tourstep="certTable">
|
||||||
<div style="width: 100%; overflow-x: auto; margin-bottom: 1em;">
|
<div style="width: 100%; overflow-x: auto; margin-bottom: 1em;">
|
||||||
<table class="ui sortable unstackable basic celled table">
|
<table class="ui unstackable basic celled table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Domain</th>
|
<tr><th>Domain</th>
|
||||||
<th>Last Update</th>
|
<th>Last Update</th>
|
||||||
@ -161,7 +161,9 @@
|
|||||||
msgbox("Requesting certificate via " + defaultCA +"...");
|
msgbox("Requesting certificate via " + defaultCA +"...");
|
||||||
|
|
||||||
//Request ACME for certificate
|
//Request ACME for certificate
|
||||||
|
let buttonOriginalHTML = "";
|
||||||
if (btn != undefined){
|
if (btn != undefined){
|
||||||
|
buttonOriginalHTML = $(btn).html();
|
||||||
$(btn).addClass('disabled');
|
$(btn).addClass('disabled');
|
||||||
$(btn).html(`<i class="ui loading spinner icon"></i>`);
|
$(btn).html(`<i class="ui loading spinner icon"></i>`);
|
||||||
}
|
}
|
||||||
@ -169,11 +171,26 @@
|
|||||||
obtainCertificate(domain, dns, defaultCA.trim(), function(succ){
|
obtainCertificate(domain, dns, defaultCA.trim(), function(succ){
|
||||||
if (btn != undefined){
|
if (btn != undefined){
|
||||||
$(btn).removeClass('disabled');
|
$(btn).removeClass('disabled');
|
||||||
if (succ){
|
if ($(btn).hasClass("icon")){
|
||||||
$(btn).html(`<i class="ui green check icon"></i>`);
|
//Only change the button icon
|
||||||
|
if (succ){
|
||||||
|
$(btn).html(`<i class="ui green check icon"></i>`);
|
||||||
|
}else{
|
||||||
|
$(btn).html(`<i class="ui red times icon"></i>`);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$(btn).html(`<i class="ui red times icon"></i>`);
|
//Show error or success icon with text
|
||||||
|
if (succ){
|
||||||
|
$(btn).html(`<i class="ui green check icon"></i> Requested`);
|
||||||
|
}else{
|
||||||
|
$(btn).html(`<i class="ui red times icon"></i> Error`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Restore the button after 3 seconds
|
||||||
|
setTimeout(function(){
|
||||||
|
$(btn).html(buttonOriginalHTML);
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
initManagedDomainCertificateList();
|
initManagedDomainCertificateList();
|
||||||
|
@ -350,15 +350,27 @@
|
|||||||
let originalContent = $(column).html();
|
let originalContent = $(column).html();
|
||||||
|
|
||||||
//Check if this host is covered within one of the certificates. If not, show the icon
|
//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
|
let domains = [payload.RootOrMatchingDomain]; //Domain for getting certificate if needed
|
||||||
for (var i = 0; i < payload.MatchingDomainAlias.length; i++){
|
for (var i = 0; i < payload.MatchingDomainAlias.length; i++){
|
||||||
let thisAliasName = payload.MatchingDomainAlias[i];
|
let thisAliasName = payload.MatchingDomainAlias[i];
|
||||||
domains.push(thisAliasName);
|
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
|
//encode the domain to DOM
|
||||||
let certificateDomains = encodeURIComponent(JSON.stringify(domains));
|
let certificateDomains = encodeURIComponent(JSON.stringify(domains));
|
||||||
|
|
||||||
@ -371,9 +383,8 @@
|
|||||||
</div><br>
|
</div><br>
|
||||||
<button class="ui basic compact tiny button" style="margin-left: 0.4em; margin-top: 0.4em;" onclick="editAliasHostnames('${uuid}');"><i class=" blue at icon"></i> Alias</button>
|
<button class="ui basic compact tiny button" style="margin-left: 0.4em; margin-top: 0.4em;" onclick="editAliasHostnames('${uuid}');"><i class=" blue at icon"></i> Alias</button>
|
||||||
<button class="ui basic compact tiny button" style="margin-left: 0.4em; margin-top: 0.4em;" onclick="editAccessRule('${uuid}');"><i class="ui filter icon"></i> Access Rule</button>
|
<button class="ui basic compact tiny button" style="margin-left: 0.4em; margin-top: 0.4em;" onclick="editAccessRule('${uuid}');"><i class="ui filter icon"></i> Access Rule</button>
|
||||||
<button class="ui basic compact tiny ${domainIsCovered?"disabled":""} button" style="margin-left: 0.4em; margin-top: 0.4em;" onclick="requestCertificateForExistingHost('${uuid}', '${certificateDomains}');"><i class="green lock icon"></i> Get Certificate</button>
|
<button class="ui basic compact tiny ${enableQuickRequestButton?"":"disabled"} button" style="margin-left: 0.4em; margin-top: 0.4em;" onclick="requestCertificateForExistingHost('${uuid}', '${certificateDomains}', this);"><i class="green lock icon"></i> Get Certificate</button>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
||||||
$(".hostAccessRuleSelector").dropdown();
|
$(".hostAccessRuleSelector").dropdown();
|
||||||
}else{
|
}else{
|
||||||
@ -536,9 +547,29 @@
|
|||||||
Certificate Shortcut
|
Certificate Shortcut
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function requestCertificateForExistingHost(hostUUID, RootAndAliasDomains){
|
function requestCertificateForExistingHost(hostUUID, RootAndAliasDomains, btn=undefined){
|
||||||
RootAndAliasDomains = JSON.parse(decodeURIComponent(RootAndAliasDomains))
|
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
|
//Bind on tab switch events
|
||||||
|
@ -165,18 +165,18 @@
|
|||||||
<div class="ui basic segment rulesInstructions">
|
<div class="ui basic segment rulesInstructions">
|
||||||
<span style="font-size: 1.2em; font-weight: 300;"><i class="ui yellow star icon"></i> Domain</span><br>
|
<span style="font-size: 1.2em; font-weight: 300;"><i class="ui yellow star icon"></i> Domain</span><br>
|
||||||
Example of domain matching keyword:<br>
|
Example of domain matching keyword:<br>
|
||||||
<code>arozos.com</code> <br>Any acess requesting arozos.com will be proxy to the IP address below<br>
|
<code>aroz.org</code> <br>Any acess requesting aroz.org will be proxy to the IP address below<br>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<span style="font-size: 1.2em; font-weight: 300;"><i class="ui yellow star icon"></i> Subdomain</span><br>
|
<span style="font-size: 1.2em; font-weight: 300;"><i class="ui yellow star icon"></i> Subdomain</span><br>
|
||||||
Example of subdomain matching keyword:<br>
|
Example of subdomain matching keyword:<br>
|
||||||
<code>s1.arozos.com</code> <br>Any request starting with s1.arozos.com will be proxy to the IP address below<br>
|
<code>s1.aroz.org</code> <br>Any request starting with s1.aroz.org will be proxy to the IP address below<br>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<span style="font-size: 1.2em; font-weight: 300;"><i class="ui yellow star icon"></i> Wildcard</span><br>
|
<span style="font-size: 1.2em; font-weight: 300;"><i class="ui yellow star icon"></i> Wildcard</span><br>
|
||||||
Example of wildcard matching keyword:<br>
|
Example of wildcard matching keyword:<br>
|
||||||
<code>*.arozos.com</code> <br>Any request with a host name matching *.arozos.com will be proxy to the IP address below. Here are some examples.<br>
|
<code>*.aroz.org</code> <br>Any request with a host name matching *.aroz.org will be proxy to the IP address below. Here are some examples.<br>
|
||||||
<div class="ui list">
|
<div class="ui list">
|
||||||
<div class="item"><code>www.arozos.com</code></div>
|
<div class="item"><code>www.aroz.org</code></div>
|
||||||
<div class="item"><code>foo.bar.arozos.com</code></div>
|
<div class="item"><code>foo.bar.aroz.org</code></div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<form id="email-form" class="ui form">
|
<form id="email-form" class="ui form">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>Sender Address</label>
|
<label>Sender Address</label>
|
||||||
<input type="text" name="senderAddr" placeholder="E.g. noreply@zoraxy.arozos.com">
|
<input type="text" name="senderAddr" placeholder="E.g. noreply@zoraxy.aroz.org">
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<p><i class="caret down icon"></i> Connection setup for email service provider</p>
|
<p><i class="caret down icon"></i> Connection setup for email service provider</p>
|
||||||
|
@ -160,7 +160,7 @@
|
|||||||
<br><br>
|
<br><br>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<div class="ui container" style="color: grey; font-size: 90%">
|
<div class="ui container" style="color: grey; font-size: 90%">
|
||||||
<p><a href="https://zoraxy.arozos.com" target="_blank">Zoraxy</a> <span class="zrversion"></span> © 2021 - <span class="year"></span> tobychui. Licensed under AGPL</p>
|
<p><a href="https://zoraxy.aroz.org" target="_blank">Zoraxy</a> <span class="zrversion"></span> © 2021 - <span class="year"></span> tobychui. Licensed under AGPL</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="messageBox" class="ui green floating big compact message">
|
<div id="messageBox" class="ui green floating big compact message">
|
||||||
|
@ -140,7 +140,7 @@
|
|||||||
<div class="field registerOnly">
|
<div class="field registerOnly">
|
||||||
<div class="ui left icon input">
|
<div class="ui left icon input">
|
||||||
<i class="lock icon"></i>
|
<i class="lock icon"></i>
|
||||||
<input id="repeatMagic" type="password" name="passwordconfirm" placeholder="Confirm Password">
|
<input id="repeatMagic" type="password" name="passwordconfirm" placeholder="Confirm Password" >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field loginOnly" style="text-align: left;">
|
<div class="field loginOnly" style="text-align: left;">
|
||||||
@ -175,11 +175,11 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="wavebase">
|
<div class="wavebase">
|
||||||
<p>Proudly powered by <a href="https://zoraxy.arozos.com" target="_blank">Zoraxy</a></p>
|
<p>Proudly powered by <a href="https://zoraxy.aroz.org" target="_blank">Zoraxy</a></p>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
AOS.init();
|
AOS.init();
|
||||||
|
var registerMode = false;
|
||||||
var redirectionAddress = "/";
|
var redirectionAddress = "/";
|
||||||
var loginAddress = "/api/auth/login";
|
var loginAddress = "/api/auth/login";
|
||||||
$(".checkbox").checkbox();
|
$(".checkbox").checkbox();
|
||||||
@ -197,6 +197,7 @@
|
|||||||
$.get("/api/auth/userCount", function(data){
|
$.get("/api/auth/userCount", function(data){
|
||||||
if (data == 0){
|
if (data == 0){
|
||||||
//Allow user creation
|
//Allow user creation
|
||||||
|
registerMode = true;
|
||||||
$(".loginOnly").hide();
|
$(".loginOnly").hide();
|
||||||
$(".registerOnly").show();
|
$(".registerOnly").show();
|
||||||
}
|
}
|
||||||
@ -240,13 +241,23 @@
|
|||||||
$("input").on("keydown",function(event){
|
$("input").on("keydown",function(event){
|
||||||
if (event.keyCode === 13) {
|
if (event.keyCode === 13) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if ($(this).attr("id") == "magic"){
|
if (registerMode){
|
||||||
login();
|
//Register mode
|
||||||
|
if ($(this).attr("id") == "repeatMagic"){
|
||||||
|
$("#regsiterbtn").click();
|
||||||
|
}else{
|
||||||
|
//Focus to next field
|
||||||
|
$(this).next().focus();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
//Fuocus to password field
|
//Login mode
|
||||||
$("#magic").focus();
|
if ($(this).attr("id") == "magic"){
|
||||||
|
login();
|
||||||
|
}else{
|
||||||
|
//Fuocus to password field
|
||||||
|
$("#magic").focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="wavebase">
|
<div class="wavebase">
|
||||||
<p>Proudly powered by <a href="https://zoraxy.arozos.com" target="_blank">Zoraxy</a></p>
|
<p>Proudly powered by <a href="https://zoraxy.aroz.org" target="_blank">Zoraxy</a></p>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
AOS.init();
|
AOS.init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user