เข้าถึง Etherpad
- ส่วนต่อประสานผู้ใช้:
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 Compose:
/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 certificates:
/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 ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/etherpad
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้าง Let’s Encrypt certificate ที่ใช้ได้:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่ SSL paths ใน Nginx config:
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. เปิด browser และไปที่: https://yourdomain.com
หมายเหตุ
- Etherpad ให้บริการหลังพร็อกซีย้อนกลับ Nginx สำหรับการยกเลิก SSL และปรับปรุงความปลอดภัย
- ใบรับรองที่ลงนามด้วยตนเองอาจทำให้เกิดคำเตือนเบราว์เซอร์ คาดว่าจะเป็นเช่นนั้นเว้นแต่ว่าจะใช้ Let's Encrypt
- เบราว์เซอร์บางตัวอาจแสดงข้อผิดพลาดหรือทำให้ Etherpad ทำงานไม่ถูกต้อง
- Etherpad ได้รับการทดสอบและยืนยันว่าใช้งานได้กับ Firefox ซึ่งแนะนำเพื่อให้เข้ากันได้ดีที่สุด