Edgewall Software

Ticket #493 (new enhancement)

Opened 4 years ago

Last modified 8 days ago

Use trac with a remote Subversion repository

Reported by: radix at twistedmatrix.com Owned by: cboos
Priority: high Milestone: 0.13
Component: version control Version: 0.9.2
Severity: major Keywords: subversion svn remote repository svk
Cc: yuangang28@…, nslater@…, oetiker@…, marshall@…, slith76@…, jwin1@…, azrael@…, mr0winky@…, caio1982@…, edgewall.cjy@…, anarcat@…, chris@…, chris.a.williams@…, jp@…, scott@…, tdussa@…, heikki.lampen@…, climaxius@…, felix.schwarz@…, trac.edgewall.org@…, martin.marcher@…, rflegel@…, soloturn@…, lists@…, imanuel.scholz@…, jyrki.muukkonen@…, dewey@…, sergei@…, thomas.subera@…, sloukam@…, dstaple@…, buckett@…, jasonm23@…, matthew.block@…, ryanmccue@…, jcalcote@…, trac@…, mdecoffe@…, a_baranenko@…, jan-trac@…, termim@…, dl9pf@…, richard@…, robert@…, mike@…, ilkka.laukkanen@…

Description (last modified by cmlenz) (diff)

It stinks pretty bad that I have to install trac on my Subversion server AND give it write access to it.

Attachments

Change History

  Changed 4 years ago by mrowe@…

  • severity changed from normal to enhancement

At present Subversion's Python bindings do not support the more-generic "repository access layer" that would facilitate accessing file://, http:// and svn:// repositories. Adding support for remote repositories to Trac will be difficult until this situation is remedied.

  Changed 4 years ago by daniel

As Mark pointed out, this is indeed the reason for above mentioned stink.

Whenever there's an official way to us the RA layer, Trac will utilize it.

  Changed 4 years ago by anonymous

This is understandably difficult. However, do ant trac'ers have recommendations for how to do do fine grained access control for users coming through trac? I'm currently using subversions apache module to control which users have read and write access to content via AuthzSVNAccessFile. Since trac is using the server bindings and not going through HTTP as a client, it is bypassing my access control layer. Does any one know how to do svn access control at a lower level???

I'll take this up on the svn lists too.

  Changed 4 years ago by cmlenz

  • summary changed from Use trac with a REMOTE Subversion repository to Use trac with a remote Subversion repository

  Changed 4 years ago by Marc Sutton

Subversion 1.2 has just been released and they've flattened the remote access API so SWIG can access it (and python bindings can be produced).

Is that all that's required to get trac to use a remote repository?

  Changed 4 years ago by cmlenz

  • description modified (diff)

I've experimented with this, but unfortunately the SWIG bindings for svn_ra didn't seem to be completely usable.

For example, svn_ra_stat (IIRC) should return a dirent object of some kind, but it expects a pointer to a struct. Apparently the mapping from C to python isn't quite worked out yet for that layer.

  Changed 4 years ago by Juanma Barranquero

[...] Subversion 1.2 has just been released [...]

Well, Subversion 1.2 has not yet been released, unless you count release candidates as full releases. Let's not spread wrong information, please.

  Changed 3 years ago by eric@…

1.2 has been released now... any improvement on this situation?

  Changed 3 years ago by anonymous

Related to fine grained permissions question asked in this topic:

http://projects.edgewall.com/trac/wiki/FineGrainedPermissions

  Changed 3 years ago by jwt

  • keywords repository svk added
  • owner changed from jonas to daniel
  • version changed from 0.7 to 0.8.3
  • component changed from general to trac-admin

I have successfully used http://svk.elixus.org/ for mirroring a remote repository (to a local trac-server). Obviously this is not always desirable.

Any status-update on this issue yet ?

  Changed 3 years ago by anonymous

  • cc vyt@… added

  Changed 3 years ago by marshall@…

  • cc marshall@… added

  Changed 3 years ago by anonymous

  • cc slith76@… added

  Changed 3 years ago by cmlenz

  • owner changed from daniel to cmlenz
  • component changed from trac-admin to version control

  Changed 3 years ago by anonymous

  • cc jwin1@… added

  Changed 3 years ago by anonymous

  • cc changed from vyt@vzljot.ru, marshall@exclupen.com, slith76@gmail.com,jwin1@web.de to vyt@vzljot.ru, marshall@exclupen.com, slith76@gmail.com, jwin1@web.de

  Changed 3 years ago by Tobi Oetiker <oetiker@…>

  • cc oetiker@… added
  • version changed from 0.8.3 to 0.9b2

