aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/atuin-server/src')
-rw-r--r--crates/atuin-server/src/handlers/mod.rs8
-rw-r--r--crates/atuin-server/src/settings.rs7
2 files changed, 14 insertions, 1 deletions
diff --git a/crates/atuin-server/src/handlers/mod.rs b/crates/atuin-server/src/handlers/mod.rs
index 50f82336..ce10f4b7 100644
--- a/crates/atuin-server/src/handlers/mod.rs
+++ b/crates/atuin-server/src/handlers/mod.rs
@@ -19,10 +19,16 @@ pub async fn index<DB: Database>(state: State<AppState<DB>>) -> Json<IndexRespon
// It's super unlikely this will happen
let count = state.database.total_history().await.unwrap_or(-1);
+ let version = state
+ .settings
+ .fake_version
+ .clone()
+ .unwrap_or(VERSION.to_string());
+
Json(IndexResponse {
homage: homage.to_string(),
- version: VERSION.to_string(),
total_history: count,
+ version,
})
}
diff --git a/crates/atuin-server/src/settings.rs b/crates/atuin-server/src/settings.rs
index dfe238d6..c62c65b8 100644
--- a/crates/atuin-server/src/settings.rs
+++ b/crates/atuin-server/src/settings.rs
@@ -67,6 +67,13 @@ pub struct Settings<DbSettings> {
pub tls: Tls,
pub mail: Mail,
+ /// 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>,
+
#[serde(flatten)]
pub db_settings: DbSettings,
}