+ apt-get install bundler
+
+Installer les dépendances :
+
+ bundle install --deployment --without=development --path=vendor/bundle
+ chmod -R o+rX vendor/bundle
+
+Il faut donner les droits d'écriture à `wiki-ca` sur le répertoire `var`.
+
+Pour rendre facilement accessible `list-members-emails`, on peut ajouter dans
+`/usr/local/bin` un mini script tel que celui-ci :
+
+ #!/bin/sh
+ NOS_OIGNONS_BOARD_WIKI_PATH=/srv/ikiwiki/wiki-ca/src \
+ /srv/ikiwiki/wiki-ca/gestion-adh/bin/list-emails
+
+Ne pas oublier de le rendre exécutable.
+
+On va utiliser des
+[services](https://www.freedesktop.org/software/systemd/man/systemd.service.html)
+et des [timers](https://www.freedesktop.org/software/systemd/man/systemd.timer.html)
+systemd pour les scripts à utiliser régulièrement.
+
+Dans `/etc/systemd/system/gestion-adh-update-ag-subscribers.service` :
+
+ [Unit]
+ Description=Update subscribers of the `ag` mailing list according to memberships
+
+ [Service]
+ Type=oneshot
+ WorkingDirectory=/srv/ikiwiki/wiki-ca/gestion-adh
+ User=wiki-ca
+ ExecStart=/srv/ikiwiki/wiki-ca/gestion-adh/bin/update-ag-subscribers
+ Environment=BUNDLE_GEMFILE=/srv/ikiwiki/wiki-ca/gestion-adh/Gemfile NOS_OIGNONS_BOARD_WIKI_PATH=/srv/ikiwiki/wiki-ca/src
+ SyslogIdentifier=update-ag-subscribers
+ ProtectSystem=strict
+ ProtectHome=true
+ PrivateTmp=yes
+ PrivateDevices=yes
+
+Dans `/etc/systemd/system/gestion-adh-update-ag-subscribers.timer` :
+
+ [Unit]
+ Description=Run update-ag-subscribers every hour
+
+ [Timer]
+ RandomizedDelaySec=30min
+ OnCalendar=hourly
+
+ [Install]
+ WantedBy=timers.target
+
+Il est également nécessaire de configurer le *credential* avec les informations
+de connexion à Mailman :
+
+ echo -n 'https://USER:SECRET_PASSWORD@localhost:8001' | sudo systemd-creds encrypt --name=mailman-rest-url -p - - | sudo tee -a /etc/systemd/system/gestion-adh-update-subscribers.service.d/overrides.conf
+
+Dans `/etc/systemd/system/gestion-adh-send-membership-reminders.service` :
+
+ [Unit]
+ Description=Send reminders to renew membership
+
+ [Service]
+ Type=oneshot
+ WorkingDirectory=/srv/ikiwiki/wiki-ca/gestion-adh
+ User=wiki-ca
+ ExecStart=/srv/ikiwiki/wiki-ca/gestion-adh/bin/send-membership-reminders
+ Environment=BUNDLE_GEMFILE=/srv/ikiwiki/wiki-ca/gestion-adh/Gemfile NOS_OIGNONS_BOARD_WIKI_PATH=/srv/ikiwiki/wiki-ca/src
+ SyslogIdentifier=send-membership-reminders
+ ProtectSystem=strict
+ ProtectHome=true
+ PrivateTmp=yes
+ PrivateDevices=yes
+ ReadWritePaths=/srv/ikiwiki/wiki-ca/gestion-adh/var
+
+Dans `/etc/systemd/system/gestion-adh-send-membership-reminders.timer` :
+
+ [Unit]
+ Description=Run send-membership-reminders every day
+
+ [Timer]
+ OnCalendar=06:42
+
+ [Install]
+ WantedBy=timers.target
+
+Dans `/etc/systemd/system/gestion-adh-send-member-emails-to-advisors.service` :
+
+ [Unit]
+ Description=Send member emails to the advisory board
+
+ [Service]
+ Type=oneshot
+ WorkingDirectory=/srv/ikiwiki/wiki-ca/gestion-adh
+ User=wiki-ca
+ ExecStart=/srv/ikiwiki/wiki-ca/gestion-adh/bin/send-member-emails-to-advisors
+ Environment=BUNDLE_GEMFILE=/srv/ikiwiki/wiki-ca/gestion-adh/Gemfile NOS_OIGNONS_BOARD_WIKI_PATH=/srv/ikiwiki/wiki-ca/src
+ SyslogIdentifier=send-member-emails-to-advisors
+ ProtectSystem=strict
+ ProtectHome=true
+ PrivateTmp=yes
+ PrivateDevices=yes
+
+Dans `/etc/systemd/system/gestion-adh-send-member-emails-to-advisors.timer` :
+
+ [Unit]
+ Description=Run send-member-emails-to-advisors monthly
+
+ [Timer]
+ OnCalendar=monthly
+
+ [Install]
+ WantedBy=timers.target
+
+Pour installer le `pre-commit` *hook* sur le dépôt utilisé par
+Ikiwiki, on met dans `/srv/ikiwiki/wiki-ca/src/.git/hooks/pre-commit` :
+
+ if ! BUNDLE_GEMFILE=/srv/ikiwiki/wiki-ca/gestion-adh/Gemfile /srv/ikiwiki/wiki-ca/gestion-adh/bin/pre-commit-hook; then
+ # Reset changes that do not pass the pre-commit hook to prevent
+ # wrong changes to lay in the Ikiwiki source directory.
+ git reset --hard
+ exit 1
+ fi
+
+Ne pas oublier de le rendre exécutable.
+
+Pour installer le `pre-receive` *hook* sur le dépôt central, on met dans
+`/srv/git/.gitolite/hooks/wiki-ca/hooks/pre-receive` :
+
+ #!/bin/sh
+ BUNDLE_GEMFILE=/srv/ikiwiki/wiki-ca/gestion-adh/Gemfile /srv/ikiwiki/wiki-ca/gestion-adh/bin/pre-receive-hook
+
+Ne pas oublier de le rendre exécutable. Il faut ensuite faire un lien symbolique :
+
+ ln -s ../../../.gitolite/hooks/wiki-ca/pre-receive /srv/git/repositories/wiki-ca.git/hooks/pre-receive