diff --git a/docker/Dockerfile b/docker/Dockerfile index bee0e909..725bc2c6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,18 +13,11 @@ RUN docker-php-ext-install mysqli mbstring xml RUN rm -rf /var/www/html/docker/ COPY ./ /var/www/html/ WORKDIR /var/www/html +# Setting permissions as: https://github.com/magicbug/Cloudlog/wiki/Installation RUN cd /var/www/html \ -&& echo "Setting root as owner of the folder..." \ -&& chown -R root:root /var/www/html \ -&& echo "Setting permissions to the install folder" \ -&& chown -R root:www-data ./application/config/ \ -&& chown -R root:www-data ./application/logs/ \ -&& chown -R root:www-data ./assets/qslcard/ \ -&& chown -R root:www-data ./backup/ \ -&& chown -R root:www-data ./updates/ \ -&& chown -R root:www-data ./uploads/ \ -&& chown -R root:www-data ./images/eqsl_card_images/ \ -&& chown -R root:www-data ./assets/json/ \ +&& echo "Setting root as owner of the html folder" \ +&& chown -R root:www-data /var/www/html +RUN echo "Setting permissions to the install folder" \ && chmod -R g+rw ./application/config/ \ && chmod -R g+rw ./application/logs/ \ && chmod -R g+rw ./assets/qslcard/ \ @@ -33,6 +26,4 @@ RUN cd /var/www/html \ && chmod -R g+rw ./uploads/ \ && chmod -R g+rw ./images/eqsl_card_images/ \ && chmod -R g+rw ./assets/json/ \ -&& chmod 777 /var/www/html/install \ -&& echo "Make sure everything is fine" \ -&& dir -ls +&& chmod -R 777 /var/www/html/install \ No newline at end of file diff --git a/install/includes/core_class.php b/install/includes/core_class.php index 37604e26..09cc9ee1 100644 --- a/install/includes/core_class.php +++ b/install/includes/core_class.php @@ -123,5 +123,4 @@ class Core { } } -?> - +?> \ No newline at end of file diff --git a/install/includes/database_class.php b/install/includes/database_class.php index 4cdc634c..b843862e 100644 --- a/install/includes/database_class.php +++ b/install/includes/database_class.php @@ -43,5 +43,4 @@ class Database { return true; } } -?> - +?> \ No newline at end of file diff --git a/install/index.php b/install/index.php index cc0e5d8b..1e65398d 100644 --- a/install/index.php +++ b/install/index.php @@ -7,13 +7,21 @@ $db_file_path = $db_config_path."database.php"; function delDir($dir) { $files = glob( $dir . '*', GLOB_MARK ); - foreach( $files as $file ){ - if( substr( $file, -1 ) == '/' ) - delDir( $file ); - else - unlink( $file ); + foreach ( $files as $file ) { + if ( substr( $file, -1 ) == '/' ) { + if (file_exists($file)) { + delDir( $file ); + } + } else { + if (file_exists($file)) { + unlink( $file ); + } + } } - rmdir( $dir ); + // This step may be not needed + if (file_exists($dir)) { + rmdir( $dir ); + } } if (file_exists($db_file_path)) {