New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/mediawiki] improve configuration for reverse proxy configs #64098
Conversation
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki/setup.sh
Show resolved
Hide resolved
f12ee25
to
7dfa319
Compare
added a few commits, i was going to make separate PRs but these changes depend on each other. i'll update the PR description. |
dae774b
to
b550856
Compare
b550856
to
1112ae3
Compare
anything i can do to help move this forward? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @dunn!
I have added several comments, please take a look at them.
Additionally, I would appreciate if you could remove the following section from the tests:
containers/.vib/mediawiki/goss/mediawiki.yaml
Lines 40 to 45 in b8c665b
/opt/bitnami/apache/conf/vhosts/mediawiki-vhost.conf: | |
exists: true | |
filetype: file | |
contents: | |
- "RewriteEngine On" | |
- "RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]" |
Because you are moving the Apache config creation from buildtime to runtime, the file no longer exists, causing the tests (and the CI/CD pipeline) to fail.
bitnami/mediawiki/1/debian-12/prebuildfs/opt/bitnami/scripts/libwebserver.sh
Outdated
Show resolved
Hide resolved
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki/setup.sh
Show resolved
Hide resolved
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki/setup.sh
Show resolved
Hide resolved
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki-env.sh
Outdated
Show resolved
Hide resolved
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/libmediawiki.sh
Show resolved
Hide resolved
b75418e
to
3258375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dunn,
Thank you for implementing my suggestions, please take a look at my comment regarding MEDIAWIKI_SCRIPT_PATH
.
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki/setup.sh
Show resolved
Hide resolved
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/mediawiki-env.sh
Outdated
Show resolved
Hide resolved
bitnami/mediawiki/1/debian-12/rootfs/opt/bitnami/scripts/libmediawiki.sh
Show resolved
Hide resolved
we need the `RewriteRule` in the vhost to match `wgArticlePath` in the application `LocalSettings.php`, which requires that it be modified at startup in order to respect custom values of `MEDIAWIKI_WIKI_PREFIX`. Signed-off-by: alexandra catalina <git@garbage.world>
Signed-off-by: alexandra catalina <git@garbage.world>
Signed-off-by: alexandra catalina <git@garbage.world>
setting $wgServer to the hostname results in all generated links using that host, instead of being relative URLs. this breaks deployments run behind a reverse proxy if the proxy port/path differs from MediaWiki's. Signed-off-by: alexandra catalina <git@garbage.world>
…tion" This reverts commit bc40415. Signed-off-by: alexandra catalina <git@garbage.world>
Signed-off-by: alexandra catalina <git@garbage.world>
this file is now generated at run-time Signed-off-by: alexandra catalina <git@garbage.world>
That matches the current behavior and avoids breaking existing installations Signed-off-by: alexandra catalina <git@garbage.world>
3258375
to
814ca8d
Compare
@migruiz4 thanks for the review! I added a commit setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution @dunn, looks good to me!
several changes to improve behavior when running behind a reverse proxy:
RewriteRule
in the vhost to match$wgArticlePath
in the applicationLocalSettings.php
, which requires that it be modified at startup in order to respect custom values ofMEDIAWIKI_WIKI_PREFIX
.$wgScriptPath
to""
is fine for the normal case, but if you're running behind a reverse proxy and want to serve MediaWiki on one path (e.g.,/wiki
) and other services on other paths, being able to set the script path as non-root makes proxy routing easier.$wgServer
toMEDIAWIKI_HOST
results in absolute URLs including the full hostname and port, instead of relative URLs, which breaks links when the reverse proxy is running on a different port. for the same reason, set$wgAssumeProxiesUseDefaultProtocolPorts
to false.Fixes #64097