Some redirections are ignoring relative URL
Summary
I've found at least two redirections that ignore the relative URL configuration. Those are:
.../wikis -> .../wikis/home
.../settings/members -> .../project_members
Steps to reproduce
- Install GitLab under a relative URL
- Create a project
- Go to .../gitlab/namespace/project/settings/members and expect a 404
Relevant logs and/or screenshots
This is in my local installation, the redirection is ignoring the relative URL:
x.x.x.x - - [05/Sep/2017:08:58:15 +0200] "GET /gitlab/<namespace>/<project>/wikis HTTP/1.0" 301 108 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"
x.x.x.x - - [05/Sep/2017:08:58:15 +0200] "GET /<namespace>/<project>/wikis/home HTTP/1.0" 404 27990 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36"
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: SUSE LINUX 12.1 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.5.2 Bundler Version:1.15.4 Rake Version: 12.0.0 Redis Version: 2.8.23 Git Version: 2.8.4 Sidekiq Version:5.0.4 Go Version: go1.8.3 linux/amd64GitLab information Version: 9.5.3 Revision: 789cc67 Directory: /home/git/gitlab DB Adapter: postgresql URL: https://xxx/gitlab HTTP Clone URL: https://xxx/gitlab/some-group/some-project.git SSH Clone URL: git@xxx:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.8.0 Repository storage paths:
- default: /home/git/repositories Hooks: /home/git/gitlab-shell/hooks Git: /usr/local/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.8.0 ? ... OK (5.8.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... ... everything ok ...
Running /home/git/gitlab-shell/bin/check Check GitLab API access: OK Access to /home/git/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
... ldap output ...
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... yes Init script up-to-date? ... yes Projects have namespace: ... ... everything yes ...
Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.3) Git version >= 2.7.3 ? ... yes (2.8.4) Active users: ... 109
Checking GitLab ... Finished
Possible fixes
I lack the knowledge to debug it, but I've found that these two redirections are the only ones that share a similar syntax:
config/routes/project.rb: get :members, to: redirect('/%{namespace_id}/%{project_id}/project_members')
config/routes/wiki.rb: get '/', to: redirect('/%{namespace_id}/%{project_id}/wikis/home')