本地布暑collaboraonline
写入 CODE 官方源:
sudo tee /etc/apt/sources.list.d/collaboraonline.sources <<EOF Types: deb URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb Suites: ./ Signed-By: /usr/share/keyrings/collaboraonline-release-keyring.gpg EOF
确保密钥存在:
sudo mkdir -p /usr/share/keyrings sudo wget -O /usr/share/keyrings/collaboraonline-release-keyring.gpg \ https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg
更新并安装:
sudo apt update sudo apt install coolwsd code-brand
安装完成之后,核心配置文件:
/etc/coolwsd/coolwsd.xml
里面要配置 `host` 白名单(你的 WOPI 业务域名 / IP),否则拒绝 WOPI 请求。
验证服务:
sudo systemctl enable --now coolwsd curl http://127.0.0.1:9980/hosting/discovery
返回是XML就对了。
下面是一些坑点:
1、关闭内置 SSL(本机安装必改)
sudo nano /etc/coolwsd/coolwsd.xml
找到这段:
<ssl desc="SSL settings"> <enable>false</enable> <termination desc="Connection via proxy where CM manages SSL">true</termination>
含义:
<enable>false:coolwsd 自身走裸 HTTP
<termination>true:由前端 Nginx 做 SSL 终止(后面你要的)
保存,重启:
sudo systemctl restart coolwsd
2、WOPI 白名单提醒
跑通之后,一定要在 `coolwsd.xml` 的 host 段加上你的内网业务地址,否则打开文档直接拒绝:
<host allow="true">http://192.168.x.x</host> <host allow="true">http://oa.内网域名</host> <host allow="true">localhost</host>
同时确认监听:
<listen type="string">0.0.0.0</listen>
WOPI 信任组:
你现在 `alias_groups mode="first"`,改成 `groups`,填入你的 WOPI host(你的 flask 内网地址),否则打开文档容易被拦截:
<alias_groups desc="allowed WOPI hosts" mode="groups"> <group> <host desc="hostname to allow or deny." allow="true">http://192.168.56.1</host> </group> <!-- 保留你原来的 Python 测试主机,否则它会被禁用 --> <group> <host desc="hostname to allow or deny." allow="true">http://127.0.0.1:8088</host> </group> </alias_groups>
重载并重启:
sudo systemctl daemon-reload sudo systemctl restart coolwsd


支付宝打赏
微信打赏 
