fix: admpass.sh hang, OLS httpd_config structure, listener maps
Three fixes:
1. Replace admpass.sh calls with direct htpasswd writes — the script
is interactive-only (no --password flag) and hangs forever in
automation. Write admin htpasswd directly with openssl passwd.
2. Fix httpd_config.conf template — OLS requires virtualHost {} blocks
with vhRoot/configFile, not bare include of vhconf.conf files.
Add proper _backend virtualHost block, map it to Backend listener,
use self-signed cert for Secure listener until real certs exist.
3. Fix addOLSListenerMap to only add maps to Default and Secure
listeners (not Backend which is reserved for the admin panel).
4. Fix default PHP detection to read from wo.conf config instead
of picking first installed version (which would prefer php74).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -93,13 +93,27 @@ class WOSecureController(CementBaseController):
|
||||
pargs.user_pass = password
|
||||
if password == "":
|
||||
pargs.user_pass = passwd
|
||||
# Set OLS admin password using admpass.sh
|
||||
# Set OLS admin + backend password directly
|
||||
# (admpass.sh is interactive-only and hangs in automation)
|
||||
WOShellExec.cmd_exec(
|
||||
self, "/usr/local/lsws/admin/misc/admpass.sh "
|
||||
"{username} {password}"
|
||||
self, "printf \"{username}:"
|
||||
"$(openssl passwd -apr1 '{password}' "
|
||||
"2>/dev/null)\n\" "
|
||||
"> /usr/local/lsws/admin/conf/htpasswd "
|
||||
"2>/dev/null"
|
||||
.format(username=pargs.user_input,
|
||||
password=pargs.user_pass),
|
||||
log=False)
|
||||
WOShellExec.cmd_exec(
|
||||
self, "printf \"{username}:"
|
||||
"$(openssl passwd -apr1 '{password}' "
|
||||
"2>/dev/null)\n\" "
|
||||
"> {conf}/htpasswd-wo "
|
||||
"2>/dev/null"
|
||||
.format(username=pargs.user_input,
|
||||
password=pargs.user_pass,
|
||||
conf=WOVar.wo_ols_conf_dir),
|
||||
log=False)
|
||||
WOGit.add(self, [WOVar.wo_ols_conf_dir],
|
||||
msg="Adding changed secure auth into Git")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user