jgm / gitit

A wiki using HAppS, pandoc, and git
GNU General Public License v2.0
2.15k stars 225 forks source link

Suggested proxy configuration is incompatible with github authentication #623

Open gcampax opened 5 years ago

gcampax commented 5 years ago

Using the suggested directive:

ProxyPassReverse /

apache will rewrite the github oauth2 redirect to be a redirect inside the wiki, and eventually hit a redirect loop. The correct way to set up apache, according to their docs, is:

ProxyPassReverse http://127.0.0.1:5001

This unfortunately breaks all other redirects in gitit. The solution is for gitit to always use absolute redirects.

I believe it should be possible to modify getWikiBase to return an absolute URL (combining the rqUri part that it has with "http://", rqHost and the port from the configuration), however I don't know if that's used to generate content that mod_proxy_html would not understand (eg javascript or css) so locally I instead manually modified all instances of seeOther, movedPermanently and tempRedirect. Of course, I'll appreciate an upstream fix for this!