Subversion: Share user file with Apache and svnserve

0

I'd like to support both the svn: and http: protocols for an SVN server that will only be accessed within the network. However, I'd like the two protocols to share the same users and passwords. Is there a way for Apache and svnserve to share the same user data stored in a file local to the server?

jpmc26

Posted 2013-07-13T06:23:19.163

Reputation: 393

Answers

1

Is there a way for Apache and svnserve to share the same user data stored in a file local to the server?

Not directly and automatically, not single file with user-database, but may be scripted and automated (but in insecure, in common way)

Main problem is different formats (and type of stored data) of user-file for Apache and svnserve

passwd-file in Apache uses

user:<HASH-OF-PASSWORD>

user-db for svnserve

[users]
user = PASSWORD

Because hashing is non-reversible function, you must

  • Perform all user-adds and user-edits in user-db (you can try to delete users on Apache's side, but have in this case to support bidirectional sync, thus - I suupose, user-delete in user-db only also will be better choice)
  • After each user-db changes process-parse-sync user-db with passwd-file: read about htpasswd -b mode in man page (maybe about ... -i also)

Just IMNSHO: support only one server will be a lot easier way

Lazy Badger

Posted 2013-07-13T06:23:19.163

Reputation: 3 557

Yes, I agree that a single server would be much easier. No argument there. Unfortunately, there is an existing svnserve that my coworkers (and myself) are using. Now I'm in need of the http server, but I don't want to break everyone else's checkouts. I wonder if rather than trying to synchronize the two, it might be simpler to just have a script that generates the two. Changes require local modifications, anyway. Thanks! – jpmc26 – 2013-07-13T07:25:13.200