[Andrew] Moderator Panel

[Andrew] Moderator Panel 2.0.9

No permission to download
Getting quite some errors lately:
Code:
GuzzleHttp\Exception\ServerException: Server error: `GET https://freeipapi.com/api/json/10.0.0.47` resulted in a `502 Bad Gateway` response: error code: 502 
src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

Stack Trace
#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(72): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)
#1 src/vendor/guzzlehttp/promises/src/Promise.php(209): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(52): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/promises/src/Promise.php(251): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/vendor/guzzlehttp/promises/src/Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Promise\Promise->wait()
#10 src/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://freeipa...', Array)
#11 src/addons/Andrew/ModeratorPanel/XF/Repository/User.php(69): GuzzleHttp\Client->get('https://freeipa...', Array)
#12 src/addons/Andrew/ModeratorPanel/XF/Service/User/Tfa.php(22): Andrew\ModeratorPanel\XF\Repository\User->getIpCountry('10.0.0.47')
#13 src/XF/ControllerPlugin/LoginPlugin.php(135): Andrew\ModeratorPanel\XF\Service\User\Tfa->verify(Object(XF\Http\Request), 'totp')
#14 src/XF/Admin/Controller/LoginController.php(122): XF\ControllerPlugin\LoginPlugin->runTfaCheck('https://forum.d...')
#15 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\LoginController->actionTwoStep(Object(XF\Mvc\ParameterBag))
#16 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Login', 'TwoStep', Object(XF\Mvc\RouteMatch), Object(SV\SignupAbuseBlocking\XF\Admin\Controller\Login), NULL)
#17 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SignupAbuseBlocking\XF\Admin\Controller\Login), NULL)
#18 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#19 src/XF/App.php(2813): XF\Mvc\Dispatcher->run()
#20 src/XF.php(802): XF\App->run()
#21 admin.php(15): XF::runApp('XF\\Admin\\App')
#22 {main}
 
Getting quite some errors lately:
Code:
GuzzleHttp\Exception\ServerException: Server error: `GET https://freeipapi.com/api/json/10.0.0.47` resulted in a `502 Bad Gateway` response: error code: 502
src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

Stack Trace
#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(72): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)
#1 src/vendor/guzzlehttp/promises/src/Promise.php(209): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(52): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/promises/src/Promise.php(251): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/vendor/guzzlehttp/promises/src/Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Promise\Promise->wait()
#10 src/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://freeipa...', Array)
#11 src/addons/Andrew/ModeratorPanel/XF/Repository/User.php(69): GuzzleHttp\Client->get('https://freeipa...', Array)
#12 src/addons/Andrew/ModeratorPanel/XF/Service/User/Tfa.php(22): Andrew\ModeratorPanel\XF\Repository\User->getIpCountry('10.0.0.47')
#13 src/XF/ControllerPlugin/LoginPlugin.php(135): Andrew\ModeratorPanel\XF\Service\User\Tfa->verify(Object(XF\Http\Request), 'totp')
#14 src/XF/Admin/Controller/LoginController.php(122): XF\ControllerPlugin\LoginPlugin->runTfaCheck('https://forum.d...')
#15 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\LoginController->actionTwoStep(Object(XF\Mvc\ParameterBag))
#16 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Login', 'TwoStep', Object(XF\Mvc\RouteMatch), Object(SV\SignupAbuseBlocking\XF\Admin\Controller\Login), NULL)
#17 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SignupAbuseBlocking\XF\Admin\Controller\Login), NULL)
#18 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#19 src/XF/App.php(2813): XF\Mvc\Dispatcher->run()
#20 src/XF.php(802): XF\App->run()
#21 admin.php(15): XF::runApp('XF\\Admin\\App')
#22 {main}

Do you use litespeed by any chance?
 
Getting quite some errors lately:
Code:
GuzzleHttp\Exception\ServerException: Server error: `GET https://freeipapi.com/api/json/10.0.0.47` resulted in a `502 Bad Gateway` response: error code: 502
src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

