rapiz1 / rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Apache License 2.0
8.8k stars 440 forks source link

Add parsing tokens from files or environment variables #373

Closed ShiromMakkad closed 1 week ago

ShiromMakkad commented 1 week ago

Solves #264 and #218

Info

This adds support for token parsing from environment variables with the format RATHOLE_{server name in uppercase}_TOKEN or RATHOLE_DEFAULT_TOKEN. It also adds token_file and default_token_file to client and server configs. The updated Readme has a more detailed description of the changes.

Testing

Tested using cargo test. I've also added a file inside valid_configs to test for the file token and a new test case for environment variable parsing.

Todo