From 60ee74c68a7bef2b59e9ef9e5f92507302c349fb Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 17 May 2026 09:53:56 +0200 Subject: [PATCH] proxy-auth: fix check_proxy enforcement and persistence The proxy IP check was never enforced: ServiceProxyAuth read config key 'proxy_check' but the property is registered as 'check_proxy', so the lookup always returned the default empty string and the else-branch set $sProxyRequest = true unconditionally. The BOOL property also had SetEncrypted(), which caused getDecrypted() to call DecryptFromJSON() on a literal bool and fail with "DecryptFromJSON() invalid $data", so the admin UI never reflected the saved value. BOOLs are stored as plain bools in JSON; switch to Get() and drop SetEncrypted() on the property. Co-Authored-By: Claude Opus 4.7 --- plugins/proxy-auth/index.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/proxy-auth/index.php b/plugins/proxy-auth/index.php index ad2fea0f4..d13a37c40 100644 --- a/plugins/proxy-auth/index.php +++ b/plugins/proxy-auth/index.php @@ -6,8 +6,8 @@ class ProxyAuthPlugin extends \RainLoop\Plugins\AbstractPlugin NAME = 'Proxy Auth', AUTHOR = 'Philipp', URL = 'https://www.mundhenk.org/', - VERSION = '0.5', - RELEASE = '2024-09-20', + VERSION = '0.6', + RELEASE = '2026-05-17', REQUIRED = '2.36.1', CATEGORY = 'Login', LICENSE = 'MIT', @@ -84,7 +84,7 @@ class ProxyAuthPlugin extends \RainLoop\Plugins\AbstractPlugin $sMsg = "ProxyIP: " . $sProxyIP; $oLogger->Write($sMsg, $sLevel, $sPrefix); - $sProxyCheck = $this->Config()->getDecrypted('plugin', 'proxy_check', ''); + $sProxyCheck = (bool) $this->Config()->Get('plugin', 'check_proxy', false); $sClientIPs = $this->Manager()->Actions()->Http()->GetClientIP(true); /* make sure that remote user is only set by authorized proxy to avoid security risks */ @@ -192,8 +192,7 @@ class ProxyAuthPlugin extends \RainLoop\Plugins\AbstractPlugin ->SetLabel('Check Proxy') ->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL) ->SetDescription('Activates check if proxy is connecting') - ->SetDefaultValue(true) - ->SetEncrypted(), + ->SetDefaultValue(true), \RainLoop\Plugins\Property::NewInstance('proxy_ip') ->SetLabel('Proxy IPNet') ->SetType(\RainLoop\Enumerations\PluginPropertyType::STRING_TEXT)