diff --git a/ynh-dev b/ynh-dev index f239518..c75995f 100755 --- a/ynh-dev +++ b/ynh-dev @@ -329,6 +329,13 @@ function use_git() chown -R ynhdev /var/cache/ynh-dev/yunohost-admin/ create_sym_link "/ynh-dev/yunohost-admin-vue/app/package.json" "/var/cache/ynh-dev/yunohost-admin/package.json" create_sym_link "/ynh-dev/yunohost-admin-vue/app/package-lock.json" "/var/cache/ynh-dev/yunohost-admin/package-lock.json" + mv "/etc/nginx/conf.d/yunohost_admin.conf.inc" "/etc/nginx/conf.d/yunohost_admin.conf.inc.bkp" + trap 'on_exit' INT + on_exit() + { + mv "/etc/nginx/conf.d/yunohost_admin.conf.inc.bkp" "/etc/nginx/conf.d/yunohost_admin.conf.inc" + systemctl reload nginx + } # create_sym_link "/ynh-dev/yunohost-admin-vue/app" "/usr/share/yunohost/admin" cd /var/cache/ynh-dev/yunohost-admin/ @@ -368,6 +375,24 @@ EOF # Install dependencies npm ci --no-bin-links success "Now using Git repository for yunohost-admin" + cat < /etc/nginx/conf.d/yunohost_admin.conf.inc +location /yunohost/admin { + proxy_pass https://localhost:8080/yunohost/admin; + proxy_redirect off; + proxy_set_header Host \$host; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header X-Forwarded-Proto \$scheme; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host \$server_name; + proxy_set_header X-Forwarded-Port \$server_port; + + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "upgrade"; +} +EOF + + systemctl reload nginx cd /ynh-dev/yunohost-admin-vue/app/ npm run serve ;;