Content
View differences
Updated by Wieland Lindenthal 7 months ago
As _As a developer who needs to make or approve changes on op-blocknote-hocuspocus op-blocknote-hocuspocus_
I _I want to be able to run op-blocknote-hocuspocus locally and use it with OP running locally locally_
So _So that I can easily test the changes changes_
<br>
**Steps to reproduce:**
1\. run Hocuspocus locally, so that it is reachable on 127.0.0.1:1234
2\. Configure "ws://127.0.0.1:1234" as Hocuspocus url in OpenProject
3\. Open a (blocknote) document and look at the browser console
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/799867/content">
<br>
**Side notes:**
* There is `DynamicContentSecurityPolicy#add_hocuspocus_host_to_csp` which dynamically tries to add the configured hocuspocus url to CSP and this works correctly when given a real url, like `hocuspocus.local`.
* Other settings, like the `fog_directory` are set directly in `config/initializers/content_security_policy.rb`. if set there, it also works with the IP.
* Other settings in `config/initializers/content_security_policy.rb` use the `OpenProject::Configuration`, which also includes a `OpenProject::Configuration.collaborative_editing_hocuspocus_url`. However, this contains just a default value (`openproject.local`) instead of using the value from the Setting. Depending on how the CSP value for `collaborative_editing_hocuspocus_url` should be set, this could be fixed together with this WP or just be deleted or be fixed in a separate WP.
I
So
<br>
**Steps to reproduce:**
1\. run Hocuspocus locally, so that it is reachable on 127.0.0.1:1234
2\. Configure "ws://127.0.0.1:1234" as Hocuspocus url in OpenProject
3\. Open a (blocknote) document and look at the browser console
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/799867/content">
<br>
**Side notes:**
* There is `DynamicContentSecurityPolicy#add_hocuspocus_host_to_csp` which dynamically tries to add the configured hocuspocus url to CSP and this works correctly when given a real url, like `hocuspocus.local`.
* Other settings, like the `fog_directory` are set directly in `config/initializers/content_security_policy.rb`. if set there, it also works with the IP.
* Other settings in `config/initializers/content_security_policy.rb` use the `OpenProject::Configuration`, which also includes a `OpenProject::Configuration.collaborative_editing_hocuspocus_url`. However, this contains just a default value (`openproject.local`) instead of using the value from the Setting. Depending on how the CSP value for `collaborative_editing_hocuspocus_url` should be set, this could be fixed together with this WP or just be deleted or be fixed in a separate WP.