PDA

Bekijk de volledige versie : [How to] Subversion, working svn server on WL-500gp or WL-HDD



mefi
09-01-2008, 16:16
# Hey

# i assume that you followed wengi'S great tutorial and your usb hdd is mounted correctly.
# to install svn package, in my case
# http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/svn_1.4.5-3_mipsel.ipk
# just run


ipkg install svn

# prepare the repository, i've mounted my biggest partition under /opt, so here we go


mkdir /opt/share/svn
svnadmin create /opt/share/svn/repos
ls /opt/share/svn/repos

# should look like:

ls
conf/ dav/ db/ format hooks/ locks/ README.txt

# edit /opt/share/svn/repos/conf/svnserve.conf
# the following authz-db DOES finally work for me, i get NO authentication failures anymore


anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = Mefis Home Repository

# the following authz-db DOES finally work for me, i get NO authentication failures anymore
# here is an example how to restrict a SVN project to a certain group
# Notice: here is this example the user mike should be able to connect to the svn project Project01 by connecting with svn://YOURDOMAINNAME/Project01
# beside of this user mefi is able to access also the root svn://YOURDOMAINNAME/



[groups]
admins = mefi
projectgroup1 = mefi, susi, mike, nina

[/Project01]
@projectgroup1 = rw
* =

[/]
@admins = rw
* =


# edit /opt/share/svn/repos/conf/passwd
# choose a username und password you like to use for svn
# not necessaryly the system user you are using

[users]
mefi = secret

# now follows the configuration part for starting svn daemon with xinetd! (NOTICE: this solves the hanging-connection-due-to-low-entropy-problem )
# edit /etc/services and insert following lines

svn 3690/tcp # Subversion
svn 3690/udp # Subversion

# make it persistent


echo "/etc/services" >> /tmp/local/.files

# create the file /opt/etc/xinet.d/svnserve with following contents, and edit it to your needs



service svn
{
disable = no
socket_type = stream
user = YOUR-SYSTEM-USERNAME
server = /opt/bin/svnserve
server_args = -i -r /opt/share/svn/repos
wait = no
nice = 10
only_from = 0.0.0.0/0
}


# and tatata, our lovely flash mem persistent save (reboot not necessary now)


flashfs save && flashfs commit && flashfs enable

# be sure you have xinet configured for starting up automatically
# you should have /opt/etc/init.d/S10xinetd or something like that.


# the svn daemon should everytime be started automatically if an connection request for the svn ports are detected by xinetd

# after the next reboot you should be able automaitcally
# to use svn in your LAN or free the port 3690 in your post-firewall and use subversion from all around the world :D

# i've tested all on wl-500gp and wl-hdd with TortoiseSVN and subclipse as
# clients from my winxp, but should also work with a different configuration.

# Thanks for this great forum.
# mefi

UPDATE (SOLVED SEE UPDATE2):
unfortunatelly there is a problem with /dev/random and the svn package. ( detail: http://rubylution.ping.de/articles/2006/08/12/weird-subversion-hangs-using-svnserve )
WORKAROUND:
if your svn client hangs then perform some commands on your wl-500gp like find / -name blah or top

Does anyone has an idea to solve this problem, permanantly?
There is a new package of svn available (1.4.6). maybe someone could compile for oleg fw

UPDATE2 (SOLVED SEE UPDATE3):
obviously dropbear uses randomly generated data while ssh session is active.
the easiest way not to get the above described "hanging" connection, just log off from your ssh console ;)
i wondered why this problem occured sporadic, now i know ;)

UPDATE3:
whole tutorial above updated.
I managed to solve the hanging-connection-due-to-low-entropy-problem by using the xinetd for fireing the svn process.
svn works now like a charm, i tested it by working on an university developing projekt concurrently with 3 other students. and with my own private reachable low cost svnserver i love the svn concept even more than before ;)
Meanwhile there is a new version of svn package available: svn_1.4.6-1_mipsel.ipk

tj_spark
17-03-2008, 10:12
works like a charme forme :)

there is only one error:

echo "/etc/services" /tmp/local/.files

should be:

echo "/etc/services" > /tmp/local/.files

or nothing will happen, right?

chers
TJ

kibenimatik
14-04-2008, 13:34
# be sure you have xinet configured for starting up automatically
# you should have /opt/etc/init.d/S10xinetd or something like that.

I'm sorry if i ask a stupid question, but what should contain this file /opt/etc/init.d/S10xinetd ?

Serpent
14-04-2008, 14:59
#!/bin/sh
OPTWARE_TARGET=wl500g
#
# Startup script for xinetd
#
# Stop myself if running
killall xinetd 2>/dev/null

# Stop other inetd processes if running
if [ ${OPTWARE_TARGET} = "nslu2" ] ; then
killall inetd 2>/dev/null
fi

