added more configuration vars for backblaze

This commit is contained in:
Chris
2018-03-26 15:12:58 +02:00
parent 73fed1269e
commit 27a65d4c59
3 changed files with 11 additions and 8 deletions

View File

@@ -225,7 +225,7 @@ If you access the image with the code like this: ```https://www.pictshare.net/ch
- You have full control over your data. PictShare doesn't need remote libaries or tracking crap
## Scaling
You can use Backblaze Buckets for storage of images so you can use multiple instances of PictShare and if the image is not found on the instance, it will look in the bucket.
You can use **Backblaze Buckets** for storage of images so you can use multiple instances of PictShare and if the image is not found on the instance, it will look in the bucket.
Just add your credentials to the config.inc.php file as described in the ```example.config.inc.php``` file.
@@ -237,8 +237,8 @@ Just add your credentials to the config.inc.php file as described in the ```exam
## nginx config
This is a simple config file that should make PictShare work on nginx
- Install php fpm: ```apt-get install php5-fpm```
- Install php Graphics libraries: ```apt-get install php5-gd```
- Install php fpm: ```apt-get install php-fpm```
- Install php Graphics libraries: ```apt-get install php-gd```
```
server {

View File

@@ -79,8 +79,11 @@ define('SHOW_ERRORS', false);
/* BACKBLAZE B2 */
/* You can find your info here: https://secure.backblaze.com/b2_buckets.htm */
//define('BACKBLAZE',true); //true=>use backblaze to upload images, false=>don't
//define('BACKBLAZE',true); //true=>use backblaze false=>don't
//define('BACKBLAZE_ID','');
//define('BACKBLAZE_KEY', '');
//define('BACKBLAZE_BUCKET_ID', '');
//define('BACKBLAZE_BUCKET_NAME', '');
//define('BACKBLAZE_BUCKET_NAME', '');
//define('BACKBLAZE_AUTODOWNLOAD', true); //if true, will download images from backblaze if not found local
//define('BACKBLAZE_AUTOUPLOAD', true); //if true, will upload images to backblaze when they are uploaded to pictshare
//define('BACKBLAZE_AUTOUPDELETE', true); //if true, will delete images from backblaze if they are deleted from pictshare

View File

@@ -94,7 +94,7 @@ class PictshareModel extends Model
}
$data['hash']=$el;
}
else if(BACKBLAZE === true && $this->couldThisBeAnImage($el)) //looks like it might be a hash but didn't find it here. Let's see
else if(BACKBLAZE === true && $this->couldThisBeAnImage($el) && BACKBLAZE_AUTODOWNLOAD ===true) //looks like it might be a hash but didn't find it here. Let's see
{
$b = new Backblaze();
if($b->download($el)) //if the backblaze download function says it's an image, we'll take it
@@ -212,7 +212,7 @@ class PictshareModel extends Model
rmdir($base_path);
//delete from backblaze if configured
if(BACKBLAZE===true)
if(BACKBLAZE===true && BACKBLAZE_AUTOUPDELETE===true)
{
$b = new Backblaze();
$b->deleteFile($hash);
@@ -489,7 +489,7 @@ class PictshareModel extends Model
fclose($fh);
}
if(BACKBLAZE===true)
if(BACKBLAZE===true && BACKBLAZE_AUTOUPLOAD===true)
{
$b = new Backblaze();
$b->upload($hash);