When I try using svn://svn....../repo as a repository path, I end up with a nice error message:

Assertion failed: is_canonical (base, blen), file subversion/libsvn_subr/path.c, line 114

I am using svn 1.2.1 with trac 0.9b2

any progress on remote repository support ?

  Changed 3 years ago by jwin1@…

I really want to promote using trac here with our development, but our 'server-folks' (sadly) just aren't open-minded enough to keep trac and svn on one machine, not speaking of all political difficulties...

This is really an important one for us.

  Changed 3 years ago by mgood

Well, I think that it will save your "server-folks" some work to keep the two on the same box, since it makes it easier to set up things like the authentication that should be the same between them. If the SVN repository uses the FSFS backend (highly recommended), you can run Trac with read-only access to the repository. If that's still not sufficient, you should be able to share the SVN repository read-only via NFS to the Trac server.

  Changed 3 years ago by anonymous

Any experienced IT administrator knows that keeping multiple services on one box does not "save work". This is the single reason why we cannot adopt Trac for any real project in our organization. We have an established SVN repository, processes, and security policy and there is no way we could install Trac on the SVN server. The SVN server is considered security and mission critical.

If there would be a way to somehow relay authorization from the user's desktop to the SVN server through Trac, that would be perfect. This way we could set up Trac without having to let our IT department set it up (which would take months to actually happen). We could update to a new release and apply patches whenever we need to. Currently, we cannot, since setting up Trac requires all-permissive access to the SVN repository and that means it would have to be administered by the IT guys. If Trac could offload all real authentication and access control to SVN, our IT would be happy.

Anyway, just the possibility to access a remote SVN repository is needed for our IT to even consider setting up a Trac server.

  Changed 3 years ago by jwin

regardless of the status of the swig-python bindings, if I want to test the svn_ra access, is

trunk/trac/versioncontrol/tests

the right place to look for modifying to use svn_ra access ?

Has anyone done this recently ?

  Changed 3 years ago by jwin

how about using a Python-extension written in C the C-Api for svn_ra should work

  Changed 3 years ago by jw

svn 1.3rc7

* new public APIs:

  • new transfer progress callback for DAV (r15948)
  • svn_ra_initialize(), svn_client_open_ra_session()
  • svn_fs_closest_copy(), svn_fs_type()
  • several rev'd APIs, see doxygen docs

* SWIG bindings: No more compile-time or runtime SWIG dependencies

  • SWIG/python bindings:
    • automatic memory management: APIs no longer require pool

  Changed 3 years ago by anonymous

  • version changed from 0.9b2 to 0.9.2

  Changed 3 years ago by Mitch

Any progress on this? I'd love to use this feature.

  Changed 3 years ago by imp <trac@…>

  • cc trac@… added

  Changed 3 years ago by anonymous

  • cc anderson@… added

  Changed 3 years ago by anonymous

  • cc azrael@… added

  Changed 3 years ago by anonymous

  • cc cbassham@… added

  Changed 3 years ago by anonymous

  • milestone set to 0.9.5

  Changed 3 years ago by cmlenz

  • milestone 0.9.5 deleted

WTF?

  Changed 3 years ago by anonymous

  • cc mr0winky@… added

Whats the eta on this feature? We have been using trac for about 1 year and would like to decouple Trac from the svn repository because we do not wish to give out mass accounts to the machine hosting our repo, for obvious security/stability reasons.

  Changed 3 years ago by anonymous

  • cc trac-trac@… added

  Changed 3 years ago by eblot

#2828 has been marked as a duplicate.

  Changed 3 years ago by caio1982

Any progress on making it happen? Does anyone above got some err... "hack" that fully works? Mirroring data using SVK or even DRBD (!) is not a real option and NFS is... well, you know.

  Changed 3 years ago by anonymous

  • cc caio1982@… added

  Changed 3 years ago by anonymous

pysvn seems to have support for accessing remote repositories. And these bindings looks a lot more "active" too.

  Changed 3 years ago by cboos

  • owner changed from cmlenz to cboos
  • priority changed from normal to low
  • milestone set to 0.11

I've noticed the pysvn suggestion when it was made. This, combined with the VcRefactoring#NewRepositoryCache changes, would make it practical to work with remote subversion repositories, as remote requests would only have to be done for doing changeset synchronizations.

  Changed 3 years ago by anonymous

  • cc edgewall.cjy@… added

  Changed 2 years ago by anonymous

