mirror of
https://github.com/YunoHost-Apps/converse_ynh.git
synced 2024-09-03 18:25:53 +02:00
Fix
This commit is contained in:
parent
8fcaae73c6
commit
c46557ee7e
2 changed files with 21 additions and 14 deletions
|
@ -11,23 +11,16 @@ location __PATH__/ {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# BOSH
|
||||||
location = __PATH__/http-bind {
|
location = __PATH__/http-bind {
|
||||||
proxy_pass http://localhost:5290/http-bind;
|
proxy_pass "http://localhost:5290/http-bind";
|
||||||
proxy_redirect off;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_set_header X-Forwarded-Host $server_name;
|
proxy_buffering off;
|
||||||
proxy_set_header X-Forwarded-Port $server_port;
|
tcp_nodelay on;
|
||||||
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection “upgrade”;
|
|
||||||
}
|
|
||||||
|
|
||||||
# CORS
|
|
||||||
location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
|
|
||||||
more_set_headers 'Access-Control-Allow-Origin: "*"'; # Decide here whether you want to allow all or only a particular domain
|
|
||||||
root __FINALPATH__/; # Properly set the path here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
|
|
|
@ -26,6 +26,17 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
|
# If final_path doesn't exist, create it
|
||||||
|
if [ -z "$final_path" ]; then
|
||||||
|
final_path=/var/www/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -48,8 +59,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=4
|
ynh_script_progression --message="Upgrading source files..." --weight=4
|
||||||
|
|
||||||
|
# Remove the app directory securely
|
||||||
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
# Download, the source from sources folder
|
# Download, the source from sources folder
|
||||||
mkdir -p $final_path && cp -a ../sources/* $final_path
|
cp -a ../sources/* $final_path
|
||||||
ynh_replace_string --match_string="__DOMAIN____PATH__" --replace_string="$domain$path_url" --target_file="$final_path/index.html"
|
ynh_replace_string --match_string="__DOMAIN____PATH__" --replace_string="$domain$path_url" --target_file="$final_path/index.html"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue