Remove the self-signed option

Properly configure a reverse proxy/Collabora instead.
This commit is contained in:
Brandon Doornbos 2026-06-17 00:51:55 +02:00
parent 55ff1dc501
commit d4a18e8ac7
3 changed files with 2 additions and 8 deletions

View file

@ -1575,8 +1575,7 @@ def add_opds(ap):
def add_wopi(ap): def add_wopi(ap):
ap2 = ap.add_argument_group("WOPI options") ap2 = ap.add_argument_group("WOPI options")
ap2.add_argument("--wopi", action="store_true", help="allows for integrating with office suites using WOPI (volflag=wopi)") ap2.add_argument("--wopi", action="store_true", help="allows for integrating with office suites using WOPI (volflag=wopi)")
ap2.add_argument("--wopi-client", type=u, default="https://localhost:9980", help="where to find your WOPI client, this is what actually hosts e.g. Collabora Online") ap2.add_argument("--wopi-client", type=u, default="https://demo.eu.collaboraonline.com", help="where to find your WOPI client, this is what actually hosts e.g. Collabora Online")
ap2.add_argument("--wopi-self-signed", action="store_true", help="disable certificate verification of the WOPI client, only use with local use")
def add_handlers(ap): def add_handlers(ap):

View file

@ -397,7 +397,6 @@ flagcats = {
"wopi": { "wopi": {
"wopi": "enable WOPI support for integrating with online office suites", "wopi": "enable WOPI support for integrating with online office suites",
"wopi-client": "address of WOPI client, e.g. Collabora Online", "wopi-client": "address of WOPI client, e.g. Collabora Online",
"wopi-self-signed": "disable certificate verification of the WOPI client, only use with local use"
}, },
"opds": { "opds": {
"opds": "enable OPDS", "opds": "enable OPDS",

View file

@ -18,7 +18,6 @@ import time
import uuid import uuid
import urllib.request import urllib.request
import urllib.parse import urllib.parse
import ssl
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from datetime import datetime from datetime import datetime
from operator import itemgetter from operator import itemgetter
@ -1606,10 +1605,7 @@ class HttpCli(object):
} }
try: try:
ctx = ssl.create_default_context() discovery = urllib.request.urlopen(self.args.wopi_client + "/hosting/discovery")
ctx.check_hostname = False if self.args.wopi_self_signed else True
ctx.verify_mode = ssl.CERT_NONE if self.args.wopi_self_signed else ssl.CERT_REQUIRED
discovery = urllib.request.urlopen(self.args.wopi_client + "/hosting/discovery", context=ctx)
response = ET.fromstring(discovery.read()) response = ET.fromstring(discovery.read())
ext = path.split('.')[-1] ext = path.split('.')[-1]
wopi_url = response.find(".//action[@ext='%s'][@urlsrc]" % ext).get("urlsrc") wopi_url = response.find(".//action[@ext='%s'][@urlsrc]" % ext).get("urlsrc")