I want to set up Trac for a SourceForge? project, but I can't until this feature is added. I hope it happens soon.

  Changed 2 years ago by Barry Scott

pysvn indeed can access remote repos. Is there anything missing from pysvn API that would prevent you using it to solve this problem? (Apart from the pain of changing from svn bindings to pysvn that is!)

Barry - pysvn author

  Changed 2 years ago by anonymous

  • cc anarcat@… added

  Changed 2 years ago by anonymous

  • cc stevej@… added

  Changed 2 years ago by caio1982

  • priority changed from low to normal

I think it's a quite important feature that would make Trac even more flexible so it's not that good change this ticket's priority to "low" instead of "normal". Workarounds or extensions are acceptable but aren't the best solution, IMHO.

  Changed 2 years ago by anonymous

Lack of this feature is the main reason why my new employer's development department doesn't use Trac (a pretty big international company). I've used Trac on the previous job with great success and I'm very sad I can't use it now.

  Changed 2 years ago by anonymous

We are a small team in a big company evaluating Trac. This single issue is the reason why we won't use it companywide.

  Changed 2 years ago by Manuzhai

  • cc manuzhai@… added

  Changed 2 years ago by anonymous

  • cc chris.a.williams@… added

  Changed 2 years ago by anonymous

  • cc tim_gould@… added

  Changed 2 years ago by anonymous

  • cc jp@… added

  Changed 2 years ago by anonymous

  • cc scott@… added

  Changed 2 years ago by anonymous

  • cc tdussa@… added

  Changed 2 years ago by anonymous

  • cc heikki.lampen@… added

  Changed 2 years ago by anonymous

  • cc climaxius@… added

  Changed 2 years ago by anonymous

  • priority changed from normal to highest

  Changed 2 years ago by mgood

  • priority changed from highest to normal

Feel free to bump up the priority if you're volunteering to implement it. Otherwise you'll need to be patient.

  Changed 2 years ago by anonymous

  • cc felix.schwarz@… added

  Changed 2 years ago by anonymous

  • cc trac.edgewall.org@… added

  Changed 2 years ago by anonymous

  • cc trac.edgewall.org@…, added

  Changed 2 years ago by trac@…

In terms of implementing this, I was thinking it would be easy enough to write a new version control module (i.e. svn_pysvn) that uses pysvn instead of subersion's python bindings.

Does that make sense ? Are there any pitfalls to doing it this way ?

  Changed 2 years ago by cboos

