1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grafana_ynh.git synced 2024-09-03 20:36:29 +02:00

Apply port change on install and nginx.conf

This commit is contained in:
nemsia 2017-05-08 21:22:16 +02:00
parent fe57c119ca
commit de208db3ac
3 changed files with 6 additions and 4 deletions

View file

@ -3,7 +3,7 @@ location / {
proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-WEBAUTH-USER $remote_user; proxy_set_header X-WEBAUTH-USER $remote_user;
proxy_pass http://127.0.0.1:5000; proxy_pass http://127.0.0.1:YNH_WWW_PORT;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_pass_request_headers on; proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive"; proxy_set_header Connection "keep-alive";

View file

@ -14,7 +14,7 @@ location ~ YNH_WWW_PATH/(?<ndpath>.*) {
proxy_pass_request_headers on; proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive"; proxy_set_header Connection "keep-alive";
proxy_store off; proxy_store off;
proxy_pass http://127.0.0.1:5000/$ndpath$is_args$args; proxy_pass http://127.0.0.1:YNH_WWW_PORT/$ndpath$is_args$args;
gzip on; gzip on;
gzip_proxied any; gzip_proxied any;

View file

@ -13,6 +13,7 @@ source ./_common.sh
# Retrieve arguments # Retrieve arguments
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH path=$YNH_APP_ARG_PATH
port=$YNH_APP_ARG_PORT
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
@ -79,8 +80,8 @@ sudo systemctl start influxdb
sudo cp ../conf/ldap.toml /etc/grafana sudo cp ../conf/ldap.toml /etc/grafana
grafana_conf="/etc/grafana/grafana.ini" grafana_conf="/etc/grafana/grafana.ini"
# Set final URL # Set final port
sudo sed -i '/^\[server\]$/,/^\[/ s/;http_port = .*/http_port = 5000/' $grafana_conf sudo sed -i "/^\[server\]$/,/^\[/ s@;http_port = .*@http_port = $port@" $grafana_conf
# Set final URL # Set final URL
sudo sed -i "/^\[server\]$/,/^\[/ s@;root_url = .*@root_url = https://$domain$path@" $grafana_conf sudo sed -i "/^\[server\]$/,/^\[/ s@;root_url = .*@root_url = https://$domain$path@" $grafana_conf
# Disable check for updates # Disable check for updates
@ -140,6 +141,7 @@ else
fi fi
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
sed -i "s@YNH_WWW_PORT@$port@g" $nginx_conf
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
# If app is public, add url to SSOWat conf as skipped_uris # If app is public, add url to SSOWat conf as skipped_uris