From 1b08964f8c1d37aa9e3cd6d4e3a6fca29cb4e92b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:41:05 -0500 Subject: [PATCH 01/14] Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.9.0 (#975) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.2 to 17.9.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.7.2...v17.9.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../ProjectLighthouse.Tests.GameApiTests.csproj | 2 +- .../ProjectLighthouse.Tests.WebsiteTests.csproj | 2 +- ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj index 1e6cabdb8..35f907d88 100644 --- a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj +++ b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj @@ -14,7 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index 69bd3e2bc..701ad8ede 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -14,7 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index 4205a75a3..9d62964ae 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -19,7 +19,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive From 34328c891f0a2975b37c21f1a0d0e592f6c1e678 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:41:18 -0500 Subject: [PATCH 02/14] Bump Selenium.WebDriver.ChromeDriver from 121.0.6167.8500 to 123.0.6312.5800 (#994) Bump Selenium.WebDriver.ChromeDriver Bumps [Selenium.WebDriver.ChromeDriver](https://github.com/jsakamoto/nupkg-selenium-webdriver-chromedriver) from 121.0.6167.8500 to 123.0.6312.5800. - [Changelog](https://github.com/jsakamoto/nupkg-selenium-webdriver-chromedriver/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/jsakamoto/nupkg-selenium-webdriver-chromedriver/compare/v.121.0.6167.8500...v.123.0.6312.5800) --- updated-dependencies: - dependency-name: Selenium.WebDriver.ChromeDriver dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../ProjectLighthouse.Tests.WebsiteTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index 701ad8ede..b7abb2ab1 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -16,7 +16,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 09644ebed359dec3a7bad2da5b25b2083fb9f1b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:41:33 +0000 Subject: [PATCH 03/14] Bump xunit.runner.visualstudio from 2.5.6 to 2.5.7 (#995) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.6 to 2.5.7. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.6...2.5.7) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../ProjectLighthouse.Tests.GameApiTests.csproj | 2 +- .../ProjectLighthouse.Tests.WebsiteTests.csproj | 2 +- ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj index 35f907d88..04d693c86 100644 --- a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj +++ b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj @@ -16,7 +16,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index b7abb2ab1..042d4bf39 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -18,7 +18,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index 9d62964ae..7090f644a 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -21,7 +21,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 5364c51d45a11f29d5d86971eb69c46904a33b5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:52:05 +0000 Subject: [PATCH 04/14] Bump Selenium.WebDriver from 4.14.1 to 4.18.1 (#984) Bumps [Selenium.WebDriver](https://github.com/SeleniumHQ/selenium) from 4.14.1 to 4.18.1. - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Commits](https://github.com/SeleniumHQ/selenium/commits/selenium-4.18.1) --- updated-dependencies: - dependency-name: Selenium.WebDriver dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../ProjectLighthouse.Tests.WebsiteTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index 042d4bf39..fb7307415 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + From c6e7da5259c2652e3f74363b051041010d905870 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:52:53 +0000 Subject: [PATCH 05/14] Bump xunit from 2.5.3 to 2.7.0 (#981) Bumps [xunit](https://github.com/xunit/xunit) from 2.5.3 to 2.7.0. - [Commits](https://github.com/xunit/xunit/compare/2.5.3...2.7.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../ProjectLighthouse.Tests.GameApiTests.csproj | 2 +- .../ProjectLighthouse.Tests.WebsiteTests.csproj | 2 +- ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj index 04d693c86..bfee214b4 100644 --- a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj +++ b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index fb7307415..45cbe3701 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -17,7 +17,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index 7090f644a..071581ffa 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 67756805e05bdf395b6d43027e5d714f3cf641e0 Mon Sep 17 00:00:00 2001 From: sudokoko Date: Wed, 27 Mar 2024 22:06:30 -0400 Subject: [PATCH 06/14] Bump dependencies --- ...ProjectLighthouse.Tests.GameApiTests.csproj | 6 +++--- ...ProjectLighthouse.Tests.WebsiteTests.csproj | 10 +++++----- .../ProjectLighthouse.Tests.csproj | 8 ++++---- ProjectLighthouse/ProjectLighthouse.csproj | 18 +++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj index bfee214b4..db0ead102 100644 --- a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj +++ b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj @@ -9,8 +9,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index 45cbe3701..0686a1d38 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -9,20 +9,20 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index 071581ffa..4eb6d411e 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -14,8 +14,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -25,12 +25,12 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index 9512d7173..44c923488 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -10,27 +10,27 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + From e1cc214f44bf9cb4429f8781231824cd57943612 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:13:11 -0400 Subject: [PATCH 07/14] Bump dotnet-ef from 7.0.13 to 8.0.3 (#997) Bumps [dotnet-ef](https://github.com/dotnet/efcore) from 7.0.13 to 8.0.3. - [Release notes](https://github.com/dotnet/efcore/releases) - [Commits](https://github.com/dotnet/efcore/compare/v7.0.13...v8.0.3) --- updated-dependencies: - dependency-name: dotnet-ef dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 760f61729..a1b89d981 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "7.0.13", + "version": "8.0.3", "commands": [ "dotnet-ef" ] From a5ba5844f86babb7f7d5d0fa480bdfe40c9a6411 Mon Sep 17 00:00:00 2001 From: sudokoko Date: Thu, 28 Mar 2024 13:25:36 -0400 Subject: [PATCH 08/14] Display the latest announcement (if any) on the landing page --- .../Pages/LandingPage.cshtml | 29 ++++++++++++++++++- .../Pages/LandingPage.cshtml.cs | 7 +++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml index 903dbf0cb..95c749163 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml @@ -60,7 +60,34 @@ } } -

+@if (Model.LatestAnnouncement != null) +{ +
+
+

@Model.LatestAnnouncement.Title

+
+ + @(Model.LatestAnnouncement.Content.Length > 250 + ? Model.LatestAnnouncement.Content[..250] + $"... [read more]({ServerConfiguration.Instance.ExternalUrl}/notifications)" + : Model.LatestAnnouncement.Content) + +
+ @if (Model.LatestAnnouncement.Publisher != null) + { + + } +
+
+} +else +{ +

+}
diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs index f866557b3..37edf44bd 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs @@ -5,6 +5,7 @@ using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Website; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -19,6 +20,8 @@ public class LandingPage : BaseLayout public int PendingAuthAttempts; public List PlayersOnline = new(); + public WebsiteAnnouncementEntity? LatestAnnouncement; + public LandingPage(DatabaseContext database) : base(database) { } @@ -54,6 +57,10 @@ public async Task OnGet() .Include(s => s.Creator) .ToListAsync(); + this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher) + .OrderByDescending(a => a.AnnouncementId) + .FirstOrDefaultAsync(); + return this.Page(); } } \ No newline at end of file From 975fcab100e6e66994ff9bf0a46a48604cb268ba Mon Sep 17 00:00:00 2001 From: sudokoko Date: Thu, 28 Mar 2024 13:42:05 -0400 Subject: [PATCH 09/14] Revert "Display the latest announcement (if any) on the landing page" This reverts commit a5ba5844f86babb7f7d5d0fa480bdfe40c9a6411. Commit was intended for the `read-only` branch and was pushed to `main` in error. --- .../Pages/LandingPage.cshtml | 29 +------------------ .../Pages/LandingPage.cshtml.cs | 7 ----- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml index 95c749163..903dbf0cb 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml @@ -60,34 +60,7 @@ } } -@if (Model.LatestAnnouncement != null) -{ -
-
-

@Model.LatestAnnouncement.Title

-
- - @(Model.LatestAnnouncement.Content.Length > 250 - ? Model.LatestAnnouncement.Content[..250] + $"... [read more]({ServerConfiguration.Instance.ExternalUrl}/notifications)" - : Model.LatestAnnouncement.Content) - -
- @if (Model.LatestAnnouncement.Publisher != null) - { - - } -
-
-} -else -{ -

-} +

diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs index 37edf44bd..f866557b3 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs @@ -5,7 +5,6 @@ using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Profile; -using LBPUnion.ProjectLighthouse.Types.Entities.Website; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -20,8 +19,6 @@ public class LandingPage : BaseLayout public int PendingAuthAttempts; public List PlayersOnline = new(); - public WebsiteAnnouncementEntity? LatestAnnouncement; - public LandingPage(DatabaseContext database) : base(database) { } @@ -57,10 +54,6 @@ public async Task OnGet() .Include(s => s.Creator) .ToListAsync(); - this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher) - .OrderByDescending(a => a.AnnouncementId) - .FirstOrDefaultAsync(); - return this.Page(); } } \ No newline at end of file From 0ee8970c64c5bd5888251391b003300a04af28c7 Mon Sep 17 00:00:00 2001 From: sudokoko Date: Fri, 29 Mar 2024 22:51:12 -0400 Subject: [PATCH 10/14] Implement read-only mode (#1001) * Implement read-only mode * Use localized string under default language for announce text * Redirect to user page rather than returning blank 400 * Protect call to `ParseBase64Image` * Add protections to SlotSettingsPage and nitpick format * Display the latest announcement (if any) on the landing page * Fix a kokoism Accidentally tried to use markdown within the landing page... I'm rather smart aren't I * Prevent possible XSS * Separate truncated announcement text and link with "..." * Apply suggestion from code review * Add read-only check to /postComment in slot page controller * Fix inconsistent tabbing --- .../BaseLayout.resx | 6 +++ .../StringLists/BaseLayoutStrings.cs | 3 ++ .../Controllers/CommentController.cs | 6 +++ .../Controllers/MessageController.cs | 7 ++++ .../Controllers/Resources/PhotosController.cs | 5 ++- .../Resources/ResourcesController.cs | 9 ++++- .../Controllers/Slots/PublishController.cs | 9 +++++ .../Controllers/Slots/ReviewController.cs | 9 ++++- .../Controllers/UserController.cs | 7 ++++ .../Controllers/SlotPageController.cs | 5 ++- .../Controllers/UserPageController.cs | 3 ++ .../Pages/LandingPage.cshtml | 37 ++++++++++++++++++- .../Pages/LandingPage.cshtml.cs | 7 ++++ .../Pages/Layouts/BaseLayout.cshtml | 12 ++++++ .../Pages/Partials/CommentsPartial.cshtml | 27 +++++++++++--- .../Pages/Partials/ReviewPartial.cshtml | 19 ++++++++-- .../Pages/SlotSettingsPage.cshtml.cs | 7 +++- .../Pages/UserSettingsPage.cshtml.cs | 8 ++++ .../UserGeneratedContentLimitConfiguration.cs | 6 +++ .../Configuration/ServerConfiguration.cs | 2 +- 20 files changed, 176 insertions(+), 18 deletions(-) diff --git a/ProjectLighthouse.Localization/BaseLayout.resx b/ProjectLighthouse.Localization/BaseLayout.resx index 6cd9c681a..65d1229f7 100644 --- a/ProjectLighthouse.Localization/BaseLayout.resx +++ b/ProjectLighthouse.Localization/BaseLayout.resx @@ -87,4 +87,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs b/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs index 64f390219..f46cb4e60 100644 --- a/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs +++ b/ProjectLighthouse.Localization/StringLists/BaseLayoutStrings.cs @@ -23,5 +23,8 @@ public static class BaseLayoutStrings public static readonly TranslatableString LicenseWarn2 = create("license_warn_2"); public static readonly TranslatableString LicenseWarn3 = create("license_warn_3"); + public static readonly TranslatableString ReadOnlyWarnTitle = create("read_only_warn_title"); + public static readonly TranslatableString ReadOnlyWarn = create("read_only_warn"); + private static TranslatableString create(string key) => new(TranslationAreas.BaseLayout, key); } \ No newline at end of file diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs index 76f2b715b..a906b170b 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs @@ -119,6 +119,9 @@ public async Task PostComment(string? username, string? slotType, { GameTokenEntity token = this.GetToken(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + GameComment? comment = await this.DeserializeBody(); if (comment?.Message == null) return this.BadRequest(); @@ -159,6 +162,9 @@ public async Task DeleteComment([FromQuery] int commentId, string { GameTokenEntity token = this.GetToken(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + if ((slotId == 0 || SlotHelper.IsTypeInvalid(slotType)) == (username == null)) return this.BadRequest(); CommentEntity? comment = await this.database.Comments.FirstOrDefaultAsync(c => c.CommentId == commentId); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs index 3d3f16be9..4666366f6 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs @@ -3,6 +3,8 @@ using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; +using LBPUnion.ProjectLighthouse.Localization; +using LBPUnion.ProjectLighthouse.Localization.StringLists; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types.Entities.Notifications; @@ -59,6 +61,11 @@ public async Task Announce() announceText.Replace("%user", username); announceText.Replace("%id", token.UserId.ToString()); + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + { + announceText.Insert(0, BaseLayoutStrings.ReadOnlyWarn.Translate(LocalizationManager.DefaultLang)); + } + #if DEBUG announceText.Append("\n\n---DEBUG INFO---\n" + $"user.UserId: {token.UserId}\n" + diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs index e79626439..4c73d0a04 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/PhotosController.cs @@ -37,6 +37,9 @@ public async Task UploadPhoto() { GameTokenEntity token = this.GetToken(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + int photoCount = await this.database.Photos.CountAsync(p => p.CreatorId == token.UserId); if (photoCount >= ServerConfiguration.Instance.UserGeneratedContentLimits.PhotosQuota) return this.BadRequest(); @@ -90,7 +93,7 @@ public async Task UploadPhoto() case SlotType.Developer: { SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.Type == photoSlot.SlotType && s.InternalSlotId == photoSlot.SlotId); - if (slot != null) + if (slot != null) photoSlot.SlotId = slot.SlotId; else photoSlot.SlotId = await SlotHelper.GetPlaceholderSlotId(this.database, photoSlot.SlotId, photoSlot.SlotType); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs index 3c1c2f822..7231ccafb 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Resources/ResourcesController.cs @@ -1,5 +1,6 @@ #nullable enable using System.Text; +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Logging; @@ -58,10 +59,14 @@ public async Task UploadResource(string hash) string fullPath = Path.GetFullPath(path); FileHelper.EnsureDirectoryCreated(assetsDirectory); - // lbp treats code 409 as success and as an indicator that the file is already present + + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + + // LBP treats code 409 as success and as an indicator that the file is already present if (FileHelper.ResourceExists(hash)) return this.Conflict(); - // theoretically shouldn't be possible because of hash check but handle anyways + // Theoretically shouldn't be possible because of hash check but handle anyways if (!fullPath.StartsWith(FileHelper.FullResourcePath)) return this.BadRequest(); Logger.Info($"Processing resource upload (hash: {hash})", LogArea.Resources); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs index e09a06e65..7bedc01dc 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/PublishController.cs @@ -43,6 +43,9 @@ public async Task StartPublish() UserEntity? user = await this.database.UserFromGameToken(token); if (user == null) return this.Forbid(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + GameUserSlot? slot = await this.DeserializeBody(); if (slot == null) { @@ -116,6 +119,9 @@ public async Task Publish([FromQuery] string? game) UserEntity? user = await this.database.UserFromGameToken(token); if (user == null) return this.Forbid(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + GameUserSlot? slot = await this.DeserializeBody(); if (slot == null) @@ -335,6 +341,9 @@ public async Task Unpublish(int id) { GameTokenEntity token = this.GetToken(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.SlotId == id); if (slot == null) return this.NotFound(); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs index aa4e1c5b9..7feae4bf4 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/Slots/ReviewController.cs @@ -1,4 +1,5 @@ #nullable enable +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Helpers; @@ -92,6 +93,9 @@ public async Task PostReview(int slotId) { GameTokenEntity token = this.GetToken(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + GameReview? newReview = await this.DeserializeBody(); if (newReview == null) return this.BadRequest(); @@ -115,7 +119,7 @@ public async Task PostReview(int slotId) } review.Thumb = Math.Clamp(newReview.Thumb, -1, 1); review.LabelCollection = LabelHelper.RemoveInvalidLabels(newReview.LabelCollection); - + review.Text = newReview.Text; review.Deleted = false; review.Timestamp = TimeHelper.TimestampMillis; @@ -239,6 +243,9 @@ public async Task DeleteReview(int slotId, string username) { GameTokenEntity token = this.GetToken(); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + int creatorId = await this.database.Slots.Where(s => s.SlotId == slotId).Select(s => s.CreatorId).FirstOrDefaultAsync(); if (creatorId == 0) return this.BadRequest(); diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs index fb5b6128f..cbed989be 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/UserController.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Extensions; using LBPUnion.ProjectLighthouse.Files; @@ -73,6 +74,9 @@ public async Task UpdateUser() if (update.Biography != null) { + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + if (update.Biography.Length > 512) return this.BadRequest(); user.Biography = update.Biography; @@ -85,6 +89,9 @@ public async Task UpdateUser() { if (string.IsNullOrWhiteSpace(resource)) continue; + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest(); + if (!FileHelper.ResourceExists(resource) && !resource.StartsWith('g')) return this.BadRequest(); if (!GameResourceHelper.IsValidTexture(resource)) return this.BadRequest(); diff --git a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs index 66eafbc08..7f22b0b6b 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -// I would like to apologize in advance for anyone dealing with this file. +// I would like to apologize in advance for anyone dealing with this file. // Theres probably a better way to do this with delegates but I'm tired. // TODO: Clean up this file // - jvyden @@ -63,6 +63,9 @@ public async Task PostComment([FromRoute] int id, [FromForm] stri WebTokenEntity? token = this.database.WebTokenFromRequest(this.Request); if (token == null) return this.Redirect("~/login"); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.Redirect("~/slot/" + id); + if (msg == null) { Logger.Error($"Refusing to post comment from {token.UserId} on level {id}, {nameof(msg)} is null", LogArea.Comments); diff --git a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs index 161bb1a87..afd23458d 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs @@ -39,6 +39,9 @@ public async Task PostComment([FromRoute] int id, [FromForm] stri WebTokenEntity? token = this.database.WebTokenFromRequest(this.Request); if (token == null) return this.Redirect("~/login"); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.Redirect("~/user/" + id); + if (msg == null) { Logger.Error($"Refusing to post comment from {token.UserId} on user {id}, {nameof(msg)} is null", LogArea.Comments); diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml index 903dbf0cb..9f9ba991e 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml @@ -60,7 +60,42 @@ } } -

+@if (Model.LatestAnnouncement != null) +{ +
+
+

@Model.LatestAnnouncement.Title

+
+ @if (Model.LatestAnnouncement.Content.Length > 250) + { + + @Model.LatestAnnouncement.Content[..250]... + read more + + } + else + { + + @Model.LatestAnnouncement.Content + + } +
+ @if (Model.LatestAnnouncement.Publisher != null) + { + + } +
+
+} +else +{ +

+}
diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs index f866557b3..37edf44bd 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml.cs @@ -5,6 +5,7 @@ using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts; using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Entities.Website; using LBPUnion.ProjectLighthouse.Types.Levels; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -19,6 +20,8 @@ public class LandingPage : BaseLayout public int PendingAuthAttempts; public List PlayersOnline = new(); + public WebsiteAnnouncementEntity? LatestAnnouncement; + public LandingPage(DatabaseContext database) : base(database) { } @@ -54,6 +57,10 @@ public async Task OnGet() .Include(s => s.Creator) .ToListAsync(); + this.LatestAnnouncement = await this.Database.WebsiteAnnouncements.Include(a => a.Publisher) + .OrderByDescending(a => a.AnnouncementId) + .FirstOrDefaultAsync(); + return this.Page(); } } \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml index 5de98aa34..14f147822 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml @@ -178,6 +178,18 @@
} + @if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + { +
+
+ + @Model.Translate(BaseLayoutStrings.ReadOnlyWarnTitle) +

+ @Html.Raw(Model.Translate(BaseLayoutStrings.ReadOnlyWarn)) +

+
+
+ }
diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml index 4a2a98691..cbab2fdbb 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/CommentsPartial.cshtml @@ -1,4 +1,5 @@ @using System.Web +@using LBPUnion.ProjectLighthouse.Configuration @using LBPUnion.ProjectLighthouse.Database @using LBPUnion.ProjectLighthouse.Localization @using LBPUnion.ProjectLighthouse.Servers.Website.Extensions @@ -31,18 +32,32 @@ @if (Model.CommentsEnabled && Model.User != null) {
-
-
- + @if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + { +
+

+ + @ServerConfiguration.Instance.Customization.ServerName is currently in read-only mode. + You will not be able to post comments until read-only mode is disabled. + +

- - + } + else + { +
+
+ +
+ +
+ } @if (Model.Comments.Count > 0) {
} } - + @{ int i = 0; foreach (KeyValuePair commentAndReaction in Model.Comments) diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml index 610342658..f8c16a5ff 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml @@ -4,7 +4,6 @@ @using LBPUnion.ProjectLighthouse.Helpers @using LBPUnion.ProjectLighthouse.Types.Entities.Level @using LBPUnion.ProjectLighthouse.Types.Serialization - @{ bool isMobile = (bool?)ViewData["IsMobile"] ?? false; bool canDelete = (bool?)ViewData["CanDelete"] ?? false; @@ -29,6 +28,18 @@
} + @if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + { +
+

+ + @ServerConfiguration.Instance.Customization.ServerName is currently in read-only mode. + You will not be able to post reviews in-game until read-only mode is disabled. + +

+
+ } + @for(int i = 0; i < Model.Reviews.Count; i++) { ReviewEntity review = Model.Reviews[i]; @@ -36,7 +47,7 @@ -1 => review.Reviewer?.BooHash, 0 => review.Reviewer?.MehHash, 1 => review.Reviewer?.YayHash, - + _ => throw new ArgumentOutOfRangeException(), }) ?? ""; @@ -49,7 +60,7 @@ -1 => "Boo!", 0 => "Meh.", 1 => "Yay!", - + _ => throw new ArgumentOutOfRangeException(), }; @@ -114,7 +125,7 @@ if (window.confirm("Are you sure you want to delete this?\nThis action cannot be undone.")){ window.location.hash = "reviews"; window.location.href = "/moderation/deleteReview/" + reviewId + "?callbackUrl=" + this.window.location; - } + } }
diff --git a/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs index 310386e76..b461d9825 100644 --- a/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs @@ -1,4 +1,5 @@ #nullable enable +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Files; using LBPUnion.ProjectLighthouse.Helpers; @@ -25,6 +26,10 @@ public async Task OnPost([FromRoute] int slotId, [FromForm] strin if (!this.User.IsModerator && this.User != this.Slot.Creator) return this.Redirect("~/slot/" + slotId); + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + return this.Redirect($"~/slot/{slotId}"); + string? avatarHash = await FileHelper.ParseBase64Image(avatar); if (avatarHash != null) this.Slot.IconHash = avatarHash; @@ -46,7 +51,7 @@ public async Task OnPost([FromRoute] int slotId, [FromForm] strin if (labels != null) { labels = LabelHelper.RemoveInvalidLabels(labels); - if (this.Slot.AuthorLabels != labels) + if (this.Slot.AuthorLabels != labels) this.Slot.AuthorLabels = labels; } diff --git a/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs index 066ca973b..85b0c242f 100644 --- a/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs @@ -39,6 +39,10 @@ [FromForm] string? language if (!this.User.IsModerator && this.User != this.ProfileUser) return this.Redirect("~/user/" + userId); + // Deny request if in read-only mode + if (avatar != null && ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + return this.Redirect($"~/user/{userId}"); + string? avatarHash = await FileHelper.ParseBase64Image(avatar); if (avatarHash != null) this.ProfileUser.IconHash = avatarHash; @@ -47,6 +51,10 @@ [FromForm] string? language if (biography != null) { + // Deny request if in read-only mode + if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) + return this.Redirect($"~/user/{userId}"); + biography = CensorHelper.FilterMessage(biography); if (this.ProfileUser.Biography != biography && biography.Length <= 512) this.ProfileUser.Biography = biography; diff --git a/ProjectLighthouse/Configuration/ConfigurationCategories/UserGeneratedContentLimitConfiguration.cs b/ProjectLighthouse/Configuration/ConfigurationCategories/UserGeneratedContentLimitConfiguration.cs index 6430b7541..f725c2788 100644 --- a/ProjectLighthouse/Configuration/ConfigurationCategories/UserGeneratedContentLimitConfiguration.cs +++ b/ProjectLighthouse/Configuration/ConfigurationCategories/UserGeneratedContentLimitConfiguration.cs @@ -11,6 +11,12 @@ public class UserGeneratedContentLimitConfiguration public int PhotosQuota { get; set; } = 500; + /// + /// When enabled, all UGC uploads are disabled. This includes levels, photos, reviews, + /// comments, and certain profile settings. + /// + public bool ReadOnlyMode { get; set; } = false; + public bool ProfileCommentsEnabled { get; set; } = true; public bool LevelCommentsEnabled { get; set; } = true; diff --git a/ProjectLighthouse/Configuration/ServerConfiguration.cs b/ProjectLighthouse/Configuration/ServerConfiguration.cs index 7258804e0..30c7c89be 100644 --- a/ProjectLighthouse/Configuration/ServerConfiguration.cs +++ b/ProjectLighthouse/Configuration/ServerConfiguration.cs @@ -11,7 +11,7 @@ public class ServerConfiguration : ConfigurationBase // This is so Lighthouse can properly identify outdated configurations and update them with newer settings accordingly. // If you are modifying anything here, this value MUST be incremented. // Thanks for listening~ - public override int ConfigVersion { get; set; } = 25; + public override int ConfigVersion { get; set; } = 26; public override string ConfigName { get; set; } = "lighthouse.yml"; public string WebsiteListenUrl { get; set; } = "http://localhost:10060"; From da8322e01a3aa5b9533cbbdd8cd72c2cc0e56a8a Mon Sep 17 00:00:00 2001 From: sudokoko Date: Fri, 29 Mar 2024 23:17:01 -0400 Subject: [PATCH 11/14] Fix errant line breaks in landing page announcement view --- .../Pages/LandingPage.cshtml | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml index 9f9ba991e..1414c642e 100644 --- a/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/LandingPage.cshtml @@ -66,19 +66,14 @@

