Fix URL validator for mirror services when using localhost
What does this MR do and why?
After converting from the old UrlBlocker
to the new one
(#430830),
we saw that some self-hosted users experienced problems with the mirror
repositories (#443296 (closed)).
The problem is caused when using local domains. I investigated the
problem and found that UpdateMirrorService
and UpdateRemoteMirrorService
do not send the allow_localhost
and allow_local_network
settings
to UrlBlocker
. After adding these settings, it started to work
successfully.
It's still strange that this used to be working in the old UrlBlocker
.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- etc/hosts
Add another local address to test;
172.16.123.1 gdk.test gdk-mirror.test
- config/gitlab.yml
Allow it to be a host;
allowed_hosts: ["gdk-mirror.test"]
- admin/application_settings/network
I don't have any setting other than allowing local requests.
- Create a project by mirroring a local project
Without the changes in this MR
- After successful project creation, you'll see that mirroring does not work
With the changes in this MR
- After successful project creation, you'll see that mirroring does work