====== Éditeur de pad collaboratif ====== ===== Installation du système de la vm ===== La machine a été installée en repectant les [[admin:procedures:creation_machine_virtuelle|procédures d'installations de VM]]. Les volumes suivants ont été créés et montés: * modele-vg-postgres_data sur ''/var/lib/postgresql'' ===== Installation des services ===== ==== Installation des pré-requis ==== Ajout dépot nodejs de nodejs (version récente requise) : deb https://deb.nodesource.com/node_6.x stretch main deb-src https://deb.nodesource.com/node_6.x stretch main Ajout de la clé du dépôt : curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - apt update apt-get install gzip git curl python libssl-dev pkg-config build-essential nodejs npm ==== Installation des sources ==== mkdir -p /var/www/etherpad-lite cd /var/www/ git clone git://github.com/ether/etherpad-lite.git useradd etherpad sed -e 's|/home/etherpad|/var/www/etherpad-lite|' /etc/passwd -i chown -R etherpad:etherpad /var/www/etherpad-lite mkdir -p ~etherpad/.npm chown -R etherpad:etherpad-lite ~etherpad-lite ==== Installation de la base postgres ==== apt install postgresql Création de l'utilisateur etherpad dans postgres : sudo -u postgres sh -c 'createuser -d etherpad && createdb -O etherpad etherpad' ==== Monitoring ==== Configuration de nagios pour le monitoring : Ajouter cette ligne à la fin du fichier /etc/postgresql/9.6/main/pg_hba.conf host template1 nagios 127.0.0.1/32 trust Ajouter le rôle nagios : sudo -u postgres sh -c 'createuser nagios' Relancer postgres : systemctl restart postgresql.service ==== Configuration ==== Configuration de la base de données dans ''settings.json'': "dbType" : "postgres", "dbSettings" : { "user" : "etherpad", "host" : "/var/run/postgresql", "password": "", "database": "etherpad", "charset" : "utf8mb4" }, Le démarrage du service est effectué manuellement de la manière suivante : su - etherpad -s /bin/bash ./bin/run.sh ==== Intégration au système ==== Le script suivant a été écrit pour le démarrage de etherpad au boot: [Unit] Description=etherpad-lite (real-time collaborative document editing) After=syslog.target network.target [Service] Type=simple User=etherpad-lite Group=etherpad-lite ExecStart=/srv/etherpad-lite/bin/run.sh [Install] WantedBy=multi-user.target systemctl enable etherpad-lite ===== Activation des plugins ===== ==== Activation du plugin adminpads ==== Ce plugin permet de remplacer l'ancien système et d'effacer des pads. Il a été installé de la manière suivante: cd /var/www/etherpad-lite/src npm i ep_adminpads systemctl restart etherpad-lite L'accès à l'interface se fait via https://pad.chapril.org/admin ==== Activation du plugin delete_empty_pads ==== Ce plugin permet la suppression automatique des pads créés pour rien. L'installation via le gestionnaire de plugin ayant échouée, passage en manuel : =(^-^)=root@pad:/var/www/etherpad-lite# npm i ep_delete_empty_pads /var/www/etherpad-lite └── ep_delete_empty_pads@0.0.4 npm WARN enoent ENOENT: no such file or directory, open '/var/www/etherpad-lite/package.json' npm WARN etherpad-lite No description npm WARN etherpad-lite No repository field. npm WARN etherpad-lite No README data npm WARN etherpad-lite No license field. =(^-^)=root@pad:/var/www/etherpad-lite# service restart etherpad-lite ==== Affichage de la table de matière par défaut ==== Convient pour le plugin : https://npmjs.org/package/ep_table_of_contents ajouter "ep_toc": { "disable_by_default": false }, dans le fichier settings.json à la racine du etherpad-lite ou via l'interface d'administration.