Stack Trace
#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(72): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)
#1 src/vendor/guzzlehttp/promises/src/Promise.php(209): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(52): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/promises/src/Promise.php(251): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/vendor/guzzlehttp/promises/src/Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Promise\Promise->wait()
#10 src/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://freeipa...', Array)
#11 src/addons/Andrew/ModeratorPanel/XF/Repository/User.php(69): GuzzleHttp\Client->get('https://freeipa...', Array)
#12 src/addons/Andrew/ModeratorPanel/XF/Service/User/Tfa.php(22): Andrew\ModeratorPanel\XF\Repository\User->getIpCountry('10.0.0.47')
#13 src/XF/ControllerPlugin/LoginPlugin.php(135): Andrew\ModeratorPanel\XF\Service\User\Tfa->verify(Object(XF\Http\Request), 'totp')
#14 src/XF/Admin/Controller/LoginController.php(122): XF\ControllerPlugin\LoginPlugin->runTfaCheck('https://forum.d...')
#15 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\LoginController->actionTwoStep(Object(XF\Mvc\ParameterBag))
#16 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Login', 'TwoStep', Object(XF\Mvc\RouteMatch), Object(SV\SignupAbuseBlocking\XF\Admin\Controller\Login), NULL)
#17 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SignupAbuseBlocking\XF\Admin\Controller\Login), NULL)
#18 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#19 src/XF/App.php(2813): XF\Mvc\Dispatcher->run()
#20 src/XF.php(802): XF\App->run()
#21 admin.php(15): XF::runApp('XF\\Admin\\App')
#22 {main}
Can you explain the context in which this IP was used? I see this is private IP address. Was this operating in a dev environment? The issue appears to be an issue with the API being available at that time.

Are you still getting these errors?
 
Yeah, this error was from my internal test server, hence the internal ip.

But I switched to a couple of different geoip providers and went back to the default because all the others are paid services
So far only one error.
 
Are these yours? I have been getting dozens of these for the past couple days. I'm guessing maybe the host server is a bit overwhelmed?

I do use litespeed but no recent changes.
I had issues a lot with the latest litespeed build, so i reverted to the previous and a lot of errors went away.
 
No bad gateway errors for the past 14 hrs. I'll keep an eye on it and check with my ISP to see if anything was changed recently.

Thanks
 
The API appears to be working. I am not sure if it was when the error appeared or if you have a server issue.
I'll keep an eye on it and check with my ISP to see if anything was changed recently.
I saw the same error as well one or two times with MP 2. No Litespeed or any other fancy stuff. So I guess it is the API that stops responding in a timely manner from time to time or MP itself.
 
I had 3 more of them overnight. Maybe it is some kind of botnet triggering more than the limit on the site of 60 requests per minute or something.
 
It would be great if mods could watch user notes to be informed by alert when there is a new one.

Or

If maybe mentions in user notes alerted users.
 
Another thing I noticed on Recent logins:
If no IP Lookup API is configured, columns Login country and Register country are always empty and the filters (obviously) do not work.

It therefore might make sense to hide those elements if no API is enabled (for privacy reasons).

It would also be nice if there was support for Cloudflare (header CF-IPCountry), ideally you could support arbitrary headers so this would also work for werbserver modules.
 
Improvement Sugestion

Template andrew_moderatorpanel_macros

Code:
<li class="noteUser">
    <xf:if is="$showTargetUser AND $user_note.user_id != $user_note.note_user_id">
        <xf:username user="$user_note.User" rich="true" defaultname="{$user_note.User.username}" aria-hidden="true" />
        <xf:fa icon="{{ $xf.isRtl ? 'fa-caret-left' : 'fa-caret-right' }} u-muted" />
        <xf:username user="$user_note.User" rich="true" defaultname="{{ phrase('unknown') }}" aria-hidden="true" />

        <xf:else />
        <xf:username user="$user_note.User" rich="true" defaultname="{$user_note.username}" />
    </xf:if>
</li>
<li>
    {{ phrase('andrew_moderatorpanel_entered_note_on') }}   
</li>
<li class="noteUser">
    <xf:username user="$user_note.NoteUser" rich="true" defaultname="{$user_note.NoteUser.username}" aria-hidden="true" />
</li>
<li>
    <xf:date time="$user_note.create_date" />
</li>

In the output this looks like a sentence:
1728634704174.webp

As the sentence is build from various parts in the HTML, the structure is pretty much hardcoded - thats makes it difficult to properly translate this into other languages which might need a somewhat different sentence structure.

Could this be changed so the whole sentence is a phrase?

This would make translations a lot easier :)
 
Bug / Feature Wish
If a moderator has permission Search custom fields they can search any custom field - including those that are not visible on message info, not visible on member profile and not editable by moderators.

IMHO this is not ideal as there might be fields that moderators should not be able to see / search.

So such fields should either be excluded entirely or searching them should be guarded by a permission.
 
Last edited:
Back
Top Bottom