<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Charles Sanquer</title>
    <description>Charles Sanquer Blog</description>
    <link>http://www.charles-sanquer.net//</link>
    <atom:link href="http://www.charles-sanquer.net//feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Fri, 26 Aug 2016 21:27:13 +0200</pubDate>
    <lastBuildDate>Fri, 26 Aug 2016 21:27:13 +0200</lastBuildDate>
    <generator>Jekyll v3.2.1</generator>
    
      <item>
        <title>Symfony2 avec npm, bower et assetic</title>
        <description>&lt;p&gt;Petit tutoriel pour combiner &lt;a href=&quot;https://getcomposer.org&quot;&gt;composer&lt;/a&gt;, &lt;a href=&quot;https://www.npmjs.org/&quot;&gt;npm&lt;/a&gt; (&lt;a href=&quot;http://nodejs.org/&quot;&gt;nodejs&lt;/a&gt;), &lt;a href=&quot;http://bower.io/&quot;&gt;bower&lt;/a&gt; et &lt;a href=&quot;http://symfony.com/fr/doc/current/cookbook/assetic/index.html&quot;&gt;assetic&lt;/a&gt; afin de gérer toutes vos dépendances CSS, JS, PHP sur un projet symfony2.&lt;/p&gt;

&lt;h3 id=&quot;prrequis&quot;&gt;Prérequis&lt;/h3&gt;

&lt;p&gt;Vous avez besoin de :
* PHP &amp;gt;= 5.3 (évidement)
* nodejs &amp;gt;= 0.10
* Git pour le téléchargement des dépendances
* &lt;a href=&quot;https://getcomposer.org&quot;&gt;composer&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;configurer-composer&quot;&gt;Configurer Composer&lt;/h3&gt;

&lt;p&gt;Il faut ajouter la commande &lt;code class=&quot;highlighter-rouge&quot;&gt;npm install&lt;/code&gt; au niveau des hooks post-install et post-update de la section scripts du fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;composer.json&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;scripts&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;post-install-cmd&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;npm install&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;post-update-cmd&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;npm install&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;configurer-npm&quot;&gt;Configurer NPM&lt;/h3&gt;

&lt;p&gt;Créez un fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;packages.json&lt;/code&gt; (vous pouvez utiliser notamment la commande &lt;code class=&quot;highlighter-rouge&quot;&gt;npm init&lt;/code&gt;).
Le point important est de renseigner la section scripts - postinstall avec la commande bower.&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my-sf2-project&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Martin Durand martin.durand@example.com&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;private&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;dependencies&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;less&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~1.7&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;uglify-js&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~2.4&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;uglifycss&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~0.0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;bower&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~1.3&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;scripts&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;postinstall&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;node_modules/.bin/bower install&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ici, NPM est configuré de la façon suivante :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;l’application symfony2 est &lt;strong&gt;privée&lt;/strong&gt; (elle ne doit pas être publié sur www.npmjs.org)&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;on utilise les dépendances nodejs suivante &lt;a href=&quot;http://lesscss.org/&quot;&gt;less&lt;/a&gt; , &lt;a href=&quot;https://github.com/mishoo/UglifyJS2&quot;&gt;uglify-js&lt;/a&gt; , &lt;a href=&quot;https://github.com/fmarcia/UglifyCSS&quot;&gt;uglifycss&lt;/a&gt;, et bien sur &lt;a href=&quot;http://bower.io/&quot;&gt;bower&lt;/a&gt;.&lt;/p&gt;

    &lt;p&gt;Less, uglify-js et uglifycss seront utilisé par les filtres assetic par la suite.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;à la fin de l’installation npm, on lance l’installation des packages front par &lt;strong&gt;bower&lt;/strong&gt; : on utilise l’executable bower local du projet qui a été installé dans &lt;code class=&quot;highlighter-rouge&quot;&gt;node_modules/.bin/bower&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;configurer-bower&quot;&gt;Configurer bower&lt;/h3&gt;

&lt;p&gt;Créez tout d’abord un fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;.bowerrc&lt;/code&gt; afin de définir où les packages front vont être installé :&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;directory&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;web/bower_components&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ici on configure bower pour installer les dépendances front dans le dossier &lt;code class=&quot;highlighter-rouge&quot;&gt;bower_components&lt;/code&gt; dans le dossier &lt;code class=&quot;highlighter-rouge&quot;&gt;web&lt;/code&gt; de symfony2.
On pourrait aussi les installer dans le dossier &lt;code class=&quot;highlighter-rouge&quot;&gt;Resources/public/bower_components&lt;/code&gt; d’un bundle.&lt;/p&gt;

