1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cryptpad_ynh.git synced 2024-09-03 18:26:14 +02:00

Fix some random CSP issues

This commit is contained in:
Jimmy Monin 2017-07-23 22:53:29 +02:00
parent a1cc249d41
commit eb2883f949
3 changed files with 15 additions and 4 deletions

View file

@ -32,7 +32,7 @@ module.exports = {
* it is recommended that you configure these fields to match the * it is recommended that you configure these fields to match the
* domain which will serve your cryptpad instance. * domain which will serve your cryptpad instance.
*/ */
"connect-src 'self' ws://*", "connect-src 'self' ws://__URL__cryptpad_websocket ws://*",
"child-src 'self' *", "child-src 'self' *",
// data: is used by codemirror // data: is used by codemirror

View file

@ -10,6 +10,18 @@ location / {
proxy_set_header Connection upgrade; proxy_set_header Connection upgrade;
} }
location = /cryptpad_websocket {
proxy_pass http://localhost:__PORT__;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support (nginx 1.4)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
#location = /api/config { #location = /api/config {
# default_type text/javascript; # default_type text/javascript;

View file

@ -99,8 +99,7 @@ ynh_use_logrotate
final_path=/var/www/$app final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
#ynh_setup_source $final_path ynh_setup_source $final_path
sudo git clone https://github.com/xwiki-labs/cryptpad.git $final_path
#================================================= #=================================================
# Files owned by root, www-data can just read # Files owned by root, www-data can just read
@ -140,8 +139,8 @@ popd
#================================================= #=================================================
sudo mv ../conf/config.js $final_path/config.js sudo mv ../conf/config.js $final_path/config.js
ynh_replace_string "__URL__" "$path_url" "$final_path/config.js"
ynh_replace_string "__PORT__" "$port" "$final_path/config.js" ynh_replace_string "__PORT__" "$port" "$final_path/config.js"
ynh_replace_string "__URL__" "$domain$path_url" "$final_path/config.js"
#================================================= #=================================================
# INSTALL MODULES FOR CRYPTPAD # INSTALL MODULES FOR CRYPTPAD