1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/converse_ynh.git synced 2024-09-03 18:25:53 +02:00
This commit is contained in:
ericgaspar 2021-02-02 12:48:54 +01:00
parent 8fcaae73c6
commit c46557ee7e
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 21 additions and 14 deletions

View file

@ -11,23 +11,16 @@ location __PATH__/ {
rewrite ^ https://$server_name$request_uri? permanent;
}
# BOSH
location = __PATH__/http-bind {
proxy_pass http://localhost:5290/http-bind;
proxy_redirect off;
proxy_pass "http://localhost:5290/http-bind";
proxy_http_version 1.1;
proxy_set_header Host $host;
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-Host $server_name;
proxy_set_header X-Forwarded-Port $server_port;
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
proxy_buffering off;
tcp_nodelay on;
}
# Include SSOWAT user panel.

View file

@ -26,6 +26,17 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
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
#=================================================
@ -48,8 +59,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
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
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"
fi