feat: update plugin entry, install script, and docs for API Key auth
- plugin/index.ts: use apiKey instead of challengeUuid - scripts/install.mjs: update prompts and examples - README.md: update config docs and examples
This commit is contained in:
@@ -15,7 +15,7 @@ interface PluginConfig {
|
||||
enabled?: boolean;
|
||||
backendUrl?: string;
|
||||
identifier?: string;
|
||||
challengeUuid?: string;
|
||||
apiKey?: string;
|
||||
reportIntervalSec?: number;
|
||||
httpFallbackIntervalSec?: number;
|
||||
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
||||
@@ -47,10 +47,9 @@ export default function register(api: PluginAPI, config: PluginConfig) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!config.challengeUuid) {
|
||||
logger.error('Missing required config: challengeUuid');
|
||||
logger.error('Please register server in HarborForge Monitor first');
|
||||
return;
|
||||
if (!config.apiKey) {
|
||||
logger.warn('Missing config: apiKey');
|
||||
logger.warn('API authentication will be disabled. Generate apiKey from HarborForge Monitor admin.');
|
||||
}
|
||||
|
||||
const serverPath = join(__dirname, '..', 'server', 'telemetry.mjs');
|
||||
@@ -74,7 +73,7 @@ export default function register(api: PluginAPI, config: PluginConfig) {
|
||||
...process.env,
|
||||
HF_MONITOR_BACKEND_URL: config.backendUrl || 'https://monitor.hangman-lab.top',
|
||||
HF_MONITOR_IDENTIFIER: config.identifier || '',
|
||||
HF_MONITOR_CHALLENGE_UUID: config.challengeUuid,
|
||||
HF_MONITOR_API_KEY: config.apiKey || '',
|
||||
HF_MONITOR_REPORT_INTERVAL: String(config.reportIntervalSec || 30),
|
||||
HF_MONITOR_HTTP_FALLBACK_INTERVAL: String(config.httpFallbackIntervalSec || 60),
|
||||
HF_MONITOR_LOG_LEVEL: config.logLevel || 'info',
|
||||
|
||||
Reference in New Issue
Block a user