mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
20 stars 2 forks source link

Split configuration into modules (big refactor) #61

Closed mycognosist closed 1 year ago

mycognosist commented 1 year ago

Addresses https://github.com/mycognosist/solar/issues/55 and https://github.com/mycognosist/solar/issues/60

This PR represents a large refactor to the configuration architecture of solar.

As a result of this PR, solar is now fully embeddable as a Rust library and the application configuration is much easier to generate. It should also be easier for contributors to add or alter the existing configuration parameters since everything now follows more idiomatic Rust patterns.

I moved the few environment variable parameters into the CLI for the sake of simplicity and consistency.

I have also added partial validation of URLs supplied via the --connect CLI option, as well as the network key supplied via the --network-key option.

The CLI has been migrated from structopt to clap.

Breaking change: The fields in the secret.toml file are now named public_key and private_key (not id and secret as before). Anyone with an existing installation is recommended to backup their secret.toml file and rename the fields.