From 3fe878adab71490dfc2adc75b6e0cd76eb3c15de Mon Sep 17 00:00:00 2001 From: anmol Date: Sun, 11 Nov 2018 03:44:44 +0530 Subject: [PATCH] Fixed static file error in nginx and fix upgrade script --- conf/nginx.conf | 2 ++ scripts/upgrade | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c9e508b..4ed2704 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,11 @@ location ~* \.(jpg|jpeg|png|gif|ico|js|pdf)$ { + root __FINALPATH__/__APP__ add_header Cache-Control "public"; expires 7d; } location / { + proxy_pass http://localhost:__PORT__/; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; diff --git a/scripts/upgrade b/scripts/upgrade index 01d6715..7cb9775 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,8 +41,6 @@ elif [ "$is_public" = "No" ]; then fi - - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -98,8 +96,12 @@ ynh_install_app_dependencies gettext postgresql postgresql-contrib libpq-dev git ( cd $final_path/$app && git pull ) # Give permisiion to the final_path -chown -R "$app":"$app" "$final_path" +( cd $final_path && sudo -u "$app" curl -sf -L https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly --date=2018-07-17 ) + export PATH="$PATH:/var/www/$app/.cargo/bin:/var/$app/.local/bin:/usr/local/sbin" + export FEATURES=postgres +chown -R "$app":"$app" "$final_path" +( cd $final_path/$app && sudo -u "$app" cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0' ) ( cd $final_path/$app && sudo -u "$app" cargo install --force ) ( cd $final_path/$app && sudo -u "$app" cargo install --path plume-cli --force ) ( cd $final_path/$app && diesel migration run )