fix use-git vuejs

This commit is contained in:
Kay0u 2021-01-16 17:38:50 +01:00
parent 094c4861eb
commit 12fc1ab5d5
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

25
ynh-dev
View file

@ -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 <<EOF > /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
;;