Modifications entre les versions 7 et 10 (s'étendant sur 3 versions)
Version 7 à la date du 2010-09-13 15:12:36
Taille: 9215
Éditeur: ThomasNoël
Commentaire: 1.0
Version 10 à la date du 2019-11-25 17:36:43
Taille: 12946
Commentaire: mise à jour…
Texte supprimé. Texte ajouté.
Ligne 9: Ligne 9:
Sources d'inspiration :  Sources d'inspiration :
Ligne 32: Ligne 32:
# aptitude install ruby  # aptitude install ruby
Ligne 194: Ligne 194:
== Patches AUF == == Patches AUF (actif) ==
Ligne 198: Ligne 198:
 * permettre des logins de 60 caractères : http://www.redmine.org/attachments/1642/0001-Fixes-2719.patch
 * afficher "votre courriel AUF" sur la plage de login :
 {{{
--- app/views/account/login.rhtml (revision 3762)
+++ app/views/account/login.rhtml (working copy)
@@ -4,7 +4,7 @@
 * rendre accessible l'URL demandée initialement
 {{{#!highlight diff
--- app/helpers/application_helper.rb (révision 6284)
+++ app/helpers/application_helper.rb (copie de travail)
@@ -766,6 +766,12 @@
     form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
   end

+ def back_url_link
+ back_url = params[:back_url] || request.env['HTTP_REFERER']
+ back_url = CGI.unescape(back_url.to_s)
+ CGI.escape(back_url)
+ end
+
   def back_url_hidden_field_tag
     back_url = params[:back_url] || request.env['HTTP_REFERER']
     back_url = CGI.unescape(back_url.to_s)
}}}
 * ajouter l'accès id.auf (SSO/SLO) sur la page de login :
 {{{#!highlight diff
--- ./app/views/account/login.html.erb.orig 2016-10-10 07:48:13.000000000 +0000
+++ ./app/views/account/login.html.erb 2019-11-25 16:38:12.754314977 +0000
@@ -3,6 +3,19 @@
 <%= form_tag(signin_path, onsubmit: 'return keepAnchorOnSignIn(this);') do %>
Ligne 206: Ligne 224:
+<tbody>
+<tr><td align="left"><strong>Usagers de l'AUF&nbsp;:</strong></td>
+ <td align="right">
+ <a href="/mellon/login?ReturnTo=<%= back_url_link %>" onMouseOver="document.idauf_bouton.src='/idauf_bouton_survol.png';" onMouseOut="document.idauf_bouton.src='/idauf_bouton.png';"><img id="idauf_bouton" width="200" height="32" src="/idauf_bouton.png" /></a>
+ </td>
+</tr>
+<tr><td colspan="2"><div style="position: relative; top: 0; left: 0; text-align: center;">
+ <hr style="display: inline-block; position: absolute; left: 0; width: 45%; height: 2px;" />
+ <span> ou </span>
+ <hr style="display: inline-block; position: absolute; right: 0; width: 45%; height: 2px;" />
+ </div></td>
+</tr>
+<tr><td colspan="2" align="left"><strong>Pour les usagers qui n'ont pas d'adresse @auf.org,</strong><br />utilisez le formulaire de connexion suivant&nbsp;:</strong></td></tr>
Ligne 207: Ligne 238:
- <td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
+ <td align="right"><label for="username"><%=l(:field_login)%>:</label><br /><i>(votre courriel AUF)</i></td>
     <td align="left"><%= text_field_tag 'username', nil, :tabindex => '1' %></td>
     <td style="text-align:right;"><label for="username"><%=l(:field_login)%>:</label></td>
     <td style="text-align:left;"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
@@ -10,6 +23,8 @@
 <tr>
     <td style="text-align:right;"><label for="password"><%=l(:field_password)%>:</label></td>
     <td style="text-align:left;"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
+ <% if Setting.lost_password? %>&nbsp;&nbsp;<%= link_to 'Oublié ?', :controller => 'account', :action => 'lost_password' %><% end %>
+ </td>
Ligne 211: Ligne 247:
 <% if Setting.openid? %>
Ligne 212: Ligne 249:
}}}
 * --(utilisation correcte de `git` pour les projets avec dépôt git :)-- plus nécessaire en 1.0 ?
 {{{
@@ -20,21 +35,13 @@
 <tr>
     <td></td>
     <td style="text-align:left;">
+ <input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5" style="float: right;" />
         <% if Setting.autologin? %>
         <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
         <% end %>
     </td>
 </tr>
-<tr>
- <td style="text-align:left;">
- <% if Setting.lost_password? %>
- <%= link_to l(:label_password_lost), lost_password_path %>
- <% end %>
- </td>
- <td style="text-align:right;">
- <input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
- </td>
-</tr>
+</tbody>
 </table>
 <% end %>
 </div>
}}}
 {{{#!highlight diff
--- public/stylesheets/application.css (révision 7077)
+++ public/stylesheets/application.css (copie de travail)
@@ -89,7 +89,8 @@
 #login-form table {margin-top:5em; padding:1em; margin-left: auto; margin-right: auto; border: 2px solid #FDBF3B; background-color:#FFEBC1; }
 #login-form table td {padding: 6px;}
 #login-form label {font-weight: bold;}
-#login-form input#username, #login-form input#password { width: 300px; }
+#login-form input#username { width: 300px; }
+#login-form input#password { width: 220px; }
 
 input#openid_url { background: url(../images/openid-bg.gif) no-repeat; background-color: #fff; background-position: 0 50%; padding-left: 18px; }
 
}}}

== Patches AUF (obsolètes) ==

 * --(utilisation correcte de `git` pour les projets avec dépôt git :)-- plus nécessaire depuis 1.0
 {{{#!highlight diff
Ligne 218: Ligne 296:
     module Adapters          module Adapters
Ligne 223: Ligne 301:
 
Ligne 227: Ligne 305:
 * affichage plus claire des sous-projets d'un projet (items au lieu d'une seule liste virgulée) :
 {{{
--- app/views/projects/show.rhtml (revision 3762)
+++ app/views/projects/show.rhtml (working copy)
@@ -14,7 +14,10 @@
  <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
   <% if @subprojects.any? %>
   <li><%=l(:label_subproject_plural)%>:
- <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
+ <ul><li>
+ <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join("</li><li>") %>
+ </li></ul>
+ </li>
   <% end %>
  <% @project.custom_values.each do |custom_value| %>
  <% if !custom_value.value.blank? %>
}}}
Ligne 245: Ligne 306:
 {{{  {{{#!highlight diff
Ligne 258: Ligne 319:
 * --(permettre des logins de 60 caractères : )-- déjà intégré par Redmine
 . voir http://www.redmine.org/attachments/1642/0001-Fixes-2719.patch

 * --(affichage plus claire des sous-projets d'un projet (items au lieu d'une seule liste virgulée) : )-- plus vraiment indiqué
 {{{#!highlight diff
--- app/views/projects/show.rhtml (revision 6284)
+++ app/views/projects/show.rhtml (working copy)
@@ -14,7 +14,10 @@
  <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
   <% if @subprojects.any? %>
   <li><%=l(:label_subproject_plural)%>:
- <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
+ <ul><li>
+ <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join("</li><li>") %>
+ </li></ul>
+ </li>
   <% end %>
  <% @project.custom_values.each do |custom_value| %>
  <% if !custom_value.value.blank? %>
}}}

Notes sur l'installation de http://redmine.auf.org

(rappel : première version de JeanChristopheAndré : /PremiereVersion)

On a décidé d'installer la version 1.0-stable (svn) sans passer par un paquet Debian. Le framework Rails est également installé directement, via le système «gem» de Ruby. Quelques paquets viennent des backports.

Sources d'inspiration :

Préparation

Machine Debian Lenny 5.0, avec activation des backports et de volatile :

  • ajout de lenny/volatile et lenny-backports au /etc/apt/sources.list

  • création d'un fichier /etc/apt/preferences contenant :

    Explanation: autoriser les mises à jour automatiques pour les backports
    Package: *
    Pin: release a=lenny-backports
    Pin-Priority: 200
  • correction du /etc/hosts pour mettre le nom pleinement qualifié (FQDN) avant l'alias...

  • vérification du support des locales Unicode, en particulier fr_FR.UTF-8

  • installation de mysql-server, sécurisation et mise en place du support Unicode

  • installation de apache2 et mise en place du support Unicode

Installation Ruby et paquets ruby de base nécessaires

  • # aptitude install ruby
    # aptitude install irb             # facultatif, utile pour le script/console de redmine
    # aptitude -t lenny-backports install rubygems rake
    # aptitude install libopenssl-ruby
    # aptitude install libdbd-mysql-ruby mysql-client
    # aptitude install librmagick-ruby  # facultatif, permettra d'avoir des graphes dans redmine

Installation de rails 2.3.5 et dépendances (via gem)

  • # gem install rails -V -v=2.3.5
    (...)
    Successfully installed rake-0.8.7
    Successfully installed activesupport-2.3.5
    Successfully installed activerecord-2.3.5
    Successfully installed rack-1.0.1
    Successfully installed actionpack-2.3.5
    Successfully installed actionmailer-2.3.5
    Successfully installed activeresource-2.3.5
    Successfully installed rails-2.3.5
    8 gems installed

Téléchargement de redmine 1.0-stable via svn

On installe redmine dans /opt :

  • # cd /opt
    # svn checkout http://redmine.rubyforge.org/svn/branches/1.0-stable redmine-1.0
    # ln -s redmine-1.0 redmine

Configuration de redmine

Création de la base MySQL redmine09 et de l'utilisateur correspondant :

  • create database redmine09 character set utf8;
    create user 'redmine'@'localhost' identified by 'trucmachin';
    grant all privileges on redmine09.* to 'redmine'@'localhost';

Connexion de redmine à cette base :

  • # cat > config/database.yml << EOF
    production:
      adapter: mysql
      database: redmine09
      host: localhost
      username: redmine
      password: trucmachin
      encoding: utf8
    EOF

Initialisation de redmine

  • $ rake generate_session_store
    $ export RAILS_ENV=production
    $ rake db:migrate
    $ rake redmine:load_default_data
    $ rake db:migrate_plugins  # est-ce nécessaire ? je ne pense pas, mais ça fait pas de mal.

Mise en production via mongrel

(note : ceci est inspiré de http://doc.ubuntu-fr.org/redmine#configuration)

Mongrel est un serveur HTTP qui va propulser redmine sur un port local (127.0.0.1:3000). C'est ensuite apache qui rendra redmine visible de l'extérieur en HTTPS (voir ci-dessous) :

  • # aptitude install mongrel

Création d'un utilisateur dédié à redmine et mise en place des droits d'accès :

  • # adduser --system redmine --home /opt/redmine --no-create-home --group --gecos "redmine system user" --disabled-login --disabled-password
    # cd /opt/redmine
    # chown -R redmine:redmine log files tmp plugin/plugin_assets

Ajout d'un script de démarrage de redmine via mongrel : /etc/init.d/redmine_mongrel, et activation de ce script avec update-rc.d redmine_mongrel defaults

Mise à disposition en HTTPS avec apache

Activation des modules d'apache2 nécessaires :

  • # a2enmod proxy proxy_http ssl

On installe le certificat et la clé SSL pour *.auf.org et on configure le site dans /etc/apache2/sites-enabled/redmine.auf.org :

  • <VirtualHost *:443>
            (...)
            SSLEngine on
            SSLCertificateFile    /.../all-auf.org.crt
            SSLCertificateKeyFile /.../all-auf.org.key
            SSLCACertificateFile  /.../CA.pem
            SSLVerifyClient None
            (...)
            ProxyPreserveHost Off
            ProxyPass        /  http://127.0.0.1:3000/
            ProxypassReverse /  http://127.0.0.1:3000/
            <Proxy *>
                    Order allow,deny
                    Allow from all
            </Proxy>
    </VirtualHost>
    
    <VirtualHost *:80>
            ServerAdmin webmaster@auf.org
            ServerName redmine.auf.org
            Redirect permanent / https://redmine.auf.org/
    </VirtualHost>

Création automatique des comptes depuis le LDAP

Note : ceci suppose que l'authentification LDAP a été activée dans redmine, et que le groupe AUF existe.

Script lancé en cron toutes les 5 minutes : sync_ldap.sh

Synchronisation des dépôts git

Un cron est installé qui met à jour tous les dépôts /srv/git/*.git :

  • # sources d'inspiration
    # http://mult.ifario.us/p/integrating-github-and-redmine
    # http://www.redmine.org/wiki/redmine/RedmineRepositories
    
    # mise a jour des depots
    for git in `ls -d /srv/git/*.git`
    do
            echo "git fetch $git"
            cd $git
            git --bare fetch origin :master
            #git reset refs/remotes/origin/master > /dev/null  #selon doc redmine, mais est-ce necessaire ?
    done
    
    # mise a jour du suivi par redmine
    # (optionnel, car de toute façon ça serait fait lors du premier acces a chaque depot)
    echo "mise a jour redmine (Repository.fetch_changesets)"
    cd /opt/redmine
    ./script/runner "Repository.fetch_changesets" -e production

Pour activer un nouveau dépôt sur la machine, il suffit donc de faire quelque chose comme :

  •     root@redmine# su - redmine
     redmine@redmine$ cd /srv/git
     redmine@redmine$ git clone --bare git://git.auf.org/xxxx.git xxxx.git
     redmine@redmine$ cd xxxx.git
     redmine@redmine$ git --bare remote add origin git://git.auf.org/xxxx.git

Voir aussi Git/DépôtGit

Patches AUF (actif)

Ces modifications ont été apportées au redmine installé :

  • rendre accessible l'URL demandée initialement
       1 --- app/helpers/application_helper.rb   (révision 6284)
       2 +++ app/helpers/application_helper.rb   (copie de travail)
       3 @@ -766,6 +766,12 @@
       4      form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
       5    end
       6 
       7 +  def back_url_link
       8 +    back_url = params[:back_url] || request.env['HTTP_REFERER']
       9 +    back_url = CGI.unescape(back_url.to_s)
      10 +    CGI.escape(back_url)
      11 +  end
      12 +
      13    def back_url_hidden_field_tag
      14      back_url = params[:back_url] || request.env['HTTP_REFERER']
      15      back_url = CGI.unescape(back_url.to_s)
    
  • ajouter l'accès id.auf (SSO/SLO) sur la page de login :
       1 --- ./app/views/account/login.html.erb.orig     2016-10-10 07:48:13.000000000 +0000
       2 +++ ./app/views/account/login.html.erb  2019-11-25 16:38:12.754314977 +0000
       3 @@ -3,6 +3,19 @@
       4  <%= form_tag(signin_path, onsubmit: 'return keepAnchorOnSignIn(this);') do %>
       5  <%= back_url_hidden_field_tag %>
       6  <table>
       7 +<tbody>
       8 +<tr><td align="left"><strong>Usagers de l'AUF&nbsp;:</strong></td>
       9 +    <td align="right">
      10 +        <a href="/mellon/login?ReturnTo=<%= back_url_link %>" onMouseOver="document.idauf_bouton.src='/idauf_bouton_survol.png';" onMouseOut="document.idauf_bouton.src='/idauf_bouton.png';"><img id="idauf_bouton" width="200" height="32" src="/idauf_bouton.png" /></a>
      11 +    </td>
      12 +</tr>
      13 +<tr><td colspan="2"><div style="position: relative; top: 0; left: 0; text-align: center;">
      14 +        <hr style="display: inline-block; position: absolute; left: 0; width: 45%; height: 2px;" />
      15 +        <span> ou </span>
      16 +        <hr style="display: inline-block; position: absolute; right: 0; width: 45%; height: 2px;" />
      17 +    </div></td>
      18 +</tr>
      19 +<tr><td colspan="2" align="left"><strong>Pour les usagers qui n'ont pas d'adresse @auf.org,</strong><br />utilisez le formulaire de connexion suivant&nbsp;:</strong></td></tr>
      20  <tr>
      21      <td style="text-align:right;"><label for="username"><%=l(:field_login)%>:</label></td>
      22      <td style="text-align:left;"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
      23 @@ -10,6 +23,8 @@
      24  <tr>
      25      <td style="text-align:right;"><label for="password"><%=l(:field_password)%>:</label></td>
      26      <td style="text-align:left;"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
      27 +        <% if Setting.lost_password? %>&nbsp;&nbsp;<%= link_to 'Oublié ?', :controller => 'account', :action => 'lost_password' %><% end %>
      28 +    </td>
      29  </tr>
      30  <% if Setting.openid? %>
      31  <tr>
      32 @@ -20,21 +35,13 @@
      33  <tr>
      34      <td></td>
      35      <td style="text-align:left;">
      36 +        <input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5" style="float: right;" />
      37          <% if Setting.autologin? %>
      38          <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
      39          <% end %>
      40      </td>
      41  </tr>
      42 -<tr>
      43 -    <td style="text-align:left;">
      44 -        <% if Setting.lost_password? %>
      45 -            <%= link_to l(:label_password_lost), lost_password_path %>
      46 -        <% end %>
      47 -    </td>
      48 -    <td style="text-align:right;">
      49 -        <input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
      50 -    </td>
      51 -</tr>
      52 +</tbody>
      53  </table>
      54  <% end %>
      55  </div>
    
       1 --- public/stylesheets/application.css  (révision 7077)
       2 +++ public/stylesheets/application.css  (copie de travail)
       3 @@ -89,7 +89,8 @@
       4  #login-form table {margin-top:5em; padding:1em; margin-left: auto; margin-right: auto; border: 2px solid #FDBF3B; background-color:#FFEBC1; }
       5  #login-form table td {padding: 6px;}
       6  #login-form label {font-weight: bold;}
       7 -#login-form input#username, #login-form input#password { width: 300px; }
       8 +#login-form input#username { width: 300px; }
       9 +#login-form input#password { width: 220px; }
      10  
      11  input#openid_url { background: url(../images/openid-bg.gif) no-repeat; background-color: #fff; background-position: 0 50%; padding-left: 18px; }
    

Patches AUF (obsolètes)

  • utilisation correcte de git pour les projets avec dépôt git : plus nécessaire depuis 1.0

       1 --- lib/redmine/scm/adapters/git_adapter.rb     (revision 3762)
       2 +++ lib/redmine/scm/adapters/git_adapter.rb     (working copy)
       3 @@ -22,7 +22,7 @@
       4      module Adapters
       5        class GitAdapter < AbstractAdapter
       6          # Git executable name
       7 -        GIT_BIN = "git"
       8 +        GIT_BIN = "/usr/bin/git"
       9 
      10          def info
      11            begin
    
  • ne pas afficher les descriptions dans la liste des projets (https://redmine.auf.org/projects) : mieux géré en 1.0

       1 --- app/helpers/projects_helper.rb      (revision 3762)
       2 +++ app/helpers/projects_helper.rb      (working copy)
       3 @@ -70,7 +70,7 @@
       4          classes = (ancestors.empty? ? 'root' : 'child')
       5          s << "<li class='#{classes}'><div class='#{classes}'>" +
       6                 link_to(h(project), {:controller => 'projects', :action => 'show', :id => project}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}")
       7 -        s << "<div class='wiki description'>#{textilizable(project.short_description, :project => project)}</div>" unless project.description.blank?
       8 +        # s << "<div class='wiki description'>#{textilizable(project.short_description, :project => project)}</div>" unless project.description.blank?
       9          s << "</div>\n"
      10          ancestors << project
      11        end
    
  • permettre des logins de 60 caractères : déjà intégré par Redmine

  • voir http://www.redmine.org/attachments/1642/0001-Fixes-2719.patch

  • affichage plus claire des sous-projets d'un projet (items au lieu d'une seule liste virgulée) : plus vraiment indiqué

       1 --- app/views/projects/show.rhtml       (revision 6284)
       2 +++ app/views/projects/show.rhtml       (working copy)
       3 @@ -14,7 +14,10 @@
       4         <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
       5    <% if @subprojects.any? %>
       6         <li><%=l(:label_subproject_plural)%>:
       7 -           <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
       8 +         <ul><li>
       9 +           <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join("</li><li>") %>
      10 +         </li></ul>
      11 +       </li>
      12    <% end %>
      13         <% @project.custom_values.each do |custom_value| %>
      14         <% if !custom_value.value.blank? %>
    

redmine/InstallationMontreal (dernière édition le 2019-11-25 17:36:43 par JeanChristopheAndré)