diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/playvideos/README.md | 9 | ||||
-rw-r--r-- | plugins/qrcode/qrcode.php | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/plugins/playvideos/README.md b/plugins/playvideos/README.md index ab4be22a..32a94e88 100644 --- a/plugins/playvideos/README.md +++ b/plugins/playvideos/README.md | |||
@@ -8,22 +8,21 @@ This uses code from https://zaius.github.io/youtube_playlist/ and is currently o | |||
8 | 8 | ||
9 | #### Installation and setup | 9 | #### Installation and setup |
10 | 10 | ||
11 | This is a default Shaarli plugin, you just have to enable it. See https://shaarli.readthedocs.io/en/master/Shaarli-configuration/ | 11 | This is a default Shaarli plugin, you just have to enable it. See [Shaarli configuration](../../doc/md/Shaarli-configuration.md). |
12 | 12 | ||
13 | 13 | ||
14 | #### Troubleshooting | 14 | #### Troubleshooting |
15 | 15 | ||
16 | If your server has [Content Security Policy](http://content-security-policy.com/) headers enabled, this may prevent the script from loading fully. You should relax the CSP in your server settings. Example CSP rule for apache2: | 16 | If your server has [Content Security Policy](http://content-security-policy.com/) headers enabled, this may prevent the script from loading fully. You should relax the CSP in your server settings. Example CSP rule for apache2: |
17 | |||
18 | In `/etc/apache2/conf-available/shaarli-csp.conf`: | ||
19 | 17 | ||
20 | ```apache | 18 | ```apache |
21 | <Directory /path/to/shaarli> | 19 | <Directory /path/to/shaarli> |
20 | # Required for playvideos plugin | ||
22 | Header set Content-Security-Policy "script-src 'self' 'unsafe-inline' https://www.youtube.com https://s.ytimg.com 'unsafe-eval'" | 21 | Header set Content-Security-Policy "script-src 'self' 'unsafe-inline' https://www.youtube.com https://s.ytimg.com 'unsafe-eval'" |
23 | </Directory> | 22 | </Directory> |
24 | ``` | 23 | ``` |
25 | 24 | ||
26 | Then run `a2enconf shaarli-csp; service apache2 reload` | 25 | You may place the `Header` directive in the `<Directory...` section of your [webserver configuration](../../doc/md/Server-configuration.md)/virtualhost file, or write the above snippet to `/etc/apache2/conf-available/shaarli-csp.conf`; then run `a2enconf shaarli-csp; service apache2 reload`. |
27 | 26 | ||
28 | ### License | 27 | ### License |
29 | ``` | 28 | ``` |
diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php index 3b5dae34..56ae47b3 100644 --- a/plugins/qrcode/qrcode.php +++ b/plugins/qrcode/qrcode.php | |||
@@ -42,7 +42,7 @@ function hook_qrcode_render_linklist($data) | |||
42 | function hook_qrcode_render_footer($data) | 42 | function hook_qrcode_render_footer($data) |
43 | { | 43 | { |
44 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { | 44 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { |
45 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js'; | 45 | $data['js_files'][] = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js'; |
46 | } | 46 | } |
47 | 47 | ||
48 | return $data; | 48 | return $data; |
@@ -58,7 +58,7 @@ function hook_qrcode_render_footer($data) | |||
58 | function hook_qrcode_render_includes($data) | 58 | function hook_qrcode_render_includes($data) |
59 | { | 59 | { |
60 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { | 60 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { |
61 | $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css'; | 61 | $data['css_files'][] = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css'; |
62 | } | 62 | } |
63 | 63 | ||
64 | return $data; | 64 | return $data; |