Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9485

Closed
Open
Created Jul 24, 2015 by Administrator@rootOwner

API v3 is missing port in web urls

Created by: fandingo

I'm using a Docker container to run Gitlab (provided by docker.io/sameersbn/gitlab), and I pass GITLAB_PORT=10080, so all the Gitlab urls work behind the Docker proxy.

The problem is that the API does not populate the port information for HTTP but does for SSH. For example, look at this ruby code

require 'gitlab'
gl = Gitlab.client(:endpoint => 'http://localhost:10080/api/v3', :private_token => '**************')
proj = gl.projects[0]
proj.web_url
=> "http://localhost/jhbrown/htpasswd-data"
proj.http_url_to_repo
=> "http://localhost/jhbrown/htpasswd-data.git"

proj.to_yaml

--- !ruby/object:Gitlab::ObjectifiedHash hash: id: 4 description: '' default_branch: master tag_list: &1 [] public: false archived: false visibility_level: 0 ssh_url_to_repo: ssh://git@localhost:10022/fandingo/my-repo.git http_url_to_repo: http://localhost/fandingo/my-repo.git web_url: http://localhost/fandingo/my-repo owner: &2 name: Fandingo username: fandingo id: 3 state: active avatar_url: http://www.gravatar.com/avatar/d3c6af866376f8d8a6467b4fb729dd3d?s=40&d=identicon name: my-repo name_with_namespace: Fandingo / my-repo path: my-repo path_with_namespace: fandingo/my-repo issues_enabled: true merge_requests_enabled: true wiki_enabled: true snippets_enabled: false created_at: '2015-07-22T16:25:21.431Z' last_activity_at: '2015-07-24T18:38:08.587Z' creator_id: 3 namespace: &3 id: 3 name: fandingo path: fandingo owner_id: 3 created_at: '2015-05-12T16:23:23.897Z' updated_at: '2015-05-12T16:23:23.897Z' description: '' avatar: avatar_url: data: id: 4 description: '' default_branch: master tag_list: *1 public: false archived: false visibility_level: 0 ssh_url_to_repo: ssh://git@localhost:10022/fandingo/my-repo.git http_url_to_repo: http://localhost/fandingo/my-repo.git web_url: http://localhost/fandingo/my-repo owner: !ruby/object:Gitlab::ObjectifiedHash hash: *2 data: name: Fandingo username: fandingo id: 3 state: active avatar_url: http://www.gravatar.com/avatar/d3c6af866376f8d8a6467b4fb729dd3d?s=40&d=identicon name: my-repo name_with_namespace: Fandingo / my-repo path: my-repo path_with_namespace: fandingo/my-repo issues_enabled: true merge_requests_enabled: true wiki_enabled: true snippets_enabled: false created_at: '2015-07-22T16:25:21.431Z' last_activity_at: '2015-07-24T18:38:08.587Z' creator_id: 3 namespace: !ruby/object:Gitlab::ObjectifiedHash hash: *3 data: id: 3 name: fandingo path: fandingo owner_id: 3 created_at: '2015-05-12T16:23:23.897Z' updated_at: '2015-05-12T16:23:23.897Z' description: '' avatar: avatar_url:

Assignee
Assign to
Time tracking