Dan Brown

Updated folder permissions installation instructions & fixed issue with handling…

… image saving on user creation
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 use BookStack\Exceptions\ImageUploadException; 3 use BookStack\Exceptions\ImageUploadException;
4 use BookStack\Image; 4 use BookStack\Image;
5 use BookStack\User; 5 use BookStack\User;
6 +use Exception;
6 use Intervention\Image\ImageManager; 7 use Intervention\Image\ImageManager;
7 use Illuminate\Contracts\Filesystem\Factory as FileSystem; 8 use Illuminate\Contracts\Filesystem\Factory as FileSystem;
8 use Illuminate\Contracts\Filesystem\Filesystem as FileSystemInstance; 9 use Illuminate\Contracts\Filesystem\Filesystem as FileSystemInstance;
...@@ -88,9 +89,11 @@ class ImageService ...@@ -88,9 +89,11 @@ class ImageService
88 } 89 }
89 $fullPath = $imagePath . $imageName; 90 $fullPath = $imagePath . $imageName;
90 91
91 - if(!is_writable(dirname(public_path($fullPath)))) throw new ImageUploadException('Image Directory ' . public_path($fullPath) . ' is not writable by the server.'); 92 + try {
92 - 93 + $storage->put($fullPath, $imageData);
93 - $storage->put($fullPath, $imageData); 94 + } catch (Exception $e) {
95 + throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
96 + }
94 97
95 $imageDetails = [ 98 $imageDetails = [
96 'name' => $imageName, 99 'name' => $imageName,
......
...@@ -47,7 +47,7 @@ git clone https://github.com/ssddanbrown/BookStack.git --branch release --single ...@@ -47,7 +47,7 @@ git clone https://github.com/ssddanbrown/BookStack.git --branch release --single
47 47
48 2. `cd` into the application folder and run `composer install`. 48 2. `cd` into the application folder and run `composer install`.
49 3. Copy the `.env.example` file to `.env` and fill with your own database and mail details. 49 3. Copy the `.env.example` file to `.env` and fill with your own database and mail details.
50 -4. Ensure the `storage` & `bootstrap/cache` folders are writable by the web server. 50 +4. Ensure the `storage`, `bootstrap/cache` & `public/uploads` folders are writable by the web server.
51 5. In the application root, Run `php artisan key:generate` to generate a unique application key. 51 5. In the application root, Run `php artisan key:generate` to generate a unique application key.
52 6. If not using apache or if `.htaccess` files are disabled you will have to create some URL rewrite rules as shown below. 52 6. If not using apache or if `.htaccess` files are disabled you will have to create some URL rewrite rules as shown below.
53 7. Run `php artisan migrate` to update the database. 53 7. Run `php artisan migrate` to update the database.
......