1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jirafeau_ynh.git synced 2024-09-03 19:35:53 +02:00

Merge pull request #16 from Kloadut/master

[fix] Allow installation and upgrade on the root of a domain
This commit is contained in:
Le Kload 2015-05-23 15:38:30 +02:00
commit d0fe46eb34
3 changed files with 13 additions and 1 deletions

View file

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

View file

@ -13,6 +13,8 @@ if [[ ! $? -eq 0 ]]; then
exit 1 exit 1
fi fi
# Remove trailing "/" for next commands
path=${path%/}
# Check that admin user is an existing account # Check that admin user is an existing account
sudo yunohost user list --json | grep -q "\"username\": \"$admin_user\"" sudo yunohost user list --json | grep -q "\"username\": \"$admin_user\""
@ -51,6 +53,11 @@ sudo chmod -R 700 $var_root
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
if [[ "$path" == "" ]]; then
sed -i "s@YNH_WWW_LOCATION@/@g" ../conf/nginx.conf
else
sed -i "s@YNH_WWW_LOCATION@$path@g" ../conf/nginx.conf
fi
nginxconf=/etc/nginx/conf.d/$domain.d/jirafeau.conf nginxconf=/etc/nginx/conf.d/$domain.d/jirafeau.conf
sudo cp ../conf/nginx.conf $nginxconf sudo cp ../conf/nginx.conf $nginxconf
sudo chown root: $nginxconf sudo chown root: $nginxconf

View file

@ -33,6 +33,11 @@ sudo chown -R www-data:root $var_root
sudo chmod -R 700 $var_root sudo chmod -R 700 $var_root
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
if [[ "$path" == "" ]]; then
sed -i "s@YNH_WWW_LOCATION@/@g" ../conf/nginx.conf
else
sed -i "s@YNH_WWW_LOCATION@$path@g" ../conf/nginx.conf
fi
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
nginxconf=/etc/nginx/conf.d/$domain.d/jirafeau.conf nginxconf=/etc/nginx/conf.d/$domain.d/jirafeau.conf