|
2 | 2 | ################################################################################ |
3 | 3 | # <START METADATA> |
4 | 4 | # @file_name: www-permissions.sh |
5 | | -# @version: 3.1.1095 |
| 5 | +# @version: 3.1.1096 |
6 | 6 | # @description: This script will add a new www-data group on your server |
7 | 7 | # and set permissions for ${www_root:-/var/www/html/vsapp}. |
8 | 8 | # Please ensure you have read the documentation before continuing. |
@@ -342,27 +342,27 @@ vstacklet::vsperms::adjust() { |
342 | 342 | vstacklet::shell::text::error "failed to change directory permissions of ${www_root:-/var/www/html/vsapp} to 2755." |
343 | 343 | exit 1 |
344 | 344 | } |
345 | | - # @script-note: change the permissions of files under web root ${www_root} to 0664 |
346 | | - vstacklet::shell::text::white "changing file permissions of ${www_root:-/var/www/html/vsapp} to 0664 ... " |
347 | | - find "${www_root:-/var/www/html/vsapp}" -type f -exec chmod -R 0664 {} + || { |
348 | | - vstacklet::shell::text::error "failed to change file permissions of ${www_root:-/var/www/html/vsapp} to 0664." |
| 345 | + # @script-note: change the permissions of files under web root ${www_root} to 0444 |
| 346 | + vstacklet::shell::text::white "changing file permissions of ${www_root:-/var/www/html/vsapp} to 0444 ... " |
| 347 | + find "${www_root:-/var/www/html/vsapp}" -type f -exec chmod -R 0444 {} + || { |
| 348 | + vstacklet::shell::text::error "failed to change file permissions of ${www_root:-/var/www/html/vsapp} to 0444." |
349 | 349 | exit 1 |
350 | 350 | } |
351 | 351 | # @script-note: change file permissions on config files (this is useful for WordPress installations) |
352 | | - # Check the directory for wp-config.php and set the permissions to 0644 |
| 352 | + # Check the directory for wp-config.php and set the permissions to 0444 |
353 | 353 | if [[ -n $(find "${www_root:-/var/www/html/vsapp}" -type f -name "wp-config.php") ]]; then |
354 | | - vstacklet::shell::text::white "changing permissions of wp-config.php to 0644 ... " |
355 | | - find "${www_root:-/var/www/html/vsapp}" -type f -name "wp-config.php" -exec chmod 0644 {} + || { |
356 | | - vstacklet::shell::text::error "failed to change permissions of wp-config.php to 0644." |
| 354 | + vstacklet::shell::text::white "changing permissions of wp-config.php to 0444 ... " |
| 355 | + find "${www_root:-/var/www/html/vsapp}" -type f -name "wp-config.php" -exec chmod 0444 {} + || { |
| 356 | + vstacklet::shell::text::error "failed to change permissions of wp-config.php to 0444." |
357 | 357 | exit 1 |
358 | 358 | } |
359 | 359 | fi |
360 | | - # @script-note: check the directories for any .conf files and set the permissions to 0644 (this is useful for Nginx configurations) |
| 360 | + # @script-note: check the directories for any .conf files and set the permissions to 0444 (this is useful for Nginx configurations) |
361 | 361 | # Check several levels deep for .conf files |
362 | 362 | if [[ -n $(find "${www_root:-/var/www/html/vsapp}" -type f -name "*.conf") ]]; then |
363 | | - vstacklet::shell::text::white "changing permissions of ${www_root:-/var/www/html/vsapp}/*.conf to 0644 ... " |
364 | | - find "${www_root:-/var/www/html/vsapp}" -type f -name "*.conf" -exec chmod 0644 {} + || { |
365 | | - vstacklet::shell::text::error "failed to change permissions of ${www_root:-/var/www/html/vsapp}/*.conf to 0644." |
| 363 | + vstacklet::shell::text::white "changing permissions of ${www_root:-/var/www/html/vsapp}/*.conf to 0444 ... " |
| 364 | + find "${www_root:-/var/www/html/vsapp}" -type f -name "*.conf" -exec chmod 0444 {} + || { |
| 365 | + vstacklet::shell::text::error "failed to change permissions of ${www_root:-/var/www/html/vsapp}/*.conf to 0444." |
366 | 366 | exit 1 |
367 | 367 | } |
368 | 368 | fi |
|
0 commit comments