From 73968651389515f1cc56e5e3b90b2403e2cbdff8 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 20 Jul 2023 00:26:14 -0400 Subject: [PATCH 1/6] Update bundled dotnet version to 6.0.20 --- build/Version.props | 2 +- .../Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs | 6 +++--- .../Tgstation.Server.Host.Service.Wix.Bundle.wixproj | 6 +++--- build/package/winget/prepare_installer_input_artifacts.ps1 | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/Version.props b/build/Version.props index 08a427b4de..fd0d736472 100644 --- a/build/Version.props +++ b/build/Version.props @@ -18,6 +18,6 @@ netstandard2.0 - https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.19/dotnet-hosting-6.0.19-win.exe + https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.20/dotnet-hosting-6.0.20-win.exe diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs index 62a558e1f1..2213c5ab0a 100644 --- a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs @@ -3,10 +3,10 @@ - + - + @@ -14,7 +14,7 @@ - + diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj index ab59841b93..f36ff5c638 100644 --- a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj @@ -1,7 +1,7 @@ - ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);AspNetRedistUrl=$(TgsRedistUrl) + ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl) Bundle x86 tgstation-server-installer @@ -13,11 +13,11 @@ - + - + diff --git a/build/package/winget/prepare_installer_input_artifacts.ps1 b/build/package/winget/prepare_installer_input_artifacts.ps1 index df88aca955..7a264a180e 100644 --- a/build/package/winget/prepare_installer_input_artifacts.ps1 +++ b/build/package/winget/prepare_installer_input_artifacts.ps1 @@ -12,7 +12,7 @@ try Remove-Item -Recurse -Force build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/obj -ErrorAction SilentlyContinue [XML]$versionXML = Get-Content build/Version.props -ErrorAction Stop - $redistUrl = $versionXML.Project.PropertyGroup.TgsRedistUrl + $redistUrl = $versionXML.Project.PropertyGroup.TgsDotnetRedistUrl mkdir artifacts $previousProgressPreference = $ProgressPreference From 26123c4dfd3c55a81aa80dd0b4e6790268cc4c16 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 20 Jul 2023 00:29:03 -0400 Subject: [PATCH 2/6] Nuget package updates --- build/TestCommon.props | 4 ++-- .../.config/dotnet-tools.json | 2 +- .../Tgstation.Server.Host.csproj | 18 +++++++++--------- .../Tgstation.Server.ReleaseNotes.csproj | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build/TestCommon.props b/build/TestCommon.props index 50ad972952..e0485b3a76 100644 --- a/build/TestCommon.props +++ b/build/TestCommon.props @@ -12,8 +12,8 @@ - - + + diff --git a/src/Tgstation.Server.Host/.config/dotnet-tools.json b/src/Tgstation.Server.Host/.config/dotnet-tools.json index 9c9e626a64..eef9b429ca 100644 --- a/src/Tgstation.Server.Host/.config/dotnet-tools.json +++ b/src/Tgstation.Server.Host/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "7.0.7", + "version": "7.0.9", "commands": [ "dotnet-ef" ] diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index bb3e366c21..8541d4df2a 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -70,19 +70,19 @@ - + - + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive - + - + @@ -90,7 +90,7 @@ - + @@ -114,11 +114,11 @@ - + - + diff --git a/tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj b/tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj index 02af17a6a7..e22cd8987f 100644 --- a/tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj +++ b/tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj @@ -7,7 +7,7 @@ - + From 25651e37ba18fd79a55cbd7c6982cefd8f03116c Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 20 Jul 2023 02:38:49 -0400 Subject: [PATCH 3/6] Add MariaDB to installer. Adjust SetupWizard to support it Closes #1603 --- build/Version.props | 6 +- .../Bundle.wxs | 8 +- ...ion.Server.Host.Service.Wix.Bundle.wixproj | 6 +- .../Theme.wxl | 70 ++++++++++++++ .../Theme.xml | 95 +++++++++++++++++++ .../Package.wxs | 4 +- .../prepare_installer_input_artifacts.ps1 | 2 + .../Configuration/InternalConfiguration.cs | 5 + .../Setup/SetupWizard.cs | 47 +++++++-- 9 files changed, 227 insertions(+), 16 deletions(-) create mode 100644 build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.wxl create mode 100644 build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.xml diff --git a/build/Version.props b/build/Version.props index fd0d736472..4f3b87ee93 100644 --- a/build/Version.props +++ b/build/Version.props @@ -14,10 +14,10 @@ 1.3.0 1.2.1 1.0.2 - 6 netstandard2.0 + 6 - - https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.20/dotnet-hosting-6.0.20-win.exe + https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.20/dotnet-hosting-6.0.20-win.exe + https://ftp.osuosl.org/pub/mariadb/mariadb-11.0.2/winx64-packages/mariadb-11.0.2-winx64.msi diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs index 2213c5ab0a..c316226284 100644 --- a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Bundle.wxs @@ -1,7 +1,7 @@ - + @@ -13,11 +13,11 @@ - - - + + + diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj index f36ff5c638..1858d41c47 100644 --- a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj @@ -1,7 +1,7 @@ - ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl) + ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=$(TgsMariaDBRedistUrl) Bundle x86 tgstation-server-installer @@ -19,6 +19,10 @@ + + + + diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.wxl b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.wxl new file mode 100644 index 0000000000..69dcacccdd --- /dev/null +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.wxl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.xml b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.xml new file mode 100644 index 0000000000..d6bd65e5c5 --- /dev/null +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Theme.xml @@ -0,0 +1,95 @@ + + + + Segoe UI + Segoe UI + Segoe UI + Segoe UI + + + + + + + + + + + + + + #(loc.InstallLicenseLinkText) + #(loc.MariaDBCheckbox) + #(loc.InstallAcceptCheckbox) + + + + + + + + + + + + + + + + + + + + + + + + + + + + #(loc.FailureHyperlinkLogText) + + + + + + + diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix/Package.wxs b/build/package/winget/Tgstation.Server.Host.Service.Wix/Package.wxs index e136a27cd9..b546febbe3 100644 --- a/build/package/winget/Tgstation.Server.Host.Service.Wix/Package.wxs +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix/Package.wxs @@ -8,6 +8,7 @@ + @@ -15,7 +16,8 @@ - + + diff --git a/build/package/winget/prepare_installer_input_artifacts.ps1 b/build/package/winget/prepare_installer_input_artifacts.ps1 index 7a264a180e..ab075c6e3c 100644 --- a/build/package/winget/prepare_installer_input_artifacts.ps1 +++ b/build/package/winget/prepare_installer_input_artifacts.ps1 @@ -13,6 +13,7 @@ try [XML]$versionXML = Get-Content build/Version.props -ErrorAction Stop $redistUrl = $versionXML.Project.PropertyGroup.TgsDotnetRedistUrl + $dbRedistUrl = $versionXML.Project.PropertyGroup.TgsMariaDBRedistUrl mkdir artifacts $previousProgressPreference = $ProgressPreference @@ -20,6 +21,7 @@ try try { Invoke-WebRequest -Uri $redistUrl -OutFile artifacts/hosting-bundle.exe + Invoke-WebRequest -Uri $dbRedistUrl -OutFile artifacts/mariadb.msi } finally { $ProgressPreference = $previousProgressPreference } diff --git a/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs b/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs index 0d54f24d73..0ed1730c9c 100644 --- a/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs @@ -24,5 +24,10 @@ /// The base path for the app settings configuration files. /// public string AppSettingsBasePath { get; set; } + + /// + /// Coerce the to select . + /// + public bool MariaDBSetup { get; set; } } } diff --git a/src/Tgstation.Server.Host/Setup/SetupWizard.cs b/src/Tgstation.Server.Host/Setup/SetupWizard.cs index d83aeeb11c..9309b7a891 100644 --- a/src/Tgstation.Server.Host/Setup/SetupWizard.cs +++ b/src/Tgstation.Server.Host/Setup/SetupWizard.cs @@ -362,6 +362,12 @@ namespace Tgstation.Server.Host.Setup { if (firstTime) { + if (internalConfiguration.MariaDBSetup) + { + await console.WriteAsync("It looks like you just installed MariaDB. Selecting it as the database type.", true, cancellationToken); + return DatabaseType.MariaDB; + } + await console.WriteAsync(String.Empty, true, cancellationToken); await console.WriteAsync( "NOTE: If you are serious about hosting public servers, it is HIGHLY reccommended that TGS runs on a database *OTHER THAN* Sqlite.", @@ -413,19 +419,30 @@ namespace Tgstation.Server.Host.Setup { DatabaseType = await PromptDatabaseType(firstTime, cancellationToken), }; - firstTime = false; string serverAddress = null; ushort? serverPort = null; - bool isSqliteDB = databaseConfiguration.DatabaseType == DatabaseType.Sqlite; + var definitelyLocalMariaDB = firstTime && internalConfiguration.MariaDBSetup; + var isSqliteDB = databaseConfiguration.DatabaseType == DatabaseType.Sqlite; IPHostEntry serverAddressEntry = null; if (!isSqliteDB) do { await console.WriteAsync(null, true, cancellationToken); - await console.WriteAsync("Enter the server's address and port [: or ] (blank for local): ", false, cancellationToken); - serverAddress = await console.ReadLineAsync(false, cancellationToken); + if (definitelyLocalMariaDB) + { + await console.WriteAsync("Enter the server's port (blank for 3306): ", false, cancellationToken); + var enteredPort = await console.ReadLineAsync(false, cancellationToken); + if (!String.IsNullOrWhiteSpace(enteredPort) && enteredPort.Trim() != "3306") + serverAddress = $"localhost:{enteredPort}"; + } + else + { + await console.WriteAsync("Enter the server's address and port [: or ] (blank for local): ", false, cancellationToken); + serverAddress = await console.ReadLineAsync(false, cancellationToken); + } + if (String.IsNullOrWhiteSpace(serverAddress)) serverAddress = null; else if (databaseConfiguration.DatabaseType == DatabaseType.SqlServer) @@ -463,7 +480,7 @@ namespace Tgstation.Server.Host.Setup while (true); await console.WriteAsync(null, true, cancellationToken); - await console.WriteAsync($"Enter the database {(isSqliteDB ? "file path" : "name")} (Can be from previous installation. Otherwise, should not exist): ", false, cancellationToken); + await console.WriteAsync($"Enter the database {(isSqliteDB ? "file path" : "name")} ({(definitelyLocalMariaDB ? "leave blank for \"tgs\")" : "Can be from previous installation. Otherwise, should not exist")}): ", false, cancellationToken); string databaseName; bool dbExists = false; @@ -484,6 +501,8 @@ namespace Tgstation.Server.Host.Setup null, cancellationToken); } + else if (definitelyLocalMariaDB) + databaseName = "tgs"; if (String.IsNullOrWhiteSpace(databaseName)) await console.WriteAsync("Invalid database name!", true, cancellationToken); @@ -510,8 +529,17 @@ namespace Tgstation.Server.Host.Setup if (!isSqliteDB) if (!useWinAuth) { - await console.WriteAsync("Enter username: ", false, cancellationToken); - username = await console.ReadLineAsync(false, cancellationToken); + if (definitelyLocalMariaDB) + { + await console.WriteAsync("Using username: root", true, cancellationToken); + username = "root"; + } + else + { + await console.WriteAsync("Enter username: ", false, cancellationToken); + username = await console.ReadLineAsync(false, cancellationToken); + } + await console.WriteAsync("Enter password: ", false, cancellationToken); password = await console.ReadLineAsync(true, cancellationToken); } @@ -625,6 +653,11 @@ namespace Tgstation.Server.Host.Setup await console.WriteAsync(e.Message, true, cancellationToken); await console.WriteAsync(null, true, cancellationToken); await console.WriteAsync("Retrying database configuration...", true, cancellationToken); + + if (definitelyLocalMariaDB) + await console.WriteAsync("No longer assuming MariaDB is the target.", true, cancellationToken); + + firstTime = false; } } while (true); From aaffea8a899673f588c41d0374da3cefcead41e8 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 20 Jul 2023 02:39:28 -0400 Subject: [PATCH 4/6] Version bump to 5.14.0 --- build/Version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Version.props b/build/Version.props index 4f3b87ee93..d3a0d35466 100644 --- a/build/Version.props +++ b/build/Version.props @@ -3,7 +3,7 @@ - 5.13.3 + 5.14.0 4.7.1 9.11.0 6.0.0 From 4e17fe61735e1c38b3fc50091643d2a6fa3413dc Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 20 Jul 2023 02:42:08 -0400 Subject: [PATCH 5/6] Remove README.md note about V3 --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 400b07832e..247da90e4a 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,6 @@ This is a toolset to manage production BYOND servers. It includes the ability to update the server without having to stop or shutdown the server (the update will take effect on a "reboot" of the server), the ability to start the server and restart it if it crashes, as well as systems for managing code and game files, and locally merging GitHub Pull Requests for test deployments. -### Legacy Servers - -Older server versions can be found in the V# branches of this repository. Note that the current server fully incompatible with installations before version 4. Only some static files may be copied over: https://github.com/tgstation/tgstation-server#static-files - ## Setup ### Pre-Requisites From 8d0e32a8021e21439b81a449eed832d046944908 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 20 Jul 2023 02:44:23 -0400 Subject: [PATCH 6/6] README.md notes about bundled MariaDB --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 247da90e4a..57cefc4363 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ This is a toolset to manage production BYOND servers. It includes the ability to ### Pre-Requisites +_Note: If you opt to use the Windows installer, all pre-requisites (including MariaDB) are provided out of the box._ + tgstation-server needs a relational database to store it's data. If you're just a hobbyist server host, you can probably get away with using SQLite for this. SQLite is bundled with TGS and simply requires you to specify where on your machine you want to store the data. @@ -46,7 +48,7 @@ Note that the Windows Service and installer executables require administrative p [Download the latest release's tgstation-server-installer.exe](https://github.com/tgstation/tgstation-server/releases/latest). Executing it will take you through the process of installing and configuring your server. The required dotnet runtime may be installed as a pre-requisite. -Note: If you use the `/silent` or `/passive` arguments to the installer, you will need to either pre-configure TGS or configure and start the `tgstation-server` service after installing. A shortcut will be placed on your desktop and in your start menu to assist with this. +Note: If you use the `/silent` or `/passive` arguments to the installer, you will not be able to install MariaDB using it. In addition, if those arguments are present, you'll need to either pre-configure TGS or configure and start the `tgstation-server` service after installing. A shortcut will be placed on your desktop and in your start menu to assist with this. ##### winget (Windows 10 or later) @@ -75,7 +77,7 @@ Once winget is installed, simply run the following commands, accepting any promp winget install tgstation-server ``` -The required dotnet runtime may be installed as a pre-requisite. +The required dotnet runtime may be installed as a pre-requisite. MariaDB will not be installed. Note: If you use the `-h` or `--disable-interactivity` winget arguments, you will need to either pre-configure TGS or configure and start the `tgstation-server` service after installing. A shortcut will be placed on your desktop and in your start menu to assist with this.