21
0
Fork 0
wiki/HowtoGitit.md

143 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

2017-01-20 10:48:10 +01:00
---
2017-01-20 15:07:07 +01:00
categories: git wiki
2017-01-20 10:48:10 +01:00
title: Howto GitIt
2017-01-20 15:07:07 +01:00
...
* Site/dépôt officiel : <https://github.com/jgm/gitit/tree/master/>
2017-01-20 15:09:03 +01:00
**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
2017-01-20 15:07:07 +01:00
### Paquet Debian
2017-01-20 10:48:10 +01:00
~~~
# apt install gitit
2017-01-20 15:07:07 +01:00
$ 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.
2017-01-20 10:48:10 +01:00
~~~
### Manuellement
2017-01-20 10:48:10 +01:00
~~~
# apt install cabal-install ghc zlib1g-dev
2018-12-23 02:58:59 +01:00
# adduser --disabled-password gitit
# sudo -u gitit -i
2017-01-20 10:48:10 +01:00
~~~
~~~
$ cabal update
2018-12-23 14:01:06 +01:00
$ cabal --reorder-goals install gitit
2017-01-20 10:48:10 +01:00
$ echo PATH="$HOME/.cabal/bin:$PATH" > ~/.profile
2017-01-20 15:07:07 +01:00
$ gitit --version
2018-12-23 14:01:06 +01:00
gitit version 0.12.3 -plugins
2017-01-20 10:48:10 +01:00
~~~
2017-01-20 10:48:10 +01:00
Note : `/tmp` doit être en EXEC pendant l'installation
2017-01-20 15:09:03 +01:00
Pour la mise à jour, on fera simplement:
2017-01-20 15:07:07 +01:00
~~~
$ cabal update
$ cabal install gitit
2017-01-20 15:09:03 +01:00
# systemctl restart gitit
2017-01-20 15:07:07 +01:00
~~~
## Configuration
2017-01-20 10:48:10 +01:00
~~~
$ gitit --print-default-config > gitit.conf
~~~
2017-01-20 15:07:07 +01:00
Exemple de configuration pour `gitit.conf` :
2016-09-16 00:08:15 +02:00
~~~
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
~~~
2017-01-20 15:07:07 +01:00
Exemple de configuration [Nginx](HowtoNginx) `/etc/nginx/sites-available/gitit.conf` :
2016-09-16 00:08:15 +02:00
~~~
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;
}
2016-09-16 00:08:15 +02:00
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
2017-01-20 15:07:07 +01:00
On peut lancer manuellement :
2017-01-20 10:48:10 +01:00
~~~
$ gitit -f gitit.conf
~~~
2017-01-20 15:07:07 +01:00
Exemple d'unité [systemd](HowtoSystemd) :
~~~
[Unit]
Description=Wiki gitit
After=network.target
[Service]
2017-01-20 15:11:30 +01:00
User=gitit
2017-01-20 15:07:07 +01:00
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_ :
2016-09-16 00:08:15 +02:00
2017-01-20 10:48:10 +01:00
~~~
$ pandoc -v
~~~
2022-09-14 10:03:58 +02:00
## Troubleshooting
Si Gitit affiche certaines pages en markdown sans linterpréter, il faut supprimer le contenu du répertoire `cache` dans son répertoire racine :
2022-09-14 10:03:58 +02:00
~~~
# rm -rf <GITIT_ROOT>/cache/*
2022-09-14 10:03:58 +02:00
~~~