Truy cập Etherpad
- Giao diện người dùng:
https://<SERVER_IP> - Giao diện quản trị:
https://<SERVER_IP>/admin - Thông tin đăng nhập của quản trị viên: Tên người dùng
admin, mật khẩu được lưu trữ trong.envasADMIN_PASSWORD
Thêm người dùng thông qua cài đặt quản trị viên
1. Thăm quan: https://<SERVER_IP>/admin
2. Đi tới Cài đặt.
3. Tệp cấu hình JSON sẽ được hiển thị.
4. Xác định vị trí users phần:
"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. Thêm người dùng mới (theo cú pháp JSON hợp lệ):
"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. Nhấp vào Lưu cài đặt.
7. Nhấp vào Khởi động lại Etherpad.
File và thư mục quan trọng
- Cài đặt ứng dụng:
/root/etherpad - File Docker Compose:
/root/etherpad/docker-compose.yml - Biến môi trường:
/root/etherpad/.env - Dữ liệu cơ sở dữ liệu PostgreSQL:
/var/lib/docker/volumes/etherpad_postgres_data/_data - Dữ liệu thời gian chạy Etherpad:
/var/lib/docker/volumes/etherpad_etherpad-var/_data - Thư mục plugin:
/var/lib/docker/volumes/etherpad_plugins/_data - Cấu hình Nginx:
/etc/nginx/sites-available/etherpad - Chứng chỉ SSL:
/etc/nginx/ssl/
Quản lý dịch vụ
Liệt kê các container:
docker ps
Khởi động lại container:
docker compose -f /root/etherpad/docker-compose.yml restart
Theo dõi nhật ký Etherpad:
docker compose -f /root/etherpad/docker-compose.yml logs -f
Khởi động lại Nginx:
systemctl restart nginx
Kích hoạt SSL với một tên miền
1. Trỏ tên miền của bạn về IP máy chủ.
2. Sửa cấu hình Nginx và thay thế cả server_name <IP>; với tên miền của bạn (<your-domain>) cho cả block HTTP (cổng 80) và HTTPS (cổng 443):
vim /etc/nginx/sites-available/etherpad
3. Cài đặt Certbot:
apt install -y certbot python3-certbot-nginx
4. Chạy lệnh sau để tạo một chứng chỉ Let’s Encrypt hợp lệ:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Thay thế các đường dẫn SSL trong cấu hình Nginx:
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. Khởi động lại Nginx để áp dụng thay đổi:
systemctl restart nginx
7. Mở trình duyệt và truy cập: https://yourdomain.com
Ghi chú
- Etherpad được phục vụ đằng sau proxy ngược Nginx để chấm dứt SSL và cải thiện bảo mật.
- Chứng chỉ tự ký có thể kích hoạt cảnh báo của trình duyệt; điều này được mong đợi trừ khi Let's Encrypt được sử dụng.
- Một số trình duyệt có thể hiển thị lỗi hoặc khiến Etherpad hoạt động không chính xác.
- Etherpad đã được thử nghiệm và xác nhận hoạt động trên Firefox, được khuyến nghị để có khả năng tương thích tốt nhất.