164 lines
2.9 KiB
Markdown
164 lines
2.9 KiB
Markdown
# 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/
|
|
|
|
# Installation
|
|
|
|
Basée sur :
|
|
- https://github.com/ether/etherpad-lite#manual-install
|
|
- https://framacloud.org/fr/cultiver-son-jardin/etherpad
|
|
|
|
|
|
## Prérequis système
|
|
|
|
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
|
|
```
|
|
|
|
## Prérequis logiciels
|
|
|
|
### Git
|
|
Installation de Git pour cloner le code :
|
|
```
|
|
apt install git
|
|
```
|
|
|
|
### Postgresql
|
|
|
|
Base de données :
|
|
```
|
|
apt-get install postgresql postgresql-contrib
|
|
```
|
|
|
|
### Nodejs
|
|
|
|
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 :
|
|
```
|
|
apt install nodejs
|
|
```
|
|
|
|
## Déploiement
|
|
|
|
Créer un compte dédié :
|
|
```
|
|
adduser --disabled-password --system --group --home /srv/pad.libre-service.eu/
|
|
```
|
|
|
|
Déployer le code :
|
|
```
|
|
cd /var/www
|
|
git clone --branch master git://github.com/ether/etherpad-lite.git pad.libre-service.eu
|
|
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
|
|
```
|
|
|
|
|
|
Next, start the Etherpad service and enable it to start at system reboot with the following command:
|
|
```
|
|
systemctl start etherpad
|
|
systemctl status etherpad
|
|
```
|
|
|
|
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
|
|
```
|
|
|
|
|