/opt/sbin/xinetd

Raven
21-08-2008, 14:47
Makes all the instructions but did not connect goes
No repository found in 'svn://*.*.*.124/finans'

What is wrong?

wpte
05-01-2009, 16:19
hey, just wondering...
did anyone get a successfull port-forward?

as soon as I try to connect from outside, I get the message: "connection unexpectedly closed" in the tortoise svn repo-browser.

in post-firewall I have this:

iptables -A INPUT -p tcp --dport 3690 -j ACCEPT
iptables -A INPUT -p udp --dport 3690 -j ACCEPT

as far as I can see with tcp view, there are no other connections between the server and the client:confused:

rapash
09-03-2009, 19:31
Hello. I have a problem:
svn: Repository moved permanently to https://192.168.1.1/svn/ ; please relocate.

Where is the problem? Thanks

wpte
11-03-2009, 08:10
Hello. I have a problem:
svn: Repository moved permanently to https://192.168.1.1/svn/ ; please relocate.

Where is the problem? Thanks


the url should be like this: svn://192.168.1.1/svn
at least... if you have a folder called svn in your repository.
you first need to create a user for main access

like this:

in the file auth

[/]
admin = rw

in the file pass

admin = mypassword

HomerJay
13-10-2009, 19:59
Hey Guys.

I just installed Olegs firmware (WL500gp-1.9.2.7-d-r655.trx) on my Asus WL500g Premium (V.1) by following wengi's HowTo on http://wl500g.info/showthread.php?t=10307.

After that i tried installing SVN on the Router.

But i didn't get it working.

When I try to connect to the router by svn://192.168.1.1/ i only get the following error message:


Checkout from svn://192.168.1.1/svn, revision HEAD, Fully recursive, Externals included
Kann nicht mit Host »192.168.1.1« verbinden: Es konnte keine Verbindung
hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
In English: "No conn. to Host 192.168....Host rejected connection"

I don't know whats wrong. So please anyone help me...

That's what i did (following the upper HowTo).


ipkg install svn


mkdir /tmp/harddisk/svn
svnadmin create /tmp/harddisk/svn/repos

ls says everthing's fine till now

edited /tmp/harddisk/svn/repos/conf/svnserve.conf like melfi told me to (see post1)
edited /tmp/harddisk/svn/repos/conf/passwd and /tmp/harddisk/svn/repos/authz

