{"action":"opened","issue":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/9302","labels_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/9302/labels{/name}","comments_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/9302/comments","events_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/9302/events","html_url":"https://github.com/gitlabhq/gitlabhq/issues/9302","id":77092630,"number":9302,"title":"Relative url triggers rails-turbolink on links to external websites","user":{"login":"Flaiker","id":5270359,"avatar_url":"https://avatars.githubusercontent.com/u/5270359?v=3","gravatar_id":"","url":"https://api.github.com/users/Flaiker","html_url":"https://github.com/Flaiker","followers_url":"https://api.github.com/users/Flaiker/followers","following_url":"https://api.github.com/users/Flaiker/following{/other_user}","gists_url":"https://api.github.com/users/Flaiker/gists{/gist_id}","starred_url":"https://api.github.com/users/Flaiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flaiker/subscriptions","organizations_url":"https://api.github.com/users/Flaiker/orgs","repos_url":"https://api.github.com/users/Flaiker/repos","events_url":"https://api.github.com/users/Flaiker/events{/privacy}","received_events_url":"https://api.github.com/users/Flaiker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-16T18:01:03Z","updated_at":"2015-05-16T18:01:03Z","closed_at":null,"body":"### Summary\r\nWith relative-url-support enabled and other services being on the same subdomain (fileserver, gitlab-ci, ...) hyperlinks in markdown-files to these services are not marked with the `data-no-turbolink=\"data-no-turbolink\"`-attribute which results in the linked page loading without its own js/css but with the one of the gitlab instance.\r\n\r\n### Steps to reproduce\r\n1. Setup a gitlab instance using [relative url support](https://github.com/gitlabhq/gitlabhq/blob/master/config/application.rb#L55-L67), resulting in gitlab being available at `https://sub.domain.com/gitlab`\r\n2. Setup another service on the same subdomain but with a different root, for example Gitlab-CI:\r\n`https://sub.domain.com/ci`\r\n3. Create a repository with a markdown file (like README.md) and insert a hyperlink like:\r\n`[See on CI](https://sub.domain.com/ci/projects/1?ref=master)`\r\n4. Click on the link\r\n\r\n### Expected behavior\r\nThe link should be opened in the browser like any other link to an external website.\r\n\r\n### Observed behavior\r\nInstead the link is opened using the rails-turbolink-feature, which results in css missing / being wrong.\r\n\r\n### Relevant logs and/or screenshots\r\n**Normal directory listing**\r\n![2](https://cloud.githubusercontent.com/assets/5270359/7667249/9ca59e9a-fc01-11e4-8fc6-d4d662560a8a.PNG)\r\n\r\n**Directory listing with gitlab-stylesheet**\r\n![1](https://cloud.githubusercontent.com/assets/5270359/7667245/7e6f961a-fc01-11e4-8c13-96397a239136.PNG)\r\n\r\n**Normal Gitlab-CI repository overview**\r\n![4](https://cloud.githubusercontent.com/assets/5270359/7667251/b14f83ce-fc01-11e4-8b22-aed6fa9209e6.PNG)\r\n\r\n**Gitlab-CI with Gitlab stylesheet**\r\n![3](https://cloud.githubusercontent.com/assets/5270359/7667252/bcd5a390-fc01-11e4-8adf-1a2bddb93b4b.PNG)\r\n\r\nYou can solve this by pressing F5, although then you have the same problem going back from Gitlab-CI to Gitlab, as you can see here:\r\n\r\n**Normal Gitlab repository overview**\r\n![6](https://cloud.githubusercontent.com/assets/5270359/7667257/fdb4e894-fc01-11e4-9bb3-7b4ee3b05389.PNG)\r\n\r\n**Gitlab respository with Gitlab-CI stylesheet**\r\n![5](https://cloud.githubusercontent.com/assets/5270359/7667260/0a907a4c-fc02-11e4-9d72-62b4a38038e4.PNG)\r\n\r\nAlso interesting to note as in my example I took the gitlab-ci badge which is already linked in the repository overview automatically, however that one works as it has the additional html-attribute. Here are the two badge links:\r\n\r\nCreated by Gitlab on connecting a repo with gitlab-ci:\r\n```\r\n<a data-no-turbolink=\"data-no-turbolink\" href=\"https://sub.domain.com/ci/projects/1?ref=master\"><img alt=\"build status\" src=\"https://sub.domain.com/ci/projects/1/status.png?ref=master\"></a>\r\n```\r\nCreated with markdown:\r\n```\r\n<a href=\"https://sub.domain.com/ci/projects/1?ref=master\"><img src=\"https://sub.domain.com/ci/projects/1/status.png?ref=master\" alt=\"build status\"></a>\r\n```\r\n\r\n### Output of checks\r\n**sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true**\r\n```\r\nChecking Environment ...\r\n\r\nGit configured for git user? ... yes\r\n\r\nChecking Environment ... Finished\r\n\r\nChecking GitLab Shell ...\r\n\r\nGitLab Shell version >= 2.6.3 ? ... OK (2.6.3)\r\nRepo base directory exists? ... yes\r\nRepo base directory is a symlink? ... no\r\nRepo base owned by git:git? ... yes\r\nRepo base access is drwxrws---? ... yes\r\nSatellites access is drwxr-x---? ... yes\r\nhooks directories in repos are links: ...\r\n6/2 ... ok\r\n7/3 ... ok\r\n8/4 ... ok\r\n8/5 ... ok\r\n8/6 ... ok\r\n8/7 ... ok\r\n8/8 ... ok\r\n8/9 ... ok\r\n8/10 ... ok\r\n8/11 ... ok\r\n8/12 ... ok\r\n8/13 ... ok\r\n8/14 ... ok\r\n8/15 ... ok\r\n8/16 ... ok\r\n8/17 ... ok\r\n8/18 ... ok\r\n8/19 ... ok\r\n8/20 ... ok\r\n8/21 ... ok\r\n8/22 ... ok\r\n8/23 ... ok\r\n8/24 ... ok\r\n8/25 ... ok\r\n8/26 ... ok\r\n8/27 ... ok\r\n8/28 ... ok\r\n8/29 ... ok\r\n8/30 ... ok\r\n2/31 ... ok\r\n2/32 ... ok\r\n2/33 ... ok\r\n2/34 ... ok\r\n2/35 ... ok\r\n2/36 ... ok\r\nRunning /home/git/gitlab-shell/bin/check\r\nCheck GitLab API access: OK\r\nCheck directories and files:\r\n        /home/git/repositories/: OK\r\n        /home/git/.ssh/authorized_keys: OK\r\nTest redis-cli executable: redis-cli 2.8.4\r\nSend ping to redis server: PONG\r\ngitlab-shell self-check successful\r\n\r\nChecking GitLab Shell ... Finished\r\n\r\nChecking Sidekiq ...\r\n\r\nRunning? ... yes\r\nNumber of Sidekiq processes ... 1\r\n\r\nChecking Sidekiq ... Finished\r\n\r\nChecking LDAP ...\r\n\r\nLDAP is disabled in config/gitlab.yml\r\n\r\nChecking LDAP ... Finished\r\n\r\nChecking GitLab ...\r\n\r\nDatabase config exists? ... yes\r\nDatabase is SQLite ... no\r\nAll migrations up? ... yes\r\nDatabase contains orphaned GroupMembers? ... no\r\nGitLab config exists? ... yes\r\nGitLab config outdated? ... no\r\nLog directory writable? ... yes\r\nTmp directory writable? ... yes\r\nInit script exists? ... yes\r\nInit script up-to-date? ... yes\r\nprojects have namespace: ...\r\n6/2 ... yes\r\n7/3 ... yes\r\n8/4 ... yes\r\n8/5 ... yes\r\n8/6 ... yes\r\n8/7 ... yes\r\n8/8 ... yes\r\n8/9 ... yes\r\n8/10 ... yes\r\n8/11 ... yes\r\n8/12 ... yes\r\n8/13 ... yes\r\n8/14 ... yes\r\n8/15 ... yes\r\n8/16 ... yes\r\n8/17 ... yes\r\n8/18 ... yes\r\n8/19 ... yes\r\n8/20 ... yes\r\n8/21 ... yes\r\n8/22 ... yes\r\n8/23 ... yes\r\n8/24 ... yes\r\n8/25 ... yes\r\n8/26 ... yes\r\n8/27 ... yes\r\n8/28 ... yes\r\n8/29 ... yes\r\n8/30 ... yes\r\n2/31 ... yes\r\n2/32 ... yes\r\n2/33 ... yes\r\n2/34 ... yes\r\n2/35 ... yes\r\n2/36 ... yes\r\nProjects have satellites? ...\r\n6/2 ... yes\r\n7/3 ... yes\r\n8/4 ... yes\r\n8/5 ... yes\r\n8/6 ... yes\r\n8/7 ... yes\r\n8/8 ... yes\r\n8/9 ... yes\r\n8/10 ... yes\r\n8/11 ... yes\r\n8/12 ... yes\r\n8/13 ... yes\r\n8/14 ... yes\r\n8/15 ... yes\r\n8/16 ... yes\r\n8/17 ... yes\r\n8/18 ... yes\r\n8/19 ... yes\r\n8/20 ... yes\r\n8/21 ... yes\r\n8/22 ... yes\r\n8/23 ... yes\r\n8/24 ... yes\r\n8/25 ... yes\r\n8/26 ... yes\r\n8/27 ... yes\r\n8/28 ... yes\r\n8/29 ... yes\r\n8/30 ... yes\r\n2/31 ... yes\r\n2/32 ... yes\r\n2/33 ... yes\r\n2/34 ... yes\r\n2/35 ... yes\r\n2/36 ... yes\r\nRedis version >= 2.0.0? ... yes\r\nRuby version >= 2.0.0 ? ... yes (2.1.6)\r\nYour git bin path is \"/usr/bin/git\"\r\nGit version >= 1.7.10 ? ... yes (2.4.0)\r\nActive users: 4\r\n\r\nChecking GitLab ... Finished\r\n```\r\n\r\n**Gitlab Version**\r\nGitLab 7.11.0.rc2 a7a5de7\r\nGitLab Shell 2.6.3\r\nGitLab API v3\r\nRuby 2.1.6p336\r\nRails 4.1.9\r\n\r\n**sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production**\r\n```\r\nSystem information\r\nSystem:         Ubuntu 14.04\r\nCurrent User:   git\r\nUsing RVM:      no\r\nRuby Version:   2.1.6p336\r\nGem Version:    2.2.3\r\nBundler Version:1.9.4\r\nRake Version:   10.4.2\r\nSidekiq Version:3.3.0\r\n\r\nGitLab information\r\nVersion:        7.11.0.rc2\r\nRevision:       a7a5de7\r\nDirectory:      /home/git/gitlab\r\nDB Adapter:     postgresql\r\nURL:            https://***.com/git\r\nHTTP Clone URL: https://***.com/git/some-project.git\r\nSSH Clone URL:  git@***.com:some-project.git\r\nUsing LDAP:     no\r\nUsing Omniauth: yes\r\nOmniauth Providers: github\r\n\r\nGitLab Shell\r\nVersion:        2.6.3\r\nRepositories:   /home/git/repositories/\r\nHooks:          /home/git/gitlab-shell/hooks/\r\nGit:            /usr/bin/git\r\n```\r\n\r\n### Possible fixes\r\nSince other links to external websites work normally there must be some code checking for wether a link is internal or external which needs to also take the relative url root into consideration. Alternatively you could disable the turbolink feature for all \"user-generated\" links, so wikis, repository files etc. (that would be more of a dirty hotfix...).\r\nFor now I replaced my links with links to the http-version of the website so that the turbolink-trigger doesn't fire but I still get to the url (because I have setup an auto redirect to https) which obviously is not the ideal solution.\r\n\r\nI know using the relative url support is not recommended, though I would appreciate it if this could be fixed as without the relative url I would need to buy multiple ssl-certs for all the subdomains of the different services which is an expense factor."}}