Skip to content

Commit

Permalink
Prevent overwrite_key and force_update from being set in the config file
Browse files Browse the repository at this point in the history
These parameters are dangerous and should only be set via command line flags. This change causes the application to panic if they are set in the configuration file, and updates the parameters to be settable only via the command line.
  • Loading branch information
anipaul2 committed May 11, 2023
1 parent 340f238 commit e776708
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions teos/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ impl Config {
self.tor_support |= options.tor_support;
self.debug |= options.debug;
self.deps_debug |= options.deps_debug;
if self.overwrite_key {
panic!("The 'overwrite_key' parameter cannot be set in the configuration file.");
}
if self.force_update {
panic!("The 'force_update' parameter cannot");
}
self.overwrite_key = options.overwrite_key;
self.force_update = options.force_update;
}
Expand Down

0 comments on commit e776708

Please sign in to comment.