Skip to content

Support for different post/host in the ssh://... url in the web interface. - #268

Closed
bogeskov wants to merge 2 commits into
gitblit-org:masterfrom
bogeskov:master
Closed

Support for different post/host in the ssh://... url in the web interface.#268
bogeskov wants to merge 2 commits into
gitblit-org:masterfrom
bogeskov:master

Conversation

@bogeskov

@bogeskov bogeskov commented Jun 4, 2015

Copy link
Copy Markdown

I've tried to run gitblit in a docker container, and wanted to run the ssh server on what looks like port 22.
However I didn't want to run it as root. So I exposed the default port as (server's 2nd ip) port 22.
Then I would like an easy way of using this port in the web interface.

So I added git.sshDisplayHost/Port to the config.


Commit comment:

Added git.sshDisplay{Port|Host} to hide port forward.

Running gitblit in a container it's easy to expose the ssh on the default port.
Using git.sshDisplayPort/git.sshDisplayHost you can expose the forwarded address
as the official location.

Running gitblit in a container it's easy to expose the ssh on the default port.
Using git.sshDisplayPort/git.sshDisplayHost you can expose the forwarded address
as the official location.
@gitblit

gitblit commented Jun 4, 2015

Copy link
Copy Markdown
Collaborator

I understand the use-case for the port. I am not understanding the hostname setting. When would the hostname in web.canonicalUrl be different than the one in git.sshDIsplayHost?

@bogeskov

bogeskov commented Jun 4, 2015

Copy link
Copy Markdown
Author

The reason for the git.sshDisplayHost, is that the primary url is mapped into an apache with proxypass together with some other services (/artifactory, /jenkins, /moinmoin , /sonarqube, ...), so that I have only one http entrypoint. But the ssh is on the server that actually runs the docker gitblit container.
I suppose I could install a port forwarder on port 22 on the webserver machine, and then add an extra ip, to that one for ssh access. However if I was to go that way, I would should probably rethink the entire setup, which has all the symptoms of a but shooting organism.

Running gitblit in a container it's easy to expose the ssh on the default port.
Using git.sshDisplayPort/git.sshDisplayHost you can expose the forwarded address
as the official location.

Handle undefined (empty defined) settings.
@bogeskov

bogeskov commented Jun 4, 2015

Copy link
Copy Markdown
Author

Just realized that I didn't handle empty settings properly. Committed a fix to that.

@gitblit

gitblit commented Jun 15, 2015

Copy link
Copy Markdown
Collaborator

I manually merged & revised your contribution to the develop branch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants