mirror of
https://github.com/derfenix/webarchive.git
synced 2026-03-11 12:41:54 +03:00
9dafdf6abf6e03b1470fd7e6d5c21fa43f76313a
Own Webarchive
Aimed to be a simple, fast and easy-to-use webarchive for personal or home-net usage.
Requirements
- Golang 1.19 or higher
- wkhtmltopdf binary in $PATH (to save pages in pdf)
Usage
1. Start the server
go run ./cmd/server/main.go
2. Add a page
curl -X POST --location "http://localhost:5001/pages" \
-H "Content-Type: application/json" \
-d "{
\"url\": \"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1937\",
\"formats\": [
\"all\"
]
}" | jq .
3. Get the page's info
curl -X GET --location "http://localhost:5001/pages/$page_id" | jq .
where $page_id — value of the id field from previous command response.
If status field in response is success (or with_errors) - the results field
will contain all processed formats with ids of the stored files.
4. Open file in browser
xdg-open "http://localhost:5001/pages/$page_id/file/$file_id"
Where $page_id — value of the id field from previous command response, and
$file_id — the id of interesting file.
5. List all stored pages
curl -X GET --location "http://localhost:5001/pages" | jq .
Roadmap
- Save page to pdf
- Save URL headers
- Save page to the single-page html
- Save page to html with separate resource files (?)
- Optional authentication
- Multi-user access
- Support PostgreSQL
- Extend configuration
Description
Languages
Go
91.6%
JavaScript
5.1%
HTML
2.4%
Dockerfile
0.5%
Nix
0.4%