Merge branch 'dev' into MorePackages

This commit is contained in:
Jordan Dominion
2024-03-22 16:12:29 -04:00
committed by GitHub
11 changed files with 89 additions and 76 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ You can of course, as always, ask for help at [#coderbus](irc://irc.rizon.net/co
### Development Environment
You need the .NET 8.0 SDK, node>=v20, and npm>=v5.7 (in your PATH) to compile the server.
You need the .NET 8.0 SDK, node>=v20, and npm>=v5.7 (in your PATH) to compile the server. On Linux, you also need the `libgdiplus` package installed to generate icons.
The recommended IDE is Visual Studio 2022 or VSCode.
+4 -4
View File
@@ -318,7 +318,7 @@ jobs:
- name: Patch Doxyfile
run: |
VERSION=$(cat "build/Version.props" | grep -oPm1 "(?<=<TgsCoreVersion>)[^<]+")
echo -e "\nPROJECT_NUMBER = $VERSION\nINPUT = .\nOUTPUT_DIRECTORY = ./doxout\nPROJECT_LOGO = ./build/tgs.ico\nHAVE_DOT=YES" >> "docs/Doxyfile"
echo -e "\nPROJECT_NUMBER = $VERSION\nINPUT = .\nOUTPUT_DIRECTORY = ./doxout\nPROJECT_LOGO = ./artifacts/tgs.ico\nHAVE_DOT=YES" >> "docs/Doxyfile"
- name: Doxygen Build
uses: mattnotmitt/doxygen-action@411df0c62acb5b96b8a93d93a7bf4b753c47ea05 # v1.9.5
@@ -385,7 +385,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y -o APT::Immediate-Configure=0 libc6-i386 libstdc++6:i386 libgcc-s1:i386
sudo apt-get install -y -o APT::Immediate-Configure=0 libc6-i386 libstdc++6:i386 libgcc-s1:i386 libgdiplus
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -726,7 +726,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y -o APT::Immediate-Configure=0 libc6-i386 libstdc++6:i386 gdb libgcc-s1:i386
sudo apt-get install -y -o APT::Immediate-Configure=0 libc6-i386 libstdc++6:i386 gdb libgcc-s1:i386 libgdiplus
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -1130,7 +1130,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y -o APT::Immediate-Configure=0 libstdc++6:i386 libgcc-s1:i386 gnupg2 xmlstarlet
sudo apt-get install -y -o APT::Immediate-Configure=0 libstdc++6:i386 libgcc-s1:i386 gnupg2 xmlstarlet libgdiplus
- name: Import GPG Key
if: (github.event_name == 'push' && contains(github.event.head_commit.message, '[TGSDeploy]') && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/dev'))
+9 -9
View File
@@ -408,15 +408,15 @@ _NOTE: Your reverse proxy setup may interfere with SSE (Server-Sent Events) whic
#### IIS (Reccommended for Windows)
1. Acquire an HTTPS certificate. The easiet free way for Windows is [win-acme](https://github.com/PKISharp/win-acme) (requires you to set up the website first)
2. Install the [Web Platform Installer](https://www.microsoft.com/web/downloads/platform.aspx)
3. Open the web platform installer in the IIS Manager and install the Application Request Routing 3.0 module
4. Create a new website, bind it to HTTPS only with your chosen certificate and exposed port. The physical path won't matter since it won't be used. Use `Require Server Name Indication` if you want to limit requests to a specific URL prefix. Do not use the same port as the one TGS is running on.
5. Close and reopen the IIS Manager
5. Open the site and navigate to the `URL Rewrite` module
6. In the `Actions` Pane on the right click `Add Rule(s)...`
7. For the rule template, select `Reverse Proxy` under `Inbound and Outbound Rules` and click `OK`
8. You may get a prompt about enabling proxy functionality. Click `OK`
9. In the window that appears set the `Inbound Rules` textbox to the URL of your tgstation-server i.e. `http://localhost:5000`. Ensure `Enable SSL Offloading` is checked, then click `OK`
1. Install the [URL Rewrite Module](https://www.iis.net/downloads/microsoft/url-rewrite)
1. Install the [Application Request Routing Module](https://www.iis.net/downloads/microsoft/application-request-routing)
1. Create a new website, bind it to HTTPS only with your chosen certificate and exposed port. The physical path won't matter since it won't be used. Use `Require Server Name Indication` if you want to limit requests to a specific URL prefix. Do not use the same port as the one TGS is running on.
1. Close and reopen the IIS Manager
1. Open the site and navigate to the `URL Rewrite` module
1. In the `Actions` Pane on the right click `Add Rule(s)...`
1. For the rule template, select `Reverse Proxy` under `Inbound and Outbound Rules` and click `OK`
1. You may get a prompt about enabling proxy functionality. Click `OK`
1. In the window that appears set the `Inbound Rules` textbox to the URL of your tgstation-server i.e. `localhost:5000`. Ensure `Enable SSL Offloading` is checked, then click `OK`
#### Caddy (Reccommended for Linux, or those unfamilar with configuring NGINX or Apache)
+1
View File
@@ -16,6 +16,7 @@ RUN . $NVM_DIR/nvm.sh \
&& apt-get update \
&& apt-get install -y \
dos2unix \
libgdiplus \
&& rm -rf /var/lib/apt/lists/*
# Build web control panel
@@ -15,21 +15,13 @@
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
<!-- This is here because I know we have node as a build dep so this just works -->
<Target Name="IconGeneration" BeforeTargets="ResolveAssemblyReferences" Inputs="build_logo.js;../../build/logo.svg" Outputs="../../artifacts/tgs.ico;../../artifacts/tgs.png">
<Message Text="Restoring yarn packages..." Importance="high" />
<Exec Command="npx --yes yarn@$(TgsYarnVersion) add svg-to-ico@1.0.14 svg2img@1.0.0-beta.2" />
<Target Name="IconGeneration" BeforeTargets="ResolveAssemblyReferences" Inputs="../../build/logo.svg" Outputs="../../artifacts/tgs.ico;../../artifacts/tgs.png;../../tools/Tgstation.Server.LogoGenerator/Program.cs">
<Message Text="Generating icons from SVG..." Importance="high" />
<Exec Command="node ./build_logo.js" />
<Exec Command="dotnet run --project tools/Tgstation.Server.LogoGenerator -c $(Configuration)" WorkingDirectory="../.." />
</Target>
<Target Name="IconClean" AfterTargets="Clean">
<Message Text="Cleaning icons..." Importance="high" />
<Delete Files="../../artifacts/tgs.ico;../../artifacts/tgs.png" />
</Target>
<Target Name="IconNodeCleanup" AfterTargets="IconGeneration;IconClean">
<RemoveDir Directories="node_modules" />
<Delete Files="package.json;yarn.lock;logo_bg_white.svg;yarn-error.log" />
</Target>
</Project>
-48
View File
@@ -1,48 +0,0 @@
// Prereq packages: svg-to-ico@1.0.14 svg2img@1.0.0-beta.2
// Usage: node ./build_logo.js
// Generates ../../artifacts/tgs.ico and ../../artifacts/tgs.ico
const svg_to_img = require("svg-to-ico");
const svg2img = require('svg2img');
const fs = require('fs');
const { exit } = require("process");
if (!fs.existsSync("../../artifacts")) {
fs.mkdirSync("../../artifacts",'0777', true);
}
const svg_bytes = fs.readFileSync("../../build/logo.svg");
const svg = svg_bytes.toString();
const white_bg_svg = svg
.replace("<!-- DO NOT CHANGE THIS LINE, UNCOMMENTING IT ENABLES THE WHITE BACKGROUND FOR THE .ICO--><!--", "")
.replace("SCRIPT_REPLACE_TOKEN", "");
fs.writeFileSync("logo_white_bg.svg", white_bg_svg);
svg_to_img({
input_name: "logo_white_bg.svg",
output_name: "../../artifacts/tgs.ico",
sizes: [ 160 ]
}).then(() => {
fs.unlinkSync("logo_white_bg.svg");
svg2img(
"../../build/logo.svg",
{
resvg: {
fitTo: {
mode: 'width', // or height
value: 64,
}
}
},
function(error, buffer) {
if(error) {
console.error(`PNG conversion failed: ${error}`);
exit(2);
}
fs.writeFileSync("../../artifacts/tgs.png", buffer);
});
}).catch((error) => {
fs.unlinkSync("logo_white_bg.svg");
console.error(`ICO conversion failed: ${error}`);
exit(1);
});
@@ -320,7 +320,7 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
Optional<IEmbedAuthor> author = new EmbedAuthor(assemblyInformationProvider.VersionPrefix)
{
Url = "https://github.com/tgstation/tgstation-server",
IconUrl = "https://cdn.discordapp.com/attachments/1114451486374637629/1151650846019432448/tgs.png",
IconUrl = "https://cdn.discordapp.com/attachments/1114451486374637629/1151650846019432448/tgs.png", // 404's in browsers but works in Discord
};
var embed = new Embed
{
+19 -1
View File
@@ -176,8 +176,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicOperation", "BasicOper
tests\DMAPI\BasicOperation\basic operation_test.dme = tests\DMAPI\BasicOperation\basic operation_test.dme
tests\DMAPI\BasicOperation\Config.dm = tests\DMAPI\BasicOperation\Config.dm
tests\DMAPI\BasicOperation\Test.dm = tests\DMAPI\BasicOperation\Test.dm
tests\DMAPI\BasicOperation\test_event-qwer.sh = tests\DMAPI\BasicOperation\test_event-qwer.sh
tests\DMAPI\BasicOperation\test_event-qwer.bat = tests\DMAPI\BasicOperation\test_event-qwer.bat
tests\DMAPI\BasicOperation\test_event-qwer.sh = tests\DMAPI\BasicOperation\test_event-qwer.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildFail", "BuildFail", "{103C61AB-67D6-46FE-AA47-CC633B88EE0F}"
@@ -204,6 +204,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Host.Common", "src\Tgstation.Server.Host.Common\Tgstation.Server.Host.Common.csproj", "{CF3968A0-EA81-4464-B2D4-C7D40F6B5BCB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Common", "src\Tgstation.Server.Common\Tgstation.Server.Common.csproj", "{70CD9A98-D31A-44A4-81D1-D02764CEEEFD}"
ProjectSection(ProjectDependencies) = postProject
{7F7FCFDF-271D-45C2-830C-BCCB19C57077} = {7F7FCFDF-271D-45C2-830C-BCCB19C57077}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{2648A85F-61AE-428E-95E1-66D06C7A3768}"
ProjectSection(SolutionItems) = preProject
@@ -258,6 +261,8 @@ Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "Tgstation.Server.Host.Servi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.ReleaseNotes", "tools\Tgstation.Server.ReleaseNotes\Tgstation.Server.ReleaseNotes.csproj", "{69944039-65C2-40E1-9D86-0608FA0C2D70}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tgstation.Server.LogoGenerator", "tools\Tgstation.Server.LogoGenerator\Tgstation.Server.LogoGenerator.csproj", "{7F7FCFDF-271D-45C2-830C-BCCB19C57077}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -516,6 +521,18 @@ Global
{69944039-65C2-40E1-9D86-0608FA0C2D70}.ReleaseNoWindows|Any CPU.Build.0 = Release|Any CPU
{69944039-65C2-40E1-9D86-0608FA0C2D70}.ReleaseNoWix|Any CPU.ActiveCfg = Release|Any CPU
{69944039-65C2-40E1-9D86-0608FA0C2D70}.ReleaseNoWix|Any CPU.Build.0 = Release|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.DebugNoWindows|Any CPU.ActiveCfg = Debug|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.DebugNoWindows|Any CPU.Build.0 = Debug|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.DebugNoWix|Any CPU.ActiveCfg = Debug|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.DebugNoWix|Any CPU.Build.0 = Debug|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.Release|Any CPU.Build.0 = Release|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.ReleaseNoWindows|Any CPU.ActiveCfg = Release|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.ReleaseNoWindows|Any CPU.Build.0 = Release|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.ReleaseNoWix|Any CPU.ActiveCfg = Release|Any CPU
{7F7FCFDF-271D-45C2-830C-BCCB19C57077}.ReleaseNoWix|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -553,6 +570,7 @@ Global
{82996E9D-5E63-4CC5-8179-612C71B4F56C} = {506B9092-AF88-4DA2-84FD-C11646B695B0}
{9E66C6F1-E235-4979-83B5-C2B3FDAD6E01} = {506B9092-AF88-4DA2-84FD-C11646B695B0}
{69944039-65C2-40E1-9D86-0608FA0C2D70} = {A55C1117-5808-4AB2-BEA6-4D4A3E66A2F2}
{7F7FCFDF-271D-45C2-830C-BCCB19C57077} = {A55C1117-5808-4AB2-BEA6-4D4A3E66A2F2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DFD36C95-3E49-41C7-ACDB-86BAF5B18A79}
@@ -0,0 +1,34 @@
// Simplest app 2024
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Text;
using Svg;
var svgContents = await File.ReadAllTextAsync("build/logo.svg");
var whiteBgSvgContents = svgContents
.Replace("<!-- DO NOT CHANGE THIS LINE, UNCOMMENTING IT ENABLES THE WHITE BACKGROUND FOR THE .ICO--><!--", String.Empty)
.Replace("SCRIPT_REPLACE_TOKEN", String.Empty);
await using var pngMs =
new MemoryStream(
Encoding.UTF8.GetBytes(svgContents));
await using var icoMs =
new MemoryStream(
Encoding.UTF8.GetBytes(whiteBgSvgContents));
var svg = SvgDocument.Open<SvgDocument>(pngMs);
var whiteBgSvg = SvgDocument.Open<SvgDocument>(icoMs);
using var bitmap = svg.Draw(128, 128);
using var whiteBgBitmap = whiteBgSvg.Draw(160, 160);
using var icon = Icon.FromHandle(whiteBgBitmap.GetHicon());
Directory.CreateDirectory("artifacts");
await using var iconStream = new FileStream("artifacts/tgs.ico", FileMode.Create);
bitmap.Save("artifacts/tgs.png", ImageFormat.Png);
icon.Save(iconStream);
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../build/Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Svg" Version="3.4.7" />
</ItemGroup>
</Project>
@@ -809,7 +809,7 @@ namespace Tgstation.Server.ReleaseNotes
var versionsPropertyGroup = project.Elements().First(x => x.Name == xmlNamespace + "PropertyGroup");
var coreVersion = Version.Parse(versionsPropertyGroup.Element(xmlNamespace + "TgsCoreVersion").Value);
const string BodyForPRSha = "bec143988b4b8ddeb586ed97aaf0647803110d98";
const string BodyForPRSha = "b64a9a24ec6b13c819b47304625a88864c3872e0";
var prBody = $@"# Automated Pull Request
This pull request was generated by our [deployment pipeline]({actionUrl}) as a result of the release of [tgstation-server-v{coreVersion}](https://github.com/tgstation/tgstation-server/releases/tag/tgstation-server-v{coreVersion}). Validation was performed as part of the process.
@@ -817,10 +817,12 @@ This pull request was generated by our [deployment pipeline]({actionUrl}) as a r
The user account that created this pull request is available to correct any issues.
- [x] Have you signed the [Contributor License Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs)?
- [x] Is there a linked Issue?
- Shouldn't be possible as this release was just created.
- [x] Have you checked that there aren't other open [pull requests](https://github.com/microsoft/winget-pkgs/pulls) for the same manifest update/change?
- This PR is generated as a direct result of a new release of `tgstation-server` this should be impossible
- [x] This PR only modifies one (1) manifest
- [x] Have you [validated](https://github.com/microsoft/winget-pkgs/blob/master/AUTHORING_MANIFESTS.md#validation) your manifest locally with `winget validate --manifest <path>`?
- [x] Have you [validated](https://github.com/microsoft/winget-pkgs/blob/master/doc/Authoring.md#validation) your manifest locally with `winget validate --manifest <path>`?
- Validation is performed as a prerequisite to deployment.
- [x] Have you tested your manifest locally with `winget install --manifest <path>`?
- Manifest installation and uninstallation is performed as a prerequisite to deployment.