website-screenshot
📸 website screenshots as a service
Features
- 💫 powered by Rust
- 🚀 blazing fast
- 👮 built-in ratelimiter
- 👜 built-in storage providers
- 🗼 configurable
Deployment
Prerequisites
- Rust 1.60+ or greater
- Redis 6 or greater
- Chrome browser
- Chromedriver (must match with the version your Chrome browser)
Environment Variables
PORT
- the port that the application will run (optional, defaults to3000
)REDIS_URL
- the address of your redis database (required)
Railway
Pre-built Binaries
⚠️- You can't change the provider when using the pre-built binaries.
Linux
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.
Building from source
- Clone this repository. e.g.
git clone https://github.com/devtomio/website-screenshot
- Build the binary
cargo build --release
Storage Providers
Fs (Filesystem) Provider
📝 - This is the default provider.
Build Command
Cloudinary Provider
📝 - You must make an unsigned upload preset.
Environment Variables
CLOUDINARY_API_KEY
- your api key (required)CLOUDINARY_UPLOAD_PRESET
- the name of your unsigned upload preset (required)CLOUDINARY_CLOUD_NAME
- the cloud name that you set during registration (required)
Build Command
Amazon AWS S3 Provider
⚠️ - This is untested. If you encounter a bug please don't hesitate to open an issue.
Environment Variables
S3_BUCKET_NAME
- the name of your s3 bucket (required)S3_REGION
- the region of your s3 bucket (required)S3_ACCESS_KEY
- your access key (required)S3_SECRET_KEY
- your secret key (required)S3_SECURITY_TOKEN
- your security token (optional)S3_SESSION_TOKEN
- your session token (optional)
Build Command
Tixte Provider
Environment Variables
TIXTE_UPLOAD_KEY
- your upload key, can be found on the integrations tab (required)TIXTE_DOMAIN_CONFIG
- whether to use random domains or a specific domain (required, can only bestandard
, orrandom
)TIXTE_CUSTOM_DOMAIN
- the specific domain to use (only required whenTIXTE_DOMAIN_CONFIG
is set tostandard
)
Build Command
Sled Provider
Environment Variables
SLED_PATH
- the path to provide when opening the sled database (optional, defaults to.website-screenshot
)
Build Command
Endpoints
GET /
Hello, world!
Example Response:
Hello, world!
POST /screenshot
Creates a screenshot.
JSON payload with the url
key.
Example Payload:
Example Response
GET /s/:slug
Gets the screenshot that is corresponding to the slug.
Example URL
http://localhost:3000/s/abcdefghijk
Example Response
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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):
This project follows the all-contributors specification. Contributions of any kind welcome!