访问以太网板
- 用户界面:
https://<SERVER_IP> - 管理界面:
https://<SERVER_IP>/admin - 管理员凭据:用户名
admin,密码存储在.envasADMIN_PASSWORD
通过管理设置添加用户
1. 访问: https://<SERVER_IP>/admin
2. 前往“设置”。
3. 将显示 JSON 配置文件。
4. 找到 users 部分:
"users": {
"admin": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "${ADMIN_PASSWORD:null}",
"is_admin": true
},
"user": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "test",
"is_admin": false
}
},
5. 添加新用户(遵循有效的 JSON 语法):
"users": {
"admin": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "${ADMIN_PASSWORD:null}",
"is_admin": true
},
"user": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "test",
"is_admin": false
},
"newuser": {
"password": "strongpassword",
"is_admin": false
}
},
6. 单击保存设置。
7. 单击重新启动 Etherpad。
重要文件和目录
- 应用程序安装:
/root/etherpad - Docker 撰写文件:
/root/etherpad/docker-compose.yml - 环境变量:
/root/etherpad/.env - PostgreSQL 数据库数据:
/var/lib/docker/volumes/etherpad_postgres_data/_data - Etherpad 运行时数据:
/var/lib/docker/volumes/etherpad_etherpad-var/_data - 插件目录:
/var/lib/docker/volumes/etherpad_plugins/_data - Nginx 配置:
/etc/nginx/sites-available/etherpad - SSL 证书:
/etc/nginx/ssl/
服务管理
列出容器:
docker ps
重启容器:
docker compose -f /root/etherpad/docker-compose.yml restart
关注 Etherpad 日志:
docker compose -f /root/etherpad/docker-compose.yml logs -f
重新启动 Nginx:
systemctl restart nginx
为域启用 SSL
1. 将您的域名指向服务器IP。
2.编辑Nginx配置并替换两者 server_name <IP>; 与您的域名(<your-domain>) 对于 HTTP(端口 80)和 HTTPS(端口 443)块:
vim /etc/nginx/sites-available/etherpad
3.安装Certbot:
apt install -y certbot python3-certbot-nginx
4. 运行以下命令生成有效的 Let’s Encrypt 证书:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. 替换 Nginx 配置中的 SSL 路径:
vim /etc/apache2/sites-available/etherpad
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. 重新启动 Nginx 以应用更改:
systemctl restart nginx
7. 打开浏览器并访问: https://yourdomain.com
笔记
- Etherpad 在 Nginx 反向代理后面提供服务,以实现 SSL 终止并提高安全性。
- 自签名证书可能会触发浏览器警告;除非使用 Let’s Encrypt,否则这是预期的。
- 某些浏览器可能会显示错误或导致 Etherpad 无法正常工作。
- Etherpad 已经过测试并确认可以在 Firefox 上运行,建议使用它以获得最佳兼容性。