&lt;p&gt;Ensuite il faut créer le fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;bower.json&lt;/code&gt; (éventuellement avec la commande &lt;code class=&quot;highlighter-rouge&quot;&gt;bower init&lt;/code&gt; ou plutôt &lt;code class=&quot;highlighter-rouge&quot;&gt;node_modules/.bin/bower init&lt;/code&gt; car on utlise une version de bower installé de façon locale par npm).&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my-sf2-project&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;authors&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Martin Durand &amp;lt;martin.durand@example.com&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;private&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;ignore&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;**/.*&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;node_modules&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;bower_components&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;public/bower_components&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;tests&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;dependencies&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;bootstrap&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;v3.1.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;jquery&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~2.1.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;jquery-migrate&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~1.2.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;font-awesome&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;~4.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;modernizr&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2.6.2&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ici, Bower est configuré pour rendre privé le projet symfony2 ( pas de publication accidentelle sur bower.io) et on utilise les dépendances suivantes : twitter bootstrap, jquery, font-awesome et modernizr.&lt;/p&gt;

&lt;h3 id=&quot;configuration-dassetic-et-symfony2&quot;&gt;Configuration d’Assetic et Symfony2&lt;/h3&gt;

&lt;p&gt;Modification de la config d’assetic :&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;app/config/config.yml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;s&quot;&gt;assetic&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%kernel.debug%&quot;&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;use_controller&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;enabled&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/local/bin/node&quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# chemin vers l'executable nodejs&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;node_paths&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# chemin vers les modules nodejs installés localement pour le projet par npm&lt;/span&gt;
        &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%kernel.root_dir%/../node_modules&quot;&lt;/span&gt;  
        &lt;span class=&quot;c1&quot;&gt;# chemin vers les modules nodejs du systeme, sert de fallback&lt;/span&gt;
        &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/local/lib/node_modules&quot;&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;filters&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;less&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;apply_to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.less$&quot;&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# on utilise le lessc installé localement&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%kernel.root_dir%/../node_modules/.bin/lessc&quot;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;cssrewrite&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;apply_to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.css$&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;app/config/config_prod.yml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;s&quot;&gt;assetic&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;filters&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;less&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;apply_to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.less$&quot;&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# on utilise le lessc installé localement&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%kernel.root_dir%/../node_modules/.bin/lessc&quot;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;cssrewrite&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;apply_to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.css$&quot;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;uglifycss&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# on utilise le uglifycss installé localement&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%kernel.root_dir%/../node_modules/.bin/uglifycss&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;apply_to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.css$&quot;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;uglifyjs2&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# on utilise le uglifyjs installé localement&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%kernel.root_dir%/../node_modules/.bin/uglifyjs&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;apply_to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.js$&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;utilisation-des-assets-dans-twig&quot;&gt;Utilisation des assets dans twig&lt;/h3&gt;

&lt;p&gt;Desormais vous pouvez utiliser les balises assetic de twig pour compiler les fichiers less et rassembler et minifier tous les fichiers js et css&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;stylesheets&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/less/bootstrap.less'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;output='css/compiled/main.css'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;lt;link&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{{ asset_url }}&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;media=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;screen&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;endstylesheets&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;javascripts&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/modernizr/modernizr.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/jquery/dist/jquery.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/jquery-migrate/jquery-migrate.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/affix.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/alert.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/button.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/carousel.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/collapse.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/dropdown.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/modal.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/tooltip.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/popover.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/scrollspy.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/tab.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'bower_components/bootstrap/js/transition.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;output='js/compiled/main.js'&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{{ asset_url }}&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;endjavascripts&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;on-installe-tout&quot;&gt;On installe tout&lt;/h3&gt;

