目 录CONTENT

文章目录

Docker玩法:实时协作文档编辑器Etherpad

华灯
2024-04-16 / 0 评论 / 0 点赞 / 19 阅读 / 6977 字

img

实时协作文档编辑器Etherpad

什么是 Etherpad ?

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

安装

在群晖上以 Docker 方式安装。

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

img

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

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

img

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

img

端口

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

# 查看端口占用
netstat -tunlp | grep 端口号
本地端口容器端口
90119001

img

环境

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

img

运行

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

img

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

img

完成后就能看到主界面了

img

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

img

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

img

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

升级

安装 PostgreSQL

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

img

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

img

etherpad 中建一个子目录 postgres

img

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

img

端口

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

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

本地端口容器端口
43215432

img

环境

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

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

img

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

img

修改 Etherpad 容器

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

链接

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

img

环境

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

img

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

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

img

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

img

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

img

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

img

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

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

img

参考文档

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

0

评论区