rustypaste/config.toml

71 lines
2.2 KiB
TOML
Raw Normal View History

[config]
2023-05-13 19:50:39 +00:00
refresh_rate = "1s"
[server]
2023-05-13 19:50:39 +00:00
address = "127.0.0.1:8000"
#url = "https://rustypaste.shuttleapp.rs"
#workers=4
2023-05-13 19:50:39 +00:00
max_content_length = "10MB"
upload_path = "./upload"
timeout = "30s"
expose_version = false
feat(server): add an endpoint for retrieving a list of files (#94) * Start * Wip * Implement path based JSON index * Remove json_index_path * Return datetime stamp instead of relative time * Add file size to list item * Add auth check when retrieving JSON index * Make json index path hardcoded * Test (currently failing) * Fix test for test_json_list * Clippy fix * Revert cargo to original versions with only needed changes * Add detail about auth guard affecting list route * Change json_index_path to expose_list * Remove unneeded linebreak * Remove unnecessary import * Remove unnecessary space at end of line * Move config check after auth check * Use new auth check syntax, add docs to struct, rename test_json_list to test_list * Replace chrono usage with uts2ts * Check list result in test * Add example to README * Upgrade serde_json to 1.0.103 * Add linebreak * Remove unneeded clone * Remove extra nl * Update README.md * Update README.md Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com> * Update README.md Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com> * Remove serde_json * Set default config to false for expose_list * Apply suggestions from code review Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com> * Check that option is value in test_list * Update Cargo.toml Co-authored-by: Helmut K. C. Tessarek <tessarek@evermeet.cx> * Update cargo.lock * Use expect() to check file name * Remove underscore from list item struct * Keep comma after last line * refactor(server): rename ListItem fields * test(fixtures): add fixture test for listing files * test push * remove file again * chop off ts from filename and minor refactor * update README * docs(readme): fix capitalization * refactor(server): clean up list implementation --------- Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com> Co-authored-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
2023-08-07 10:55:13 +00:00
expose_list = false
#auth_tokens = [
# "super_secret_token1",
# "super_secret_token2",
#]
#delete_tokens = [
# "super_secret_token1",
# "super_secret_token3",
#]
2023-08-26 20:40:04 +00:00
handle_spaces = "replace" # or "encode"
[landing_page]
text = """
Submit files via HTTP POST here:
curl -F 'file=@example.txt' <server>
This will return the URL of the uploaded file.
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.
By default, pastes expire every hour. The server admin may or may not have
changed this.
Check out the GitHub repository at https://github.com/orhun/rustypaste
Command line tool is available at https://github.com/orhun/rustypaste-cli
"""
#file = "index.txt"
content_type = "text/plain; charset=utf-8"
[paste]
random_url = { type = "petname", words = 2, separator = "-" }
#random_url = { type = "alphanumeric", length = 8 }
#random_url = { type = "alphanumeric", length = 6, suffix_mode = true }
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|sh|rs|toml)$" },
]
mime_blacklist = [
"application/x-dosexec",
"application/java-archive",
"application/java-vm",
]
duplicate_files = true
# default_expiry = "1h"
delete_expired_files = { enabled = true, interval = "1h" }