Using the mod_svn module for apache you can access the repository not onl via SVN client but also directly via HTTP using the same URL. You only get a plain directory listing showing the HEAD revision in such a case.
It is possible (may be via URL parameters) to access older revisions of the SVN repository if they has net been copied/tagged within the SVN?
I know that there are 3rd party software that allows to do so like ViewCV or WebSVN but I am interested in how far you get with only a plain SVN repository accessible via mod_svn and HTTP(S).
You can use the r querystring parameter to access older versions of files and directory listings with mod_dav_svn. For example:
http://host.example.com/repos/project/trunk/README.txt?r=1234
The SVN Book has more details on how this works.
Related
I am writing a set of svn hooks to allow remote management of the SVN repository, just like gitolite does with GIT.
I created the script that generates the AuthzSVNAccessFile for each repository I have, now I need to tell Apache to look for each of them depending on the repository.
I cannot have a apache config file for each repository, because it would need to restart the apache server.
I know I can use a single AuthzSVNAccessFile to manage multiple repository, but the script that build the file takes time (need to discover the full path of every dir inside the repository), and would make the commit take too long.
I tried to use mod_rewrite, but it did not work, maybe I used it wrong.
Basically I need to have a rule in my apache configuration file that reads different file depending on the URL requested, is that possible? How?
Or I need a script able to rewrite a block of a file. I am using sed to replace the strings I have in my template, but do not know how to use it to replace multiple lines.
Thanks for your time
No idea why you're trying to use mod_rewrite unless I'm entirely misunderstanding your question. But it sounds like you are using SVNParentPath and are having trouble figuring out how to configure the authz settings for all the repositories.
You have a couple of options.
Use one authz file
You can actually generate a single authz file and specify which repositories the rules apply to. The syntax is of the form [repos-name:path] (as you can find in the Path-Based Authorization section of the Subversion Book). One disadvantage of this is that if you have a lot of repositories and a lot of paths with rules it can slow things down. Which it sounds like you've run into. One thing that can help mitigate this some is using the following configuration
SVNPathAuthz short_circuit
SVNPathAuthz controls how requests for paths other than the URI are authorized when other paths need to be accessed than the URI of the request (e.g. log, commit, etc). The default behavior is to issue a sub-request. This generates a new GET request in httpd and sends it through all of the authorization infrastructure for httpd. However, in almost all cases this is not needed since the only authorization configuration that can vary with the path under the Location being used to serve SVN is the mod_authz_svn configuration. short_circuit, tells Subversion to avoid all of this and simply send the authorization info straight to mod_authz_svn who provides the answer directly limiting the delay.
That may still not be enough so there are a couple of alternatives, but you'll need at least 1.7 to use them.
AuthzSVNReposRelativeAccessFile
Subversion 1.7 added a new configuration directive that lets you specify a path relative to the conf subdirectory of the repository. For instance if you have a repo named foo you can put the authz file in /path/to/foo/conf/authz and then set the following configuration value:
AuthzSVNReposRelativeAccessFile authz
The directive prior to 1.7 that was used AuthzSVNAccessFile was relative to the server root path.
In Repository Authz*
Subversion 1.8 allows you to store the authz file in the repository itself. So for instance if you committed the file in the repo in a directory named conf as the file authz then you'd do:
AuthzSVNAccessFile ^/authz
The ^/ syntax is replaced with the full path to the repository.
You probably want to read the details on the linked release notes for 1.8 if you decide to use this.
I'm using Artifactory 3.0.3 (open source).
In our company, we have two own repositories and both are on a different machine than Artifactory. Let's call them:
OurRepo1 - public, any developer can download artifacts from it
OurRepo2 - private, only some developers are allowed to access and download artifacts from it
And here's the thing:
Due to security reasons we want OurRepo2 not to be cached by Artifactory (easy to do), BUT NOW, how can I define permissions for this OurRepo2 to be accessible only by some users?
When I'm creating a new permission target I can select only local repos and caches of remote repos (e.g. OurRepo1-cache). But I don't want either of that. I want to limit the very access to the physical OurRepo2.
Is it possible with Artifactory?
In this case, I'd use an HTTP proxy like nginx in front of your Artifactory instances, and use rewrite rules to direct traffic to the correct back-end repo. You can then insist on certain auth credentials when trying to access OurRepo2 whilst leaving OurRepo1 free of authentication.
I have helped to manage such an "nginx + Artifactory" combination in an organisation with 100+ developers, and it worked very well.
I've already setup Apache to manage svn requests.
Basically the structure of the svn related directory is this:
/Repository
-----OneRepo
-----TheOtherRepo
Repository is a "normal" directory, while OneRepo and TheOtherRepo are svn repositories.
I've used SVNParentPath and SVNListParentPath directives and if I go to localhost/Repository/ (with my browser) I can see all my repositories.
Now, if I try to access a single repository (for example: OneRepo) from a client (in my case Cornerstone but Versions is the same) everything works fine.
The problem is that I would like to access the repository listing from the client so that I have a big "folder" with all my projects in it. Does it make sense?
So, instead of writing http://192.168.x.x/Repository/OneRepo in my client (and it works) I would like to write http://192.168.x.x/Repository/ and view a listing of project and so checkout whatever project I would like to.
Is that possible?
Thanks
This works only in a http browser. So your standard SVN Client (commandline , TortoiseSVN, etc.) can not list your repositories
I'm trying to convert some projects at work from subversion to git. The projects are websites and our current subversion setup uses davfs to mount the repository and point apache's document root there. This way apache in dev runs the code currently checked-into the svn repository.
mount:
mount.davfs http://code.repository/svn/site.com /mnt/davfs/site.com
httpd.conf:
ServerName site.com
DocumentRoot /mnt/davfs/site.com
I'm looking for a way to mimic this setup with git. But, from what I understand, mounting a git repository (yes, our git repo is accessed over http) this way will result in the git repository internals showing up as the docroot and not the code itself.
example:
ls /mnt/davfs/gitrepository
Parent Directory
HEAD
branches/
config
description
hooks/
info/
objects/
refs/
Does anyone know if there is a way to achieve the desired effect?
Thanks!
If you want to be able to browse the code, you should be using something like gitweb. If you want to push/pull from the repo, then the internals should be showing up as the docroot.
In a bare repository (the kind that you would use for such a central repo, since you generally don't want to push to non-bare repos), there is no actual checkout of the code files on disk, the only things in that bare repo are the "git internals".
If you want to get a copy of the code on the server out of the repository, you probably want to use git archive - possibly in a post-receive hook if you want it to run every time new code is pushed to the repository. See the following man pages for details:
http://www.kernel.org/pub/software/scm/git/docs/git-archive.html
http://git-scm.com/docs/githooks
Well the git repo is another beast. If you want to browse source code, you need something like gitweb. Mind you, if you just pointed to a svn repo, you'd be looking at internals too; The /mnt/davfs/site.com is probably hosted with apache mod-dav-svn which does something similar as gitweb would do.
You'll want to look at gitweb or competition. Gitweb is IMHO the simplest to setup
https://git.wiki.kernel.org/index.php/Gitweb
For sharing your repository (to make it clonable, e.g.) just serve the tree as static HTTP pages (as docroot directly) because davfs will not (reliably) make it possible for others to push to your repo anyway.
Pushing would be done using the Smart HTTP server, git-daemon or over ssh
I would like to host a Maven repository for a framework we're working on and its dependencies. Can I just deploy my artifacts to my FTP host using mvn deploy, or should I manually deploy and/or setup some things before being able to deploy artifacts? I only have FTP access to server I want to host the Maven repo on.
The online repository I want to use is not hosted by myself. As I say, I only have FTP access, so if possible, I would like to use that FTP space as a Maven repository. The tools mentioned seem to work when you have full control over the host machine, or at least more than just FTP access since you need to configure the local directories where the repositories will be placed. Is this possible?
You might want to have a look at Nexus, a Maven repository manager. We've replaced our local Maven repository with a Nexus-based one and find it tremendously useful.
I've successfully used Archiva as my repository for several years ... see http://archiva.apache.org/. It's easy to administer and allows you to configure as many repositories as you need (SNAPSHOT, internal, external, etc).
According to the book "Better Builds with Maven", the most common type of repository is HTTP, this paragraph describes what I think you need:
This chapter will assume the repositories are running from http://localhost:8081/ and that artifacts are deployed to the repositories using the file system. However, it is possible to use a repository on another server with any combination of supported protocols including http, ftp, scp, sftp and more. For more information, refer to Chapter 3.
A Maven 2 repository is simply a specific directory structure, so once you get the transport and server specifications right for the repository and deployment portion of your POMs, it should be completely transparent to your users.
You can even use Dropbox. All that you need is a public address to access the files generated with mvn deploy, with any of the protocols in the accepted answer.
I guess there are more services that can work in the same way, but I'm not certain about the URL schemes that alternatives to Dropbox may use.
https://maven.apache.org/wagon/wagon-providers/wagon-ftp/ will tell you that you can use ftp to read from an existing repository, but not to create a new one. I don't think that it is impossible in principle, but no one has cared to write all the fiddly code to do the directory management via ftp.