Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add static app version and show in footer (#336)

Leendert de Borst8284241be6aa
diff --git a/aliasvault.sln b/aliasvault.sln
index d7de349a4..40426bb89 100644
--- a/aliasvault.sln
+++ b/aliasvault.sln
@@ -65,6 +65,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AliasVault.Generators.Ident
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{DD359F0A-0180-4F8F-9E48-46213386BA4D}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AliasVault.Shared.Core", "src\Shared\AliasVault.Shared.Core\AliasVault.Shared.Core.csproj", "{40CA41BF-9E67-4D0A-A3F8-38B94992E4CA}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -163,6 +165,10 @@ Global
{80E74FBC-4EC8-45FB-B210-473337C484B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80E74FBC-4EC8-45FB-B210-473337C484B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80E74FBC-4EC8-45FB-B210-473337C484B5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {40CA41BF-9E67-4D0A-A3F8-38B94992E4CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {40CA41BF-9E67-4D0A-A3F8-38B94992E4CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {40CA41BF-9E67-4D0A-A3F8-38B94992E4CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {40CA41BF-9E67-4D0A-A3F8-38B94992E4CA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -190,6 +196,7 @@ Global
{80E74FBC-4EC8-45FB-B210-473337C484B5} = {03D55CA4-20B3-4FEA-9ADD-3C7B5B10E0FE}
{59642CEF-D90A-4A6B-AD3F-9C6300D1E3FC} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
{15EFE0D0-F41B-47D7-86B7-8F840335CB82} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
+ {40CA41BF-9E67-4D0A-A3F8-38B94992E4CA} = {DD359F0A-0180-4F8F-9E48-46213386BA4D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FEE82475-C009-4762-8113-A6563D9DC49E}
diff --git a/src/AliasVault.Admin/AliasVault.Admin.csproj b/src/AliasVault.Admin/AliasVault.Admin.csproj
index 14794ce54..f4514e7bc 100644
--- a/src/AliasVault.Admin/AliasVault.Admin.csproj
+++ b/src/AliasVault.Admin/AliasVault.Admin.csproj
@@ -44,6 +44,7 @@
<ItemGroup>
<ProjectReference Include="..\Databases\AliasServerDb\AliasServerDb.csproj" />
<ProjectReference Include="..\Shared\AliasVault.RazorComponents\AliasVault.RazorComponents.csproj" />
+ <ProjectReference Include="..\Shared\AliasVault.Shared.Core\AliasVault.Shared.Core.csproj" />
<ProjectReference Include="..\Utilities\AliasVault.Auth\AliasVault.Auth.csproj" />
<ProjectReference Include="..\Utilities\AliasVault.Logging\AliasVault.Logging.csproj" />
<ProjectReference Include="..\Utilities\Cryptography\AliasVault.Cryptography.Server\AliasVault.Cryptography.Server.csproj" />
diff --git a/src/AliasVault.Admin/Main/Layout/Footer.razor b/src/AliasVault.Admin/Main/Layout/Footer.razor
index 00a4a77e3..a001c876b 100644
--- a/src/AliasVault.Admin/Main/Layout/Footer.razor
+++ b/src/AliasVault.Admin/Main/Layout/Footer.razor
@@ -1,9 +1,9 @@
-<footer class="md:flex md:items-center md:justify-between px-4 2xl:px-0 py-6 md:py-10">
- <p class="text-sm text-center text-gray-500 mb-4 md:mb-0">
- © 2024 AliasVault. All rights reserved.
+@using AliasVault.Shared.Core
+<footer class="md:flex md:items-center md:justify-between px-4 2xl:px-0 py-6 md:py-10">
+ <p class="text-sm text-center text-gray-500 mb-4 lg:mb-0">
+ © 2024 <span>@AppInfo.ApplicationName v@(AppInfo.GetFullVersion())</span>. All rights reserved.
</p>
<ul class="flex flex-wrap items-center justify-center">
- <li><a href="https://github.com/lanedirt/AliasVault/blob/main/LICENSE.md" class="mr-4 text-sm font-normal text-gray-500 hover:underline md:mr-6 dark:text-gray-400">Terms and conditions</a></li>
<li><a href="https://github.com/lanedirt/AliasVault/blob/main/LICENSE.md" class="mr-4 text-sm font-normal text-gray-500 hover:underline md:mr-6 dark:text-gray-400">License</a></li>
<li><a href="https://github.com/lanedirt/AliasVault" target="_blank" class="text-sm font-normal text-gray-500 hover:underline dark:text-gray-400">GitHub</a></li>
</ul>
diff --git a/src/AliasVault.Client/AliasVault.Client.csproj b/src/AliasVault.Client/AliasVault.Client.csproj
index 8c71cbc18..d4265137a 100644
--- a/src/AliasVault.Client/AliasVault.Client.csproj
+++ b/src/AliasVault.Client/AliasVault.Client.csproj
@@ -77,6 +77,7 @@
<ProjectReference Include="..\Generators\AliasVault.Generators.Identity\AliasVault.Generators.Identity.csproj" />
<ProjectReference Include="..\Generators\AliasVault.Generators.Password\AliasVault.Generators.Password.csproj" />
<ProjectReference Include="..\Shared\AliasVault.RazorComponents\AliasVault.RazorComponents.csproj" />
+ <ProjectReference Include="..\Shared\AliasVault.Shared.Core\AliasVault.Shared.Core.csproj" />
<ProjectReference Include="..\Shared\AliasVault.Shared\AliasVault.Shared.csproj" />
<ProjectReference Include="..\Utilities\Cryptography\AliasVault.Cryptography.Client\AliasVault.Cryptography.Client.csproj" />
<ProjectReference Include="..\Utilities\AliasVault.CsvImportExport\AliasVault.CsvImportExport.csproj" />
diff --git a/src/AliasVault.Client/Main/Layout/Footer.razor b/src/AliasVault.Client/Main/Layout/Footer.razor
index f2a038cb0..d1bb7f10a 100644
--- a/src/AliasVault.Client/Main/Layout/Footer.razor
+++ b/src/AliasVault.Client/Main/Layout/Footer.razor
@@ -1,13 +1,14 @@
@inject NavigationManager NavigationManager
+@using AliasVault.Shared.Core
@implements IDisposable
<footer class="relative lg:fixed bottom-0 left-0 right-0 dark:bg-gray-900 @(ShowBorder ? "border-t border-gray-200 dark:border-gray-700" : "")">
<div class="container mx-auto px-4 py-4">
<div class="flex flex-col lg:flex-row justify-between items-center">
<p class="text-sm text-center text-gray-500 mb-4 lg:mb-0">
- © 2024 AliasVault. All rights reserved.
+ © 2024 <span>@AppInfo.ApplicationName v@(AppInfo.GetFullVersion())</span>. All rights reserved.
</p>
- <div class="hidden lg:block text-center text-gray-400 text-sm">@RandomQuote</div>
+ <div class="hidden lg:block text-center text-gray-400 text-sm">@_randomQuote</div>
<ul class="flex flex-wrap items-center justify-center">
<li>
<a href="https://github.com/lanedirt/AliasVault" target="_blank" class="text-sm font-normal text-gray-500 hover:underline dark:text-gray-400">GitHub</a>
@@ -32,7 +33,7 @@
"Tip: Use the g+l (go lock) keyboard shortcut to lock the vault.",
];
- private string RandomQuote = string.Empty;
+ private string _randomQuote = string.Empty;
/// <inheritdoc />
public void Dispose()
@@ -45,7 +46,7 @@
{
if (firstRender)
{
- RandomQuote = Quotes[Random.Shared.Next(Quotes.Length)];
+ _randomQuote = Quotes[Random.Shared.Next(Quotes.Length)];
NavigationManager.LocationChanged += RefreshQuote;
}
}
@@ -55,7 +56,7 @@
/// </summary>
private void RefreshQuote(object? sender, LocationChangedEventArgs e)
{
- RandomQuote = Quotes[Random.Shared.Next(Quotes.Length)];
+ _randomQuote = Quotes[Random.Shared.Next(Quotes.Length)];
StateHasChanged();
}
}
diff --git a/src/Shared/AliasVault.RazorComponents/README.md b/src/Shared/AliasVault.RazorComponents/README.md
new file mode 100644
index 000000000..e4cdfa95b
--- /dev/null
+++ b/src/Shared/AliasVault.RazorComponents/README.md
@@ -0,0 +1,31 @@
+# AliasVault.RazorComponents
+
+This project contains shared Razor components and UI-related functionality used across the AliasVault solution. This project focuses specifically on reusable UI components.
+
+## Purpose
+
+This library provides shared Blazor components used by both the client and admin applications:
+- Reusable Razor components
+- UI-specific services
+- Component-related models
+- Component-specific utilities
+
+## Project Structure
+
+The project is organized as follows:
+- `Components/` - Contains reusable Razor components like Paginator.razor
+- `Services/` - UI-specific services used by components
+- `Models/` - Component-specific models and DTOs
+
+## Dependencies
+
+This project:
+- Is a Razor Class Library targeting browser platform
+- Depends on Microsoft.AspNetCore.Components.Web
+- Can include UI-specific external dependencies as needed
+
+## Related Projects
+
+- **AliasVault.Shared** - Contains general shared models, DTOs and business logic
+- **AliasVault.Shared.Core** - Contains core shared code with no external dependencies
+- **AliasVault.RazorComponents** (this project) - Contains shared UI components and Razor-specific code
diff --git a/src/Shared/AliasVault.Shared.Core/AliasVault.Shared.Core.csproj b/src/Shared/AliasVault.Shared.Core/AliasVault.Shared.Core.csproj
new file mode 100644
index 000000000..8f620d10b
--- /dev/null
+++ b/src/Shared/AliasVault.Shared.Core/AliasVault.Shared.Core.csproj
@@ -0,0 +1,32 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net8.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <DocumentationFile>bin\Debug\net8.0\AliasVault.Shared.Core.xml</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <DocumentationFile>bin\Release\net8.0\AliasVault.Shared.Core.xml</DocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ </PackageReference>
+ </ItemGroup>
+
+ <ItemGroup>
+ <AdditionalFiles Include="..\..\stylecop.json">
+ <Link>stylecop.json</Link>
+ </AdditionalFiles>
+ </ItemGroup>
+
+</Project>
diff --git a/src/Shared/AliasVault.Shared.Core/AppInfo.cs b/src/Shared/AliasVault.Shared.Core/AppInfo.cs
new file mode 100644
index 000000000..7446de684
--- /dev/null
+++ b/src/Shared/AliasVault.Shared.Core/AppInfo.cs
@@ -0,0 +1,78 @@
+//-----------------------------------------------------------------------
+// <copyright file="AppInfo.cs" company="lanedirt">
+// Copyright (c) lanedirt. All rights reserved.
+// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace AliasVault.Shared.Core;
+
+/// <summary>
+/// Provides application-wide constant information and versioning.
+/// </summary>
+public static class AppInfo
+{
+ /// <summary>
+ /// Gets the application name.
+ /// </summary>
+ public const string ApplicationName = "AliasVault";
+
+ /// <summary>
+ /// Gets the major version number.
+ /// </summary>
+ public const int VersionMajor = 0;
+
+ /// <summary>
+ /// Gets the minor version number.
+ /// </summary>
+ public const int VersionMinor = 5;
+
+ /// <summary>
+ /// Gets the patch version number.
+ /// </summary>
+ public const int VersionPatch = 0;
+
+ /// <summary>
+ /// Gets the build number, typically used in CI/CD pipelines.
+ /// Can be overridden at build time.
+ /// </summary>
+ public static string BuildNumber { get; } = string.Empty;
+
+ /// <summary>
+ /// Gets a value indicating whether the application is running in development mode.
+ /// </summary>
+ public static bool IsDevelopment { get; } =
+#if DEBUG
+ true;
+#else
+ false;
+#endif
+
+ /// <summary>
+ /// Gets the full version string in semantic versioning format.
+ /// </summary>
+ /// <returns>The full version string.</returns>
+ public static string GetFullVersion()
+ {
+ var version = $"{VersionMajor}.{VersionMinor}.{VersionPatch}";
+
+ if (IsDevelopment)
+ {
+ version += string.IsNullOrEmpty(BuildNumber)
+ ? "-dev"
+ : $"-dev.{BuildNumber}";
+ }
+ else if (!string.IsNullOrEmpty(BuildNumber))
+ {
+ version += $"+{BuildNumber}";
+ }
+
+ return version;
+ }
+
+ /// <summary>
+ /// Gets a short version string (major.minor).
+ /// </summary>
+ /// <returns>The short version string.</returns>
+ public static string GetShortVersion() => $"{VersionMajor}.{VersionMinor}";
+}
diff --git a/src/Shared/AliasVault.Shared.Core/README.md b/src/Shared/AliasVault.Shared.Core/README.md
new file mode 100644
index 000000000..a6f401612
--- /dev/null
+++ b/src/Shared/AliasVault.Shared.Core/README.md
@@ -0,0 +1,16 @@
+# AliasVault.Shared.Core
+
+This project contains core shared code for the AliasVault project such as versioning information and shared constants.
+This project does not contain any external dependencies to ensure minimal impact on consuming projects.
+
+## Purpose
+
+This library provides fundamental, dependency-free components that are shared across all AliasVault projects:
+- Application versioning
+- Core constants
+- Basic enums
+- Shared interfaces
+
+## Dependencies
+
+This project does not depend on any external libraries.
diff --git a/src/Shared/AliasVault.Shared/README.md b/src/Shared/AliasVault.Shared/README.md
new file mode 100644
index 000000000..1cff70279
--- /dev/null
+++ b/src/Shared/AliasVault.Shared/README.md
@@ -0,0 +1,16 @@
+# AliasVault.Shared
+
+This project contains shared models, DTOs, and functionality used across the AliasVault solution. Unlike AliasVault.Shared.Core, this project can include external dependencies and more complex shared logic.
+
+## Purpose
+
+This library provides shared components used by both client and server applications:
+- Data transfer objects (DTOs)
+- Domain models
+- Shared services
+- Extension methods
+- Common utilities
+
+## Dependencies
+
+This project can include external dependencies as needed such as utility libraries etc.