#1616 Recovery script in Docker container (#1726)

This commit is contained in:
Manuel
2023-12-04 13:06:14 +01:00
committed by GitHub
parent cca8be09cb
commit fc38f7ab29
7 changed files with 1531 additions and 0 deletions

30
cli/cli.js Normal file
View File

@@ -0,0 +1,30 @@
import yargs from 'yargs';
import { resetPasswordForOwner } from './commands/reset-owner-password.js';
import { resetPasswordForUsername } from './commands/reset-password.js';
yargs(process.argv.slice(2))
.scriptName('homarr')
.usage('$0 <cmd> [args]')
.command('reset-owner-password', 'Resets the current owner password without UI access', async () => {
await resetPasswordForOwner();
})
.command(
'reset-password',
'Reset the password of a specific user without UI access',
(yargs) => {
yargs.option('username', {
type: 'string',
describe: 'Username of user',
demandOption: true
});
},
async (argv) => {
await resetPasswordForUsername(argv.username);
}
)
.version(false)
.showHelpOnFail(true)
.alias('h', 'help')
.demandCommand()
.help().argv;