-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a38ad92
commit c4896ca
Showing
43 changed files
with
3,247 additions
and
2,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
NODE_ENV=development | ||
|
||
ALLOW_LIST=jasonraimondi.com,github.com | ||
|
||
STORAGE_PROVIDER= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"printWidth": 120, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} | ||
arrowParens: avoid | ||
bracketSpacing: true | ||
printWidth: 100 | ||
trailingComma: all | ||
tabWidth: 2 | ||
semi: true | ||
singleQuote: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright 2021 Jason Raimondi <[email protected]> | ||
Copyright 2024 Jason Raimondi <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ A URL to PNG generator over HTTP with a fairly simple API accessed via query par | |
Run the following command: | ||
|
||
``` | ||
docker run --rm -p 3000:3000 ghcr.io/jasonraimondi/url-to-png | ||
docker run --rm -p 3089:3089 ghcr.io/jasonraimondi/url-to-png | ||
``` | ||
|
||
On the hub: [Link to DockerHub](https://hub.docker.com/r/jasonraimondi/url-to-png/) | ||
|
@@ -25,6 +25,8 @@ Serve the project | |
git clone [email protected]:jasonraimondi/url-to-png.git | ||
cd url-to-png | ||
pnpm install | ||
# you may need to run this command if you are having issues with playwright | ||
pnpm exec playwright install | ||
pnpm dev | ||
``` | ||
|
||
|
@@ -41,21 +43,21 @@ pnpm dev | |
- `isDarkMode: boolean` - Prefer color scheme dark - **Optional** - Default: `false` | ||
- `deviceScaleFactor: number` - Specify device scale factor (can be thought of as dpr) - **Optional** - Default: `1` | ||
|
||
Try it out at `localhost:3000?url=https://www.jasonraimondi.com&isDarkMode=true` and you should get back an image capture of my website homepage. | ||
Try it out at `localhost:3089?url=https://www.jasonraimondi.com&isDarkMode=true` and you should get back an image capture of my website homepage. | ||
|
||
All sorts of combos work: | ||
|
||
``` | ||
http://localhost:3000?url=https://jasonraimondi.com | ||
http://localhost:3000?url=https://jasonraimondi.com&forceReload=true | ||
http://localhost:3000?url=https://jasonraimondi.com&isFullPage=true | ||
http://localhost:3000?url=https://jasonraimondi.com&isMobile=true | ||
http://localhost:3000?url=https://jasonraimondi.com&isDarkMode=true | ||
http://localhost:3000?url=https://jasonraimondi.com&width=400&height=400 | ||
http://localhost:3000?url=https://jasonraimondi.com&viewPortHeight=400&viewPortWidth=400 | ||
http://localhost:3000?url=https://jasonraimondi.com&viewPortHeight=400&viewPortWidth=400 | ||
http://localhost:3000?url=https://jasonraimondi.com&isFullPage=true&isMobile=true&width=400&height=400&viewPortHeight=400&viewPortWidth=400 | ||
http://localhost:3000?url=https://jasonraimondi.com&isMobile=true&isFullPage=true&viewPortWidth=375&width=375&deviceScaleFactor=1 | ||
http://localhost:3089?url=https://jasonraimondi.com | ||
http://localhost:3089?url=https://jasonraimondi.com&forceReload=true | ||
http://localhost:3089?url=https://jasonraimondi.com&isFullPage=true | ||
http://localhost:3089?url=https://jasonraimondi.com&isMobile=true | ||
http://localhost:3089?url=https://jasonraimondi.com&isDarkMode=true | ||
http://localhost:3089?url=https://jasonraimondi.com&width=400&height=400 | ||
http://localhost:3089?url=https://jasonraimondi.com&viewPortHeight=400&viewPortWidth=400 | ||
http://localhost:3089?url=https://jasonraimondi.com&viewPortHeight=400&viewPortWidth=400 | ||
http://localhost:3089?url=https://jasonraimondi.com&isFullPage=true&isMobile=true&width=400&height=400&viewPortHeight=400&viewPortWidth=400 | ||
http://localhost:3089?url=https://jasonraimondi.com&isMobile=true&isFullPage=true&viewPortWidth=375&width=375&deviceScaleFactor=1 | ||
``` | ||
|
||
## System Requirements | ||
|
@@ -147,6 +149,24 @@ STORAGE_PROVIDER=filesystem | |
IMAGE_STORAGE_PATH=/tmp/foo | ||
``` | ||
|
||
## Metrics | ||
|
||
You can enable metrics by setting `METRICS=true` in your `.env` file. This will expose a `/metrics` endpoint for Prometheus to scrape. | ||
|
||
```json | ||
{ | ||
"poolMetrics": { | ||
"spareResourceCapacity": 8, | ||
"size": 2, | ||
"available": 2, | ||
"borrowed": 0, | ||
"pending": 0, | ||
"max": 10, | ||
"min": 2 | ||
} | ||
} | ||
``` | ||
|
||
## Sources | ||
|
||
- Upstream Repository: [https://git.jasonraimondi.com/jason/url-to-png](https://git.jasonraimondi.com/jason/url-to-png) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
<img src="http://localhost:3000/?url=https://jasonraimondi.com"> | ||
<img src="http://localhost:3000/?url=https://aircraftturbineworks.com"> | ||
<img src="http://localhost:3000/?url=https://reddit.com"> | ||
<img src="http://localhost:3000/?url=https://bbc.com"> | ||
<img src="http://localhost:3000/?url=https://aol.com"> | ||
<img src="http://localhost:3000/?url=https://ask.com"> | ||
<img src="http://localhost:3000/?url=https://github.com"> | ||
<img src="http://localhost:3000/?url=https://google.com"> | ||
<img src="http://localhost:3000/?url=https://imgur.com"> | ||
<img src="http://localhost:3000/?url=https://candy.com"> | ||
<img src="http://localhost:3000/?url=https://amazon.com"> | ||
<img src="http://localhost:3000/?url=https://etsy.com"> | ||
<img src="http://localhost:3000/?url=https://wayfair.com"> | ||
<img src="http://localhost:3000/?url=https://en.wikipedia.org/wiki/Candy"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&forceReload=true"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&isFullPage=true"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&isMobile=true"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&isDarkMode=true"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&width=400&height=400"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&viewPortHeight=400&viewPortWidth=400"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&viewPortHeight=400&viewPortWidth=400"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&isFullPage=true&isMobile=true&width=400&height=400&viewPortHeight=400&viewPortWidth=400"> | ||
<img src="http://localhost:3089/?url=https://jasonraimondi.com&isMobile=true&isFullPage=true&viewPortWidth=375&width=375&deviceScaleFactor=1"> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.