Clarify websocket address is needed

This commit is contained in:
Kabiru Mwenja
2026-02-23 12:47:42 +03:00
parent b22162ecb0
commit 2e596397bb
3 changed files with 4 additions and 4 deletions
@@ -63,10 +63,10 @@ module Documents
def invalid_hocuspocus_url?
return false if Setting.collaborative_editing_hocuspocus_url.blank?
!valid_hocuspocus_url?(Setting.collaborative_editing_hocuspocus_url)
!websocket_url?(Setting.collaborative_editing_hocuspocus_url)
end
def valid_hocuspocus_url?(url)
def websocket_url?(url)
uri = URI.parse(url)
uri.is_a?(URI::WS) || uri.is_a?(URI::WSS)
rescue URI::InvalidURIError
+1 -1
View File
@@ -151,7 +151,7 @@ en:
some_unwritable: Some values are configured via environment variables and cannot be edited here.
hocuspocus_server_url:
label: "Hocuspocus server URL"
caption: "The address of a working Hocuspocus server."
caption: "The WebSocket address of a working Hocuspocus server."
invalid_scheme: "Must use a WebSocket protocol (ws:// or wss://)."
hocuspocus_server_secret:
label: "Client secret"
@@ -100,7 +100,7 @@ RSpec.describe "Document collaboration settings admin",
click_on("Save")
# Inline validation shown on the field
expect(page).to have_content("is not a supported protocol")
expect(page).to have_content("Must use a WebSocket protocol (ws:// or wss://).")
# Setting unchanged
expect(Setting.collaborative_editing_hocuspocus_url).to eq("wss://hocuspocus.example.com")