Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Install Subversion with SASL auth on Ubuntu 14.04.1 LTS
- #
- # 30/12/2014 V1.0 - Alessandro Carini
- #
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Installiamo Subversion e configuriamo il supporto SASL
- # ----------------------------------------------------------------------------
- SVNROOT="/srv/subversion"
- SVNUSER="subversion"
- DOMAIN="example.com"
- ACCOUNT="myuser"
- PASSWORD="mypassword"
- REPOSITORY="myrepo"
- # -= Installiamo subversion e sasl =-
- apt-get -y install subversion xinetd sasl2-bin gsasl
- adduser --system --group --home $SVNROOT $SVNUSER
- # -= Configuriamo svnserve per funzionare tramite xinetd =-
- cat << __EOF__ > /etc/xinetd.d/svnserve
- # default: on
- # description:
- # Subversion server for the svn protocol
- service svn
- {
- disable = no
- id = svn-stream
- socket_type = stream
- protocol = tcp
- instances = 50
- per_source = 5
- log_on_success += PID HOST DURATION
- log_on_failure += HOST
- wait = no
- user = $SVNUSER
- server = /usr/bin/svnserve
- server_args = -i -r $SVNROOT
- }
- __EOF__
- reload xinetd
- # -= Configuriamo SASL =-
- mkdir /etc/sasl2
- cat << __EOF__ > /etc/sasl2/svn.conf
- pwcheck_method: auxprop
- auxprop_plugin: sasldb
- sasldb_path: $SVNROOT/sasldb2
- # mech_list: DIGEST-MD5 GSSAPI
- __EOF__
- # -= Creiamo un account e un repository di test =-
- # utente di test (e.g. saslpasswd2 -c -a svn -u example.com myuser)
- saslpasswd2 -c -a svn -u $DOMAIN $ACCOUNT << __EOF__
- $PASSWORD
- __EOF__
- # repository di test
- svnadmin create $SVNROOT/$REPOSITORY
- creation=$(date "+%Y%m%d")
- mv $SVNROOT/$REPOSITORY/conf/authz $SVNROOT/$REPOSITORY/conf/authz.$creation
- mv $SVNROOT/$REPOSITORY/conf/svnserve.conf $SVNROOT/$REPOSITORY/conf/svnserve.conf.$creation
- cat << __EOF__ > $SVNROOT/$REPOSITORY/conf/authz
- # domain = $DOMAIN, repository $REPOSITORY
- # created = $creation
- [groups]
- rwgroup = $ACCOUNT
- [$REPOSITORY:/]
- @rwgroup = rw
- __EOF__
- cat << __EOF__ > $SVNROOT/$REPOSITORY/conf/svnserve.conf
- # domain = $DOMAIN, repository $REPOSITORY
- # created = $creation
- [general]
- anon-access = none
- auth-access = write
- authz-db = authz
- realm = example.com
- [sasl]
- use-sasl = true
- min-encryption = 128
- max-encryption = 2048
- __EOF__
- # mettiamo a posto i permessi
- chown -cR $SVNUSER:$SVNUSER $SVNROOT
- # end
Advertisement
Add Comment
Please, Sign In to add comment