From 25e81d073a2627b7c0eee21876876a0d5637a758 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 18 Jan 2022 19:38:49 -0500 Subject: [PATCH] Add license disclaimer for prod instances --- ProjectLighthouse/Helpers/VersionHelper.cs | 4 ++-- ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Helpers/VersionHelper.cs b/ProjectLighthouse/Helpers/VersionHelper.cs index 6ba19acc..ea79fb61 100644 --- a/ProjectLighthouse/Helpers/VersionHelper.cs +++ b/ProjectLighthouse/Helpers/VersionHelper.cs @@ -64,14 +64,14 @@ namespace LBPUnion.ProjectLighthouse.Helpers public static string CommitHash { get; set; } public static string Branch { get; set; } public static string FullVersion => $"{ServerStatics.ServerName} {Branch}@{CommitHash} {Build}"; - public static bool IsDirty => CommitHash.EndsWith("-dirty"); + public static bool IsDirty => CommitHash.EndsWith("-dirty") || CommitHash == "invalid" || Branch == "invalid"; public static bool CanCheckForUpdates { get; set; } public static string[] Remotes { get; set; } public const string Build = #if DEBUG "Debug"; - #elif RELEASE + #elif RELEASE "Release"; #else "Unknown"; diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml index ee35c549..4b4c8eb3 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml @@ -145,6 +145,18 @@ + @if (!ServerStatics.IsDebug && VersionHelper.IsDirty) + { +
+
+ + Potential License Violation +

This instance is a public-facing instance that has been modified without the changes committed. You may be in violation of the GNU Affero General Public License v3.0.

+

If you believe this is an error, please create an issue with the output of git status ran from the root of the server source code in the description on our issue tracker.

+

If not, please publish the source code somewhere accessible to your users.

+
+
+ }