Pam Fix 2.0
This commit is contained in:
@@ -331,7 +331,6 @@ const fTotpPeriod = document.getElementById("fTotpPeriod");
|
||||
const fTotpWindow = document.getElementById("fTotpWindow");
|
||||
const fTotpDigits = document.getElementById("fTotpDigits");
|
||||
const fAllowStatic = document.getElementById("fAllowStatic");
|
||||
const fUsePam = document.getElementById("fUsePam");
|
||||
const fMaxConn = document.getElementById("fMaxConn");
|
||||
const fExpires = document.getElementById("fExpires");
|
||||
const fUp = document.getElementById("fUp");
|
||||
|
||||
@@ -121,7 +121,6 @@ function fillUserForm(u) {
|
||||
fTotpWindow.value = u.totp_window ?? 1;
|
||||
fTotpDigits.value = u.totp_digits || 6;
|
||||
fAllowStatic.checked = !!u.allow_static_password;
|
||||
if (fUsePam) fUsePam.checked = !!u.use_pam;
|
||||
fMaxConn.value = u.max_connections || "";
|
||||
fUp.value = u.limit_mbps_up || "";
|
||||
fDown.value = u.limit_mbps_down || "";
|
||||
@@ -145,7 +144,6 @@ userForm.addEventListener("submit", async e => {
|
||||
totp_window: parseInt(fTotpWindow.value||"1",10),
|
||||
totp_digits: parseInt(fTotpDigits.value||"6",10),
|
||||
allow_static_password: !!fAllowStatic.checked,
|
||||
use_pam: !!(fUsePam && fUsePam.checked),
|
||||
max_connections: parseInt(fMaxConn.value||"0",10),
|
||||
expires_at: isoFromLocal(fExpires.value),
|
||||
limit_mbps_up: parseInt(fUp.value||"0",10),
|
||||
|
||||
@@ -418,6 +418,7 @@ async function loadManagedServerConfig(id) {
|
||||
document.getElementById("managedCfgSSHIdleTimeout").value = c.ssh_idle_timeout || "0s";
|
||||
document.getElementById("managedCfgQuiet").checked = !!c.quiet;
|
||||
document.getElementById("managedCfgUserCount").checked = !!c.user_count;
|
||||
document.getElementById("managedCfgPamAuth").checked = !!c.pam_auth_enabled;
|
||||
document.getElementById("managedCfgBanner").value = c.banner || "";
|
||||
|
||||
const hasDnstt = !!c.dnstt;
|
||||
@@ -487,6 +488,7 @@ function managedConfigFromForm() {
|
||||
ssh_idle_timeout: document.getElementById("managedCfgSSHIdleTimeout").value.trim() || "0s",
|
||||
quiet: document.getElementById("managedCfgQuiet").checked,
|
||||
user_count: document.getElementById("managedCfgUserCount").checked,
|
||||
pam_auth_enabled: document.getElementById("managedCfgPamAuth").checked,
|
||||
banner: document.getElementById("managedCfgBanner").value,
|
||||
banner_file: "/opt/sshpanel/banner.txt",
|
||||
dnstt: document.getElementById("managedCfgDnsttEnabled").checked ? {
|
||||
|
||||
@@ -99,6 +99,7 @@ async function loadServerConfig() {
|
||||
document.getElementById("cfgSSHIdleTimeout").value = c.ssh_idle_timeout || "0s";
|
||||
document.getElementById("cfgQuiet").checked = !!c.quiet;
|
||||
document.getElementById("cfgUserCount").checked = !!c.user_count;
|
||||
document.getElementById("cfgPamAuth").checked = !!c.pam_auth_enabled;
|
||||
|
||||
// Banner
|
||||
document.getElementById("cfgBanner").value = c.banner || "";
|
||||
@@ -182,6 +183,7 @@ async function saveServerConfig() {
|
||||
ssh_idle_timeout: document.getElementById("cfgSSHIdleTimeout").value.trim() || "0s",
|
||||
quiet: document.getElementById("cfgQuiet").checked,
|
||||
user_count: document.getElementById("cfgUserCount").checked,
|
||||
pam_auth_enabled: document.getElementById("cfgPamAuth").checked,
|
||||
banner: document.getElementById("cfgBanner").value,
|
||||
banner_file: "/opt/sshpanel/banner.txt",
|
||||
dnstt: document.getElementById("cfgDnsttEnabled").checked ? {
|
||||
|
||||
+4
-1
@@ -306,7 +306,6 @@
|
||||
<div class="field"><label>TOTP Window</label><input id="fTotpWindow" type="number" min="0" placeholder="1"/></div>
|
||||
<div class="field"><label>TOTP Digits</label><input id="fTotpDigits" type="number" min="6" max="8" placeholder="6"/></div>
|
||||
<div class="field"><label>Allow static password too</label><input id="fAllowStatic" type="checkbox" style="width:16px;height:16px;margin-top:10px;"/></div>
|
||||
<div class="field"><label>Use Linux PAM auth (legacy)</label><input id="fUsePam" type="checkbox" style="width:16px;height:16px;margin-top:10px;"/></div>
|
||||
<div class="field"><label>Max connections</label><input id="fMaxConn" type="number" min="0" placeholder="0 = unlimited"/></div>
|
||||
<div class="field"><label>Expires at</label><input id="fExpires" type="datetime-local"/></div>
|
||||
<div class="field"><label>Max Upload (Mb/s)</label><input id="fUp" type="number" min="0" placeholder="0 = default"/></div>
|
||||
@@ -808,6 +807,7 @@
|
||||
<div class="field"><label>SSH Idle Timeout <span class="hint">0s/off = disabled</span></label><input type="text" id="managedCfgSSHIdleTimeout" placeholder="0s" title="Keep disabled for VPN/XHTTP connections."/></div>
|
||||
<label style="font-size:.73rem;display:flex;align-items:center;gap:5px;cursor:pointer;"><input type="checkbox" id="managedCfgQuiet"/> Quiet Logs</label>
|
||||
<label style="font-size:.73rem;display:flex;align-items:center;gap:5px;cursor:pointer;"><input type="checkbox" id="managedCfgUserCount"/> User Count Display</label>
|
||||
<label style="font-size:.73rem;display:flex;align-items:center;gap:5px;cursor:pointer;" title="Verify SSH logins against the Linux system password (/etc/shadow); regular accounts (UID ≥ 1000) are auto-imported."><input type="checkbox" id="managedCfgPamAuth"/> Linux PAM Login (auto-import)</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1269,6 +1269,9 @@
|
||||
<label style="font-size:.73rem;display:flex;align-items:center;gap:5px;cursor:pointer;">
|
||||
<input type="checkbox" id="cfgUserCount"/> User Count Display
|
||||
</label>
|
||||
<label style="font-size:.73rem;display:flex;align-items:center;gap:5px;cursor:pointer;" title="Verify SSH logins against the Linux system password (/etc/shadow). Regular accounts (UID ≥ 1000) that log in successfully are auto-imported into the panel.">
|
||||
<input type="checkbox" id="cfgPamAuth"/> Linux PAM Login (auto-import)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user