website-screenshot

Rust: 1.60+ Continuous Delivery Continuous Integration

📸 website screenshots as a service

Features

Deployment

Prerequisites

Environment Variables

Railway

Deploy on Railway

Pre-built Binaries

⚠️- You can't change the provider when using the pre-built binaries.

Linux

sh curl -fsSL https://raw.githubusercontent.com/devtomio/website-screenshot/main/install.sh

Other

See the Releases page of this repository and download the appropriate binary.

Docker

⚠️- You can't change the provider when using the docker image.

A dockerized version of this application is available here.

Cargo

Installing website-screenshot as a crate.

sh cargo install website-screenshot

Building from source

  1. Clone this repository. e.g. git clone https://github.com/devtomio/website-screenshot
  2. Build the binary cargo build --release

Storage Providers

Fs (Filesystem) Provider

📝 - This is the default provider.

Build Command

sh cargo build --release

[Cloudinary] Provider

📝 - You must make an unsigned upload preset.

Environment Variables

Build Command

sh cargo build --release --no-default-features --features cloudinary_provider

Amazon AWS [S3] Provider

⚠️ - This is untested. If you encounter a bug please don't hesitate to open an issue.

Environment Variables

Build Command

sh cargo build --release --no-default-features --features s3_provider

[Tixte] Provider

Environment Variables

Build Command

sh cargo build --release --no-default-features --features tixte_provider

[Sled] Provider

Environment Variables

Build Command

sh cargo build --release --no-default-features --features sled_provider

Endpoints

GET /

Hello, world!

Example Response:

text Hello, world!

POST /screenshot

Creates a screenshot.

JSON payload with the url key.

Example Payload:

json { "url": "https://rust-lang.org" }

Example Response

json { "slug": "abcdefghijk", "path": "/s/abcdefghijk", "metadata": { "url": "https://rust-lang.org" } }

GET /s/:slug

Gets the screenshot that is corresponding to the slug.

Example URL

text http://localhost:3000/s/abcdefghijk

Example Response

Rust Website

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Tomio

💻 📖 🚇 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!