From f86dce6ec3b937b080b23aaf2b3887c835ef5226 Mon Sep 17 00:00:00 2001 From: luxick Date: Tue, 6 Jan 2026 21:57:55 +0100 Subject: [PATCH] Remove auth token --- Output.php | 2 -- README | 4 ++++ conf/default.php | 1 - conf/metadata.php | 1 - lang/de/settings.php | 1 - lang/en/settings.php | 1 - script.js | 10 ---------- syntax/open.php | 4 ---- 8 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Output.php b/Output.php index e8b1113..197858b 100644 --- a/Output.php +++ b/Output.php @@ -456,7 +456,6 @@ class Output $syntax = plugin_load('syntax', 'luxtools'); $serviceUrl = $syntax ? trim((string)$syntax->getConf('open_service_url')) : ''; - $serviceToken = $syntax ? trim((string)$syntax->getConf('open_service_token')) : ''; // Prepare a DokuWiki-style link. // Use the same icon mechanism as normal media links (via $link['class']). @@ -479,7 +478,6 @@ class Output $link['more'] .= ' data-path="' . hsc($path) . '"'; if ($conf['relnofollow']) $link['more'] .= ' rel="nofollow"'; if ($serviceUrl !== '') $link['more'] .= ' data-service-url="' . hsc($serviceUrl) . '"'; - if ($serviceToken !== '') $link['more'] .= ' data-service-token="' . hsc($serviceToken) . '"'; $renderer->doc .= $renderer->_formatLink($link); } diff --git a/README b/README index 8735490..a417c0b 100644 --- a/README +++ b/README @@ -15,6 +15,10 @@ Syntax: Please refer to http://www.dokuwiki.org/extensions for additional info on how to install extensions in DokuWiki. +Development deploy helpers: + - Linux/macOS: ./deploy.sh + - Windows (PowerShell + WSL): .\deploy.ps1 + ---- Copyright (C) Gina Häußge, Dokufreaks diff --git a/conf/default.php b/conf/default.php index 0be1507..480d7f9 100644 --- a/conf/default.php +++ b/conf/default.php @@ -18,4 +18,3 @@ $conf['gallery_thumb_scale'] = 1; // Local client service used by {{open>...}}. $conf['open_service_url'] = 'http://127.0.0.1:8765'; -$conf['open_service_token'] = ''; diff --git a/conf/metadata.php b/conf/metadata.php index a2069de..d1d95bf 100644 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -18,4 +18,3 @@ $meta['thumb_placeholder'] = array('string'); $meta['gallery_thumb_scale'] = array('string'); $meta['open_service_url'] = array('string'); -$meta['open_service_token'] = array('string'); diff --git a/lang/de/settings.php b/lang/de/settings.php index 4a6fbc1..a27b5c0 100644 --- a/lang/de/settings.php +++ b/lang/de/settings.php @@ -7,4 +7,3 @@ $lang['thumb_placeholder'] = 'MediaManager-ID für den Platzhalter der Galerie-T $lang['gallery_thumb_scale'] = 'Skalierungsfaktor für Galerie-Thumbnails. 2 erzeugt schärfere Thumbnails auf HiDPI-Displays (Anzeige bleibt 150×150).'; $lang['open_service_url'] = 'URL des lokalen Client-Dienstes für {{open>...}} (z.B. http://127.0.0.1:8765).'; -$lang['open_service_token'] = 'Token für den lokalen Client-Dienst (X-Luxtools-Token).'; diff --git a/lang/en/settings.php b/lang/en/settings.php index 4e9b18c..3206f46 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -9,4 +9,3 @@ $lang['thumb_placeholder'] = 'MediaManager ID for the gallery thumbnail placehol $lang['gallery_thumb_scale'] = 'Gallery thumbnail scale factor. Use 2 for sharper thumbnails on HiDPI screens (still displayed as 150×150).'; $lang['open_service_url'] = 'Local client service URL for the {{open>...}} button (e.g. http://127.0.0.1:8765).'; -$lang['open_service_token'] = 'Token sent to the local client service (X-Luxtools-Token).'; diff --git a/script.js b/script.js index 0e8526d..5ed346b 100644 --- a/script.js +++ b/script.js @@ -51,18 +51,10 @@ return url.replace(/\/+$/, ''); } - function getServiceToken(el) { - var token = el.getAttribute('data-service-token') || ''; - return (token || '').trim(); - } - function pingOpenViaImage(el, rawPath) { var baseUrl = getServiceUrl(el); if (!baseUrl) return; - - var token = getServiceToken(el); var url = baseUrl + '/open?path=' + encodeURIComponent(rawPath); - if (token) url += '&token=' + encodeURIComponent(token); // Fire-and-forget without CORS. try { @@ -80,8 +72,6 @@ var headers = { 'Content-Type': 'application/json' }; - var token = getServiceToken(el); - if (token) headers['X-Luxtools-Token'] = token; return window.fetch(baseUrl + '/open', { method: 'POST', diff --git a/syntax/open.php b/syntax/open.php index 9747a00..8c94df0 100644 --- a/syntax/open.php +++ b/syntax/open.php @@ -74,16 +74,12 @@ class syntax_plugin_luxtools_open extends SyntaxPlugin } $serviceUrl = trim((string)$this->getConf('open_service_url')); - $serviceToken = trim((string)$this->getConf('open_service_token')); $attrs = ' type="button" class="luxtools-open"' . ' data-path="' . hsc($path) . '"'; if ($serviceUrl !== '') { $attrs .= ' data-service-url="' . hsc($serviceUrl) . '"'; } - if ($serviceToken !== '') { - $attrs .= ' data-service-token="' . hsc($serviceToken) . '"'; - } $renderer->doc .= '' . hsc($caption) . ''; return true;