Skip to content

Commit dc9d884

Browse files
authored
Merge pull request #4292 from icaksh/patch-1
feat: change htpasswd to openssl
2 parents 0d5d2b1 + 59362b7 commit dc9d884

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

backend/internal/access-list.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,13 @@ const internalAccessList = {
508508
if (typeof item.password !== 'undefined' && item.password.length) {
509509
logger.info('Adding: ' + item.username);
510510

511-
utils.execFile('/usr/bin/htpasswd', ['-b', htpasswd_file, item.username, item.password])
512-
.then((/*result*/) => {
511+
utils.execFile('openssl', ['passwd', '-apr1', item.password])
512+
.then((res) => {
513+
try {
514+
fs.appendFileSync(htpasswd_file, item.username + ':' + res + '\n', {encoding: 'utf8'});
515+
} catch (err) {
516+
reject(err);
517+
}
513518
next();
514519
})
515520
.catch((err) => {

0 commit comments

Comments
 (0)