Koozali.org: home of the SME Server
Obsolete Releases => SME 9.x Contribs => Topic started by: mpfj on December 07, 2017, 03:39:52 PM
-
Currently testing a new SVN installation, and I see the repos are all accessed via HTTP as http://<server>/<repo>.
Is there any way to change this so the repos appear as http://<server>/svn/<repo> ?
Or, even better, if each repo could have its own HTTP path ... e.g.
http://<server>/svn/companyA/repo1
http://<server>/svn/companyA/repo2
http://<server>/svn/companyB/repo5
... etc ...
-
moving to contribs section
-
Currently testing a new SVN installation, and I see the repos are all accessed via HTTP as http://<server>/<repo>.
Is there any way to change this so the repos appear as http://<server>/svn/<repo> ?
Or, even better, if each repo could have its own HTTP path ... e.g.
http://<server>/svn/companyA/repo1
http://<server>/svn/companyA/repo2
http://<server>/svn/companyB/repo5
... etc ...
I guess you would probably need a custom http template somewhere.
-
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28SubversionContent /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
vim /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28SubversionContent
then change
$OUT .= " RewriteRule ^/$key(/.*|\$) https://%{HTTP_HOST}/$key\$1 [L,R]\n\n";
to
$OUT .= " RewriteRule ^/svn/$key(/.*|\$) https://%{HTTP_HOST}/svn/$key\$1 [L,R]\n\n";
and
$OUT .= " <Location /$key>\n\n";
to
$OUT .= " <Location /svn/$key>\n\n";
and as soon as you found a way to get out of vim :D, your are done by just doing :
signal-event remoteacces-update
-
Ahhh so simple :-)
mc/mcedit to save all that vim nonsense ;-)
-
Ahhh so simple :-)
mc/mcedit to save all that vim nonsense ;-)
this not non sense :D this is a trap
thinking of it it could be a NFR : adding a variable there to allow to set a path
my $path = $modDAVSVN->prop("path") || '';
$path = $path."/" if ( substr($path, -1) ne "/" && $path ne "" );
$OUT .= " RewriteRule ^/$path$key(/.*|\$) https://%{HTTP_HOST}/$path$key\$1 [L,R]\n\n";
$OUT .= " <Location /$path$key>\n\n";
then set your path
config setprop modDAVSVN path svn
signal-event remoteacces-update
-
Finally got something working which allowed me to have a path per repo (using a "Path" property)
In 28SubversionContent I added:-
my $path = $properties{'Path'} || '';
$path = $path."/" if ( substr($path, -1) ne "/" && $path ne "" );
And changed
$OUT .= " RewriteRule ^/$key(/.*|\$) https://%{HTTP_HOST}/$key\$1 [L,R]\n\n";
$OUT .= " <Location /$key>\n\n";
… to …
$OUT .= " RewriteRule ^/$path$key(/.*|\$) https://%{HTTP_HOST}/$path$key\$1 [L,R]\n\n";
$OUT .= " <Location /$path$key>\n\n";
Thanks for the assistance :-P
-
that is also an interesting approach, we could mix both.
allow to set one for all, and overide the value per repo.