diff options
Diffstat (limited to 'crates/turtle/src/atuin_server/settings.rs')
| -rw-r--r-- | crates/turtle/src/atuin_server/settings.rs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/crates/turtle/src/atuin_server/settings.rs b/crates/turtle/src/atuin_server/settings.rs index 2bce0dac..1d0ac2d0 100644 --- a/crates/turtle/src/atuin_server/settings.rs +++ b/crates/turtle/src/atuin_server/settings.rs @@ -7,11 +7,11 @@ use fs_err::{File, create_dir_all}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Metrics { +pub(crate) struct Metrics { #[serde(alias = "enabled")] - pub enable: bool, - pub host: String, - pub port: u16, + pub(crate) enable: bool, + pub(crate) host: String, + pub(crate) port: u16, } impl Default for Metrics { @@ -25,35 +25,35 @@ impl Default for Metrics { } #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Settings { - pub host: String, - pub port: u16, - pub path: String, - pub open_registration: bool, - pub max_history_length: usize, - pub max_record_size: usize, - pub page_size: i64, - pub register_webhook_url: Option<String>, - pub register_webhook_username: String, - pub metrics: Metrics, +pub(crate) struct Settings { + pub(crate) host: String, + pub(crate) port: u16, + pub(crate) path: String, + pub(crate) open_registration: bool, + pub(crate) max_history_length: usize, + pub(crate) max_record_size: usize, + pub(crate) page_size: i64, + pub(crate) register_webhook_url: Option<String>, + pub(crate) register_webhook_username: String, + pub(crate) metrics: Metrics, /// Enable legacy sync v1 routes (history-based sync) /// Set to false to use only the newer record-based sync - pub sync_v1_enabled: bool, + pub(crate) sync_v1_enabled: bool, /// Advertise a version that is not what we are _actually_ running /// Many clients compare their version with api.atuin.sh, and if they differ, notify the user /// that an update is available. /// Now that we take beta releases, we should be able to advertise a different version to avoid /// notifying users when the server runs something that is not a stable release. - pub fake_version: Option<String>, + pub(crate) fake_version: Option<String>, #[serde(flatten)] - pub db_settings: DbSettings, + pub(crate) db_settings: DbSettings, } impl Settings { - pub fn new() -> Result<Self> { + pub(crate) fn new() -> Result<Self> { let mut config_file = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") { PathBuf::from(p) } else { |
