nextcloud 聯盟功能Federation
先講結論,nextcloud聯盟功能分享的目錄,並不會把檔案傳到對方服務器。(這樣就無法達到檔案兩邊都有的需求)
如何正確啟用聯盟功能
1. 啟用「Federation」app
2. 在管理介面->分享頁面,做好設定以及加入遠端服務器
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2023/09/image-18.png?resize=648%2C620&ssl=1)
3. 設定檔加上「allow_local_remote_servers = true」
修改 config/config.php
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2023/09/image-17.png?resize=340%2C70&ssl=1)
或是下指令
occ config:system:set allow_local_remote_servers --value true --type bool
4. 同步位址簿(需加入crontab定期執行)
occ dav:sync-system-addressbook occ federation:sync-addressbooks
5. 分享目錄給遠端的聯盟使用者
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2023/09/image-20.png?resize=490%2C243&ssl=1)
6. 遠端使用者將會接收到分享目錄的請求
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2023/09/image-21.png?resize=620%2C212&ssl=1)