Operations grimoire/Etherpad: Difference between revisions

From Nasqueron Agora
 
(12 intermediate revisions by 2 users not shown)
Line 4: Line 4:
* https://pad.nasqueron.org/
* https://pad.nasqueron.org/


== Upgrade code ==
== Upgrade ==
<source lang="console">
The easiest way is to spin a new container.
$ docker exec -it etherpad bash
 
You can also upgrade code in the live container, updating Git code then restarting Node.
 
=== Procedure A - spin a new container ===
Build a new nasqueron/etherpad:production image.
 
Pull it on docker-002, run <code>deploy-container etherpad</code> to run Salt states.
 
=== Procedure B - upgrade code ===
<syntaxhighlight lang="console">
$ docker exec -it pad bash
$ git pull
$ git pull
Line 12: Line 22:
$ logout
$ logout
$ docker restart etherpad
$ docker restart pad
$ docker logs etherpad
$ docker logs pad
[2016-08-25 00:40:24.711] [INFO] console - Your Etherpad version is 1.6.0 (45266f9)
[2016-08-25 00:40:24.711] [INFO] console - Your Etherpad version is 1.6.0 (45266f9)
</source>
</syntaxhighlight>


Check the two versions match.
Check the two versions match.


== Launch container ==
Note most recent code lives in the develop branch, not the master one.
<code>run-pad</code>


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 {{Ops file|roles/paas-docker/wrappers/files/pad-delete.py}} script fo send the request:<br><code>ssh equatower pad-delete $PADTODELETE</code>.


== Maintenance scripts ==
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.


There are documented at https://github.com/ether/etherpad-lite/wiki/Getting-to-know-the-tools-in-bin
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 37: Line 51:
This has been fixed by switching database to utf8mb4_bin:
This has been fixed by switching database to utf8mb4_bin:


<source lang="mysql">
<syntaxhighlight 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>
</syntaxhighlight>


=== Missing plugins ===
=== Missing plugins ===
The installation requires two plugins, provided as npm packages:
The installation requires two plugins, provided as npm packages:
* ep_ether-o-meter
* ep_ether-o-meter
* ep_author_neat
* ep_author_neat2
 
We now install them in <code>run-pad</code>:
 
<source lang="bash">
PLUGINS="ep_ether-o-meter ep_author_neat"


for plugin in $PLUGINS; do
The plugins are now are included in the nasqueron/etherpad:production image.
        docker exec $INSTANCE npm install $plugin
done
</source>


=== API key issue ===
=== API key issue ===
http://www.wolfplex.be/pad/ could be empty. When that occurs, the API key on this site diverges from ours.
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 <code>/var/wwwroot/wolfplex.be/.dat/secrets-api.json</code>.
They store their API on Ysul at <code>/var/dataroot/wolfplex/secrets.json</code>.


Normally, this is now handled by the following line from run-pad script:
On the Docker engine, API key should be available at /srv/pad/APIKEY.txt</code>
<code>docker cp /data/etherpad/APIKEY.txt $INSTANCE:opt/etherpad-lite/APIKEY.txt</code>


{{Configuration as code}}
Both are provisioned from Vault:
{{Vault secrets migration}}
<syntaxhighlight>
salt docker-002 state.sls roles/paas-docker/containers/etherpad
ssh docker-002 docker restart pad
salt ysul state.sls roles/webserver-content/org/wolfplex/api
</syntaxhighlight>

Latest revision as of 00:43, 7 January 2024

Shared between Nasqueron and Wolfplex

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 - spin a new container

Build a new nasqueron/etherpad:production image.

Pull it on docker-002, run deploy-container etherpad to run Salt states.

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.

Maintenance tasks

Delete a pad

As no admin dashboard plugin is installed, there are two methods to delete a pad:

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_neat2

The plugins are now are included in the nasqueron/etherpad:production image.

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/dataroot/wolfplex/secrets.json.

On the Docker engine, API key should be available at /srv/pad/APIKEY.txt

Both are provisioned from Vault:

salt docker-002 state.sls roles/paas-docker/containers/etherpad
ssh docker-002 docker restart pad
salt ysul state.sls roles/webserver-content/org/wolfplex/api