* 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>
* feat(server): support multiple auth tokens
Example:
```toml
[server]
auth_tokens = [
"super_secret_token1",
"super_secret_token2",
]
```
The previously used `AUTH_TOKEN` environment variable can still be used
and will be evaluated as well.
* fixtures: add all tokens in array to the test
* add deprecation warning for auth_token
* also add deprecation warnings at server startup
* fix formatting
* fixed tests, so that we do not use deprecated config options
* use bash array
* refactor: use separate function
* refactor: check auth tokens
* Update fixtures/test-server-auth-multiple-tokens/test.sh
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
* refactor: convert functions to methods
* refactor: check function
* refactor: get_tokens method
* style(format): add newline between functions
* refactor(server): print deprecation warnings once
---------
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
* feat(server): add landing page
Fixesorhun/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>
feat(server): support auto-deletion of expired files (#17)
chore(ci): set the number of test threads to 1
feat(config): allow the real-time update of cleanup routine
docs(readme): update README.md about deleting expired files