Add license disclaimer for prod instances

This commit is contained in:
jvyden 2022-01-18 19:38:49 -05:00
commit 25e81d073a
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 14 additions and 2 deletions

View file

@ -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";

View file

@ -145,6 +145,18 @@
</div>
</div>
</noscript>
@if (!ServerStatics.IsDebug && VersionHelper.IsDirty)
{
<div class="ui bottom attached red message large">
<div class="ui container">
<i class="warning icon"></i>
<span style="font-size: 1.2rem;">Potential License Violation</span>
<p>This instance is a public-facing instance that has been modified without the changes committed. You may be in violation of the <a href="https://github.com/LBPUnion/project-lighthouse/blob/main/LICENSE">GNU Affero General Public License v3.0</a>.</p>
<p>If you believe this is an error, please create an issue with the output of <code>git status</code> ran from the root of the server source code in the description on our <a href="https://github.com/LBPUnion/project-lighthouse/issues">issue tracker</a>.</p>
<p>If not, please publish the source code somewhere accessible to your users.</p>
</div>
</div>
}
</header>
<div class="main">
<div class="ui container">