diff --git a/README.md b/README.md index 400b07832e..57cefc4363 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,12 @@ 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 +_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. @@ -50,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) @@ -79,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. 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/build/Version.props b/build/Version.props index 08a427b4de..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 @@ -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.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 + 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 62a558e1f1..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,23 +1,23 @@ - + - + - + - - - + + + 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..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);AspNetRedistUrl=$(TgsRedistUrl) + ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=$(TgsMariaDBRedistUrl) Bundle x86 tgstation-server-installer @@ -13,12 +13,16 @@ - + - + + + + + 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 df88aca955..ab075c6e3c 100644 --- a/build/package/winget/prepare_installer_input_artifacts.ps1 +++ b/build/package/winget/prepare_installer_input_artifacts.ps1 @@ -12,7 +12,8 @@ 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 + $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/.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/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); 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 @@ - +