wiki/HowtoGitit.md
2017-01-20 15:11:30 +01:00

133 lines
2.8 KiB
Markdown

---
categories: git wiki
title: Howto GitIt
...
* Site/dépôt officiel : <https://github.com/jgm/gitit/tree/master/>
**Gitit** est un wiki basé sur [Git](HowtoGit) et écrit en [Haskell](https://fr.wikipedia.org/wiki/Haskell). Il permet l'édition de pages en utilisant la syntaxe [Markdown](https://fr.wikipedia.org/wiki/Markdown), directement via [Git](HowtoGit) ou via une interface web. Au niveau rendu, il génère des pages HTML avec un style personnalisable via des templates, et permet aussi l'export en TXT/ODT/etc ; il intègre également un moteur de recherche (regardez en haut à droite !). <https://wiki.evolix.org> utilise fièrement Gitit !
## Installation
### Paquet Debian
~~~
# apt install gitit
$ gitit --version
gitit version 0.10.4 +plugins
Copyright (C) 2008 John MacFarlane
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
~~~
### Manuellement
~~~
# apt install cabal-install ghc zlib1g-dev
# adduser gitit
# sudo -ui gitit
~~~
~~~
$ cabal update
$ cabal install gitit
$ echo PATH="$HOME/.cabal/bin:$PATH" > ~/.profile
$ gitit --version
gitit version 0.12.2 -plugins
~~~
Note : `/tmp` doit être en EXEC pendant l'installation
Pour la mise à jour, on fera simplement:
~~~
$ cabal update
$ cabal install gitit
# systemctl restart gitit
~~~
## Configuration
~~~
$ gitit --print-default-config > gitit.conf
~~~
Exemple de configuration pour `gitit.conf` :
~~~
address: 127.0.0.1
repository-type: Git
repository-path: git
session-timeout: 36000
default-extension: md
default-page-type: Markdown
front-page: index
no-delete: index, Help
use-cache: yes
~~~
Exemple de configuration [Nginx](HowtoNginx) `/etc/nginx/sites-available/gitit.conf` :
~~~
server {
server_name gitit.example.com;
listen 0.0.0.0:80;
listen [::]:80;
location /_register {
allow 192.0.2.42;
deny all;
proxy_pass http://127.0.0.1:5001/_register;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
}
location / {
proxy_pass http://127.0.0.1:5001/;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
}
access_log /var/log/nginx/gitit/access.log;
error_log /var/log/nginx/gitit/error.log;
}
~~~
## Lancement
On peut lancer manuellement :
~~~
$ gitit -f gitit.conf
~~~
Exemple d'unité [systemd](HowtoSystemd) :
~~~
[Unit]
Description=Wiki gitit
After=network.target
[Service]
User=gitit
Group=gitit
UMask=0027
WorkingDirectory=/home/gitit
PrivateTmp=true
ExecStart=/home/gitit/.cabal/bin/gitit -f /home/gitit/gitit.conf
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
Alias=wiki.service
~~~
Pour voir la liste des langages supportés pour le _highlighting_ :
~~~
$ pandoc -v
~~~