From e922f9c907b04d55a61b08e9ff1724668b36ae18 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 24 Dec 2018 00:17:31 +0100 Subject: [PATCH] more readmes --- README.md | 9 ++++++- rtfm/DOCKER.md | 32 +++++++++++++++++++++++++ rtfm/INSTALL.md | 56 ++++++++++++++++++++++++++++++++++++++++++++ rtfm/INTEGRATIONS.md | 6 +++++ rtfm/SCALING.md | 12 ++++++++++ 5 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 rtfm/DOCKER.md create mode 100644 rtfm/INTEGRATIONS.md create mode 100644 rtfm/SCALING.md diff --git a/README.md b/README.md index f569f59..61001cb 100644 --- a/README.md +++ b/README.md @@ -50,4 +50,11 @@ Test site: https://dev.pictshare.net/ (only sometimes on) - [x] Preview image generation - [x] Upload of videos - [x] Automatic conversion if not mobile friendly or wrong encoder used -- [x] Render template for videos \ No newline at end of file +- [x] Render template for videos + + +--- + +This is a [HASCHEK SOLUTIONS](https://haschek.solutions) project + +[![HS logo](https://pictshare.net/css/imgs/hs_logo.png)](https://haschek.solutions) \ No newline at end of file diff --git a/rtfm/DOCKER.md b/rtfm/DOCKER.md new file mode 100644 index 0000000..1d0b592 --- /dev/null +++ b/rtfm/DOCKER.md @@ -0,0 +1,32 @@ +# Docker +The fastest way to deploy PictShare is via the [official Docker repo](https://hub.docker.com/r/hascheksolutions/pictshare/) +- [Source code & more examples](https://github.com/HaschekSolutions/PictShare-Docker) + +```bash +docker run -d -p 80:80 -e "TITLE=My own PictShare" hascheksolutions/pictshare +``` + +[![Docker setup](http://www.pictshare.net/b65dea2117.gif)](https://www.pictshare.net/8a1dec0973.mp4) + +### Docker Compose With Prebuild Image by hascheksolutions + +Run container by docker-compose: +- First, install docker compose: +[Docker official docs](https://docs.docker.com/compose/install/) +- Pull docker-compose file: +```bash +wget https://raw.githubusercontent.com/chrisiaut/pictshare/master/docker-compose.yml +``` +- Edit docker-compose file: +```bash +vi docker-compose.yml +``` +- Run container by docker-compose: +```bash +docker-compose up +``` + +By using this compose file, you should know that: +- Will make a directory "volumes" in the same directory where compose file is. +- Change `AUTOUPDATE` to false from true by defalt. +- And...it is highly recommended to build your own image. \ No newline at end of file diff --git a/rtfm/INSTALL.md b/rtfm/INSTALL.md index e69de29..17c67c2 100644 --- a/rtfm/INSTALL.md +++ b/rtfm/INSTALL.md @@ -0,0 +1,56 @@ +# Install guide + +PictShare is written to be run on a linux server with PHP 7 and nginx. We tried to support Windows for some time but ever since we started integrating ffmpeg for MP4 hosting we ditched Windows. + +- Make sure you have PHP7 GD libraries installed: ```apt-get install php-gd``` +- Unpack the [PictShare zip](https://github.com/chrisiaut/pictshare/archive/master.zip) +- Rename /inc/example.config.inc.php to /inc/config.inc.php +- ```chmod +x bin/ffmpeg``` if you want to be able to use mp4 uploads + - The provided ffmpeg binary (bin/ffmpeg) is from [here](http://johnvansickle.com/ffmpeg/) and it's a 64bit linux executable. If you need a different one, load yours and overwrite the one provided or if you have ffmpeg installed on the server you can use the config var ```FFMPEG_BINARY``` to tell PictShare where to look for the binary +- (optional) You can and should put a [nginx](https://www.nginx.com/) proxy before the Apache server. That thing is just insanely fast with static content like images. +- (optional) To secure your traffic I'd highly recommend getting an [SSL Cert](https://letsencrypt.org/) for your server if you don't already have one. + + +## Upgrading +- Just re-download the [PictShare zip](https://github.com/chrisiaut/pictshare/archive/master.zip) file and extract and overwrite existing pictshare files. Uploads and config won't be affected. +- Check if your ```/inc/config.inc.php``` file has all settings required by the ```/inc/example.config.inc.php``` since new options might get added in new versions + + +```bash +# to be run from the directory where your pictshare directory sits in +git clone https://github.com/chrisiaut/pictshare.git temp +cp -r temp/* pictshare/. +rm -rf temp +``` + +## Nginx configuration +This is a simple config file that should make PictShare work on nginx + + +``` +server { + listen 80; + server_name your.awesome.domain.name; + + root /var/www/pictshare; # or where ever you put it + index index.php; + + location / { + try_files $uri $uri/ /index.php?url=$request_uri; + } + + location ~ \.php { + fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; #may be slightly different depending on your php version + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_script_name; + } + + location ~ /(data|tmp|bin|content-controllers|inc|interfaces|storage-controllers|templates|tools) { + deny all; + return 404; + } + +} +``` \ No newline at end of file diff --git a/rtfm/INTEGRATIONS.md b/rtfm/INTEGRATIONS.md new file mode 100644 index 0000000..e85c245 --- /dev/null +++ b/rtfm/INTEGRATIONS.md @@ -0,0 +1,6 @@ +# Integrating PictShare in other programs + +- [Pastebinit](/rtfm/PASTEBINIT.md) +- Chrome Browser extension: https://chrome.google.com/webstore/detail/pictshare-1-click-imagesc/mgomffcdpnohakmlhhjmiemlolonpafc + - Source: https://github.com/chrisiaut/PictShare-Chrome-extension +- Plugin to upload images with ShareX: https://github.com/ShareX/CustomUploaders/blob/master/pictshare.net.sxcu \ No newline at end of file diff --git a/rtfm/SCALING.md b/rtfm/SCALING.md new file mode 100644 index 0000000..66e244d --- /dev/null +++ b/rtfm/SCALING.md @@ -0,0 +1,12 @@ +# How to scale PictShare + +If your library is huge then you might want to think about scaling your instances. Pictshare (v2+) was rebuilt with scaling in mind but instead of built-in scaling features we use a smarter system + +# The "ALT_FOLDER" setting +You can set the config var ```ALT_FOLDER``` to point to a directory on the same server where pictshare will look for content and put new uploads. + +This allows you to have a shared or even a mounted ftp/nfs folder that will act as the "database" of images across multiple PictShare instances. + +The main site https://pictshare.net uses this technique to scale across many servers in multiple countries. + +Using this method you can have multiple servers for the same domain (with a reverse proxy) \ No newline at end of file