From 79183ae8e6a32a77d40196784a117e593623141a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 4 Apr 2024 23:57:25 +0200 Subject: [PATCH] docker: handle secrets.php --- docker/php/bootstrap.sh | 5 +++++ install.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/php/bootstrap.sh b/docker/php/bootstrap.sh index 5aaec0b2..006eea80 100755 --- a/docker/php/bootstrap.sh +++ b/docker/php/bootstrap.sh @@ -30,6 +30,11 @@ chgrp www-data /var/www # Initialize an empty robots.txt with the default if it doesn't exist. touch /var/www/robots.txt +# Initialize an empty writable secrests.php with the default if it doesn't exist. +touch /var/www/inc/secrets.php +chown www-data /var/www/inc/secrets.php +chgrp www-data /var/www/inc/secrets.php + # Link the cache and tmp files directory. ln -nfs /var/tmp/leftypol /var/www/tmp diff --git a/install.php b/install.php index 0d17d0da..696543a3 100644 --- a/install.php +++ b/install.php @@ -5,8 +5,8 @@ define('VERSION', '5.1.4'); require 'inc/bootstrap.php'; loadConfig(); -if (!is_writable('inc/secrets.php')) { - echo 'install.php does not have permission to write to /inc/secrets.php, without permission the installer cannot continue'; +if (!is_writable('inc/secrets.php') || !is_writable('inc/')) { + echo 'install.php does not have permission to write to /inc/secrets.php and/or /inc/, without permission the installer cannot continue'; exit(); }