pad/INSTALL.md

152 lines
2.8 KiB
Markdown

Initial requirements
====================
```
# apt install screen
```
Create DB
=========
```
# apt install postgresql postgresql-client
# systemctl enable --now postgresql
```
Check /etc/postgresql/xx/main/pg_hba.conf for localhost contains
```
host all all 127.0.0.0/24 md5
```
```
# su - postgres
$ createuser <REDACTED_USER>
$ createdb <REDACTED_DB> -O <REDACTED_USER>
$ psql <REDACTED_DB>
ALTER USER <REDACTED_USER> WITH PASSWORD '<REDACTED_PASSWORD'> ;
ALTER ROLE;
\q
```
Install Etherpad-lite
=====================
Add etherpad user
```
# adduser etherpad
# su - etherpad && cd
```
Install and run etherpad
```
# curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
# apt install -y nodejs
$ git clone --branch master https://github.com/ether/etherpad-lite.git
$ cd etherpad-lite
```
Restore "etherpad/settings.json" in etherpad-lite
Then try to start etherpad
`$ src/bin/run.sh`
Then CTRL-C
Restore the run.sh script in home folder
Setup the cron
`$ crontab -e`
and insert at the end of the file
`@reboot /home/etherpad/run.sh`
Restore "run.sh" script helper to run Etherpad in screen znd run
`~/run.sh`
Install the proxy
==================
Restore html content into /var/www
Install nginx
```
# apt install nginx
# mkdir /var/log/nginx/pad.chalec.org
# chown www-data:www-data /var/log/nginx/pad.chalec.org
```
Setup the config file from nginx/sites-available/etherpad in /etc/nginx/sites-available/etherpad
Link available to enable
```
# cd /etc/nginx/sites-enabled
# ln -s ../sites-available .
```
Start nginx
`# systemctl enable --now nginx`
Open firewall
`# ufw allow proto tcp port 80,443`
Check the service is reachable at
```
http://pad.chalec.org
https://pad.chalec.org
```
INSTALL etherpad plugins
========================
Plugin list to install at https://pad.chalec.org/admin
- adminpads2
- align
- author_hover
- delete_after_delay
- delete_empty_pads
- font_color
- font_size
- headings2
- spellcheck
- table_of_contents
Chalec infos
============
Intall Java
`# apt install openjdk-jre-headless`
`# adduser statoolinfos`
Add to admin group to read logs
```
# adduser statoolinfos admin
# su - statoolinfos
$ cd
```
Download Statoolinfos jar at https://forge.devinsy.fr/devinsy/statoolinfos/releases
Uncompress in /home/statool-<version>
link versioned folder to generic one
`$ ln -s statoolinfos-<verion> statoolinfos`
Restore statool config
(/var/www/html/.well-known/statoolinfos already restored in etherpad install)
/home/statoolinfos/statoolinfos/statoolinfos.sh probe -full /hhome/statoolinfos/statoolinfos/conf/pad.chalec.org.conf
`$ crontab -e`
45 * * * * /home/statoolinfos/statoolinfos/statoolinfos.sh probe -previousday /home/statoolinfos/statoolinfos/conf/pad.chalec.org.conf >> /home/statoolinfos/statoolinfos.log