Metadata-Version: 2.4
Name: screamshotter
Version: 2.3.2
Summary: Takes captures of HTML pages
Author-email: Makina Corpus <support.geotrek@makina-corpus.com>
License-Expression: BSD-2-Clause
Project-URL: Homepage, https://makina-corpus.com
Description-Content-Type: text/markdown
Requires-Dist: django==5.2.*
Requires-Dist: tzdata
Requires-Dist: nodeenv
Requires-Dist: djangorestframework
Requires-Dist: coreapi
Requires-Dist: whitenoise
Requires-Dist: gunicorn[gevent]
Requires-Dist: sentry-sdk

[![codecov](https://codecov.io/gh/makinacorpus/screamshotter/branch/master/graph/badge.svg?token=Vk72Ni1u8F)](https://codecov.io/gh/makinacorpus/screamshotter)
![github actions](https://github.com/makinacorpus/screamshotter/actions/workflows/test.yml/badge.svg)

<img src="src/screamshotter/static/img/logo_screamshotter_light.jpeg" alt="Screamshotter" style="max-width: 200px; height: auto;">

# Screamshotter : microservice to take webpage screenshots

### Powered by Django / Node / Puppeteer / Chromium

# INSTALL

## Ubuntu

### From apt repo

```
sudo apt update
sudo apt install wget software-properties-common
echo "deb [arch=amd64] https://packages.geotrek.fr/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/geotrek.list
wget -O- "https://packages.geotrek.fr/geotrek.gpg.key" | sudo apt-key add -
sudo apt update
sudo apt install screamshotter
```

### Local installation

Download deb package  from last release assets

Example:

```bash
wget https://github.com/makinacorpus/screamshotter/releases/download/1.9.9-beta0/screamshotter_1.9.9.ubuntu18.04.dev752653563_amd64.deb
```

Install it

```bash
sudo dpkg -i screamshotter_1.9.9.ubuntu18.04.dev752653563_amd64.deb
```

Fix dependencies

```bash
sudo apt install -f
```

Configurate screamshotter
```bash
sudo dpkg-reconfigure sreamshotter
```

## Docker

```
docker pull makinacorpus/screamshotter:latest
```

# USAGE

## ubuntu

with systemd

```
systemctl status|stop|start screamshotter
```

## docker

```
docker run -d -p 8000:8000 makinacorpus/screamshotter:latest
```

## make screenshots

```
curl -d url=https://google.com http://127.0.0.1:8000 > google.png
```

## Web test page / Browsable API

You can test and use Screamshotter directly in your web browser:

```
http://127.0.0.1:8000/
```
or
```
http://127.0.0.1:8000/?format=api
```

# DEVELOPMENT

## Docker

```
git clone git@github.com:makinacorpus/screamshotter.git
cd screamshotter
docker-compose up
```

## Tools

### pip-tools

keep dependencies up to date with pip-tools

```bash
# pip install pip-tools
pip-compile --upgrade
```

## Quality

### ruff

```bash
# pip install ruff
ruff check src
ruff format --check src
```

### eslint

```bash
# use nodeenv node & npm
npm run lint
```

## Debug

You can install sentry with screamshotter, fill SENTRY_DSN, SENTRY_ENVIRONMENT, SENTRY_TRACE_SAMPLE during installation.

Or reconfigurate with
```bash
sudo dpkg-reconfigure screamshotter
```

You can add environment variable for docker too:

```yml
environment:
    - TIMEOUT=60
    - MAX_REQUESTS=250
    - SENTRY_DSN=
    - SENTRY_ENVIRONMENT=
    - SENTRY_TRACE_SAMPLE=
    - EXTERNAL_PUPPETEER=  # if you use browserless.io : wss://your_url:3000
```
