2 months later

Is incompatible with Flarum 1.0.2

  • Root composer.json requires fof/ban-ips 0.4.0 -> satisfiable by fof/ban-ips[0.4.0].
  • fof/ban-ips 0.4.0 requires flarum/core 0.1.0-beta.15 -> found flarum/core[v0.1.0-beta.15, v0.1.0-beta.16] but it does not match your minimum-stability.
13 days later

1.0.0

  • Flarum 1.0 compatibility
  • Improve incoming IP address detection
Installation
composer require fof/ban-ips:"*"
php flarum cache:clear
    19 days later

    IanM

    This Ban button is not working .... it is not doing anything

    19 days later

    With help of auto moderation extension can we set to ban IP upon 3 failed login attempts?

      • [deleted]

      Hari Yes, that should work.

      2 months later

      The following error happened on one FreeFlarum forum:

      flarum.ERROR: RuntimeException: Route login not found in /app/vendor/flarum/core/src/Http/RouteCollection.php:159
      Stack trace:
      #0 /app/vendor/fof/ban-ips/src/Middleware/RegisterMiddleware.php(59): Flarum\Http\RouteCollection->getPath()
      #1 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): FoF\BanIPs\Middleware\RegisterMiddleware->process()
      #2 /app/vendor/kilowhat/flarum-ext-audit-free/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
      #3 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
      #4 /app/vendor/malago/flarum-achievements/src/Middlewares/MiddlewarePosted.php(27): Laminas\Stratigility\Next->handle()
      #5 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Malago\Achievements\Middlewares\MiddlewarePosted->process()
      #6 /app/vendor/fof/terms/src/Middlewares/RegisterMiddleware.php(48): Laminas\Stratigility\Next->handle()
      #7 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): FoF\Terms\Middlewares\RegisterMiddleware->process()
      #8 /app/vendor/fof/oauth/src/Middleware/ErrorHandler.php(50): Laminas\Stratigility\Next->handle()
      #9 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): FoF\OAuth\Middleware\ErrorHandler->process()
      #10 /app/vendor/flarum/core/src/Http/Middleware/ContentTypeOptionsHeader.php(21): Laminas\Stratigility\Next->handle()
      #11 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ContentTypeOptionsHeader->process()
      #12 /app/vendor/flarum/core/src/Http/Middleware/ReferrerPolicyHeader.php(30): Laminas\Stratigility\Next->handle()
      #13 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ReferrerPolicyHeader->process()
      #14 /app/vendor/flarum/core/src/Http/Middleware/FlarumPromotionHeader.php(30): Laminas\Stratigility\Next->handle()
      #15 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\FlarumPromotionHeader->process()
      #16 /app/vendor/flarum/core/src/Http/Middleware/ShareErrorsFromSession.php(57): Laminas\Stratigility\Next->handle()
      #17 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ShareErrorsFromSession->process()
      #18 /app/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(36): Laminas\Stratigility\Next->handle()
      #19 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process()
      #20 /app/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()#21 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process()
      #22 /app/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
      #23 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process()
      #24 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
      #25 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process()
      #26 /app/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
      #27 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process()
      #28 /app/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()#29 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process()
      #30 /app/vendor/flarum/core/src/Http/Middleware/CollectGarbage.php(46): Laminas\Stratigility\Next->handle()
      #31 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CollectGarbage->process()
      #32 /app/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
      #33 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process()
      #34 /app/vendor/migratetoflarum/canonical/src/Middlewares/CanonicalRedirectMiddleware.php(49): Laminas\Stratigility\Next->handle()
      #35 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): MigrateToFlarum\Canonical\Middlewares\CanonicalRedirectMiddleware->process()
      #36 /app/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()#37 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process()
      #38 /app/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
      #39 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process()
      #40 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
      #41 /app/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
      #42 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process()
      #43 /app/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
      #44 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process()
      #45 /app/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
      #46 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process()
      #47 /app/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
      #48 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process()
      #49 /app/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
      #50 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process()
      #51 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
      #52 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process()
      #53 /app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
      #54 /app/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
      #55 /app/public/index.php(22): Flarum\Http\Server->listen()
      #56 {main}

      It makes the website inaccessible ("An error occurred while trying to load this page."). Here's Flarum info:

      Flarum core 1.0.4
      PHP version: 8.0.9
      Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, intl, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, Zend OPcache
      +---------------------------------------+---------+--------+
      | Flarum Extensions                     |         |        |
      +---------------------------------------+---------+--------+
      | ID                                    | Version | Commit |
      +---------------------------------------+---------+--------+
      | flarum-flags                          | v1.0.0  |        |
      | flarum-tags                           | v1.0.3  |        |
      | flarum-suspend                        | v1.0.0  |        |
      | flarum-nicknames                      | v1.0.0  |        |
      | flarum-likes                          | v1.0.0  |        |
      | flarum-sticky                         | v1.0.0  |        |
      | flarum-markdown                       | v1.0.1  |        |
      | flarum-lock                           | v1.0.0  |        |
      | flarum-approval                       | v1.0.0  |        |
      | askvortsov-categories                 | v3.0.4  |        |
      | askvortsov-moderator-warnings         | v0.6.1  |        |
      | fof-terms                             | 1.0.0   |        |
      | clarkwinkelmann-bookmarks             | 1.0.0   |        |
      | dem13n-discussion-cards               | 0.3.8   |        |
      | fof-best-answer                       | 1.0.1   |        |
      | fof-drafts                            | 1.0.3   |        |
      | fof-impersonate                       | 1.0.0   |        |
      | fof-profile-image-crop                | 1.0.0   |        |
      | fof-user-bio                          | 1.0.0   |        |
      | fof-username-request                  | 1.0.0   |        |
      | katosdev-signature                    | 1.1.3   |        |
      | kyrne-whisper                         | 0.1.3   |        |
      | nearata-no-self-likes                 | v1.2.0  |        |
      | sycho-move-posts                      | v0.1.5  |        |
      | the-turk-stickiest                    | 2.0.3   |        |
      | malago-achievements                   | 0.5.0   |        |
      | fof-oauth                             | 1.0.2   |        |
      | antoinefr-online                      | v1.0.1  |        |
      | clarkwinkelmann-shadow-ban            | 1.0.2   |        |
      | v17development-third-party-login-only | v0.1.1  |        |
      | v17development-user-badges            | v0.2.1  |        |
      | acpl-mobile-tab                       | 1.0.5   |        |
      | flarum-bbcode                         | v1.0.0  |        |
      | flarum-emoji                          | v1.0.0  |        |
      | flarum-lang-english                   | v1.0.0  |        |
      | flarum-mentions                       | v1.0.0  |        |
      | flarum-statistics                     | v1.0.0  |        |
      | flarum-subscriptions                  | v1.0.0  |        |
      | fof-sitemap                           | 1.0.2   |        |
      | migratetoflarum-canonical             | 1.0.0   |        |
      | serakoi-flarumdiscordtheme            | 0.1.0   |        |
      | justoverclock-username-blacklist      | 0.1.0   |        |
      | sycho-advanced-extension-categories   | v0.1.3  |        |
      | therealsujitk-gifs                    | v4.1.1  |        |
      | sycho-profile-cover                   | v1.3.0  |        |
      | michaelbelgium-discussion-views       | v7.1.1  |        |
      | kilowhat-audit-free                   | 1.4.2   |        |
      | fof-user-directory                    | 1.0.2   |        |
      | fof-upload                            | 1.0.5   |        |
      | fof-reactions                         | 1.0.2   |        |
      | fof-polls                             | 1.0.3   |        |
      | fof-nightmode                         | 1.0.0   |        |
      | fof-filter                            | 1.0.2   |        |
      | fof-doorman                           | 1.0.0   |        |
      | clarkwinkelmann-emojionearea          | 1.0.0   |        |
      | clarkwinkelmann-author-change         | 1.0.1   |        |
      | askvortsov-discussion-templates       | v0.8.1  |        |
      | ralkage-hcaptcha                      | 1.0.0   |        |
      | afrux-forum-widgets-core              | v0.1.5  |        |
      | fof-ban-ips                           | 1.0.0   |        |
      +---------------------------------------+---------+--------+

      Error lines:

      Disabling FoF Ban IPs makes the error disappear. That's all that we know. Thanks

      Edit: it likely happens when v17development-third-party-login-only is enabled, as that extension removes the login route somehow, which conflicts with extensions that try to access that route

        SKevo that's odd because login is a named route that's supposed to always exist, and since it's registered in core an eventual early resolution of any binding shouldn't cause it to be skipped https://github.com/flarum/core/blob/v1.0.4/src/Forum/routes.php#L54

        Maybe one of the other extension removes that routes, or alters it by removing and re-adding it. Though I don't know of any extension that does that, and I don't see any obvious extension that could be of conflict in the info output, though there are multiple extensions that interact with login/signup, so maybe the issue happens when one of these is enabled together.

        11 days later

        When I want to ban a user's IP address, it is not banned. I don't see any logs in the error logs. There is an error in the browser console:

        Flarum: 1.0.4
        PHP: 7.4.14
        MySQL: 10.3.31-MariaDB-0ubuntu0.20.04.1

          4 months later

          mekici

          Fait

          Doesn't work anymore. Loads forever if ban all user IPs and if only one IP it won't enter the IP to the table.

            1.0.1

            Requires Flarum v1.2.0

            • Fix issue clicking "Ban" from user controls

            m4v3rick Are there any JS errors in the developer console regarding either of the issues you've mentioned? Could you elaborate on both as well?

              datitisev

              "Only ban current IP" says "No one else will be banned" and now worked after updating it (it won't work if no reason added, with reason it works).
              No error in dev tools and no errors inside the flarum logs.

              "Ban all IPs by USER"
              show this error:

              mount-redraw.js:15 
                  TypeError: app.translator.transChoice is not a function
                  at n.a.content (BanIPModal.js:83:46)
                  at n.view (Modal.tsx:110:19)
                  at Function.a (render.js:30:16)
                  at render.js:482:45
                  at p (render.js:419:9)
                  at f (render.js:315:21)
                  at render.js:477:5
                  at p (render.js:416:15)
                  at render.js:488:9
                  at p (render.js:419:9)

              Loads forever.

                datitisev

                One more thing:
                Entering it manually in the backend doesn't work either.

                TypeError: app.translator.transChoice is not a function
                    at n.a.content (BanIPModal.js:58:46)
                    at n.view (Modal.tsx:110:19)
                    at Function.s (render.js:30:16)
                    at render.js:482:45
                    at p (render.js:419:9)
                    at h (render.js:315:21)
                    at render.js:477:5
                    at p (render.js:416:15)
                    at render.js:488:9
                    at p (render.js:419:9)
                s @ mount-redraw.js:15
                mount-redraw.js:15 
                        
                       TypeError: app.translator.transChoice is not a function
                    at n.a.content (BanIPModal.js:58:46)
                    at n.view (Modal.tsx:110:19)
                    at Function.s (render.js:30:16)
                    at render.js:482:45
                    at p (render.js:419:9)
                    at h (render.js:315:21)
                    at render.js:477:5
                    at p (render.js:416:15)
                    at render.js:488:9
                    at p (render.js:419:9)

                1.0.2

                • Fix error when displaying users that will also be banned (m4v3rick)
                  • Issue would not occur if no other users would be banned

                **Requires language packs to update the translation for fof-ban-ips.lib.modal.unban_ip_users and fof-ban-ips.lib.modal.ban_ip_users:

                -ban_ip_users: User {users} will be banned|Users {users} will be banned
                +ban_ip_users: "{count, plural, one {User {users} will be banned}, other {Users {users} will be banned}}"
                4 months later

                Is there any way to ban IP ranges or use wildcards? If I try 173.34.2.* it says, "Please match the requested format."

                Is there a specific format I need to use for this to work? Thanks