Hi,
Currently I am exploring the SCM-Manager for our next hosting server for SCM. I just came across a behavior while creating the repositories called “Name Space” which is perfectly fine, but a “repo” will be prefixed to the repositories link that is not relevant.
Required solution:
(1) Can we have a custom link if this is faster and require less work?
(2) Can we just remove this and handle the requests accordingly?
or even
(3) Can we handle this with a REVERSE PROXY?
Hey @girishkg,
we discussed your question and unfortunately it is not possible. SCM-Manager depends on this “/repo/” in the url to detect whether it is a frontend or backend route. A reverse-proxy could collide with subversion since the url is part of the xml body and changing this could break your access to your subversion repositories.
Maybe you could describe your use case why you need to change this? We could then find out if there is another solution.
I have managed it using HAProxy with the below given configuration.
frontend scm-haproxy-frontend
bind 0.0.0.0:80
mode http
## (1)
#acl svn-s req.hdr(Host) svn-s.englab.local
acl ac-svn-s req.hdr(Host) 16.73.32.9
## (2)
use_backend svn-s1 if { path -i -m beg /svn/ } || { path -i -m end /svn }
#scl ac-path2 path_beg /repo/svn
#use_backend svn-s1 if ac-path1
default_backend scm-servers
backend scm-servers
# use http as proxy protocol
mode http
# sets X-Forwarded-For header
option forwardfor
# check if scm is running
option httpchk GET /api/v2
# assuming scm-manager is running on localhost at port 8080
server scm1 localhost:8080 check
# sets X-Forwarded-Host header
http-request set-header X-Forwarded-Host %[req.hdr(Host)]
# sets X-Forwarded-Proto to https if ssl is enabled
http-request set-header X-Forwarded-Proto https if { ssl_fc }
backend svn-s1
mode http
option httpchk GET /api/v2
server scm2 localhost:8080 check
http-request set-header X-Forwarded-Host %[req.hdr(Host)]
http-request set-header X-Forwarded-Proto https if { ssl_fc }
http-request redirect code 301 location http://%[hdr(host)]%[url,regsub(^/svn,/repo/svn,)] if { path_beg /svn }
My current servers have “svn” prefix (ex: http://<svn_server.local>/svn/<repos>
)
and since SM-Manager NAME_SPACE would add one more block “repo”, it was ending up having lengthier URL (http://<svn_server.local>/repo/<NAME_SPACE>/svn/repos
)
So used HAProxy rewrite to just reduce the URL length and make the URL pretty,
I will write a user guide once I settle with all the testings.
3 Likes
Hi @girishkg
good to hear that you found a solution that works for you and that can it can be helpful for others.
We are happy that you would like to share your knowledge and we are really looking forward for your guide.
1 Like
I am closing this topic as there has been no activity for more than 30 days.