&lt;p&gt;Maintenant on peut tout installer :&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;php composer.phar install
php app/console assetic:dump --env&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;prod --no-debug
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;et voila !&lt;/p&gt;
</description>
        <pubDate>Fri, 27 Jun 2014 14:34:00 +0200</pubDate>
        <link>http://www.charles-sanquer.net//tutoriels/2014/06/27/assetic-npm-symfony2/</link>
        <guid isPermaLink="true">http://www.charles-sanquer.net//tutoriels/2014/06/27/assetic-npm-symfony2/</guid>
        
        <category>symfony</category>
        
        <category>assets</category>
        
        <category>css</category>
        
        <category>javascript</category>
        
        <category>bower</category>
        
        <category>assetic</category>
        
        
        <category>tutoriels</category>
        
      </item>
    
      <item>
        <title>Installation Gitolite</title>
        <description>&lt;h2 id=&quot;prparation&quot;&gt;Préparation&lt;/h2&gt;
&lt;p&gt;Au préalable, vous devez installer git et gitweb :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo aptitude install git gitweb
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;et créer un compte unix git qui va heberger gitolite et les dépots git :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo adduser --system --shell /bin/bash --gecos &lt;span class=&quot;s1&quot;&gt;'git version control'&lt;/span&gt; --group --disabled-password --home /home/git git
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ensuite vous devez copier votre clé publique ssh (pour administrer gitolite et utiliser git) sur le serveur dans &lt;code class=&quot;highlighter-rouge&quot;&gt;/home/git&lt;/code&gt; et la renommer en &lt;code class=&quot;highlighter-rouge&quot;&gt;VotrePrenom.VotreNom.pub&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;installation-de-gitolite&quot;&gt;Installation de gitolite&lt;/h2&gt;

&lt;p&gt;On supprime les eventuelles clés SSH déjà autorisées et on prepare le PATH de l’utilisateur git&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo su git
rm &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.ssh/authorized_keys
mkdir -p &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/bin
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'PATH=$HOME/bin:$PATH'&lt;/span&gt; &amp;gt;&amp;gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.bashrc
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; .bashrc
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;puis on installe gitolite depuis &lt;a href=&quot;https://github.com/sitaramc/gitolite&quot; title=&quot;github gitolite&quot;&gt;github&lt;/a&gt; :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git://github.com/sitaramc/gitolite
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;gitolite
git co v3.5.3.1
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~
gitolite/install -ln &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/bin
gitolite setup -pk VotrePrenom.VotreNom.pub
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h2 id=&quot;configuration-de-gitweb-pour-gitolite&quot;&gt;Configuration de Gitweb pour gitolite&lt;/h2&gt;

&lt;p&gt;Gitweb ne fonctionne pas avec gitolite par defaut:
On va adapter sa configuration en remplaçant le contenu du fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/gitweb.conf&lt;/code&gt; par celui-ci :&lt;/p&gt;

&lt;div class=&quot;language-perl highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# debian gitweb conf with manual gitolite install&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# handle gitolite 3 acl in gitweb&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# path to git projects (&amp;lt;project&amp;gt;.git)&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$projectroot&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/home/git/repositories&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# directory to use for temp files&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$git_temp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/tmp&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# target of the home link on top of all pages&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#$home_link = $my_uri || &quot;/&quot;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# html text to include at home page&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#$home_text = &quot;indextext.html&quot;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# file with project list; by default, simply scan the projectroot dir.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#$projects_list = $projectroot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# stylesheet to use&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#@stylesheets = (&quot;static/gitweb.css&quot;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# javascript code for gitweb&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#$javascript = &quot;static/gitweb.js&quot;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# logo to use&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#$logo = &quot;static/git-logo.png&quot;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# the 'favicon'&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$favicon&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;static/git-favicon.png&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# ----------------------------------------------------------------------&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Per-repo authorization for gitweb using gitolite v3 access rules&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Read comments, modify code as needed, and include in gitweb.conf&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Please note that the author does not have personal experience with gitweb&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# and does not use it.  Some testing may be required.  Patches welcome but&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# please make sure they are tested against a &quot;github&quot; version of gitolite and&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# not an RPM or a DEB, for obvious reasons.&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# ----------------------------------------------------------------------&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# First, run 'gitolite query-rc -a' (as the gitolite hosting user) to find the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# values for GL_BINDIR and GL_LIBDIR in your installation.  Then use those&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# values in the code below:&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;BEGIN&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;HOME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/home/git&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;c1&quot;&gt;# or whatever is the hosting user's $HOME&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GL_BINDIR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/home/git/bin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GL_LIBDIR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/home/git/bin/lib&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Pull in gitolite's perl API module.  Among other things, this also sets the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# GL_REPO_BASE environment variable.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;lib&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GL_LIBDIR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Gitolite::&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Easy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Set projectroot for gitweb.  If you already set it earlier in gitweb.conf&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# you don't need this but please make sure the path you used is the same as&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# the value of GL_REPO_BASE in the 'gitolite query-rc -a' output above.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#$projectroot = $ENV{GL_REPO_BASE};&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Now get the user name.  Unauthenticated clients will be deemed to be the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# 'gitweb' user so make sure gitolite's conf file does not allow that user to&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# see anything sensitive.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# for nginx add this to nginx config&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# fastcgi_param   REMOTE_USER     $remote_user;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GL_USER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$cgi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;remote_user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;gitweb&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$export_auth_hook&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$repo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# gitweb passes us the full repo path; we need to strip the beginning and&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# the end, to get the repo name as it is specified in gitolite conf&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$repo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;s/^\\Q$projectroot\\E\\/?(.+)\\.git$/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# call Easy.pm's 'can_read' function&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;can_read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$repo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;$feature&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'highlight'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'default'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$feature&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'highlight'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'override'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# git-diff-tree(1) options to use for generated patches&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#@diff_opts = (&quot;-M&quot;);&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;@diff_opts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Puis il faut configurer gitolite pour gerer les mots de passe pour gitweb et les droits UNIX sur les dépots.
Il suffit de modifier le fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;/home/git/.gitolite.rc&lt;/code&gt; en ajoutant ou modifiant les variables de config suivante:&lt;/p&gt;

