1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rspamdui_ynh.git synced 2024-09-03 20:16:32 +02:00

Support subdir. Fix remove and upgrade

This commit is contained in:
Julien Malik 2016-01-20 15:17:25 +01:00
parent 9ee20f6378
commit f64065de39
4 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,4 @@
location PATHTOCHANGE { location PATHTOCHANGE/ {
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }

View file

@ -16,6 +16,7 @@ if [[ ! $? -eq 0 ]]; then
fi fi
# Configure Nginx and reload # Configure Nginx and reload
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf # Removing trailing '/' in path to handle both subdir and subdomain installs.
sed -i "s@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf
sudo service nginx reload sudo service nginx reload

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
domain=$(sudo yunohost app setting transmission domain) domain=$(sudo yunohost app setting rspamdui domain)
sudo rm /etc/nginx/conf.d/$domain.d/transmission.conf sudo rm /etc/nginx/conf.d/$domain.d/rspamdui.conf
sudo service nginx reload sudo service nginx reload
sudo yunohost app ssowatconf sudo yunohost app ssowatconf

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# Retrieve arguments # Retrieve arguments
domain=$(sudo yunohost app setting transmission domain) domain=$(sudo yunohost app setting rspamdui domain)
path=$(sudo yunohost app setting transmission path) path=$(sudo yunohost app setting rspamdui path)
# Check port availability # Check port availability
sudo yunohost app checkport 11334 sudo yunohost app checkport 11334
@ -11,6 +11,6 @@ if [[ ! $? -eq 0 ]]; then
fi fi
# Configure Nginx and reload # Configure Nginx and reload
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf sed -i "s@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf
sudo service nginx reload sudo service nginx reload