Outils pour utilisateurs

Outils du site


linux:subversion:creer_un_depot_svn

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
linux:subversion:creer_un_depot_svn [2025/04/12 14:06] tutospistolinux:subversion:creer_un_depot_svn [2025/04/12 15:03] (Version actuelle) tutospisto
Ligne 3: Ligne 3:
 # authz = /var/svn/MON_DEPOT/conf/authz # authz = /var/svn/MON_DEPOT/conf/authz
 # svn.passwd = /var/svn/MON_DEPOT/conf/svn.passwd (! non fourni !) # svn.passwd = /var/svn/MON_DEPOT/conf/svn.passwd (! non fourni !)
-# svnserve = /etc/init.d/svnserve+# svnserve = /etc/init.d/svnserve</code>
    
    
-# Creation d'un depot (ici TON_DEPOT) +Création d'un dépôt (ici TON_DEPOT) 
-svnadmin create /var/svn/TON_DEPOT +<code bash>svnadmin create /var/svn/TON_DEPOT</code> 
-On edite sa configuration (! fichier dispo avec le tuto !) + 
-nano /var/svn/TON_DEPOT/conf/svnserve.conf +On édite sa configuration : 
-# On cree six utilisateurs pour faire des tests sur les permissions (pour le premier, on utilise l'option -cm (qui cree le fichier), les autres fois l'option -m est suffisante) +<code bash>nano /var/svn/TON_DEPOT/conf/svnserve.conf</code> 
 + 
 +<code bash svnserve.conf[enable_line_numbers=1, highlight_lines_extra="20,27,32", skin=sons-of-obsidian]> 
 +### This file controls the configuration of the svnserve daemon, if you 
 +### use it to allow access to this repository.  (If you only allow 
 +### access through http: and/or file: URLs, then this file is 
 +### irrelevant.) 
 + 
 +### Visit http://subversion.tigris.org/ for more information. 
 + 
 +[general] 
 +### These options control access to the repository for unauthenticated 
 +### and authenticated users.  Valid values are "write", "read", 
 +### and "none" The sample settings below are the defaults. 
 +anon-access = none 
 +auth-access = write 
 +### The password-db option controls the location of the password 
 +### database file.  Unless you specify a path starting with a /, 
 +### the file's location is relative to the directory containing 
 +### this configuration file. 
 +### If SASL is enabled (see below), this file will NOT be used. 
 +### Uncomment the line below to use the default password file. 
 +password-db = svn.passwd 
 +### The authz-db option controls the location of the authorization 
 +### rules for path-based access control.  Unless you specify a path 
 +### starting with a /, the file's location is relative to the the 
 +### directory containing this file.  If you don't specify an 
 +### authz-db, no path-based access control is done. 
 +### Uncomment the line below to use the default authorization file. 
 +authz-db = authz 
 +### This option specifies the authentication realm of the repository. 
 +### If two repositories have the same authentication realm, they should 
 +### have the same password database, and vice versa.  The default realm 
 +### is repository's uuid. 
 +realm = TITRE_DE_TON_DEPOT 
 + 
 +[sasl] 
 +### This option specifies whether you want to use the Cyrus SASL 
 +### library for authentication. Default is false. 
 +### This section will be ignored if svnserve is not built with Cyrus 
 +### SASL support; to check, run 'svnserve --version' and look for a line 
 +### reading 'Cyrus SASL authentication is available.' 
 +# use-sasl = true 
 +### These options specify the desired strength of the security layer 
 +### that you want SASL to provide. 0 means no encryption, 1 means 
 +### integrity-checking only, values larger than 1 are correlated 
 +### to the effective key length for encryption (e.g. 128 means 128-bit 
 +### encryption). The values below are the defaults. 
 +# min-encryption = 0 
 +# max-encryption = 256 
 + 
 +</code> 
 + 
 +On crée six utilisateurs pour faire des tests sur les permissions (pour le premier, on utilise l'option -cm (qui crée le fichier), les autres fois l'option -m est suffisante)  
 + 
 +<code bash>
 htpasswd -cm /var/svn/TON_DEPOT/conf/svn.passwd admin1 htpasswd -cm /var/svn/TON_DEPOT/conf/svn.passwd admin1
 htpasswd -m /var/svn/TON_DEPOT/conf/svn.passwd admin2 htpasswd -m /var/svn/TON_DEPOT/conf/svn.passwd admin2
Ligne 17: Ligne 72:
 htpasswd -m /var/svn/TON_DEPOT/conf/svn.passwd lecteur1 htpasswd -m /var/svn/TON_DEPOT/conf/svn.passwd lecteur1
 htpasswd -m /var/svn/TON_DEPOT/conf/svn.passwd lecteur2 htpasswd -m /var/svn/TON_DEPOT/conf/svn.passwd lecteur2
