diff --git a/js/ui.js b/js/ui.js index 2c41a57..f0ffa1f 100644 --- a/js/ui.js +++ b/js/ui.js @@ -539,6 +539,7 @@ function _renderJobConfigFields(key, cfg) { `; if (key === 'patchmon_sync' || key === 'semaphore_sync') { const label = key === 'semaphore_sync' ? 'API Token (Bearer)' : 'API Token (Basic)'; + const tokenPlaceholder = key === 'patchmon_sync' ? 'token_key:token_secret' : ''; return `
@@ -548,6 +549,7 @@ function _renderJobConfigFields(key, cfg) {
`; } diff --git a/js/version.js b/js/version.js index 2b45f39..43c9ed9 100644 --- a/js/version.js +++ b/js/version.js @@ -1 +1 @@ -const VERSION = "1.5.0"; +const VERSION = "1.7.1"; diff --git a/package.json b/package.json index 3fea80c..712dabe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "catalyst", - "version": "1.7.0", + "version": "1.7.1", "type": "module", "scripts": { "start": "node server/server.js", diff --git a/server/jobs.js b/server/jobs.js index dc61d1f..160bea3 100644 --- a/server/jobs.js +++ b/server/jobs.js @@ -41,8 +41,14 @@ async function patchmonSyncHandler(cfg) { const { api_url, api_token } = cfg; if (!api_url || !api_token) throw new Error('Patchmon not configured — set API URL and token'); + // Accept raw "key:secret" (recommended) or a pre-encoded base64 string. + // ":" cannot appear in a valid base64 string, so it's a reliable discriminator. + const credential = api_token.includes(':') + ? Buffer.from(api_token).toString('base64') + : api_token; + const res = await fetch(api_url, { - headers: { Authorization: `Basic ${api_token}` }, + headers: { Authorization: `Basic ${credential}` }, }); if (!res.ok) throw new Error(`Patchmon API ${res.status}`);