实时协作文档编辑器Etherpad

今天上海全市统一核酸,6 点起来的,不到 7 点就做完了,继续足不出户。

现在每天起来第一件事情就是刷上海发布和上海杨浦,看病例的居住地。昨天群里就在传小区有核酸异常,今天已经被官方确认了,只是还不清楚是确诊还是无症状感染者,看来囤的那点菜要不够吃了啊


什么是 Etherpad ?

Etherpad 是一个实时协作编辑器,可扩展到成千上万的同时实时用户。它提供完整的数据导出功能,并在您的控制下在您的服务器上运行。

安装

在群晖上以 Docker 方式安装。

在注册表中搜索 etherpad ,选择第二个 etherpad/etherpad,版本选择 latest

docker 文件夹中,创建一个新文件夹,并将其命名为 etherpad

需要给目录增加读、写权限,否则容器启动的时候会因为文件创建失败而停止

文件夹 装载路径 说明
docker/etherpad/data /opt/etherpad-lite/var 存放数据

端口

本地端口不冲突就行,不确定的话可以用命令查一下

1
2
# 查看端口占用
netstat -tunlp | grep 端口号
本地端口 容器端口
9011 9001

环境

环境变量很多,涉及到几个方面,包括数据库、快捷键、皮肤、日志等设置、老苏没有做任何设置,采用了默认值

运行

在浏览器中输入 http://群晖IP:9011 就能看到主界面

输入名称后点 OK后有个初始化的过程

完成后就能看到主界面了

虽然界面上都是英文,其实是支持中文的

右上角可以设置名称,右下角是聊天窗口

软件本身的功能比较简单,但是如果你要多人使用,可能首先需要更改数据库,Etherpad 默认使用的数据库是 DirtyDB ,老苏尝试了下 postgres

升级

安装 PostgreSQL

在注册表中搜索 postgres ,选择第一个 postgres,版本选择 latest

改个名字 ep-postgres,修改只是为了容易识别

etherpad 中建一个子目录 postgres

文件夹 装载路径
docker/etherpad/postgres /var/lib/postgresql/data

端口

1
2
# 查看端口占用
netstat -tunlp | grep 端口号

默认端口被占用,所以改了个没被占用的

本地端口 容器端口
4321 5432

环境

可变
POSTGRES_USER 数据库用户,设为 etherpad
POSTGRES_PASSWORD 数据库密码,设为 NaB3mbeY2JYFAdnFUjEKC4GVgApLN9Lb

数据库账号、密码后面还会用到

如果运行正常并且不报错的话,就可以进行 etherpad 的改造了

修改 Etherpad 容器

先停掉 Etherpad 容器,然后进入编辑模式

链接

找到前面安装的 ep-postgres,别名简单点就好

环境

可变
DB_TYPE 数据库类型,设为 postgres
DB_HOST 数据库主机,设为 pdb
DB_PORT 数据库端口,设为 5432
DB_NAME 数据库名称,设为 etherpad
DB_USER 数据库用户,设为 etherpad
DB_PASS 数据库密码,设为 NaB3mbeY2JYFAdnFUjEKC4GVgApLN9Lb

启动之后新建的的提示已经没有 DirtyDB 警告信息了

Warning: DirtyDB is used. This is not recommended for production. -- To suppress these warning messages change suppressErrorsInPadText to true in your settings.json

测试了下手机和 PC 之间的协同编辑,不同的用户可以设置不同的颜色

更厉害的是可以记录整个协同写作的过程

至于导入、导出功能,因为没有安装 AbiwordLibreoffice,所以就没测试

其他的功能还有很多,例如更改外观、安装插件等等,可以去看看官方的说明文档:https://github.com/ether/etherpad-lite/wiki

最后还是上一张官网的动图

参考文档

ether/etherpad-lite: Etherpad: A modern really-real-time collaborative document editor.
地址:https://github.com/ether/etherpad-lite

Etherpad
地址:https://etherpad.org/

etherpad-lite/docker.md at develop · ether/etherpad-lite
地址:https://github.com/ether/etherpad-lite/blob/develop/doc/docker.md

Available Plugins · ether/etherpad-lite Wiki
地址:https://github.com/ether/etherpad-lite/wiki/Available-Plugins