Skip to content

Commit 63cca71

Browse files
committed
26 Sep 2023
1 parent b34f5e8 commit 63cca71

File tree

8 files changed

+27
-12
lines changed

8 files changed

+27
-12
lines changed

core/assets/core-boxx-1.png

-14.8 KB
Loading

core/assets/core-boxx-2.png

-12.5 KB
Loading

core/assets/core-boxx-3.png

-3.83 KB
Loading

core/assets/head-core-boxx.webp

-5.13 KB
Binary file not shown.

core/lib/CORE-Install-HTML.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
if (I_PUSH && I_OPENSSL) {
1313
require PATH_LIB . "webpush/autoload.php";
1414
define("I_VAPID", Minishlink\WebPush\VAPID::createVapidKeys());
15+
if (I_VAPID==null || I_VAPID==false || I_VAPID=="") {
16+
exit("Failed to generate push notification VAPID keys. Make sure that OpenSSL is properly installed and configured.");
17+
}
1518
}
1619

1720
// (C) HTML ?>
@@ -77,8 +80,11 @@
7780
</select>
7881
<label>Enforce HTTPS?</label>
7982
</div>
83+
<div class="text-secondary">
84+
* Once enforced, API will only respond to HTTPS calls. Recommended for live servers.
85+
</div>
8086
<div class="text-secondary mb-2">
81-
* If enforced, API will only respond to HTTPS calls - Recommended to set "yes" for live servers.
87+
* The host URL above need to be set to "HTTPS" if you want to enforce this.
8288
</div>
8389

8490
<div class="form-floating mb-2">
@@ -217,4 +223,4 @@
217223
<input id="gobtn" type="submit" class="btn btn-primary" value="Go!" disabled>
218224
</form>
219225
</div></body>
220-
</html>
226+
</html>

core/lib/CORE-Install-JS.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
// (E1) LOCK INSTALL FORM
6868
install.toggle(false);
6969

70-
// (E2) DUMMY PROOFING TO THE MAX!
70+
// (E2) URL DUMMY PROOFING TO THE MAX!
7171
let hHost = document.getElementsByName("host")[0],
7272
domain = hHost.value;
7373
domain = domain.trim();
@@ -77,8 +77,17 @@
7777
if (domain.charAt(domain.length-1) != "/") { domain = domain + "/"; }
7878
hHost.value = domain;
7979

80+
// (E3) DUMMY PROOFING - API ENFORCE HTTPS BUT HOST URL IS NOT HTTPS
81+
let https = document.getElementsByName("https")[0].value,
82+
enforce = document.getElementsByName("apihttps")[0].value;
83+
if (enforce==1 && https==0) {
84+
alert("Please set your HOST URL to HTTPS if you want to enforce HTTPS for API calls. Also make sure that you have a valid SSL cert.");
85+
install.toggle(true);
86+
return false;
87+
}
88+
8089
<?php if (I_USER) { ?>
81-
// (E3) ADMIN PASSWORD
90+
// (E4) ADMIN PASSWORD
8291
var pass = document.getElementsByName("apass")[0],
8392
cpass = document.getElementsByName("apassc")[0];
8493
if (pass.value != cpass.value) {
@@ -87,23 +96,23 @@
8796
return false;
8897
}
8998

90-
// (E4) PASSWORD STRENGTH CHECK - AT LEAST 8 CHARACTERS ALPHANUMERIC
99+
// (E5) PASSWORD STRENGTH CHECK - AT LEAST 8 CHARACTERS ALPHANUMERIC
91100
if (!/^(?=.*[0-9])(?=.*[A-Z]).{8,20}$/i.test(pass.value)) {
92101
alert("Password must be at least 8 characters alphanumeric");
93102
install.toggle(true);
94103
return false;
95104
}
96105
<?php } ?>
97106

98-
// (E5) URL PATH
107+
// (E6) URL PATH
99108
let url = (document.getElementsByName("https")[0].value=="0" ? "http" : "https")
100109
+ "://" + domain ;
101110

102-
// (E6) GENERATE HTACCESS
111+
// (E7) GENERATE HTACCESS
103112
install.ajax(url, "E1", () => {
104-
// (E7) VERIFY HTACCESS
113+
// (E8) VERIFY HTACCESS
105114
install.ajax(url + "installer/test/", "E2", () => {
106-
// (E8) PROCEED INSTALLATION
115+
// (E9) PROCEED INSTALLATION
107116
install.ajax(url, "F", () => {
108117
alert("Installation complete, this page will now reload.");
109118
location.href = url;
@@ -119,4 +128,4 @@
119128
install.rnd();
120129
install.toggle(true);
121130
};
122-
</script>
131+
</script>

users/assets/users.webp

-7.2 KB
Binary file not shown.

web push/pages/PAGE-install-push.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// (C) GENERATE VAPID KEYS
1212
require PATH_LIB . "webpush/autoload.php";
1313
$keys = Minishlink\WebPush\VAPID::createVapidKeys();
14-
if ($keys == null) {
15-
exit("Unabled to create keys, please make sure OpenSSL is properly installed and configured.");
14+
if ($keys==null || $keys==false || $keys=="") {
15+
exit("Unable to create keys, please make sure OpenSSL is properly installed and configured.");
1616
}
1717

1818
// (D) INSERT KEYS INTO CORE-CONFIG.PHP

0 commit comments

Comments
 (0)