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:
commit
d0fe46eb34
3 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
location YNH_WWW_PATH {
|
||||
location YNH_WWW_LOCATION {
|
||||
alias YNH_WWW_ALIAS ;
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
|
|
|
@ -13,6 +13,8 @@ if [[ ! $? -eq 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
path=${path%/}
|
||||
|
||||
# Check that admin user is an existing account
|
||||
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
|
||||
sed -i "s@YNH_WWW_PATH@$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
|
||||
sudo cp ../conf/nginx.conf $nginxconf
|
||||
sudo chown root: $nginxconf
|
||||
|
|
|
@ -33,6 +33,11 @@ sudo chown -R www-data:root $var_root
|
|||
sudo chmod -R 700 $var_root
|
||||
|
||||
# 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_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
nginxconf=/etc/nginx/conf.d/$domain.d/jirafeau.conf
|
||||
|
|
Loading…
Reference in a new issue