edited /etc/services (i suppose it's not important, where i add the 2 lines?!)

#made it persistent

echo "/etc/services" >> /tmp/local/.files

I found out that xinet.d is not part of olegs firmware. So i downloaded it with

ipkg xinetd
then

[admin@nabuko conf]$ vi /opt/etc/xinet.d/svnserve

service svn
{
disable = no
socket_type = stream
user = nabuko
server = /opt/bin/svnserve
server_args = -i -r /tmp/harddisk/svn/repos
wait = no
nice = 10
only_from = 0.0.0.0/0

finally:

flashfs save && flashfs commit && flashfs enable

btw. my S10xinetd


[admin@nabuko conf]$ vi /opt/etc/init.d/S10xinetd


#!/bin/sh
#OPTWARE_TARGET=oleg
OPTWARE_TARGET=wl500g
#
# Startup script for xinetd
#
# Stop myself if running
killall xinetd 2>/dev/null

# Stop other inetd processes if running
if [ ${OPTWARE_TARGET} = "nslu2" ] ; then
killall inetd 2>/dev/null
fi

/opt/sbin/xinetd

As i said, i don't get an conn. to the router via TortoiseSVN.


[admin@nabuko conf]$ ps axf

PID TTY STAT TIME COMMAND
1 ? S 0:01 /sbin/init
2 ? S 0:00 [keventd]
3 ? SN 0:00 [ksoftirqd_CPU0]
4 ? S 0:00 [kswapd]
5 ? S 0:00 [bdflush]
6 ? S 0:00 [kupdated]
7 ? S 0:00 [mtdblockd]
58 ? S 0:00 dropbear
177 ? Ss 0:00 \_ dropbear
178 pts/0 Ss 0:00 \_ -sh
186 pts/0 R+ 0:00 \_ ps axf
63 ? S 0:00 httpd vlan1
65 ? Ss 0:00 klogd
71 ? Ss 0:00 nas /tmp/nas.lan.conf /tmp/nas.lan.pid lan
73 ? S 0:00 dnsmasq
74 ? S 0:00 [khubd]
84 ? Ss 0:00 lpd
86 ? Ss 0:00 p9100d -f /dev/usb/lp0 0
90 ? S 0:00 [usb-storage-0]
91 ? S 0:00 [scsi_eh_0]
98 ? Ss 0:00 pppd file /tmp/ppp/options.wan0
102 ? Ss 0:00 infosvr br0
103 ? Ss 0:00 watchdog
119 ? S 0:00 upnp -D -L br0 -W ppp0
135 ? S 0:00 [kjournald]
136 ? S 0:00 [kjournald]
139 ? Ss 0:00 /usr/sbin/vsftpd
141 ? Ss 0:00 /usr/sbin/nmbd -D
143 ? Ss 0:00 /usr/sbin/smbd -D
159 ? Ss 0:00 /sbin/syslogd -m 0 -O /opt/var/log/syslog.log -S -l
164 ? Ss 0:00 /opt/sbin/cron

Please help me!
Ihr dürft auch in deutsch weiterhelfen ;)

Thanks & Danke


P.S.: starting SVNserver by command: svnserve -d -r /tmp/harddisk/svn/repos/ works
the error seems to be in "/opt/etc/xinet.d/svnserve"....

HomerJay
13-10-2009, 23:26
in addition to my last post (s.b.):

I located the error in


[admin@nabuko conf]$ vi /opt/etc/xinet.d/svnserve


service svn
{
disable = no
socket_type = stream
user = WHAT USERNAME????
server = /opt/bin/svnserve
server_args = -i -r /tmp/harddisk/svn/repos
wait = no
nice = 10
only_from = 0.0.0.0/0


starting it:


[admin@nabuko conf]$ /opt/etc/xinet.d/svnserve svnserve.conf
/opt/etc/xinet.d/svnserve: line 1: service: not found
/opt/etc/xinet.d/svnserve: line 11: disable: not found
/opt/etc/xinet.d/svnserve: line 11: socket_type: not found
/opt/etc/xinet.d/svnserve: line 11: user: not found
/opt/etc/xinet.d/svnserve: line 11: server: not found
/opt/etc/xinet.d/svnserve: line 11: server_args: not found
/opt/etc/xinet.d/svnserve: wait: line 11: Illegal number: =
=: No such file or directory
/opt/etc/xinet.d/svnserve: line 11: only_from: not found


plz help me! thx

wpte
15-10-2009, 23:02
I had some problems with svn as well...
first create a main admin user to log into the server, the account should have access to everything (so that means the dir is "/").
after that you should come along a whole lot further

HomerJay
16-10-2009, 21:59
well, as i said before... i get access to the svn-repos when i startthe SVNserver by command: svnserve -d -r /tmp/harddisk/svn/repos/

But that's not what i want....the solution by starting svnserver oly if it is necessary is the solution i prefere....if somehow it'll work someday :(

smloh
22-10-2009, 17:09
I had the same problem, I found that svnserve should be in xinetd.d, not xinet.d
Hope that helps!

HomerJay
23-10-2009, 19:30
Hey Everybody

I got it workin somehow :)

@smloh: Thank's for your hint. That solved one problem

Note: Second problem solved by command chmod 775 /etc/services

:)

refinedmusic
07-02-2010, 01:16
Hi guys and thanks for the great tutorial!

How do I actually access this on OS X? Xcode or something like ZigVersion?

Thanks!

// Ike

wpte
07-02-2010, 01:27
Hi guys and thanks for the great tutorial!

How do I actually access this on OS X? Xcode or something like ZigVersion?

Thanks!

// Ike

google is your best friend: http://versionsapp.com/
looks like svn for os x:p

btw... shouldn't those linux apps work for OS x as well since they are both posix?
linux one with GUI: http://rapidsvn.tigris.org/

matthewcheck
08-02-2012, 16:27
Hi,

i've successfuly managed to install the svn and is working correctly.
The problem is that i am not able to connect to my svn repository from outside.
I guess i need to correctly setup my post-firewall script, but I really don't know how. Can someone send how the post-firewall script should look like with correct svn settings?

Right now my post-firewall looks like this (only one line to access the box via ssh from outside):

#!/bin/sh
# this opens the ssh port to internet! Be sure to have strong passwords!
iptables -I INPUT -m tcp -p tcp --dport 22 -j ACCEPT

Thanks!

wpte
08-02-2012, 21:33
easy:

iptables -I INPUT -p tcp --dport 3690 -j ACCEPT
and it should work;)

matthewcheck
09-02-2012, 06:55
easy:

and it should work;)

It's working correctly now, thank you very much!

Grabber66
26-05-2012, 21:53
First at all, thanks for this Tutorial. But i have some problems to checkout.
A local import to svn was ok. But if I want to checkout with my OpenSuSe PC via lan
I get the following Error:


svn checkout svn://192.168.1.1/svn/repos ~/testordner
svn: No repository found in 'svn://192.168.1.1/svn/repos'


I think i've missed something, but i have no Idea what this can be.

If i change the checkout


svn checkout svn://192.168.1.1/repos ~/testordner
svn: Invalid authz configuration