&lt;div class=&quot;language-perl highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;%RC&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ....&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;UMASK&lt;/span&gt;                       &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;  &lt;span class=&quot;mo&quot;&gt;0027&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#les depots doivent pouvoir être lu par le group git&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;GIT_CONFIG_KEYS&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;  &lt;span class=&quot;s&quot;&gt;'gitweb\\..*'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;HTPASSWD_FILE&lt;/span&gt;               &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;  &lt;span class=&quot;s&quot;&gt;'/home/git/git_users.passwd'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# pour pouvoir editer son mot de passe gitweb&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ....&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;COMMANDS&lt;/span&gt;                    &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# ....&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;'htpasswd'&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;  &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# pour pouvoir editer son mot de passe gitweb&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;# ....&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ....&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;On change les droits des dépots (&lt;code class=&quot;highlighter-rouge&quot;&gt;drwxr-x---&lt;/code&gt; pour les dossiers et &lt;code class=&quot;highlighter-rouge&quot;&gt;-rw-r-----&lt;/code&gt; pour les fichiers ) afin qu’ils soient lisibles et modifiable par l’utilisateur git et lisibles uniquement par le groupe git.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chmod -R &lt;span class=&quot;nv&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rwX,g&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rX,o&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; /home/git/repositories/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;on crée un nouveau fichier de mot de passe pour gitweb (via la commande apache &lt;code class=&quot;highlighter-rouge&quot;&gt;htpasswd&lt;/code&gt;)&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;htpasswd -c /home/git/git_users.passwd VotrePrenom.VotreNom
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h2 id=&quot;configuration-du-serveur-web-apache-ou-nginx&quot;&gt;Configuration du serveur Web (apache ou nginx)&lt;/h2&gt;

&lt;p&gt;D’abord, ajoutez l’utilisateur apache (ou nginx) &lt;code class=&quot;highlighter-rouge&quot;&gt;www-data&lt;/code&gt; au groupe &lt;code class=&quot;highlighter-rouge&quot;&gt;git&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo adduser www-data git
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;puis créez un fichier vhost pour gitweb ( ex git.mydomain.example)&lt;/p&gt;

&lt;h3 id=&quot;configuration-apache-2&quot;&gt;Configuration Apache 2&lt;/h3&gt;

