diff --git a/conf/nginx.conf b/conf/nginx.conf index eaf9881..1875f83 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location ~ /ws/ { +location /api/ws/ { proxy_pass http://127.0.0.1:__PORT__; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; diff --git a/scripts/install b/scripts/install index 7c24650..8fbb772 100755 --- a/scripts/install +++ b/scripts/install @@ -158,6 +158,8 @@ then ynh_permission_update --permission="main" --add="visitors" fi +ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 54c58f0..32f4f92 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,6 +41,11 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# Create a permission if needed +if ! ynh_permission_exists --permission="api"; then + ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================