mirror of
https://github.com/YunoHost-Apps/cops_ynh.git
synced 2024-09-03 18:25:57 +02:00
Adjustment on htpasswd access rights
This commit is contained in:
parent
a6d9eedb66
commit
f074e59c32
3 changed files with 9 additions and 8 deletions
|
@ -88,15 +88,16 @@ sudo cp -a ../sources/* $final_path/
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
sudo chmod 775 -R $final_path
|
sudo chmod 775 -R $final_path
|
||||||
|
sudo chown -hR $runninguser:$runninguser $final_path
|
||||||
|
|
||||||
if [ "$basicauthcreate" = "Yes" ];
|
if [ "$basicauthcreate" = "Yes" ];
|
||||||
then
|
then
|
||||||
sudo chmod 600 $final_path/htpasswd
|
sudo chmod 440 $final_path/htpasswd
|
||||||
|
sudo chown www-data:www-data $final_path/htpasswd
|
||||||
else
|
else
|
||||||
echo "Nothing to do"
|
echo "Nothing to do"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo chown -hR $runninguser:$runninguser $final_path
|
|
||||||
|
|
||||||
# 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@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||||
|
|
|
@ -36,15 +36,15 @@ sudo cp -a ./sources/* $final_path/
|
||||||
# Restore permissions to app files
|
# Restore permissions to app files
|
||||||
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
||||||
sudo chown -R $runninguser:$runninguser $final_path
|
sudo chown -R $runninguser:$runninguser $final_path
|
||||||
|
|
||||||
if [ "$basicauthcreate" = "Yes" ];
|
if [ "$basicauthcreate" = "Yes" ];
|
||||||
then
|
then
|
||||||
sudo chmod 600 $final_path/htpasswd
|
sudo chmod 440 $final_path/htpasswd
|
||||||
|
sudo chown www-data:www-data $final_path/htpasswd
|
||||||
else
|
else
|
||||||
echo "Nothing to do"
|
echo "Nothing to do"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### MySQL (remove if not used) ###
|
### MySQL (remove if not used) ###
|
||||||
# If a MySQL database is used:
|
# If a MySQL database is used:
|
||||||
# # Create and restore the database
|
# # Create and restore the database
|
||||||
|
|
|
@ -78,16 +78,16 @@ sudo cp -a ../sources/* $final_path/
|
||||||
|
|
||||||
# We adjust permissions
|
# We adjust permissions
|
||||||
sudo chmod 775 -R $final_path
|
sudo chmod 775 -R $final_path
|
||||||
|
sudo chown -hR $runninguser:$runninguser $final_path
|
||||||
|
|
||||||
if [ "$basicauthcreate" = "Yes" ];
|
if [ "$basicauthcreate" = "Yes" ];
|
||||||
then
|
then
|
||||||
sudo chmod 600 $final_path/htpasswd
|
sudo chmod 440 $final_path/htpasswd
|
||||||
|
sudo chown www-data:www-data $final_path/htpasswd
|
||||||
else
|
else
|
||||||
echo "Nothing to do"
|
echo "Nothing to do"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo chown -hR $runninguser:$runninguser $final_path
|
|
||||||
|
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
is_public=$(ynh_app_setting_get $app is_public)
|
is_public=$(ynh_app_setting_get $app is_public)
|
||||||
|
|
Loading…
Add table
Reference in a new issue