2022-01-27 17:33:53 +01:00
|
|
|
# Service pad.libre-service.eu
|
|
|
|
|
|
|
|
Le service pad.libre-service.eu est un service de traitement de texte collaboratif basé sur le logiciel Etherpad-lite : https://etherpad.org/
|
|
|
|
|
2022-01-27 17:36:24 +01:00
|
|
|
# Installation
|
|
|
|
|
2022-01-29 05:33:11 +01:00
|
|
|
Basée sur :
|
|
|
|
- https://github.com/ether/etherpad-lite#manual-install
|
|
|
|
- https://framacloud.org/fr/cultiver-son-jardin/etherpad
|
|
|
|
|
2022-01-27 17:36:24 +01:00
|
|
|
|
|
|
|
## Prérequis système
|
2022-01-27 17:33:53 +01:00
|
|
|
|
|
|
|
Configuration du hostname :
|
|
|
|
```
|
|
|
|
hostname pad.libre-service.eu
|
|
|
|
```
|
|
|
|
|
|
|
|
Personnalisation du prompt dans .bashrc :
|
|
|
|
```
|
|
|
|
PS1='${debian_chroot:+($debian_chroot)}\u@\H:\w\$ '
|
|
|
|
```
|
|
|
|
Ouvrir les ports nécessaires :
|
|
|
|
```
|
|
|
|
apt install ufw
|
|
|
|
ufw allow 'ssh'
|
|
|
|
ufw enable
|
|
|
|
```
|
|
|
|
|
2022-01-27 17:36:24 +01:00
|
|
|
## Prérequis logiciels
|
2022-01-27 17:33:53 +01:00
|
|
|
|
2022-01-29 05:33:11 +01:00
|
|
|
### Git
|
|
|
|
Installation de Git pour cloner le code :
|
|
|
|
```
|
|
|
|
apt install git
|
|
|
|
```
|
|
|
|
|
|
|
|
### Postgresql
|
|
|
|
|
|
|
|
Base de données :
|
|
|
|
```
|
2022-03-12 18:47:23 +01:00
|
|
|
apt install postgresql postgresql-contrib
|
2022-01-29 05:33:11 +01:00
|
|
|
```
|
|
|
|
|
2022-03-12 18:47:23 +01:00
|
|
|
D'après la documentation d'installation de Gitea :
|
|
|
|
|
|
|
|
> PostgreSQL uses md5 challenge-response encryption scheme for password authentication by default.
|
|
|
|
> Nowadays this scheme is not considered secure anymore. Use SCRAM-SHA-256 scheme instead by editing
|
|
|
|
> the postgresql.conf configuration file on the database server to:
|
|
|
|
>
|
|
|
|
> password_encryption = scram-sha-256
|
|
|
|
>
|
|
|
|
> Restart PostgreSQL to apply the setting.
|
|
|
|
|
|
|
|
Le conseil semble judicieux donc éditer le fichier `/etc/postgresql/13/main/postgresql.conf` :
|
|
|
|
|
|
|
|
```
|
|
|
|
#password_encryption = md5 # md5 or scram-sha-256
|
|
|
|
password_encryption = scram-sha-256
|
|
|
|
```
|
|
|
|
|
|
|
|
Et redémarrer le service :
|
|
|
|
|
|
|
|
```
|
|
|
|
systemctl restart postgresql.service
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2022-01-29 05:33:11 +01:00
|
|
|
### Nodejs
|
|
|
|
|
2022-01-27 17:33:53 +01:00
|
|
|
Etherpad nécessite Node.js >= 12.17.0. Vérifier que la version de Debian Stable est compatible :
|
|
|
|
```
|
|
|
|
apt-cache show nodejs |grep Version
|
|
|
|
```
|
|
|
|
|
|
|
|
Installer :
|
|
|
|
```
|
2022-01-29 05:33:11 +01:00
|
|
|
apt install nodejs
|
2022-01-27 17:33:53 +01:00
|
|
|
```
|
|
|
|
|
2022-01-27 17:36:24 +01:00
|
|
|
## Déploiement
|
2022-01-27 17:33:53 +01:00
|
|
|
|
2022-03-12 18:47:23 +01:00
|
|
|
## Préparation de la base de données
|
|
|
|
|
|
|
|
Créer un utilisateur (« role » en langage Pgsql) :
|
|
|
|
|
|
|
|
```
|
|
|
|
su -c "psql" - postgres
|
|
|
|
CREATE ROLE etherpad WITH LOGIN PASSWORD 'xxxxxxxxxxxxx';
|
|
|
|
```
|
|
|
|
|
|
|
|
Créer une base de données :
|
|
|
|
```
|
|
|
|
CREATE DATABASE etherpad WITH OWNER etherpad TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'fr_FR.UTF-8' LC_CTYPE 'fr_FR.UTF-8';
|
|
|
|
```
|
|
|
|
|
|
|
|
Donner l'accès en éditant le ficher /etc/postgresql/13/main/pg_hba.conf :
|
|
|
|
```
|
|
|
|
local etherpad etherpad scram-sha-256
|
|
|
|
```
|
|
|
|
|
|
|
|
Redémarrer le service :
|
|
|
|
```
|
|
|
|
systemctl restart postgresql.service
|
|
|
|
```
|
|
|
|
|
|
|
|
### Création d'un utilisateur système dédié
|
|
|
|
|
|
|
|
Créer un utilisateur système dédié :
|
|
|
|
```
|
|
|
|
adduser \
|
|
|
|
--system \
|
|
|
|
--shell /bin/bash \
|
|
|
|
--gecos 'Git Version Control' \
|
|
|
|
--group \
|
|
|
|
--disabled-password \
|
|
|
|
--home /srv/etherpad/ \
|
|
|
|
git
|
|
|
|
|
|
|
|
groupmod -n git
|
|
|
|
```
|
|
|
|
|
2022-01-29 05:33:11 +01:00
|
|
|
Créer un compte dédié :
|
|
|
|
```
|
|
|
|
adduser --disabled-password --system --group --home /srv/pad.libre-service.eu/
|
|
|
|
```
|
|
|
|
|
2022-01-27 17:33:53 +01:00
|
|
|
Déployer le code :
|
|
|
|
```
|
|
|
|
cd /var/www
|
|
|
|
git clone --branch master git://github.com/ether/etherpad-lite.git pad.libre-service.eu
|
2022-01-29 05:33:11 +01:00
|
|
|
chown -R etherpad:etherpad /var/www/pad.libre-service.eu
|
|
|
|
```
|
|
|
|
|
|
|
|
Premier lancement :
|
|
|
|
```
|
|
|
|
su -c "cd /var/www/pad.libre-service.eu/ && ./bin/installDeps.sh" etherpad
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Configuration dans le fichier `/var/www/pad.libre-service.eu/settings.json` :
|
|
|
|
```
|
|
|
|
- "dbType" : "dirty",
|
|
|
|
- "dbSettings" : {
|
|
|
|
- "filename" : "var/dirty.db"
|
|
|
|
- },
|
|
|
|
|
|
|
|
"dbType" : "postgres",
|
|
|
|
"dbSettings" : {
|
|
|
|
"user": "etherpad",
|
|
|
|
"host": "localhost",
|
|
|
|
"port": 3306,
|
|
|
|
"password": "password",
|
|
|
|
"database": "etherpad",
|
|
|
|
"charset": "utf8mb4"
|
|
|
|
},
|
|
|
|
|
|
|
|
"trustProxy": true,
|
|
|
|
|
|
|
|
Define a password for the admin user:Advertisement
|
|
|
|
|
|
|
|
"users": {
|
|
|
|
"admin": {
|
|
|
|
"password": "adminpassword",
|
|
|
|
"is_admin": true
|
|
|
|
},
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Installer les dépendances nécessaires :
|
|
|
|
```
|
|
|
|
./bin/installDeps.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration Systemd
|
|
|
|
|
|
|
|
Créer le fichier `/etc/systemd/system/etherpad.service` :
|
|
|
|
```
|
|
|
|
[Unit]
|
|
|
|
Description=Etherpad-lite, the collaborative editor.
|
|
|
|
After=syslog.target network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
User=etherpad
|
|
|
|
Group=etherpad
|
|
|
|
WorkingDirectory=/opt/etherpad/etherpad-lite
|
|
|
|
Environment=NODE_ENV=production
|
|
|
|
|
|
|
|
ExecStart=/usr/bin/node /opt/etherpad/etherpad-lite/src/node/server.js
|
|
|
|
|
|
|
|
Restart=always
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
```
|
|
|
|
|
|
|
|
Activer le fichier :
|
|
|
|
```
|
|
|
|
systemctl daemon-reload
|
2022-01-27 17:33:53 +01:00
|
|
|
```
|
2022-01-27 17:36:24 +01:00
|
|
|
|
|
|
|
|
2022-01-29 05:33:11 +01:00
|
|
|
Next, start the Etherpad service and enable it to start at system reboot with the following command:
|
|
|
|
```
|
|
|
|
systemctl start etherpad
|
|
|
|
systemctl status etherpad
|
|
|
|
```
|
2022-01-27 17:36:24 +01:00
|
|
|
|
2022-01-29 05:33:11 +01:00
|
|
|
Activer le démarrage automatique :
|
|
|
|
```
|
|
|
|
systemctl enable etherpad
|
|
|
|
```
|
|
|
|
|
|
|
|
# Mise à jour
|
|
|
|
|
|
|
|
```
|
|
|
|
systemctl stop etherpad
|
|
|
|
cd /var/www/pad.libre-service.eu/
|
|
|
|
git pull
|
|
|
|
./src/bin/run.sh
|
|
|
|
????????
|
|
|
|
systemctl start etherpad
|
|
|
|
```
|
2022-01-27 17:36:24 +01:00
|
|
|
|
|
|
|
|