Operations grimoire/Etherpad: Difference between revisions
(→API key issue: {{Configuration as code}} {{Vault}}) |
(→Repair) |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
* https://pad.wolfplex.be/ | * https://pad.wolfplex.be/ | ||
* https://pad.nasqueron.org/ | * https://pad.nasqueron.org/ | ||
== Upgrade == | |||
The easiest way is to spin a new container. | |||
You can also upgrade code in the live container, updating Git code then restarting Node. | |||
=== Procedure A - upgrade container === | |||
First, pull new image and remove old container on Equatower: | |||
<source lang="console"> | |||
$ docker pull nasqueron/etherpad | |||
$ docker stop pad | |||
$ docker rm pad | |||
$ rm /srv/etherpad/.ok* | |||
</source> | |||
Then, on the Salt master, spin the new container: | |||
<source lang="console"> | |||
$ cd /opt/salt/nasqueron-operations | |||
$ salt equatower state.apply roles/paas-docker/containers/etherpad | |||
</source> | |||
If something weird happens after the update: | |||
* if you forget to remove /srv/etherpad/.ok-plugins, plugins won't be reinstalled | |||
* if you forget to remove /srv/etherpad/.ok-apikey, you'll get an API key issue (see below) | |||
* if you forget to remove /srv/etherpad/.ok-abiword, abiword won't be reinstalled | |||
To use `rm /srv/etherpad/.ok*` on Equatower and then repplay the roles/paas-docker/containers/etherpad state works to fix the situation, as those three steps can be done when the container is live. | |||
=== Procedure B - upgrade code === | |||
<source lang="console"> | |||
$ docker exec -it pad bash | |||
$ git pull | |||
… | |||
Updating 2e81b39..45266f9 | |||
… | |||
$ logout | |||
$ docker restart pad | |||
$ docker logs pad | |||
… | |||
[2016-08-25 00:40:24.711] [INFO] console - Your Etherpad version is 1.6.0 (45266f9) | |||
</source> | |||
Check the two versions match. | |||
Note most recent code lives in the develop branch, not the master one. | |||
== Launch container == | == Launch container == | ||
Line 9: | Line 55: | ||
Source script available at https://devcentral.nasqueron.org/P210. | Source script available at https://devcentral.nasqueron.org/P210. | ||
== Maintenance | == Maintenance tasks == | ||
=== Delete a pad === | |||
As no admin dashboard plugin is installed, there are two methods to delete a pad: | |||
* Send manually a request to https://pad.wolfplex.be/api/1/deletePad?apikey=APIKEY&padID=PADTODELETE | |||
* Use the {{Ops file|roles/paas-docker/wrappers/files/pad-delete.py}} script fo send the request:<br><code>ssh equatower pad-delete $PADTODELETE</code>. | |||
In the past, the few delete pad requests occurred for privacy reasons. Privacy is an acceptable justification to delete a pad. | |||
=== Repair === | |||
There are scripts to delete a pad or to repair a corrupted pad. | There are scripts to delete a pad or to repair a corrupted pad. | ||
Those are documented at https://github.com/ether/etherpad-lite/wiki/Getting-to-know-the-tools-in-bin | |||
== Past known issues == | == Past known issues == | ||
Line 21: | Line 74: | ||
This has been fixed by switching database to utf8mb4_bin: | This has been fixed by switching database to utf8mb4_bin: | ||
<source lang=" | <source lang="mysql"> | ||
ALTER DATABASE `etherpad` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; | ALTER DATABASE `etherpad` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; | ||
ALTER TABLE `etherpad.store` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; | ALTER TABLE `etherpad.store` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; | ||
</source> | </source> | ||
=== Missing plugins === | === Missing plugins === | ||
The installation requires two plugins, provided as npm packages: | The installation requires two plugins, provided as npm packages: | ||
Line 48: | Line 102: | ||
<code>docker cp /data/etherpad/APIKEY.txt $INSTANCE:opt/etherpad-lite/APIKEY.txt</code> | <code>docker cp /data/etherpad/APIKEY.txt $INSTANCE:opt/etherpad-lite/APIKEY.txt</code> | ||
{{Vault secrets migration}} | |||
{{Vault migration}} |
Revision as of 11:08, 10 October 2018
The same Etherpad installation is served at two domains:
Upgrade
The easiest way is to spin a new container.
You can also upgrade code in the live container, updating Git code then restarting Node.
Procedure A - upgrade container
First, pull new image and remove old container on Equatower:
$ docker pull nasqueron/etherpad
$ docker stop pad
$ docker rm pad
$ rm /srv/etherpad/.ok*
Then, on the Salt master, spin the new container:
$ cd /opt/salt/nasqueron-operations
$ salt equatower state.apply roles/paas-docker/containers/etherpad
If something weird happens after the update:
- if you forget to remove /srv/etherpad/.ok-plugins, plugins won't be reinstalled
- if you forget to remove /srv/etherpad/.ok-apikey, you'll get an API key issue (see below)
- if you forget to remove /srv/etherpad/.ok-abiword, abiword won't be reinstalled
To use `rm /srv/etherpad/.ok*` on Equatower and then repplay the roles/paas-docker/containers/etherpad state works to fix the situation, as those three steps can be done when the container is live.
Procedure B - upgrade code
$ docker exec -it pad bash
$ git pull
…
Updating 2e81b39..45266f9
…
$ logout
$ docker restart pad
$ docker logs pad
…
[2016-08-25 00:40:24.711] [INFO] console - Your Etherpad version is 1.6.0 (45266f9)
Check the two versions match.
Note most recent code lives in the develop branch, not the master one.
Launch container
run-pad
Source script available at https://devcentral.nasqueron.org/P210.
Maintenance tasks
Delete a pad
As no admin dashboard plugin is installed, there are two methods to delete a pad:
- Send manually a request to https://pad.wolfplex.be/api/1/deletePad?apikey=APIKEY&padID=PADTODELETE
- Use the rOPS: roles/paas-docker/wrappers/files/pad-delete.py script fo send the request:
ssh equatower pad-delete $PADTODELETE
.
In the past, the few delete pad requests occurred for privacy reasons. Privacy is an acceptable justification to delete a pad.
Repair
There are scripts to delete a pad or to repair a corrupted pad.
Those are documented at https://github.com/ether/etherpad-lite/wiki/Getting-to-know-the-tools-in-bin
Past known issues
Instability
When a copy/paste was done, server could crash.
This has been fixed by switching database to utf8mb4_bin:
ALTER DATABASE `etherpad` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE `etherpad.store` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Missing plugins
The installation requires two plugins, provided as npm packages:
- ep_ether-o-meter
- ep_author_neat
We now install them in run-pad
:
PLUGINS="ep_ether-o-meter ep_author_neat"
for plugin in $PLUGINS; do
docker exec $INSTANCE npm install $plugin
done
API key issue
http://www.wolfplex.be/pad/ could be empty. When that occurs, the API key on this site diverges from ours.
They store their API on Ysul at /var/wwwroot/wolfplex.be/.dat/secrets-api.json
.
Normally, this is now handled by the following line from run-pad script:
docker cp /data/etherpad/APIKEY.txt $INSTANCE:opt/etherpad-lite/APIKEY.txt
Vault secrets migration.
This service have secrets. They should be properly migrated in Vault.