From c5715182c0717649440941617d73af56b4b47f3f Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 27 Dec 2018 13:14:37 +0100 Subject: [PATCH] added more documentation --- README.md | 3 +++ inc/core.php | 2 +- rtfm/CONFIG.md | 17 +++++++++++++++++ rtfm/INSTALL.md | 3 +++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 rtfm/CONFIG.md diff --git a/README.md b/README.md index 5e9d08d..c2921d1 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Table of contents - New API system. Only single file uploads now via /api/upload.php (POST var name is "file"). [read more..](/rtfm/API.md) - Data directory changed from ```upload``` to ```data``` +- Backblaze support dropped for now because we didn't need it anymore as ALT_FOLDER is more flexible. If soneone needs it, it can easily be implemented via adding a new storage controller. We're happy to accept pull requests ## Status @@ -37,6 +38,8 @@ Table of contents ### Config options +Read [here](/rftm/CONFIG.md) what those options do + - [x] ALT_FOLDER - [x] URL (instead of FORCE_DOMAIN but mandatory) - [x] LOG_UPLOADER diff --git a/inc/core.php b/inc/core.php index 2fe53d3..ac5d287 100644 --- a/inc/core.php +++ b/inc/core.php @@ -472,7 +472,7 @@ function storeFile($srcfile,$hash,$deleteoriginal=false) if(defined('LOG_UPLOADER') && LOG_UPLOADER) { - $fh = fopen(ROOT.DS.'data'.DS.'uploads.txt', 'a'); + $fh = fopen(ROOT.DS.'data'.DS.'uploads.csv', 'a'); fwrite($fh, time().';'.$url.';'.$hash.';'.getUserIP()."\n"); fclose($fh); } diff --git a/rtfm/CONFIG.md b/rtfm/CONFIG.md new file mode 100644 index 0000000..ed9370a --- /dev/null +++ b/rtfm/CONFIG.md @@ -0,0 +1,17 @@ +# Config options + +|Option | value type | What it does| +|--- | --- | ---| +| URL | string | Sets the URL that will be shown to users for each upload. Must be set and must have tailing slash. eg: http://pictshare.local/ | +| ALT_FOLDER | string | All uploaded files will be copied to this location. This location can be a mounted network share (eg NFS or FTP, etc). If a file is not found in the normal upload direcotry, ALT_FOLDER will be checked. [more info about scaling PictShare](/rtfm/SCALING.md) | +| LOG_UPLOADER | bool | If set to true, all IP addresses of uploaders will be stored in /data/uploads.csv | +| FFMPEG_BINARY | string | If you installed ffmpeg on your machine, you can set the binary path here. This allows devices like the Raspberry Pi to be used with PictShare although I wouldn't recommend it because of the sloooooow conversion speed | +| PNG_COMPRESSION | int | 0 (no compression) to 9 (best compression) Note that for PNGs the compression doesn't affect the quality of the image, just the en/decode speed and file size | +| JPEG_COMPRESSION | int | 0 (worst quality) to 100 (best quality) | +| WEBP_COMPRESSION | int | 0 (worst quality, smallest file) to 100 (best quality, biggest file) | +| MASTER_DELETE_CODE | string | If set, this code will be accepted to delete any image by adding "delete_yourmasterdeletecode" to any image | +| MASTER_DELETE_IP | IP addr | If set, allows deletion of image no matter what delete code you provided if request is coming from this single IP | +| UPLOAD_FORM_LOCATION | string | If set, will only show the upload form if this url is requested. eg if you set it to /secret/upload then you only see the form if you go to http://your.pictshare.server/secret/upload but bare in mind that the uploads [via API](/rtfm/API.md) will still work for anyone| +| UPLOAD_QUOTA (NOT IMPLEMENTED) | int | Size in MB. If set, will only allow uploads if combined size of uploads on Server is smaller than this value. Does not account for ALT_FOLDER data and resized versions of original uploads won't be added to calculation | +| UPLOAD_CODE (NOT IMPLEMENTED | string | If set, all uploads require this code via GET or POST variable "uploadcode" or upload will fail | +| MAX_RESIZED_IMAGES (NOT IMPLEMENTED | string | If set, limits count of resized images/videos per file on server | \ No newline at end of file diff --git a/rtfm/INSTALL.md b/rtfm/INSTALL.md index fb7fe46..fb59de6 100644 --- a/rtfm/INSTALL.md +++ b/rtfm/INSTALL.md @@ -24,6 +24,9 @@ cp -r temp/* pictshare/. rm -rf temp ``` +## Configuring PictShare +[Documentation of config settings here](/rtfm/CONFIG.md) + ## Nginx configuration This is a simple config file that should make PictShare work on nginx