This was already acknowledged as being a good idea. See comment:38. The point of waiting for the upcoming refactoring would be to have much less work to do in order to write this new backend, as most of the operations will be done on the cache, and basically only the synchronisation of new changes will have to be backend-specific (at least that's the plan).

Nevertheless, I you feel like doing so, it would be perfectly possible to write a pysvn backend right now for milestone:0.10.

  Changed 2 years ago by anonymous

  • cc rnc000@… added; removed

  Changed 2 years ago by lists01@…

just a "me too" re: support for remote SVN repositories. we want to use trac but our sysadmin team already has a stand-alone SVN server set up.

the "on-the-same-box" requirement may be fine for small teams (or teams with that kind of independence), but in large organizations where there is a separation of responsibilities this requirement can be a show-stopper.

  Changed 2 years ago by cboos

  • severity changed from normal to major

Among the possible workarounds, there's also svnsync, which is a new tool part of Subversion 1.4. It allows to easily replicate repositories, from URL / to URL, which gives you a great deal of flexibility.

For example, you can set up a post-commit hook on the central repository that will trigger the replication to a slave repository on the server where you run Trac. Alternatively, on that Trac host, you can periodically call svnsync which will pull new revisions from the central repository.

I've tested that tool with 1.4.0rc5, and it works fine. Of course you could have done the above using svk mirror, but svnsync is more straightforward to install and use.

  Changed 2 years ago by anonymous

  • cc cbassham@… removed

  Changed 2 years ago by anonymous

  • cc anderson@… removed

  Changed 2 years ago by Shun-ichi Goto <shunichi.goto@…>

I guess there is a way to access remote repository by using standard python binding of subversion 1.4 like svnsync (written by C) does. It may require smaller change than implementing pysvn backend. Of course, it will have limitation that both trac side and remote server side need svn 1.4 or later.

  Changed 2 years ago by anonymous

  • cc martin.marcher@… added

  Changed 2 years ago by anonymous

  • cc chris@… added

  Changed 2 years ago by chris@…

Any news on this? I'm wanting to use Trac for a SourceForge? project but cannot install it on the server since I don't have file:// access to the repository. I could mirror the repository but if I'm going to do that I might as well just move my repository to my VDS which I rather not do :(

We use Trac at work and are extremely happy with it. We found it's made our lives impressively easier and tend to spend a lot of time reloadng the timeline page. I think having remote SVN capabilities would sell this to the masses 100%.

  Changed 2 years ago by sik0fewl

  • cc rflegel@… added

Another "me too." Has there been any recent progress on this ticket? The suggestion by Shun-ichi Goto seems like it will work well, at least for subversion 1.4 and greater.

  Changed 2 years ago by Shun-ichi Goto <shunichi.goto@…>

I'm working for a week to implement this backend using Subversion RA API with standard python binding. Now the code, called svn_ra, is implemented as plugin and tested to have same behaviour and result with svn_fs. It seems to work for some small project but not yet tested with big one. So it is alpha state. There are many things to be implemented and improved, especially speed up of resync.

I'm placed it in public. You can try it if you are interested in.
http://www.meadowy.org/~gotoh/projects/remote-svn-plugin/wiki
But don't forget that it should not be used for actual project yet. I'll continue to improve it.

BTW, I've also implemented with pysvn before using RA. It is very costfull because it uses client API (not RA) and client API makes session every API call. I found it is intended to replace client program (wc operation) then I gave up using it.

follow-up: ↓ 77   Changed 22 months ago by cboos

  • milestone changed from 0.11 to 0.12

See the mailing list thread starting with this mail.

We'll see in milestone:0.12 if we will integrate Shun-ichi Goto's svn_ra.py backend in Trac core, or not. In the meantime, please give a try to his remove-svn-plugin and help him improving it.

  Changed 22 months ago by anonymous

  • cc soloturn@… added

follow-up: ↓ 137   Changed 21 months ago by lists@…

  • cc lists@… added

  Changed 21 months ago by anonymous

  • cc rnc000@… removed

removed my email from CC

in reply to: ↑ 73   Changed 21 months ago by Dan <trac@…>

Replying to cboos:

See the mailing list thread starting with this mail. We'll see in milestone:0.12 if we will integrate Shun-ichi Goto's svn_ra.py backend in Trac core, or not. In the meantime, please give a try to his remove-svn-plugin and help him improving it.

I started using it, but I have not yet understood how to configure/update it with user authentication options. This is a stumbling point for me, because the remote repository(s) I want to target are not visible via anonymous access. The standard bindings want to use a callback function for this, but they don't seem to accept a Python function for this purpose. I'm investigating SWIG in general, but so far haven't found a way to implement this capability. (The document I read indicated this kind of callback is not supported.)

I took a look at pysvn, which seems that it would be very simple to add in the authentication callback function(s), although I haven't tried it yet. However, the Trac remote backend using pysvn is apparently a "dead end", as indicated above in comment:72 .

By the way, much thanks to Shun-ichi Goto for getting this feature going! It will be extremely useful IMHO.

  Changed 19 months ago by anonymous

  • cc imanuel.scholz@… added

  Changed 19 months ago by anonymous

  • cc nslater@… added

  Changed 19 months ago by anonymous

  • cc tim_gould@… removed

  Changed 19 months ago by anonymous

  • cc jyrki.muukkonen@… added

  Changed 18 months ago by anonymous

  • cc dewey@… added

  Changed 18 months ago by anonymous

  • cc sergei@… added

  Changed 17 months ago by anonymous

  • cc thomas.subera@… added

  Changed 17 months ago by anonymous

  • cc sloukam@… added

  Changed 17 months ago by anonymous

  • cc dstaple@… added

  Changed 17 months ago by anonymous

  • cc buckett@… added

follow-up: ↓ 136   Changed 17 months ago by anonymous

  • cc jasonm23@… added

  Changed 17 months ago by anonymous

  • cc matthew.block@… added

  Changed 15 months ago by ryanmccue@…

  • cc ryanmccue@… added

This is the one and only reason stopping me from using Trac. I've used Trac on previous projects and it rocks, but as my host doesn't support SVN repositories, I'm keeping them on Google Code and SourceForge?.

  Changed 15 months ago by anonymous

  • cc stevej@… removed

  Changed 15 months ago by anonymous

Another me too. This feature would help me for some sourceforge projects and also in my company.

follow-up: ↓ 94   Changed 15 months ago by anonymous

  • cc jcalcote@… added

Adding myself to the CC list - we need remote SVN access - I'm going to try the one that's been advertised on this ticket, but I'm worried about the alpha state of it. Luckily, all of our repositories have anonymous access, so we don't need svn auth for trac's interface. I wish you folks would up the priority on this one - I'd love to see it integrated in Milestone 0.11. Thanks for the great tool anyway!

in reply to: ↑ 93   Changed 15 months ago by anonymous

Replying to anonymous:

Adding myself to the CC list - we need remote SVN access - I'm going to try the one that's been advertised on this ticket, but I'm worried about the alpha state of it. Luckily, all of our repositories have anonymous access, so we don't need svn auth for trac's interface. I wish you folks would up the priority on this one - I'd love to see it integrated in Milestone 0.11. Thanks for the great tool anyway!

One more note: the primary reasons why we need remote access are not the usual IT department political reasons. Our team works on multiple projects that are scattered over a number of open source repositories - everything from eclipse plug-ins (and if you know anything about eclipse, then you know that their motto is, "IBM's way or the highway") to sourceforge projects to our own internal forge here at Novell. Trac is great, but we really need remote svn repositories.

follow-up: ↓ 96   Changed 15 months ago by anonymous

  • cc trac@… added

will you implement this feature request?

in reply to: ↑ 95   Changed 15 months ago by martin.marcher@…

Replying to anonymous:

will you implement this feature request?

iirc it has been the decision that trac will wait for the python bindings to provide this functionality and then implement it.

Afaik the problem is that pythons svn bindings only provide the functionality trac needs for file:/// URIs and not other protocols...

  Changed 15 months ago by anonymous

  • cc vyt@… removed

  Changed 14 months ago by anonymous

  • cc mdecoffe@… added

  Changed 14 months ago by cboos

One additional note for the svnsync solution (see comment:64):

It might be useful to also run a svnsync copy-revprops command, to catch the changes to revision properties, see the svn book.

The output of that command should be parsed in order to get the list of modified changesets and then you should call trac-admin <env> resync $rev on those (if using Trac 0.10.4 or above), unless you already have a post-revprop-change hook which does this and svnsync copy-revprops calls that hook (I haven't verified that it calls it, but I assume it does).

  Changed 14 months ago by madduck

  • cc trac.edgewall.org@… removed

The spam filter requires me to enter something here or else I can't just remove myself from Cc. Weird.

follow-up: ↓ 102   Changed 14 months ago by radix@…

You're lucky. I'm the reporter so I can't stop getting these god damned emails.

in reply to: ↑ 101   Changed 14 months ago by cboos

  • reporter changed from radix@… to radix at twistedmatrix.com

Replying to radix@twistedmatrix.com:

You're lucky. I'm the reporter so I can't stop getting these god damned emails.

Just ask ;-)

Btw, I started to write a more detailed step-by-step guide about how to setup a svnsync solution, I'll follow-up here when it's done.

  Changed 14 months ago by cmlenz

(very sorry everyone, need to test config change to limit the amount of mails being sent out)

  Changed 12 months ago by anonymous

  • cc jesteves@… added

Another me-too. I need svn+ssh remote access.

in reply to: ↑ description ; follow-up: ↓ 106   Changed 11 months ago by yuangang28@…

  • cc yuangang28@… added

Replying to radix at twistedmatrix.com:

It stinks pretty bad that I have to install trac on my Subversion server AND give it write access to it.

in reply to: ↑ 105   Changed 11 months ago by eblot

Replying to radix at twistedmatrix.com: It stinks pretty bad that I have to install trac on my Subversion server AND give it write access to it.

Use trac with a remote Subversion repository;I want to have the character too

Please do not alter the ticket summary!

follow-up: ↓ 108   Changed 11 months ago by Joymarquis

  • cc joymarquis@… added

I also have such requirement because we share source from a read-only SVN server that is owned by another department.

in reply to: ↑ 107   Changed 11 months ago by eblot

Replying to Joymarquis:

I also have such requirement because we share source from a read-only SVN server that is owned by another department.

If you have only a read-only access to the SVN repository you want to connect to Trac, an easy workaround is to create a local mirror of that remote repository and to keep your local repository in sync with a cron script.

  Changed 10 months ago by anonymous

  • cc a_baranenko@… added

follow-up: ↓ 111   Changed 8 months ago by anonymous

  • version changed from 0.9.2 to 0.11b1

wasnt this scheduled for 0.11 ? its like the most needed feature in trac - thousands of sourceforge developers would turn to trac overnight if this was done... keeping in mind these are all OPEN SOURCE developers meaning quite a few would help out with trac development as well....

in reply to: ↑ 110   Changed