diff --git a/.dockerignore b/.dockerignore index 73269dd..8ca677b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,6 +3,7 @@ /.github/ /upload/ /shuttle/ +/examples/ # Files .gitignore diff --git a/README.md b/README.md index ca459f6..3217d97 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,15 @@ $ rustypaste See [config.toml](./config.toml) for configuration options. +#### HTML Form + +It is possible to use an HTML form for uploading files. To do so, you need to update two fields in your `config.toml`: + +- Set the `landing_page_content_type` to `text/html; charset=utf-8`. +- Update the `landing_page` field with your HTML form. + +For an example, see [examples/html_form.toml](./examples/html_form.toml) + #### Docker Following command can be used to run a container which is built from the [Dockerfile](./Dockerfile) in this repository: diff --git a/examples/html_form.toml b/examples/html_form.toml new file mode 100644 index 0000000..5f1f5b2 --- /dev/null +++ b/examples/html_form.toml @@ -0,0 +1,128 @@ +[config] +refresh_rate = "1s" + +[server] +address = "127.0.0.1:8000" +#url = "https://rustypaste.shuttleapp.rs" +#workers=4 +max_content_length = "10MB" +upload_path = "./upload" +timeout = "30s" +expose_version = false +landing_page = """ + +
++┬─┐┬ ┬┌─┐┌┬┐┬ ┬┌─┐┌─┐┌─┐┌┬┐┌─┐ +├┬┘│ │└─┐ │ └┬┘├─┘├─┤└─┐ │ ├┤ +┴└─└─┘└─┘ ┴ ┴ ┴ ┴ ┴└─┘ ┴ └─┘ +the server administrator might remove any pastes that they do not personally +want to host. + +by default, pastes expire every hour. ++