&lt;p&gt;créez le fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/apache2/sites-available/gitweb-ssl&lt;/code&gt; :&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;IfModule mod_ssl.c&amp;gt;
&amp;lt;VirtualHost *:443&amp;gt;
  ServerName git.mydomain.example
  DocumentRoot &quot;/usr/share/gitweb&quot;
  DirectoryIndex index.cgi

  &amp;lt;Location /&amp;gt;
      # try anonymous access first, resort to real
      #Satisfy Any
      # authentication if necessary.
      Require valid-user

      SSLRequireSSL

      # how to authenticate a user
      AuthType Basic
      AuthName &quot;Gitweb : Depots git&quot;
      AuthUserFile /home/git/git_users.passwd
   &amp;lt;/Location&amp;gt;

   &amp;lt;Directory /usr/share/gitweb&amp;gt;
      Options FollowSymLinks +ExecCGI
      AddHandler cgi-script .cgi
   &amp;lt;/Directory&amp;gt;

   CustomLog /var/log/apache2/gitweb.access.log combined
   ErrorLog /var/log/apache2/gitweb.error.log

   SSLEngine on
   SSLCertificateFile    /etc/ssl/certs/&amp;lt;my-ssl-certificate-pem&amp;gt;.pem
   # Add this once there is a real (non self-signed) certificate.
   SSLCertificateKeyFile /etc/ssl/private/&amp;lt;my-ssl-certificate-key&amp;gt;.key
&amp;lt;/VirtualHost&amp;gt;

&amp;lt;VirtualHost *:80&amp;gt;
  ServerName git.mydomain.example

  Redirect / https://git.mydomain.example/
&amp;lt;/VirtualHost&amp;gt;
&amp;lt;/IfModule&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Enfin activez le vhost et redémarrez apache :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;a2enmod rewrite actions headers ssl vhost_alias
a2ensite gitweb-ssl
service apache2 restart
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h3 id=&quot;configuration-nginx&quot;&gt;Configuration Nginx&lt;/h3&gt;

&lt;p&gt;créez le fichier &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/nginx/sites-available/gitweb-ssl&lt;/code&gt; :&lt;/p&gt;

&lt;div class=&quot;language-nginx highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;server&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;80&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;server_name&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git.mydomain.example&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;rewrite&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;https://git.mydomain.example&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request_uri&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;permanent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# HTTPS server
#
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;server&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;443&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;server_name&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;git.mydomain.example&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;root&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/usr/share/gitweb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;ssl&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;ssl_certificate&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/etc/ssl/localcerts/&amp;lt;my-ssl-certificate-pem&amp;gt;.pem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;ssl_certificate_key&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/etc/ssl/localcerts/&amp;lt;my-ssl-certificate-key&amp;gt;.key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;ssl_session_timeout&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;ssl_protocols&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;SSLv3&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;TLSv1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;ssl_ciphers&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;ssl_prefer_server_ciphers&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;access_log&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/var/log/nginx/gitweb.access.log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;error_log&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/var/log/nginx/gitweb.error.log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;utf-8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;auth_basic&lt;/span&gt;           &lt;span class=&quot;s&quot;&gt;&quot;RESTRICTED&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ACCESS&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;auth_basic_user_file&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;/home/git/git_users.passwd&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kn&quot;&gt;try_files&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$uri&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;@gitweb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;@gitweb&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;fastcgi_pass&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unix:/var/run/fcgiwrap.socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;SCRIPT_FILENAME&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;/usr/share/gitweb/gitweb.cgi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;PATH_INFO&lt;/span&gt;         &lt;span class=&quot;nv&quot;&gt;$uri&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;GITWEB_CONFIG&lt;/span&gt;     &lt;span class=&quot;n&quot;&gt;/etc/gitweb.conf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;REMOTE_USER&lt;/span&gt;     &lt;span class=&quot;nv&quot;&gt;$remote_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;fastcgi_params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Enfin activez le vhost et redémarrez nginx :&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ngxensite gitweb-ssl
&lt;span class=&quot;c&quot;&gt;# ou ln -s /etc/nginx/sites-available/gitweb-ssl /etc/nginx/sites-enabled/gitweb-ssl&lt;/span&gt;
service nginx restart
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
        <pubDate>Wed, 19 Jun 2013 16:12:00 +0200</pubDate>
        <link>http://www.charles-sanquer.net//tutoriels/2013/06/19/installation-gitolite/</link>
        <guid isPermaLink="true">http://www.charles-sanquer.net//tutoriels/2013/06/19/installation-gitolite/</guid>
        
        <category>git</category>
        
        <category>gitolite</category>
        
        
        <category>tutoriels</category>
        
      </item>
    
  </channel>
</rss>
