Go to file
2024-03-22 17:14:06 +01:00
.docker Add Docker 2023-07-13 14:56:36 +02:00
app Close #468 : Add remove option in backend 2024-03-22 13:48:19 +01:00
bin Add Docker 2023-07-13 14:56:36 +02:00
cache New version from scratch 2023-06-21 11:42:36 +02:00
datas Add select img format type (jpeg, png) 2023-06-28 12:29:20 +02:00
public Close #468 : Add remove option in backend 2024-03-22 13:48:19 +01:00
src/images Fix missing favicon 2024-03-20 10:33:35 +01:00
tpl Close #468 : Add remove option in backend 2024-03-22 13:48:19 +01:00
.gitignore New version from scratch 2023-06-21 11:42:36 +02:00
composer.json New version from scratch 2023-06-21 11:42:36 +02:00
Dockerfile Update Docker version 2024-03-22 13:51:08 +01:00
DockerRun Update Docker version 2024-03-22 13:51:08 +01:00
LICENSE New version from scratch 2023-06-21 11:42:36 +02:00
README.md Add missing credit 2024-03-20 10:35:43 +01:00

!!!! Be careful !!!!

Use at your own risk

Soshot make webshot of internet page with headless machine.

Ideas

  • If webshot exist in desired size, serve them, if not, verif if complete exist, if exist, crop and resize, save and serve
  • If webshot not exist get information of page and add in the queue
  • Cron job take a webshot of complete page and save them (1920 x complete lenth)
  • Crop image and resize desired format (1920x1080, 1280x720, 160x90 ...), save and serve

SoShot always make complete webshot (1920x page lenght) + first demande size.

Size use 16/9 ratio :

  • fav = define by config (default 48px)
  • og = define by the website himself (no resize or crop)
  • thumb = 160x90
  • hd = 1280x720
  • full = 1920x1080
  • complete = 1920xpage height

Requirements

  • PHP 8.*
  • Sqlite3
  • PDO
  • Composer
  • Imagick
  • PHP-GD
  • CRON
  • Chrome / Chromium

Installation

Make directory on your web server and go in

mkdir /var/www/soshot && cd /var/www/soshot

Clone git repo

git clone https://forge.leslibres.org/Knah-Tsaeb/Soshot.git .

Install dependencies

composer install --no-dev

Add cron task

sudo crontab -u www-data -e

php /var/www/soshot/bin/thumbShoter.php

Configure your web server to serve in "public" directory

Go to web page https://shoshot.your-domain.tld

Configuration

You can use a web interface (if option "use web gui" is set to true), https://shoshot.your-domain.tld/backend?page=settings

Or you can modify config file /datas/config.json.

Accept only request from 127.0.0.1

Default : true

ShoShot only work for local machine, return 404 if use with remote machine.

Use web gui

Default : false

Soshot only work with endpoint /api. Return 404 if endpoint is not /api

Use log

Default : true

Not implemented yet.

Always make PDF

Default : false

If true, SoShot make a complete webshot and PDF of page.

Favicon size

Default : 48

Define size of favicon.

Permit type of webshot

Default : none

Select authorized size or type of webshot.

Cache expiration (for web GUI) in hour

Default : 12

Not implemented yet.

Maximum work per batch

Default : 5

Foreach cron task as launch, SoShot make 5 webshot.

Api key

Default : random string, lenght 12

!!! DANGER !!!

If you change key, all previous generation will be invalid. Soshot re make all previous generation.

Password

Default : null

Password for admin interface. No min or max character.

Chrome path

Default : empty

If path of Chrome/Chromium is not in PATH, you can define here.

Usage

For generating webshot the entry point is https://shoshot.your-domain.tld/api?

You need to define 3 parameters :

  • type (fav, og, pdf, thumb, hd, full, complete)
  • hmac (hash_hmac('sha1', url of page, your Api key);)
  • url (url of page encode with url_encode)

Example : https://shoshot.your-domain.tld/api?type=fav&hmac=44a2b3f1bc43895c23779f4e71558e9976a4daf2&url=https%3A%2F%2Ffr.wikipedia.org%2Fwiki%2FLogiciel_libre

License

GNU General Public License v3.0

See LICENSE file for more detail.

Thanks