Просмотр исходного кода

Create a couple of writeable folders in each user home directory (#580)

Raphael Schneeberger 6 лет назад
Родитель
Сommit
5bf2c9bb56
3 измененных файлов с 15 добавлено и 2 удалено
  1. 2 1
      CHANGELOG.md
  2. 5 0
      bin/v-add-user
  3. 8 1
      install/upgrade/versions/latest.sh

+ 2 - 1
CHANGELOG.md

@@ -35,7 +35,8 @@ All notable changes to this project will be documented in this file.
 - Performance: Do not resolve ip when listing iptables rules. Server tab could take multiple minutes to load in some cases.
 - Update jQuery to 3.4.1 and adjust includes.
 - Fixed cronjob issue with sftp jail due to missing user.
-- Fixed issue #569 Remote backup hostname would reject ip addr without reverse dns (PTR record)
+- Fixed issue #569 Remote backup hostname would reject ip addr without reverse dns (PTR record).
+- Create a couple of writeable folders in each user home directory (#580).
 
 ## [1.0.5] - 2019-08-06 - Hotfix
 ### Bugfixes

+ 5 - 0
bin/v-add-user

@@ -97,6 +97,11 @@ if [ ! -z "$DNS_SYSTEM" ]; then
     chmod 751 $HOMEDIR/$user/conf/dns
 fi 
 
+# Create default writeable folders
+mkdir $HOMEDIR/$user/.config $HOMEDIR/$user/.local $HOMEDIR/$user/.composer
+chown $user:$user $HOMEDIR/$user/.config $HOMEDIR/$user/.local \
+                  $HOMEDIR/$user/.composer
+
 # Set permissions
 chmod a+x $HOMEDIR/$user
 chattr +i $HOMEDIR/$user/conf > /dev/null 2>&1

+ 8 - 1
install/upgrade/versions/latest.sh

@@ -73,4 +73,11 @@ if [ -e "/etc/cron.d/hestia-sftp" ]; then
     if ! cat /etc/cron.d/hestia-sftp | grep -q 'admin'; then
         echo "@reboot admin /usr/local/hestia/bin/v-add-sys-sftp-jail" > /etc/cron.d/hestia-sftp
     fi
-fi
+fi
+
+# Create default writeable folders for all users
+for user in $($HESTIA/bin/v-list-sys-users plain); do
+    mkdir -p $HOMEDIR/$user/.config $HOMEDIR/$user/.local $HOMEDIR/$user/.composer
+    chown $user:$user $HOMEDIR/$user/.config $HOMEDIR/$user/.local \
+                      $HOMEDIR/$user/.composer
+done