diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-03-21 20:04:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-21 20:04:39 +0000 |
| commit | c9579cb9ca2a6a165d10f128e0af1dfd372e0c03 (patch) | |
| tree | 1d4feecb422aae3cde1cc7cad54ccc73b2dae410 /src/settings.rs | |
| parent | Add TUI, resolve #19, #17, #16 (#21) (diff) | |
| download | atuin-c9579cb9ca2a6a165d10f128e0af1dfd372e0c03.zip | |
Implement server (#23)
* Add initial database and server setup
* Set up all routes, auth, etc
* Implement sessions, password auth, hashing with argon2, and history storage
Diffstat (limited to '')
| -rw-r--r-- | src/settings.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/settings.rs b/src/settings.rs index a4c9f8da..6f29afd2 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -11,6 +11,11 @@ pub struct LocalDatabase { } #[derive(Debug, Deserialize)] +pub struct RemoteDatabase { + pub url: String, +} + +#[derive(Debug, Deserialize)] pub struct Local { pub server_address: String, pub dialect: String, @@ -18,8 +23,14 @@ pub struct Local { } #[derive(Debug, Deserialize)] +pub struct Remote { + pub db: RemoteDatabase, +} + +#[derive(Debug, Deserialize)] pub struct Settings { pub local: Local, + pub remote: Remote, } impl Settings { @@ -49,6 +60,8 @@ impl Settings { s.set_default("local.dialect", "us")?; s.set_default("local.db.path", db_path.to_str())?; + s.set_default("remote.db.url", "please set a postgres url")?; + if config_file.exists() { s.merge(File::with_name(config_file.to_str().unwrap()))?; } |
