-
Notifications
You must be signed in to change notification settings - Fork 23
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
Showing
1 changed file
with
13 additions
and
11 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 @@ | ||
# kwkhtmltopdf | ||
|
||
A [wkhtmlpdf](https://wkhtmltopdf.org) server with drop-in client. | ||
|
||
Why? | ||
|
@@ -7,22 +9,22 @@ Why? | |
memory hungry wkhtmltopdf jobs to dedicated pods | ||
- easily select the wkhtmltopdf version to use at runtime | ||
|
||
# WARNING | ||
## WARNING | ||
|
||
The server is not meant to be exposed to untrusted clients. | ||
|
||
Several attack vectors exist (local file access being the most obvious). | ||
Mitigating them is not a priority, since the main use case is | ||
to use it as a private service. | ||
|
||
# kwkhtmltopdf_server | ||
## kwkhtmltopdf_server | ||
|
||
A web server accepting [wkhtmlpdf](https://wkhtmltopdf.org) options and files | ||
to convert as multipart form data. | ||
|
||
It is written in go. | ||
|
||
# kwkhtmltopdf_client | ||
## kwkhtmltopdf_client | ||
|
||
A drop-in replacement for [wkhtmlpdf](https://wkhtmltopdf.org) which invokes | ||
the above server defined in the `KWKHTMLTOPDF_SERVER_URL` environment variable. | ||
|
@@ -33,9 +35,9 @@ There are two clients: | |
* a python client, which only depends on the `requests` library. | ||
It should work with any python version supported by `requests`. | ||
|
||
# Quick start | ||
## Quick start | ||
|
||
## Run the server | ||
### Run the server | ||
|
||
``` | ||
$ docker run --rm -p 8080:8080 acsone/kwhkhtmltopdf | ||
|
@@ -49,7 +51,7 @@ $ go run server/kwkhtmltopdf_server.go | |
|
||
The server should now listen on http://localhost:8080. | ||
|
||
## Run the client | ||
### Run the client | ||
|
||
``` | ||
$ go build -o client/go/kwkhtmltopdf_client client/go/kwkhtmltopdf_client.go | ||
|
@@ -66,7 +68,7 @@ $ env KWKHTMLTOPDF_SERVER_URL=http://localhost:8080 \ | |
|
||
This should generate a printout of the wkhtmltopdf home page to /tmp/test.pdf. | ||
|
||
# Run tests | ||
## Run tests | ||
|
||
1. Start the server. | ||
2. Set and export `KWKHTMLTOPDF_SERVER_URL` environment variable. | ||
|
@@ -75,12 +77,12 @@ This should generate a printout of the wkhtmltopdf home page to /tmp/test.pdf. | |
This will run the same tests against the the native wkhtmltopdf executable, | ||
as well as against the server using the python and go clients. | ||
|
||
# Roadmap | ||
## Roadmap | ||
|
||
See [issues on GitHub](<https://github.com/acsone/kwkhtmltopdf/issues>) | ||
as well as some TODO's in the source code. | ||
|
||
# Releasing | ||
## Releasing | ||
|
||
Push the master branch and ensure tests pass on travis. | ||
|
||
|
@@ -90,14 +92,14 @@ Travis will create a GitHub release with the client and server binaries. | |
|
||
[Docker Hub](https://cloud.docker.com/u/acsone/repository/docker/acsone/kwkhtmltopdf) will build the images. | ||
|
||
# Credits | ||
## Credits | ||
|
||
Author: [email protected]. | ||
|
||
Contributors: | ||
|
||
* Nils Hamerlinck | ||
|
||
# License | ||
## License | ||
|
||
MIT |