Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Discourse
  3. All client IPs logged as 172.18.0.1 (IP tracking issue)

All client IPs logged as 172.18.0.1 (IP tracking issue)

Scheduled Pinned Locked Moved Discourse
2 Posts 2 Posters 78 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    J
    JNZP
    wrote last edited by
    #1

    AI improved debugging and text, so please read it with a pinch of salt.

    Hello Cloudron team and community,

    I've noticed a recurring issue with the official Discourse app package on Cloudron regarding client IP handling.

    The Issue:
    Every single web request and API poll in Discourse is logged with the internal Docker proxy/gateway IP (172.18.0.1) instead of the actual client IP address:

    172.18.0.1 - - [24/Oct/2026:21:55:38 +0000] "GET /admin/users/... HTTP/1.1" 200 ...
    

    Why this happens:
    Ruby on Rails uses ActionDispatch::RemoteIp to inspect the X-Forwarded-For header. By default, Rails discards this header for security reasons unless the sending proxy IP is explicitly defined in Rails' trusted_proxies configuration. Because Cloudron routes traffic through the internal Docker network (172.16.0.0/12), Rails doesn't trust it out-of-the-box and falls back to 172.18.0.1.

    The Impact:

    • All users appear to share the exact same IP address in the admin panel.
    • GeoIP lookups and IP-based security features in Discourse are completely broken.

    Proposed Solution:
    Could the Cloudron Discourse package be updated to officially include the internal Docker network in Rails' trusted_proxies configuration? (e.g., via a permanent initializer or environment handling):

    require "ipaddr"
    Rails.application.config.action_dispatch.trusted_proxies = [
      IPAddr.new("127.0.0.1"), 
      IPAddr.new("::1"), 
      IPAddr.new("172.16.0.0/12")
    ]
    

    Since manual file modifications inside /app/code/config/initializers/ are completely wiped out during app updates, having this built into the official Cloudron package would permanently solve this headache.

    Thanks for your amazing work on Cloudron! Looking forward to your feedback.

    1 Reply Last reply
    1
    • jamesJ
      jamesJ
      james
      Staff
      wrote last edited by
      #2

      Hello @jnzp
      Thanks for reporting. This should be fixed the latest update.
      Please update your @discourse app and report back if the issue is resolved.

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Bookmarks
      • Search