diff --git a/src/activitypub/well_known.rs b/src/activitypub/well_known.rs index 910e73e..96a5285 100644 --- a/src/activitypub/well_known.rs +++ b/src/activitypub/well_known.rs @@ -2,7 +2,7 @@ use axum::{extract::{Path, Query, State}, http::StatusCode, response::{IntoRespo use jrd::{JsonResourceDescriptor, JsonResourceDescriptorLink}; use sea_orm::{EntityTrait, PaginatorTrait}; -use crate::{model, server::Context}; +use crate::{model, server::Context, VERSION}; #[derive(serde::Serialize)] pub struct NodeInfoDiscovery { @@ -42,7 +42,7 @@ pub async fn nodeinfo(State(ctx): State, Path(version): Path) - "2.0.json" => ( nodeinfo::types::Software { name: "μpub".to_string(), - version: Some(env!("CARGO_PKG_VERSION").into()), + version: Some(VERSION.into()), repository: None, homepage: None, }, @@ -51,7 +51,7 @@ pub async fn nodeinfo(State(ctx): State, Path(version): Path) - "2.1.json" => ( nodeinfo::types::Software { name: "μpub".to_string(), - version: Some(env!("CARGO_PKG_VERSION").into()), + version: Some(VERSION.into()), repository: Some("https://git.alemi.dev/upub.git/".into()), homepage: None, }, diff --git a/src/main.rs b/src/main.rs index e86cf31..478ebb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,8 @@ use sea_orm_migration::MigratorTrait; use crate::activitystream::{BaseType, ObjectType}; +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); + #[derive(Parser)] /// all names were taken struct CliArgs {