Merge 59362b7477cfe998986473a7c2e2fa9583057be4 into 3f3aacd7ec757f8888c97e258fb99c6bc74860b4

This commit is contained in:
Palguno Wicaksono 2025-01-28 09:44:14 +03:00 committed by GitHub
commit 8b8081643b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -508,8 +508,13 @@ const internalAccessList = {
if (typeof item.password !== 'undefined' && item.password.length) { if (typeof item.password !== 'undefined' && item.password.length) {
logger.info('Adding: ' + item.username); logger.info('Adding: ' + item.username);
utils.execFile('/usr/bin/htpasswd', ['-b', htpasswd_file, item.username, item.password]) utils.execFile('openssl', ['passwd', '-apr1', item.password])
.then((/*result*/) => { .then((res) => {
try {
fs.appendFileSync(htpasswd_file, item.username + ':' + res + '\n', {encoding: 'utf8'});
} catch (err) {
reject(err);
}
next(); next();
}) })
.catch((err) => { .catch((err) => {