Repository navigation
Conversation
mrenvoize
left a comment
There was a problem hiding this comment.
Requesting changes; the docs should not steer people into an insecure setup.
bugzilla.pl:17defaultsMOJO_LISTENto all interfaces, and the docs addMOJO_REVERSE_PROXY=1without telling the reader to bind to loopback. Mojo then trusts the lastX-Forwarded-Forvalue (Transaction.pm:36-43), andremote_ipfeeds API-key IP checks, cookie IP binding, rate limits andBlockIP. Direct access to the backend port would allow spoofing (inferred from reading, not tested). Please bind to127.0.0.1in the examples and say why.- Links are built from
urlbase, notX-Forwarded-Proto, soapache.rst:52-54is misleading. AlsoHostage.pm:57-68returns 500 unlessurlbase/inbound_proxiesare set; neither is mentioned. - The
:443vhost snippet is incomplete (no SSL directives, no ProxyPass). multiple-bugzilla.rst(in #191) has the same bind-address issue.
…inbound_proxies Address review feedback on the reverse proxy docs. Start the backend with MOJO_LISTEN on 127.0.0.1 in the Apache, Nginx and Caddy pages instead of PORT, which listens on all interfaces. With MOJO_REVERSE_PROXY=1 the app trusts forwarding headers from whatever connects to it, so the backend port must not be reachable from other hosts. Correct the X-Forwarded-Proto wording: it tells Bugzilla a request arrived over HTTPS, while most links come from urlbase. Complete the Apache 443 virtual host with SSL directives and ProxyPass, and add a port 80 redirect. Add a "Settings for a proxied Bugzilla" section to the web server page covering urlbase, inbound_proxies, and the 500 "Reverse Proxy is Misconfigured" response, and point the stale inbound_proxies entry in parameters.rst at it.
|
Thanks Martin. Addressed in c2b65a8:
2a. X-Forwarded-Proto: reworded in apache.rst and the matching sentence in nginx.rst. The header tells Bugzilla the request arrived over HTTPS; most links come from urlbase. 2b. urlbase and inbound_proxies: added a "Settings for a proxied Bugzilla" section to web_server.rst, linked from all three proxy pages. Reading Hostage.pm, the 500 fires when urlbase is https, inbound_proxies is set, and the request is not seen as HTTPS. With inbound_proxies empty the check is skipped, so the section documents both cases. Both settings live in localconfig now, so I also replaced the stale inbound_proxies entry in parameters.rst with a pointer to the new section.
Noticed while checking the code, not changed here: the remote_ip() POD in Bugzilla/Util.pm, setup/strings.txt.pl and the 3.x release notes template still describe inbound_proxies as controlling X-Forwarded-For trust, and essential-post-install-config.rst and moving.rst still call urlbase an admin parameter. I left those out to keep this PR to the proxy pages. |
Part 1 of Bug 1849943 (docs still based on BMO instead of Harmony).
What
installing/apache.rst: replaces the TODO stub with reverse proxy instructions. Covers enabling mod_proxy/mod_proxy_http/mod_headers, a virtual host example, Debian/Ubuntu and Fedora/Red Hat paths, and theX-Forwarded-Protoheader for TLS termination.installing/nginx.rst: new file.web_server.rstalready listednginxin its toctree but the page didn't exist, which caused a Sphinx build warning.Both pages match the existing Caddy page: proxy to
127.0.0.1:3001, and run the app withMOJO_REVERSE_PROXY=1.Notes
bugzilla.pl(MOJO_LISTENdefault). Both pages mention thePORToverride.httpd.conf.client_max_body_size. Nginx defaults to 1 MB, which would silently block larger attachment uploads.Testing
Built locally with the pinned versions in
docs/requirements.txt(full rebuild,sphinx-build -E). Both pages render. Thenginxtoctree warning is gone. Remaining warnings are pre-existing: the extension glob patterns (staged bymakedocs.pl, not by plain sphinx-build) and two inintegrating/auth-delegation.rst, which the next PR fixes.Still to come on 1849943
A separate PR removing BMO-specific references across the docs (BMO test server links, example hostnames, dead mozilla.org links) and the remaining mod_perl instructions in the platform install pages.