Browse Source

Fix permissions

Julien Vaubourg 9 years ago
parent
commit
9a1cc633e3
2 changed files with 3 additions and 1 deletions
  1. 1 1
      scripts/install
  2. 2 0
      scripts/restore

+ 1 - 1
scripts/install

@@ -92,7 +92,7 @@ sudo install -b -o root -g root -m 0644 ../conf/phpfpm_captive-piratebox.conf /e
 sudo git clone https://github.com/jvaubourg/php-piratebox.git /var/www/piratebox/
 
 if [ ! -z "${PIRATEBOX_GITCOMMIT_UPSTREAM}" ]; then
-  git --work-tree /var/www/piratebox/ --git-dir /var/www/piratebox/.git/ reset --hard "${PIRATEBOX_GITCOMMIT_UPSTREAM}"
+  sudo git --work-tree /var/www/piratebox/ --git-dir /var/www/piratebox/.git/ reset --hard "${PIRATEBOX_GITCOMMIT_UPSTREAM}"
 fi
 
 sudo chown -R root: /var/www/piratebox/

+ 2 - 0
scripts/restore

@@ -3,8 +3,10 @@
 # The parameter $1 is the uncompressed restore directory location
 backup_dir="${1}/apps/piratebox"
 
+sudo rm -f /etc/nginx/conf.d/captive-piratebox.conf
 sudo mkdir -p /var/www/piratebox/public/
 sudo mv "${backup_dir}/uploads/" /var/www/piratebox/public/
+sudo chown -R www-data: /var/www/piratebox/public/uploads/
 
 gitcommit=$(sudo grep revision /etc/yunohost/apps/piratebox/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/')
 gitcommit_upstream=$(sudo yunohost app setting piratebox gitcommit_upstream)