Nextcloud
Nextcloud คืออะไร?
Nextcloud คือซอฟต์แวร์โอเพนซอร์สที่ให้คุณสร้างระบบ Cloud Storage ส่วนตัวได้เหมือน Google Drive แต่รันอยู่บนเซิร์ฟเวอร์ของคุณเอง ไม่ว่าจะเป็น VPS, server ที่บ้าน หรือแม้แต่ Raspberry Pi ก็สามารถติดตั้งใช้งานได้
Nextcloud รองรับทั้งการ จัดเก็บไฟล์, แชร์ไฟล์, แก้ไขเอกสารออนไลน์, ซิงค์กับอุปกรณ์มือถือ/เดสก์ท็อป, ปฏิทิน, วิดีโอคอล, และสามารถขยายความสามารถด้วยแอปเสริมหลายร้อยตัว
(Optional) เชื่อมต่อ Nextcloud กับ OnlyOffice
OnlyOffice คือชุดซอฟต์แวร์สำนักงานแบบโอเพนซอร์ส ที่ให้คุณ เปิด แก้ไข และทำงานร่วมกันกับเอกสาร Word, Excel, PowerPoint ได้ผ่านเว็บบราวเซอร์ โดยที่ฟีลลิ่งและหน้าตาใกล้เคียงกับ Microsoft Office มากที่สุดในบรรดาเครื่องมือ open source ทั้งหมด
ตัวอย่างการติดตั้งเพื่อใช้งานในองค์กรขนาดเล็ก
map domain nextcloud.office.com มาที่ server
เตรียมไฟล์ TLS Certificate สำหรับ Nextcloud ใส่ไว้ใน folder certs
ดังนี้
cert.pem - ไฟล์ cert ของ Nextcloud key.pem - private key ที่เข้าคู่กับไฟล์ cert
เตรียมไฟล์ Caddyfile
เพื่อเป็น https proxy ให้กับ Nextcloud
เตรียมไฟล์ docker-compose.yml
เริ่ม Deploy ด้วยคำสั่ง
ทดสอบใช้งานผ่าน https://nextcloud.example.com
การเชื่อม SAML กับ nextcloud
เราสามารถทำ SSO กับ nextcloud ได้ โดยการ register nextcloud เป็น app หนึ่งบน Active Directory
Config ฝั่ง Azure AD
ไปที่เมนู Enterprise Application บน Microsoft Azure
คลิก New Application
คลิก Create your own application
กรอกชื่อ app เช่น nextcloud และเลือก Integrate any other application you don't find in the gallery (Non-gallery) แล้วคลิก Create
หลังจาก Create จะได้หน้าการจัดการ Application นี้มา
คลิกเลือก Assign users and groups และกำหนด user หรือ group ที่สามารถเข้าใช้งาน Application นี้ได้ * Group-based assignment จำเป็นต้องมี Microsoft Entra ID P1 or P2 edition ไม่เช่นนั้นต้อง assign user ใน nextcloud เข้า group เองทีละคน
คลิก Setup single sign on
Basic SAML Configuration กรอกค่าดังนี้
Identifier (Entity ID): https://nextcloud.example.com/apps/user_saml/saml/metadata
Reply URL (Assertion Consumer Service URL): https://nextcloud.example.com/apps/user_saml/saml/acs Index: 1
Sign on URL (Optional): https://nextcloud.example.com/login
Logout Url (Optional): https://nextcloud.example.com/logout
Attributes & Claims แก้ไข Claim name ดังนี้
Name: displayname Namespace: ค่าว่าง (เอา namespace http://schemas.xmlsoap.org/ws/2005/05/identity/claims ออก) Source: Attribute Source attribute: user.displayname
ทำซ้ำกับ Claim อื่นๆ email: user.mail firstname: user.givenname lastname: user.surname name: user.principalname
กด Add a group claim เลือก Groups assigned to the application Source attribute: Cloud-only group display names Advanced options: -> Customize the name of the group claim ---> Name: groups
ตรวจผลลัพธ์แล้วกลับไปหน้าก่อน
SAML Certificates คลิก Download Certificate (Base64)
จดค่า ดังนี้เพื่อไปกรอกใน nextcloud Login URL Microsoft Entra Indentifier
Config ฝั่ง Nextcloud
ไปที่
Apps
เลือกFeatured apps
หา app ชื่อSSO & SAML authentication
กดปุ่มDownload and enable
ไปที่ Administration settings เลือก
SSO & SAML authentication
Global settings ติ๊กเลือก
Allow the use of multiple user back-ends (e.g. LDAP)
General ช่อง
Attribute to map the UID to.
กรอก name ช่องOptional display name of the identity provider (default: "SSO & SAML log in")
กรอกชื่อปุ่ม Login เช่นAzure AD
Service Provider Data (ข้าม)
Identity Provider Data ช่อง
Identifier of the IdP entity (must be a URI)
กรอกค่าที่จดจากMicrosoft Entra Identifier
(7d) ช่องURL Target of the IdP where the SP will send the Authentication Request Message
กรอกค่าจาก Login URL (7d)เปิดส่วนที่ซ่อนอยู่ใต้
Show optional Identity Provider settings…
ช่องPublic X.509 certificate of the IdP
กรอกค่า BASE64 ที่ได้จาก SAML Certificate (7c)Attribute mapping เปิดส่วนที่ซ่อนใต้
Show attribute mapping settings…
ช่องAttribute to map the displayname to.
กรอกdisplayname
ช่องAttribute to map the email address to.
กรอกemail
ช่องAttribute to map the users groups to.
กรอกgroups
(ถ้า Azure AD)Nextcloud จะ Auto Save config ที่เรา set ไป ลองทดสอบไปหน้าอื่น แล้วกลับมา ว่าค่ายังอยู่ครบหรือไม่ หลังจากนั้นทดสอบ login Nextcloud ด้วย Azure AD
Last updated
Was this helpful?