-On configure les permissions du depot (! fichier d'exemple dispo avec le tuto !) +</code> 
-nano /var/svn/mon_depot/conf/authz + 
-# On configure le Path (chemin) du depot et on indique quels sont les fichiers authz et passwd grace au fichier dav_svn.conf (! fichier dispo avec le tuto !) +On configure les permissions du dépôt : 
-nano /etc/apache2/mods-available/dav_svn.conf +<code bash>nano /var/svn/TON_DEPOT/conf/authz</code> 
-On donne recursivement acces a tout les depots svn pour l'utilisateur svn (il faudra le refaire chaque ajout d'un nouveau depot !) + 
-chown -R svn: /var/svn + 
-On donne les droits apache sur le repertoire pour pouvoir publier le depot et acceder aux fichiers de configuration +<code bash authz[enable_line_numbers=1, highlight_lines_extra="34,35,37,38,39,40,42,43", skin=sons-of-obsidian]> 
-chown -R www-data:www-data /var/svn/ +### This file is an example authorization file for svnserve. 
-Le tout en une seule commande :  +### Its format is identical to that of mod_authz_svn authorization 
-chown -R svn: /var/svn && chown -R www-data:www-data /var/svn/ +### files. 
-On redemarre apache et svn pour qu'ils rechargent leurs configuration et prennent en compte nos changements +### As shown below each section defines authorizations for the path and 
-/etc/init.d/svnserve restart && /etc/init.d/apache2 restart && /etc/init.d/mongrel_cluster restart</code>+### (optional) repository specified by the section name. 
 +### The authorizations follow. An authorization line can refer to: 
 +###  - a single user, 
 +###  - a group of users defined in a special [groups] section, 
 +###  - an alias defined in a special [aliases] section, 
 +###  - all authenticated users, using the '$authenticated' token, 
 +###  - only anonymous users, using the '$anonymous' token, 
 +###  - anyone, using the '*' wildcard. 
 +### 
 +### A match can be inverted by prefixing the rule with '~'. Rules can 
 +### grant read ('r') access, read-write ('rw') access, or no access 
 +### (''). 
 + 
 +[aliases] 
 +# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average 
 + 
 +[groups] 
 +# harry_and_sally = harry,sally 
 +# harry_sally_and_joe = harry,sally,&joe 
 + 
 +# [/foo/bar] 
 +# harry = rw 
 +# &joe = r 
 +# * = 
 + 
 +# [repository:/baz/fuz] 
 +# @harry_and_sally = rw 
 +# * = r 
 + 
 +[/] 
 +admin1 = rw 
 + 
 +[/Projet1/code] 
 +visiteur1 = r 
 +admin2 =  rw 
 +dev1 = rw 
 + 
 +[/VieUniversEtLeReste] 
 +utilisateur42 =  rw 
 +</code> 
 + 
 + 
 +On configure le Path (chemin) du dépôt et on indique quels sont les fichiers authz et passwd grâce au fichier dav_svn.conf : 
 + 
 +<code bash>nano /etc/apache2/mods-available/dav_svn.conf</code> 
 + 
 +On ajoute : 
 +<code bash> 
 +<Location /svn_TON_DEPOT> 
 +        DAV svn 
 +        SVNPath /var/svn/TON_DEPOT 
 +        AuthType Basic 
 +        AuthName "TON_TITRE_DE_DEPOT" 
 +        AuthUserFile /var/svn/TON_DEPOT/conf/svn.passwd 
 + 
 +        AuthzSVNAccessFile /var/svn/TON_DEPOT/conf/authz 
 +        Require valid-user 
 +</Location> 
 +</code> 
 + 
 +On donne récursivement accès a tout les dépôts svn pour l'utilisateur svn. <note important>Il faudra le refaire à chaque ajout d'un nouveau dépôt !</note> 
 + 
 +<code bash>chown -R svn: /var/svn</code> 
 +On donne les droits à apache sur le répertoire pour pouvoir publier le dépôt et accéder aux fichiers de configuration 
 + 
 +<code bash>chown -R www-data:www-data /var/svn/</code> 
 + 
 +Le tout en une seule commande :  
 +<code bash>chown -R svn: /var/svn && chown -R www-data:www-data /var/svn/</code> 
 + 
 +On redémarre apache et svn pour qu'ils rechargent leurs configuration et prennent en compte nos changements 
 +<code bash>/etc/init.d/svnserve restart && /etc/init.d/apache2 restart</code>
  
-Le dépôt est accessibles sur http://TONDOMAIN/svn_TONDEPOT+Le dépôt est accessibles sur http://TONDOMAINE/svn_TONDEPOT
  
-A VOIR http://www.fr.sysadmin-cookbook.net/subversion+Pour se servir de SVN sur windows avec TortoiseSVN  
 +{{ :linux:subversion:tuto_svn_utilisation_tortoisesvn.pdf |}}
linux/subversion/creer_un_depot_svn.1744466768.txt.gz · Dernière modification : 2025/04/12 14:06 de tutospisto