@Model.LatestAnnouncement.Title

- @if (Model.LatestAnnouncement.Content.Length > 250) - { - - @Model.LatestAnnouncement.Content[..250]... - read more - - } - else - { - - @Model.LatestAnnouncement.Content - - } + @if (Model.LatestAnnouncement.Content.Length > 250) + { + @Model.LatestAnnouncement.Content[..250]...read more + } + else + { + @Model.LatestAnnouncement.Content + }
@if (Model.LatestAnnouncement.Publisher != null) { From 81ec09041c410e50dcaa6f7272a74849e0fbdc12 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 23:23:39 -0400 Subject: [PATCH 12/14] Update the localization files (#1006) [skip ci] Update the localization files Co-authored-by: Crowdin Bot --- ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-en-PT.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-es-ES.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-et-EE.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-fi-FI.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-he-IL.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-hi-IN.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-id-ID.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-it-IT.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-nl-NL.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-th-TH.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-tr-TR.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-uk-UA.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx | 6 ++++++ ProjectLighthouse.Localization/BaseLayout.lang-zh-TW.resx | 6 ++++++ 28 files changed, 168 insertions(+) diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx index 93d2af66e..840e788a7 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ar-SA.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx index e09dd9af5..288b7fb7a 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-da-DK.resx @@ -80,4 +80,10 @@ Hvis ikke, bedes du publicere kildekoden et eller andet sted, der er tilgængeligt for dine brugere. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx index 23a346fc6..c440b48ba 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-de-DE.resx @@ -80,4 +80,10 @@ Falls nicht, veröffentliche den Quellcode irgendwo, wo die Nutzer deiner Instanz darauf zugreifen können. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-en-PT.resx b/ProjectLighthouse.Localization/BaseLayout.lang-en-PT.resx index 5e95e70d1..4b1ed6f2b 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-en-PT.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-en-PT.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to yer users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx b/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx index 7f9158775..33a44d35e 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-eo-UY.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-es-ES.resx b/ProjectLighthouse.Localization/BaseLayout.lang-es-ES.resx index 605e6c1cb..9e8054d35 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-es-ES.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-es-ES.resx @@ -80,4 +80,10 @@ Si no es así, por favor publique el código fuente en algún lugar accesible para sus usuarios. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx index 4a9f05044..e7ab8b50b 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-es-MX.resx @@ -80,4 +80,10 @@ De lo contrario, publique el código fuente en algún lugar accesible para sus usuarios. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-et-EE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-et-EE.resx index e8afb535b..018d76883 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-et-EE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-et-EE.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-fi-FI.resx b/ProjectLighthouse.Localization/BaseLayout.lang-fi-FI.resx index 3f0769c7c..010bee822 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-fi-FI.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-fi-FI.resx @@ -80,4 +80,10 @@ Jos ei, julkaise lähdekoodisi jonnekin, jossa se on käyttäjillesi saatavissa. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx b/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx index eeca3734f..1f6d2f80c 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-fil-PH.resx @@ -80,4 +80,10 @@ Kung hindi, mangyaring ilathala ang source code sa isang lugar na maaring ma-access ng iyong mga user. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx b/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx index 5799bbab6..b6a13ce44 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-fr-FR.resx @@ -80,4 +80,10 @@ Dans le cas contraire, veuillez publier le code source dans un endroit accessible à vos utilisateurs. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx index e9c979f12..8d3faadfe 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ga-IE.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-he-IL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-he-IL.resx index b8181267b..4f227b17f 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-he-IL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-he-IL.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-hi-IN.resx b/ProjectLighthouse.Localization/BaseLayout.lang-hi-IN.resx index e8afb535b..018d76883 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-hi-IN.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-hi-IN.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-id-ID.resx b/ProjectLighthouse.Localization/BaseLayout.lang-id-ID.resx index e8afb535b..018d76883 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-id-ID.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-id-ID.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-it-IT.resx b/ProjectLighthouse.Localization/BaseLayout.lang-it-IT.resx index d0e7dc788..1bf4d272b 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-it-IT.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-it-IT.resx @@ -80,4 +80,10 @@ In caso contrario, si prega di pubblicare il codice sorgente da qualche parte accessibile ai propri utenti. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx index 87a8f042b..bd34f75af 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ja-JP.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-nl-NL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-nl-NL.resx index e8afb535b..018d76883 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-nl-NL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-nl-NL.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx b/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx index 2667ba27c..7498eea45 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-no-NO.resx @@ -80,4 +80,10 @@ Hvis ikke, vennligst publiser kildekoden et sted som er tilgjengelig for brukerne dine + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx index 3f3c3967e..165ad1eaa 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pl-PL.resx @@ -80,4 +80,10 @@ Jeśli nie, proszę opublikować kod źródłowy dostępny dla użytkowników. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx b/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx index 542aaefe4..acd98ae62 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-pt-PT.resx @@ -80,4 +80,10 @@ Se não for o caso, publique o código-fonte em um local acessível aos seus utilizadores. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx index 6885eef7a..af911178e 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-ru-RU.resx @@ -80,4 +80,10 @@ Если нет, пожалуйста, опубликуйте исходный код в доступном для ваших пользователей месте. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx index 5ea5b4201..335728b07 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-sv-SE.resx @@ -80,4 +80,10 @@ Om inte, vänligen publicera källkoden någonstans tillgängligt för dina användare. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-th-TH.resx b/ProjectLighthouse.Localization/BaseLayout.lang-th-TH.resx index e8afb535b..018d76883 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-th-TH.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-th-TH.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-tr-TR.resx b/ProjectLighthouse.Localization/BaseLayout.lang-tr-TR.resx index dad9985bd..6fcea7990 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-tr-TR.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-tr-TR.resx @@ -80,4 +80,10 @@ Eğer değilse, lütfen kaynak kodunu kullanıcılarınızın erişebileceği bir yerde yayınlayın. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-uk-UA.resx b/ProjectLighthouse.Localization/BaseLayout.lang-uk-UA.resx index 393240d3c..02d466427 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-uk-UA.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-uk-UA.resx @@ -80,4 +80,10 @@ Якщо ні, будь ласка, опублікуйте вихідний код у місці, доступному для ваших користувачів. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx index b93490ef9..5911daf5d 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-zh-CN.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file diff --git a/ProjectLighthouse.Localization/BaseLayout.lang-zh-TW.resx b/ProjectLighthouse.Localization/BaseLayout.lang-zh-TW.resx index 39f48810b..865dd50a8 100644 --- a/ProjectLighthouse.Localization/BaseLayout.lang-zh-TW.resx +++ b/ProjectLighthouse.Localization/BaseLayout.lang-zh-TW.resx @@ -80,4 +80,10 @@ If not, please publish the source code somewhere accessible to your users. + + Read-Only Mode + + + This instance is currently in read-only mode. Level and photo uploads, comments, reviews, and certain profile changes will be restricted until read-only mode is disabled. + \ No newline at end of file From e8441c134bb890162997ceb2fe8d47224a4d2a51 Mon Sep 17 00:00:00 2001 From: Ren <96893300+ren-makes-things@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:36:19 -0700 Subject: [PATCH 13/14] Use Actions to build and publish Docker images to Github Container Registry (#1004) * Create docker-publish.yml * Update docker-publish.yml * Now this should work GitHub's own template is a little out of date, had to accommodate for this https://github.com/actions/starter-workflows/issues/2357 * updating to actions/checkout@v4 * Update docker-publish.yml * Update do Co-authored-by: sudokoko * Update docker-publish.yml Co-authored-by: sudokoko * testing arm building Co-authored-by: Zaprit * an attempt to get this docker workflow to play nice with arm * Revert "testing arm building" This reverts commit a030b62f73cf219d78e83000b7e58b5aa69d7f76. * Revert "an attempt to get this docker workflow to play nice with arm" This reverts commit 8faf3f4a5a6b3b1cf0981d5501856f2cafdb68e5. * Minor nitpicky things before merge Committing these directly as to not bother you with another code review. Adds a nice-name to the job and renames "build" to "build-publish". --------- Co-authored-by: sudokoko Co-authored-by: Zaprit --- .github/workflows/docker-publish.yml | 89 ++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 000000000..f05364008 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,89 @@ +name: Build Docker Image + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build-publish: + name: Build and Publish + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 #v3.4.0 + with: + cosign-release: 'v2.2.3' + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} From 931f0792657214d81b7bf7cf3496613d3e1a74bb Mon Sep 17 00:00:00 2001 From: sudokoko Date: Sat, 30 Mar 2024 15:04:48 -0400 Subject: [PATCH 14/14] Append line breaks after read only mode warning in announce text --- .../Controllers/MessageController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs index 4666366f6..26ae10acf 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs @@ -63,7 +63,7 @@ public async Task Announce() if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) { - announceText.Insert(0, BaseLayoutStrings.ReadOnlyWarn.Translate(LocalizationManager.DefaultLang)); + announceText.Insert(0, BaseLayoutStrings.ReadOnlyWarn.Translate(LocalizationManager.DefaultLang) + "\n\n"); } #if DEBUG