Skip to content

Commit

Permalink
doc: Widget settings
Browse files Browse the repository at this point in the history
issue #1920
  • Loading branch information
frankiejol committed Oct 26, 2023
1 parent 6ac9757 commit beb7064
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions docs/docs/chatwoot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ You need a Chatwoot server, you have differents options. If you are interested i

Here you will not find a `chatwoot manual <https://www.chatwoot.com/docs/channels/website>`_, only a few steps to embed your widget code.

Once you have the widget you have to paste it in a *js* file, and add a config to Ravada.

Define widget in rvd_front.conf
-------------------------------
In ``/etc/rvd_front.conf`` configure the path to widget code. For example, ```chatwoot_widget.js```
The Widget appears at the login script, main page and startup screens:

.. image:: images/chat_login.png

.. code-block:: perl
.. image:: images/chat_inside.png

,widget => '/js/custom/chatwoot_widget.js'
Once you have the widget you have to paste it in a *js* file, and add a config to Ravada.

Create a JS widget
-------------------------------

Copy your code in the file: ``/usr/share/ravada/public/js/custom/chatwoot_widget.js``.
Do not copy the *\<script\>* tags, only the javascript code.
Set your chatwoot server at the second line.

.. code-block:: javascript
:linenos:
Expand All @@ -44,24 +47,23 @@ Do not copy the *\<script\>* tags, only the javascript code.
}
})(document,"script");
.. image:: images/chat_login.png

.. image:: images/chat_inside.png
Configuration
-------------

Security Policy
~~~~~~~~~~~~~~~
Add the widget path in the frontend settings. Go to *Admin Tools* , *Settings*
You also need to allow third party content inside HTML, set the server address
in the *Content Security Policy*.

You need to allow third party content inside HTML, edit the /etc/rvd_front.conf
config file and add this line.
.. image:: images/widget_settings.png

::
Content Security Policy
~~~~~~~~~~~~~~~~~~~~~~~

,security_policy => 'foo.bar.com'
If you want to fine-tune the Content Security Policy, check the *Advanced CSP*
to display more options.

This will allow the server *foo.bar.com* to all the content, see this
`guide <http://ravada.readthedocs.io/en/latest/docs/frontend_security_policy.html>`_
if you want to add different security policies.
.. image:: images/widget_settings_csp.png

Apply
~~~~~
Expand Down
Binary file added docs/docs/images/widget_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/widget_settings_csp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit beb7064

Please sign in to comment.