rustypaste-pretty/config.toml
TheTechRobo 37cb4d3fcb
feat(server): add landing page (#26)
* feat(server): add landing page

Fixes orhun/rustypaste#13

* feat(server): allow using {REPOSITORY} in landing page

* fix(server): Get rid of unused import, add line about expiration

* chore(fmt): cargo fmt

* fix(tests): inject app data for fixing index test

* feat(server): redirect to GitHub repository if landing page is not specified

* test(fixtures): add fixture test for landing page

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2022-10-03 21:27:35 +00:00

46 lines
1.4 KiB
TOML

[config]
refresh_rate="1s"
[server]
address="127.0.0.1:8000"
#workers=4
max_content_length="10MB"
upload_path="./upload"
timeout="30s"
landing_page="""Submit files via HTTP POST here:
curl -F 'file=@example.txt' <server>"
This will return the finished URL.
The server administrator might remove any pastes that they do not personally
want to host.
If you are the server administrator and want to change this page, just go
into your config file and change it! If you change the expiry time, it is
recommended that you do.
Check out the GitHub repository at https://github.com/orhun/rustypaste
By default, pastes expire every hour. The server admin may or may not have
changed this."""
[paste]
random_url = { enabled = true, type = "petname", words = 2, separator = "-" }
#random_url = { enabled = true, type = "alphanumeric", length = 8 }
default_extension = "txt"
mime_override = [
{ mime = "image/jpeg", regex = "^.*\\.jpg$" },
{ mime = "image/png", regex = "^.*\\.png$" },
{ mime = "image/svg+xml", regex = "^.*\\.svg$" },
{ mime = "video/webm", regex = "^.*\\.webm$" },
{ mime = "video/x-matroska", regex = "^.*\\.mkv$" },
{ mime = "application/octet-stream", regex = "^.*\\.bin$" },
{ mime = "text/plain", regex = "^.*\\.(log|txt|diff)$" },
]
mime_blacklist = [
"application/x-dosexec",
"application/java-archive",
"application/java-vm"
]
duplicate_files = true
delete_expired_files = { enabled = true, interval = "1h" }