feat: require password for admin init and auto-configure plugin path

- pass_mgr admin init now requires --key-path parameter
- Password must be at least 6 characters long
- Install script now updates OpenClaw plugins.load.paths config
- Falls back to manual instructions if config file not found
This commit is contained in:
zhi
2026-03-05 10:51:51 +00:00
parent 5084cfecb8
commit 84c9df633a
2 changed files with 55 additions and 15 deletions

View File

@@ -455,6 +455,44 @@ async function configure(env) {
log('\n Add the following to your shell profile:', 'yellow');
log(` source ${envFile}`, 'cyan');
// Update OpenClaw plugins.load.paths configuration
log('\n Updating OpenClaw plugin configuration...', 'blue');
const openclawConfigPath = join(env.openclawDir || homedir(), '.openclaw', 'config.json');
if (existsSync(openclawConfigPath)) {
try {
const configContent = readFileSync(openclawConfigPath, 'utf8');
const config = JSON.parse(configContent);
// Ensure plugins.load.paths exists
if (!config.plugins) {
config.plugins = {};
}
if (!config.plugins.load) {
config.plugins.load = {};
}
if (!config.plugins.load.paths) {
config.plugins.load.paths = [];
}
// Add paddedcell skills path if not already present
const skillsPath = join(env.openclawDir || homedir(), '.openclaw', 'skills', 'paddedcell');
if (!config.plugins.load.paths.includes(skillsPath)) {
config.plugins.load.paths.push(skillsPath);
writeFileSync(openclawConfigPath, JSON.stringify(config, null, 2));
logSuccess(`Added plugin path to OpenClaw config: ${skillsPath}`);
} else {
log(' Plugin path already in OpenClaw config', 'green');
}
} catch (err) {
logWarning(`Failed to update OpenClaw config: ${err.message}`);
}
} else {
logWarning(`OpenClaw config not found at ${openclawConfigPath}`);
log(' Please manually add the following to your OpenClaw config:', 'yellow');
log(` plugins.load.paths: ["${join(env.openclawDir || homedir(), '.openclaw', 'skills', 'paddedcell')}"]`, 'cyan');
}
}
// ============================================================================