mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-10-31 19:00:54 +00:00 
			
		
		
		
	chore(setup): Update obsolete chown group syntax (#2202)
Co-authored-by: Hugh Secker-Walker <hsw+miac@hodain.net>
This commit is contained in:
		
							parent
							
								
									1587248762
								
							
						
					
					
						commit
						57047d96e9
					
				| @ -202,13 +202,13 @@ chmod -R o-rwx /etc/dovecot | ||||
| 
 | ||||
| # Ensure mailbox files have a directory that exists and are owned by the mail user. | ||||
| mkdir -p $STORAGE_ROOT/mail/mailboxes | ||||
| chown -R mail.mail $STORAGE_ROOT/mail/mailboxes | ||||
| chown -R mail:mail $STORAGE_ROOT/mail/mailboxes | ||||
| 
 | ||||
| # Same for the sieve scripts. | ||||
| mkdir -p $STORAGE_ROOT/mail/sieve | ||||
| mkdir -p $STORAGE_ROOT/mail/sieve/global_before | ||||
| mkdir -p $STORAGE_ROOT/mail/sieve/global_after | ||||
| chown -R mail.mail $STORAGE_ROOT/mail/sieve | ||||
| chown -R mail:mail $STORAGE_ROOT/mail/sieve | ||||
| 
 | ||||
| # Allow the IMAP/POP ports in the firewall. | ||||
| ufw_allow imaps | ||||
|  | ||||
| @ -34,8 +34,8 @@ contact.admin.always_send warning critical | ||||
| EOF | ||||
| 
 | ||||
| # The Debian installer touches these files and chowns them to www-data:adm for use with spawn-fcgi | ||||
| chown munin. /var/log/munin/munin-cgi-html.log | ||||
| chown munin. /var/log/munin/munin-cgi-graph.log | ||||
| chown munin /var/log/munin/munin-cgi-html.log | ||||
| chown munin /var/log/munin/munin-cgi-graph.log | ||||
| 
 | ||||
| # ensure munin-node knows the name of this machine | ||||
| # and reduce logging level to warning | ||||
|  | ||||
| @ -110,7 +110,7 @@ InstallNextcloud() { | ||||
| 	# Make sure permissions are correct or the upgrade step won't run. | ||||
| 	# $STORAGE_ROOT/owncloud may not yet exist, so use -f to suppress | ||||
| 	# that error. | ||||
| 	chown -f -R www-data.www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud || /bin/true | ||||
| 	chown -f -R www-data:www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud || /bin/true | ||||
| 
 | ||||
| 	# If this isn't a new installation, immediately run the upgrade script. | ||||
| 	# Then check for success (0=ok and 3=no upgrade needed, both are success). | ||||
| @ -259,7 +259,7 @@ EOF | ||||
| EOF | ||||
| 
 | ||||
| 	# Set permissions | ||||
| 	chown -R www-data.www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud | ||||
| 	chown -R www-data:www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud | ||||
| 
 | ||||
| 	# Execute Nextcloud's setup step, which creates the Nextcloud sqlite database. | ||||
| 	# It also wipes it if it exists. And it updates config.php with database | ||||
| @ -311,7 +311,7 @@ var_export(\$CONFIG); | ||||
| echo ";"; | ||||
| ?> | ||||
| EOF | ||||
| chown www-data.www-data $STORAGE_ROOT/owncloud/config.php | ||||
| chown www-data:www-data $STORAGE_ROOT/owncloud/config.php | ||||
| 
 | ||||
| # Enable/disable apps. Note that this must be done after the Nextcloud setup. | ||||
| # The firstrunwizard gave Josh all sorts of problems, so disabling that. | ||||
|  | ||||
| @ -85,7 +85,7 @@ f=$STORAGE_ROOT | ||||
| while [[ $f != / ]]; do chmod a+rx "$f"; f=$(dirname "$f"); done; | ||||
| if [ ! -f $STORAGE_ROOT/mailinabox.version ]; then | ||||
| 	setup/migrate.py --current > $STORAGE_ROOT/mailinabox.version | ||||
| 	chown $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/mailinabox.version | ||||
| 	chown $STORAGE_USER:$STORAGE_USER $STORAGE_ROOT/mailinabox.version | ||||
| fi | ||||
| 
 | ||||
| # Save the global options in /etc/mailinabox.conf so that standalone | ||||
|  | ||||
| @ -170,7 +170,7 @@ EOF | ||||
| 
 | ||||
| # Create writable directories. | ||||
| mkdir -p /var/log/roundcubemail /var/tmp/roundcubemail $STORAGE_ROOT/mail/roundcube | ||||
| chown -R www-data.www-data /var/log/roundcubemail /var/tmp/roundcubemail $STORAGE_ROOT/mail/roundcube | ||||
| chown -R www-data:www-data /var/log/roundcubemail /var/tmp/roundcubemail $STORAGE_ROOT/mail/roundcube | ||||
| 
 | ||||
| # Ensure the log file monitored by fail2ban exists, or else fail2ban can't start. | ||||
| sudo -u www-data touch /var/log/roundcubemail/errors.log | ||||
| @ -194,14 +194,14 @@ usermod -a -G dovecot www-data | ||||
| 
 | ||||
| # set permissions so that PHP can use users.sqlite | ||||
| # could use dovecot instead of www-data, but not sure it matters | ||||
| chown root.www-data $STORAGE_ROOT/mail | ||||
| chown root:www-data $STORAGE_ROOT/mail | ||||
| chmod 775 $STORAGE_ROOT/mail | ||||
| chown root.www-data $STORAGE_ROOT/mail/users.sqlite | ||||
| chown root:www-data $STORAGE_ROOT/mail/users.sqlite | ||||
| chmod 664 $STORAGE_ROOT/mail/users.sqlite | ||||
| 
 | ||||
| # Fix Carddav permissions: | ||||
| chown -f -R root.www-data ${RCM_PLUGIN_DIR}/carddav | ||||
| # root.www-data need all permissions, others only read | ||||
| chown -f -R root:www-data ${RCM_PLUGIN_DIR}/carddav | ||||
| # root:www-data need all permissions, others only read | ||||
| chmod -R 774 ${RCM_PLUGIN_DIR}/carddav | ||||
| 
 | ||||
| # Run Roundcube database migration script (database is created if it does not exist) | ||||
|  | ||||
| @ -40,8 +40,8 @@ cp "$1/owncloud.db" $STORAGE_ROOT/owncloud/ | ||||
| cp "$1/config.php" $STORAGE_ROOT/owncloud/ | ||||
| 
 | ||||
| ln -sf $STORAGE_ROOT/owncloud/config.php /usr/local/lib/owncloud/config/config.php | ||||
| chown -f -R www-data.www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud | ||||
| chown www-data.www-data $STORAGE_ROOT/owncloud/config.php | ||||
| chown -f -R www-data:www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud | ||||
| chown www-data:www-data $STORAGE_ROOT/owncloud/config.php | ||||
| 
 | ||||
| sudo -u www-data php$PHP_VER /usr/local/lib/owncloud/occ maintenance:mode --off | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user