mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
Deploy code docs to GitHub Pages for workflow run 2907
Commit: c54fbb665d
This commit is contained in:
@@ -95,7 +95,7 @@ $(function() {
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span>[assembly: System.Reflection.AssemblyCopyrightAttribute(<span class="stringliteral">"Copyright (c) Jordan Brown 2018"</span>)]</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span>[assembly: System.Reflection.AssemblyDescriptionAttribute(<span class="stringliteral">"Common functions for tgstation-server."</span>)]</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span>[assembly: System.Reflection.AssemblyFileVersionAttribute(<span class="stringliteral">"7.0.0.0"</span>)]</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span>[assembly: System.Reflection.AssemblyInformationalVersionAttribute(<span class="stringliteral">"7.0.0+ce67c948cac3b2636dad3e434b892ce103b9afe6"</span>)]</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span>[assembly: System.Reflection.AssemblyInformationalVersionAttribute(<span class="stringliteral">"7.0.0+c54fbb665d480742b238d17dd95e4931e3ca426b"</span>)]</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span>[assembly: System.Reflection.AssemblyProductAttribute(<span class="stringliteral">"Tgstation.Server.Common"</span>)]</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span>[assembly: System.Reflection.AssemblyTitleAttribute(<span class="stringliteral">"Tgstation.Server.Common"</span>)]</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span>[assembly: System.Reflection.AssemblyVersionAttribute(<span class="stringliteral">"7.0.0.0"</span>)]</div>
|
||||
|
||||
@@ -93,7 +93,7 @@ $(function() {
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span>[assembly: System.Reflection.AssemblyCompanyAttribute(<span class="stringliteral">"Tgstation.Server.Shared"</span>)]</div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span>[assembly: System.Reflection.AssemblyConfigurationAttribute(<span class="stringliteral">"Release"</span>)]</div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span>[assembly: System.Reflection.AssemblyFileVersionAttribute(<span class="stringliteral">"6.7.0.0"</span>)]</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span>[assembly: System.Reflection.AssemblyInformationalVersionAttribute(<span class="stringliteral">"6.7.0+ce67c948cac3b2636dad3e434b892ce103b9afe6"</span>)]</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span>[assembly: System.Reflection.AssemblyInformationalVersionAttribute(<span class="stringliteral">"6.7.0+c54fbb665d480742b238d17dd95e4931e3ca426b"</span>)]</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span>[assembly: System.Reflection.AssemblyProductAttribute(<span class="stringliteral">"Tgstation.Server.Shared"</span>)]</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span>[assembly: System.Reflection.AssemblyTitleAttribute(<span class="stringliteral">"Tgstation.Server.Shared"</span>)]</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span>[assembly: System.Reflection.AssemblyVersionAttribute(<span class="stringliteral">"6.7.0.0"</span>)]</div>
|
||||
|
||||
+99
-104
@@ -74,14 +74,18 @@ $(function() {
|
||||
<div class="headertitle"><div class="title">tgstation-server </div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock"><p ><a class="anchor" id="md_README"></a> <img src="https://github.com/tgstation/tgstation-server/workflows/CI%20Pipeline/badge.svg" alt="CI Pipeline" style="pointer-events: none;" class="inline"/> <a href="https://codecov.io/gh/tgstation/tgstation-server"><img src="https://codecov.io/gh/tgstation/tgstation-server/branch/master/graph/badge.svg" alt="codecov" style="pointer-events: none;" class="inline"/></a></p>
|
||||
<div class="textblock"><p align="center"><a class="anchor" id="md_README"></a> </p>
|
||||
<p ><img src="./build/logo.svg" alt="" style="pointer-events: none;" class="inline"/> </p>
|
||||
<h1><a class="anchor" id="autotoc_md0"></a>
|
||||
tgstation-server</h1>
|
||||
<p ><img src="https://github.com/tgstation/tgstation-server/workflows/CI%20Pipeline/badge.svg" alt="CI Pipeline" style="pointer-events: none;" class="inline"/> <a href="https://codecov.io/gh/tgstation/tgstation-server"><img src="https://codecov.io/gh/tgstation/tgstation-server/branch/master/graph/badge.svg" alt="codecov" style="pointer-events: none;" class="inline"/></a></p>
|
||||
<p >[<img src="https://img.shields.io/github/license/tgstation/tgstation-server.svg" alt="GitHub license" style="pointer-events: none;" class="inline"/>](LICENSE) <a href="http://isitmaintained.com/project/tgstation/tgstation-server" title="Average time to resolve an issue"><img src="http://isitmaintained.com/badge/resolution/tgstation/tgstation-server.svg" alt="Average time to resolve an issue" style="pointer-events: none;" class="inline"/></a> <a href="https://www.nuget.org/packages/Tgstation.Server.Api"><img src="https://img.shields.io/nuget/v/Tgstation.Server.Api.svg" alt="NuGet version" style="pointer-events: none;" class="inline"/></a> <a href="https://www.nuget.org/packages/Tgstation.Server.Client"><img src="https://img.shields.io/nuget/v/Tgstation.Server.Client.svg" alt="NuGet version" style="pointer-events: none;" class="inline"/></a></p>
|
||||
<p ><a href="http://forthebadge.com"><img src="http://forthebadge.com/images/badges/made-with-c-sharp.svg" alt="forthebadge" style="pointer-events: none;" class="inline"/></a> <a href="https://www.reddit.com/r/SS13/comments/5oplxp/what_is_the_main_problem_with_byond_as_an_engine/dclbu1a"><img src="https://user-images.githubusercontent.com/5211576/29499758-4efff304-85e6-11e7-8267-62919c3688a9.gif" alt="forinfinityandbyond" class="inline"/></a> <a href="http://forthebadge.com"><img src="http://forthebadge.com/images/badges/built-with-love.svg" alt="forthebadge" style="pointer-events: none;" class="inline"/></a></p>
|
||||
<p >This is a toolset to manage production DreamMaker 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.</p>
|
||||
<h1><a class="anchor" id="autotoc_md1"></a>
|
||||
Setup</h1>
|
||||
<h2><a class="anchor" id="autotoc_md2"></a>
|
||||
Pre-Requisites</h2>
|
||||
<h2><a class="anchor" id="autotoc_md1"></a>
|
||||
Setup</h2>
|
||||
<h3><a class="anchor" id="autotoc_md2"></a>
|
||||
Pre-Requisites</h3>
|
||||
<p ><em>Note: If you opt to use the Windows installer, most pre-requisites for running BYOND servers (including MariaDB) are provided out of the box.</em></p>
|
||||
<p ><em>If you are running on a Windows Server OS. You <b>might</b> need to install the <a href="https://aka.ms/vs/17/release/vc_redist.x86.exe">x86 Visual C++ 2015 Runtime</a> to run BYOND.</em></p>
|
||||
<p ><em>If you wish to use OpenDream you will need to install the required dotnet SDK manually.</em></p>
|
||||
@@ -100,19 +104,17 @@ Pre-Requisites</h2>
|
||||
<li>No pre-existing database WITH schema creation permissions. or</li>
|
||||
<li>Exclusive access to a database schema that TGS has full control over.</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" id="autotoc_md3"></a>
|
||||
Installation</h2>
|
||||
<h3><a class="anchor" id="autotoc_md3"></a>
|
||||
Installation</h3>
|
||||
<p >Follow the instructions for your OS below.</p>
|
||||
<h3><a class="anchor" id="autotoc_md4"></a>
|
||||
Windows</h3>
|
||||
<h5>Note about Digital Signatures</h5>
|
||||
<h4><a class="anchor" id="autotoc_md4"></a>
|
||||
Windows</h4>
|
||||
<h6>Note about Digital Signatures</h6>
|
||||
<p >Note that the Windows Service and installer executables require administrative privileges. These are digitally signed against the Root CA managed by <a href="https://github.com/Cyberboss">Jordan Dominion</a>. Consider installing the certificate into your <code>Trusted Root Authorities</code> store for cleaner UAC prompts. The certificate can be downloaded <a href="https://file.house/zpFb.cer">here</a>, please validate the thumbprint is <code>70176acf7ffa2898fa5b5cd6e38b43b38ea5d07f</code> before installing. The OCSP server for this is <code><a href="http://ocsp.dextraspace.net">http://ocsp.dextraspace.net</a></code>.</p>
|
||||
<h4><a class="anchor" id="autotoc_md5"></a>
|
||||
Installer</h4>
|
||||
<p ><a class="anchor" id="autotoc_md5"></a> </p><h5>Installer</h5>
|
||||
<p ><a href="https://github.com/tgstation/tgstation-server/releases/latest">Download the latest release's tgstation-server-installer.exe</a>. 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.</p>
|
||||
<p >Note: If you use the <code>/silent</code> or <code>/passive</code> 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 <code>tgstation-server</code> service after installing. A shortcut will be placed on your desktop and in your start menu to assist with this.</p>
|
||||
<h4><a class="anchor" id="autotoc_md6"></a>
|
||||
winget (Windows 10 or later)</h4>
|
||||
<p ><a class="anchor" id="autotoc_md6"></a> </p><h5>winget (Windows 10 or later)</h5>
|
||||
<p ><a href="https://github.com/microsoft/winget-cli">winget</a> installed is the easiest way to install the latest version of tgstation-server (provided Microsoft has approved the most recent package manifest).</p>
|
||||
<p >Check if you have <code>winget</code> by running the following command. </p><div class="fragment"><div class="line">winget --version</div>
|
||||
</div><!-- fragment --><p >If it returns an error that means you don't have winget. You can easily install it by running the following commands in an administrative Windows Powershell instance: </p><div class="fragment"><div class="line">Import-Module Appx</div>
|
||||
@@ -128,19 +130,17 @@ winget (Windows 10 or later)</h4>
|
||||
</div><!-- fragment --><p >The required dotnet runtime may be installed as a pre-requisite. MariaDB will not be installed.</p>
|
||||
<p >Note: If you use the <code>-h</code> or <code>--disable-interactivity</code> winget arguments, you will need to either pre-configure TGS or configure and start the <code>tgstation-server</code> service after installing. A shortcut will be placed on your desktop and in your start menu to assist with this.</p>
|
||||
<p >Note: The <code>winget</code> package is submitted to Microsoft for approval once TGS releases. This means the winget version may be out of date with the current release version. You can always use the TGS updater after installing. You can see the versions still awaiting approval <a href="https://github.com/microsoft/winget-pkgs/pulls?q=is%3Apr+is%3Aopen+Tgstation.Server">here</a>.</p>
|
||||
<h4><a class="anchor" id="autotoc_md7"></a>
|
||||
Manual</h4>
|
||||
<p ><a class="anchor" id="autotoc_md7"></a> </p><h5>Manual</h5>
|
||||
<p >If you don't have it installed already, download and install the <a href="https://dotnet.microsoft.com/download/dotnet/8.0">ASP .NET Core Runtime Hosting Bundle (>= v8.0)</a>. Ensure that the <code>dotnet</code> executable file is in your system's <code>PATH</code> variable (or that of the user's that will be running the server). You can test this by opening a command prompt and running <code>dotnet --list-runtimes</code>.</p>
|
||||
<p ><a href="https://github.com/tgstation/tgstation-server/releases/latest">Download the latest release .zip</a>. Typically, you want the <code>ServerService.zip</code> package in order to run TGS as a Windows service. Choose <code>ServerConsole.zip</code> if you prefer to use a command line daemon.</p>
|
||||
<p >Extract the .zip file to where you want the server to run from. Note the account running the server must have write, execute, and delete access to the <code>lib</code> subdirectory.</p>
|
||||
<p >If you wish to install the TGS as a service, run <code>Tgstation.Server.Host.Service.exe</code>. It should prompt you to install it. Click <code>Yes</code> and the setup wizard should run.</p>
|
||||
<p >Should you want a clean start, be sure to first uninstall the service by running <code>Tgstation.Server.Host.Service.exe -u</code> from the command line.</p>
|
||||
<p >If using the console version, run <code>./tgs.bat</code> in the root of the installation directory. Ctrl+C will close the server, terminating all live game instances.</p>
|
||||
<h3><a class="anchor" id="autotoc_md8"></a>
|
||||
Linux</h3>
|
||||
<h4><a class="anchor" id="autotoc_md8"></a>
|
||||
Linux</h4>
|
||||
<p >Installing natively is the recommended way to run tgstation-server on Linux.</p>
|
||||
<h4><a class="anchor" id="autotoc_md9"></a>
|
||||
Ubuntu/Debian Package</h4>
|
||||
<p ><a class="anchor" id="autotoc_md9"></a> </p><h5>Ubuntu/Debian Package</h5>
|
||||
<p >You first need to add the appropriate Microsoft package repository for your distribution</p>
|
||||
<p >Refer to the Microsoft website for steps for</p>
|
||||
<ul>
|
||||
@@ -161,8 +161,7 @@ Ubuntu/Debian Package</h4>
|
||||
<div class="line">&& sudo tgs-configure \</div>
|
||||
<div class="line">&& sudo systemctl start tgstation-server</div>
|
||||
</div><!-- fragment --><p >The service will execute as the newly created user: <code>tgstation-server</code>. You should, ideally, store your instances somewhere under <code>/home/tgstation-server</code>.</p>
|
||||
<h4><a class="anchor" id="autotoc_md10"></a>
|
||||
Manual Setup</h4>
|
||||
<p ><a class="anchor" id="autotoc_md10"></a> </p><h5>Manual Setup</h5>
|
||||
<p >The following dependencies are required.</p>
|
||||
<ul>
|
||||
<li>aspnetcore-runtime-8.0 (See Prerequisites under the <code>Ubuntu/Debian Package</code> section)</li>
|
||||
@@ -174,8 +173,7 @@ Manual Setup</h4>
|
||||
<p ><a href="https://github.com/tgstation/tgstation-server/releases/latest">Download the latest release .zip</a>. Choose <code>ServerConsole</code>.</p>
|
||||
<p >If you have SystemD installed, we recommend installing the service unit <a href="./build/tgstation-server.service">here</a>. It assumes TGS is installed into <code>/opt/tgstation-server</code>, it is executing as the user <code>tgstation-server</code>, and you will be using the console runner, but feel free to adjust it to your needs. Note that the server will need to have it's configuration file setup before running with SystemD.</p>
|
||||
<p >Alternatively, to launch the server in the current shell, run <code>./tgs.sh</code> in the root of the installation directory. The process will run in a blocking fashion. SIGQUIT will close the server, terminating all live game instances.</p>
|
||||
<h4><a class="anchor" id="autotoc_md11"></a>
|
||||
Docker</h4>
|
||||
<p ><a class="anchor" id="autotoc_md11"></a> </p><h5>Docker</h5>
|
||||
<p >tgstation-server supports running in a docker container. The official image repository is located at <a href="https://hub.docker.com/r/tgstation/server">https://hub.docker.com/r/tgstation/server</a>. It can also be built locally by running <code>docker build . -f build/Dockerfile -t <your tag name></code> in the repository root.</p>
|
||||
<p >To create a container run </p><div class="fragment"><div class="line">docker run \</div>
|
||||
<div class="line"> -ti \ # Start with interactive terminal the first time to run the setup wizard</div>
|
||||
@@ -199,8 +197,8 @@ Docker</h4>
|
||||
<p >Note that this container is meant to be long running. Updates are handled internally as opposed to at the container level.</p>
|
||||
<p >Note that automatic configuration reloading is currently not supported in the container. See #1143</p>
|
||||
<p >If using manual configuration, before starting your container make sure the aforementioned <code>appsettings.Production.yml</code> is setup properly. See below</p>
|
||||
<h3><a class="anchor" id="autotoc_md12"></a>
|
||||
OpenDream</h3>
|
||||
<h4><a class="anchor" id="autotoc_md12"></a>
|
||||
OpenDream</h4>
|
||||
<p >In order for TGS to use <a href="https://github.com/OpenDreamProject/OpenDream">OpenDream</a>, it requires the full .NET SDK to build whichever version your servers target. Whatever that is, it must be available using the <code>dotnet</code> command for whichever user runs TGS.</p>
|
||||
<p >OpenDream currently requires <a href="https://dotnet.microsoft.com/en-us/download/dotnet/8.0">.NET SDK 8.0</a> at the time of this writing. You must install this manually outside of TGS (i.e. using your package manager).</p>
|
||||
<details >
|
||||
@@ -220,12 +218,12 @@ OpenDream</h3>
|
||||
</ol>
|
||||
<p >You should now be able to run the <code>dotnet --list-sdks</code> command and see an entry for <code>7.0.XXX [/usr/share/dotnet/sdk]</code>. </p>
|
||||
</details>
|
||||
<h2><a class="anchor" id="autotoc_md13"></a>
|
||||
Configuring</h2>
|
||||
<h3><a class="anchor" id="autotoc_md13"></a>
|
||||
Configuring</h3>
|
||||
<p >The first time you run TGS you should be prompted with a configuration wizard which will guide you through setting up your <code>appsettings.Production.yml</code></p>
|
||||
<p >This wizard will, generally, run whenever the server is launched without detecting the config yml. Follow the instructions below to perform this process manually.</p>
|
||||
<h3><a class="anchor" id="autotoc_md14"></a>
|
||||
Configuration Methods</h3>
|
||||
<h4><a class="anchor" id="autotoc_md14"></a>
|
||||
Configuration Methods</h4>
|
||||
<p >There are 3 primary supported ways to configure TGS:</p>
|
||||
<ul>
|
||||
<li>Modify the <code>appsettings.Production.yml</code> file (Recommended).</li>
|
||||
@@ -233,8 +231,8 @@ Configuration Methods</h3>
|
||||
<li>Set command line arguments in the form <code>--Section:Subsection=value</code> or <code>--Section:ArraySubsection:0=value</code> for arrays.</li>
|
||||
</ul>
|
||||
<p >The latter two are not recommended as they cannot be dynamically changed at runtime. See more on ASP.NET core configuration <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0">here</a>.</p>
|
||||
<h3><a class="anchor" id="autotoc_md15"></a>
|
||||
Manual Configuration</h3>
|
||||
<h4><a class="anchor" id="autotoc_md15"></a>
|
||||
Manual Configuration</h4>
|
||||
<p >Create an <code>appsettings.Production.yml</code> file next to <code>appsettings.yml</code>. This will override the default settings in <code>appsettings.yml</code> with your production settings. There are a few keys meant to be changed by hosts. The configuration is only read after server statup. To reload it you must restart TGS. This can be done while your game servers are running by using the Administrative restart function (as opposed to an OS service restart). Note these are all case-sensitive:</p>
|
||||
<ul>
|
||||
<li><code>General:ConfigVersion</code>: Suppresses warnings about out of date config versions. You should change this after updating TGS to one with a new config version. The current version can be found on the releases page for your server version.</li>
|
||||
@@ -288,28 +286,28 @@ Manual Configuration</h3>
|
||||
<li>Keycloak</li>
|
||||
<li>InvisionCommunity</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" id="autotoc_md16"></a>
|
||||
Database Configuration</h2>
|
||||
<h3><a class="anchor" id="autotoc_md16"></a>
|
||||
Database Configuration</h3>
|
||||
<p >If using a MariaDB/MySQL server, our client library <a href="https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1-recommended-server-charset">recommends you set 'utf8mb4' as your default charset</a> disregard at your own risk.</p>
|
||||
<p >The user created for the application will need the privilege to create databases on the first run, do not create the database for it. Once the initial set of migrations is run, the create right may be revoked. The user should maintain DDL rights though for applying future migrations</p>
|
||||
<p >Note that the ratio of application installations to databases is 1:1. Do not attempt to share a database amongst multiple TGS installations.</p>
|
||||
<h2><a class="anchor" id="autotoc_md17"></a>
|
||||
Starting</h2>
|
||||
<h3><a class="anchor" id="autotoc_md17"></a>
|
||||
Starting</h3>
|
||||
<p >For the Windows service version start the <code>tgstation-server</code> service. If it fails to start, check the Windows event log under Windows/Application for entries from tgstation-server for errors.</p>
|
||||
<p >For the console version run <code>dotnet Tgstation.Server.Host.Console.dll</code> in the installation directory. The <code>tgs.bat</code> and <code>tgs.sh</code> shell scripts are shortcuts for this. If on Windows, you must do this as admin to give the server permission to install the required DirectX dependency for certain 512 BYOND versions as well as create symlinks.</p>
|
||||
<p >For the docker version run <code>docker start <your container name></code></p>
|
||||
<p >Test your server is running by visiting the local port in your browser. You should receive a 401 Unauthorized response (You may need to view the developer console). Otherwise an error page will be present.</p>
|
||||
<h2><a class="anchor" id="autotoc_md18"></a>
|
||||
Stopping</h2>
|
||||
<h3><a class="anchor" id="autotoc_md18"></a>
|
||||
Stopping</h3>
|
||||
<p >Normally stopping TGS will terminate DreamDaemon processes. If you need a graceful detach, send command <code>130</code> to the Windows service or signal <code>SIGUSR2</code> to the Linux dotnet process. Detaching with the Windows console runner is currently not officially supported.</p>
|
||||
<p >For the Windows service version stop the <code>tgstation-server</code> service.</p>
|
||||
<p >For the SystemD managed service, use <code>systemctl stop tgstation-server</code>. DO NOT USE <code>systemctl kill</code> as this can create orphaned processes while leaving TGS running.</p>
|
||||
<p >For the console version press <code>Ctrl+C</code> or send a SIGQUIT to the ORIGINAL dotnet process.</p>
|
||||
<p >For the docker version run <code>docker stop <your container name></code>.</p>
|
||||
<h2><a class="anchor" id="autotoc_md19"></a>
|
||||
Updating the Game</h2>
|
||||
<h1><a class="anchor" id="autotoc_md20"></a>
|
||||
Integrating</h1>
|
||||
<h3><a class="anchor" id="autotoc_md19"></a>
|
||||
Updating the Game</h3>
|
||||
<h2><a class="anchor" id="autotoc_md20"></a>
|
||||
Integrating</h2>
|
||||
<p >tgstation-server provides the DMAPI which can be be integrated into any BYOND codebase for heavily enhanced functionality. The integration process is a fairly simple set of code changes.</p>
|
||||
<ol type="1">
|
||||
<li>Copy the <a href="https://github.com/tgstation/tgstation-server/releases?q=dmapi&expanded=true">latest release of the DMAPI</a> anywhere in your code base. <code>tgs.dm</code> can be seperated from the <code>tgs</code> folder, but do not modify or move the contents of the <code>tgs</code> folder</li>
|
||||
@@ -317,8 +315,8 @@ Integrating</h1>
|
||||
<li>Follow the instructions in <code>tgs.dm</code> to integrate the API with your codebase.</li>
|
||||
</ol>
|
||||
<p >The DMAPI is fully backwards compatible and should function with any tgstation-server version to date. Updates can be performed in the same manner. Using the <code>TGS_EXTERNAL_CONFIGURATION</code> is recommended in order to make the process as easy as replacing <code>tgs.dm</code> and the <code>tgs</code> folder with a newer version</p>
|
||||
<h2><a class="anchor" id="autotoc_md21"></a>
|
||||
Example</h2>
|
||||
<h3><a class="anchor" id="autotoc_md21"></a>
|
||||
Example</h3>
|
||||
<p >Here is a bare minimum example project that implements the essential code changes for integrating the DMAPI</p>
|
||||
<p >Before <code>tgs.dm</code>: </p><div class="fragment"><div class="line">//Remember, every codebase is different, you probably have better methods for these defines than the ones given here</div>
|
||||
<div class="line">#define TGS_EXTERNAL_CONFIGURATION</div>
|
||||
@@ -354,15 +352,15 @@ Example</h2>
|
||||
<div class="line">/client/Del()</div>
|
||||
<div class="line"> ..()</div>
|
||||
<div class="line"> --global.client_count</div>
|
||||
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md22"></a>
|
||||
Remote Access</h2>
|
||||
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md22"></a>
|
||||
Remote Access</h3>
|
||||
<p >tgstation-server is an <a href="https://docs.microsoft.com/en-us/aspnet/core/">ASP.Net Core</a> app based on the Kestrel web server. This section is meant to serve as a general use case overview, but the entire Kestrel configuration can be modified to your liking with the configuration YAML. See <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel">the official documentation</a> for details.</p>
|
||||
<p >Exposing the builtin Kestrel server to the internet directly over HTTP is highly not reccommended due to the lack of security. The recommended way to expose tgstation-server to the internet is to host it through a reverse proxy with HTTPS support. Here are some step by step examples to achieve this for major web servers.</p>
|
||||
<p >System administrators will most likely have their own configuration plans, but here are some basic guides for beginners.</p>
|
||||
<p >Once complete, test that your configuration worked by visiting your proxy site from a browser on a different computer. You should receive a 401 Unauthorized response.</p>
|
||||
<p ><em>NOTE: Your reverse proxy setup may interfere with SSE (Server-Sent Events) which is used for real-time job updates. If you find this to be the case, please open an issue describing what you did to fix it as there may be a way for us to bypass the need for a workaround from our end.</em></p>
|
||||
<h3><a class="anchor" id="autotoc_md23"></a>
|
||||
IIS (Reccommended for Windows)</h3>
|
||||
<h4><a class="anchor" id="autotoc_md23"></a>
|
||||
IIS (Reccommended for Windows)</h4>
|
||||
<ol type="1">
|
||||
<li>Acquire an HTTPS certificate. The easiet free way for Windows is <a href="https://github.com/PKISharp/win-acme">win-acme</a> (requires you to set up the website first)</li>
|
||||
</ol>
|
||||
@@ -393,8 +391,8 @@ IIS (Reccommended for Windows)</h3>
|
||||
<ol type="1">
|
||||
<li>In the window that appears set the <code>Inbound Rules</code> textbox to the URL of your tgstation-server i.e. <code>localhost:5000</code>. Ensure <code>Enable SSL Offloading</code> is checked, then click <code>OK</code></li>
|
||||
</ol>
|
||||
<h3><a class="anchor" id="autotoc_md24"></a>
|
||||
Caddy (Reccommended for Linux, or those unfamilar with configuring NGINX or Apache)</h3>
|
||||
<h4><a class="anchor" id="autotoc_md24"></a>
|
||||
Caddy (Reccommended for Linux, or those unfamilar with configuring NGINX or Apache)</h4>
|
||||
<ol type="1">
|
||||
<li>Setup a basic website configuration. Instructions on how to do so are out of scope.</li>
|
||||
<li>In your Caddyfile, under a server entry, add the following (replace 5000 with the port TGS is hosted on): <div class="fragment"><div class="line">https://your.site.here {</div>
|
||||
@@ -404,8 +402,8 @@ Caddy (Reccommended for Linux, or those unfamilar with configuring NGINX or Apac
|
||||
<li>For this setup, your configuration's <code>ControlPanel:PublicPath</code> needs to be blank. If you have a path in <code>PublicPath</code>, it needs to be in "reverse_proxy PublicPathHere localhost:5000".</li>
|
||||
</ol>
|
||||
<p >See <a href="https://caddyserver.com/docs/caddyfile/directives/reverse_proxy">https://caddyserver.com/docs/caddyfile/directives/reverse_proxy</a></p>
|
||||
<h3><a class="anchor" id="autotoc_md25"></a>
|
||||
NGINX (Reccommended for Linux)</h3>
|
||||
<h4><a class="anchor" id="autotoc_md25"></a>
|
||||
NGINX (Reccommended for Linux)</h4>
|
||||
<ol type="1">
|
||||
<li>Setup a basic website configuration. Instructions on how to do so are out of scope.</li>
|
||||
<li>Acquire an HTTPS certificate, likely via Let's Encrypt, and configure NGINX to use it.</li>
|
||||
@@ -416,8 +414,8 @@ NGINX (Reccommended for Linux)</h3>
|
||||
</div><!-- fragment --></li>
|
||||
</ol>
|
||||
<p >See <a href="https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/">https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/</a></p>
|
||||
<h3><a class="anchor" id="autotoc_md26"></a>
|
||||
Apache</h3>
|
||||
<h4><a class="anchor" id="autotoc_md26"></a>
|
||||
Apache</h4>
|
||||
<ol type="1">
|
||||
<li>Ensure the <code>mod_proxy</code> extension is installed.</li>
|
||||
<li>Setup a basic website configuration. Instructions on how to do so are out of scope.</li>
|
||||
@@ -439,12 +437,12 @@ Apache</h3>
|
||||
<div class="line"> ProxyPassReverse / http://127.0.0.1:8080/</div>
|
||||
<div class="line"></VirtualHost></div>
|
||||
<div class="line"></IfModule></div>
|
||||
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md27"></a>
|
||||
Swarmed Servers</h2>
|
||||
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md27"></a>
|
||||
Swarmed Servers</h3>
|
||||
<p >Multiple tgstation-servers can be linked together in a swarm. The main benefit of this is allowing for users, groups, and permissions to be shared across the servers. Servers in a swarm must connect to the same database, use the same tgstation-server version, and have their own unique names.</p>
|
||||
<p >In a swarm, one server is designated the 'controller'. This is the server other 'node's in the swarm communicate with and coordinates group updates. Issuing an update command to one server in a swarm will update them all to the specified version.</p>
|
||||
<h3><a class="anchor" id="autotoc_md28"></a>
|
||||
Swarm Server Instances</h3>
|
||||
<h4><a class="anchor" id="autotoc_md28"></a>
|
||||
Swarm Server Instances</h4>
|
||||
<p >Instances can be either part of a swarm or not. Once in the database they cannot switch between these states. In order to brin a non-swarmed instance into a swarmed server or vice-versa follow these steps.</p>
|
||||
<ol type="1">
|
||||
<li>With the existing server, detach the instance.</li>
|
||||
@@ -455,54 +453,51 @@ Swarm Server Instances</h3>
|
||||
<ol type="1">
|
||||
<li>Reattach the instance after starting the server again.</li>
|
||||
</ol>
|
||||
<h1><a class="anchor" id="autotoc_md29"></a>
|
||||
Usage</h1>
|
||||
<h2><a class="anchor" id="autotoc_md29"></a>
|
||||
Usage</h2>
|
||||
<p >tgstation-server is controlled via a RESTful HTTP json API. Documentation on this API can be found <a href="https://tgstation.github.io/tgstation-server/api.html">here</a>. This section serves to document the concepts of the server. The API is versioned separately from the release version. A specification for it can be found in the api-vX.X.X git releases/tags.</p>
|
||||
<h2><a class="anchor" id="autotoc_md30"></a>
|
||||
Updating TGS</h2>
|
||||
<h3><a class="anchor" id="autotoc_md30"></a>
|
||||
Updating TGS</h3>
|
||||
<p >TGS can self update without stopping your DreamDaemon servers. Releases made to this repository are bound by a contract that allows changes of the runtime assemblies without stopping your servers. Database migrations are automatically applied as well. Reverting to lower versions works but only works so far back in time, do so at your own risk (check changes made to <code>/src/Tgstation.Server.Host/Models/Migrations</code>).</p>
|
||||
<p >Major version updates may require additional action on the part of the user (apart from the configuration changes).</p>
|
||||
<h3><a class="anchor" id="autotoc_md31"></a>
|
||||
Linux Notes</h3>
|
||||
<h4><a class="anchor" id="autotoc_md31"></a>
|
||||
Linux Notes</h4>
|
||||
<p >If TGS was installed via a package manager, using the TGS self updater will cause the version to change without notifying said package manager. This is not necessarily a problem if you're okay with the deviation.</p>
|
||||
<p >To avoid this, use the package manager to update TGS. It is just as seamless as the self-updater.</p>
|
||||
<h4><a class="anchor" id="autotoc_md32"></a>
|
||||
apt</h4>
|
||||
<p ><a class="anchor" id="autotoc_md32"></a> </p><h5>apt</h5>
|
||||
<div class="fragment"><div class="line">sudo apt update && sudo apt upgrade -y</div>
|
||||
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md33"></a>
|
||||
Notifications</h3>
|
||||
</div><!-- fragment --><h4><a class="anchor" id="autotoc_md33"></a>
|
||||
Notifications</h4>
|
||||
<p >If a server update is available, it will be indicated in the response from the GET /Administration endpoint and shown as a green exclamation mark in the webpanel navbar. For more active notifications, you can subscribe to <a href="https://github.com/tgstation/tgstation-server/discussions/1322">this GitHub discussion</a>.</p>
|
||||
<h2><a class="anchor" id="autotoc_md34"></a>
|
||||
Users</h2>
|
||||
<h3><a class="anchor" id="autotoc_md34"></a>
|
||||
Users</h3>
|
||||
<p >All actions apart from logging in must be taken by a user. TGS installs with one default user whose credentials can be found <a href="src/Tgstation.Server.Api/DefaultCredentials.cs">here</a>. It is recommended to disable this user ASAP as it is used to create Jobs that are started by the server itself. If access to all users is lost, the default user can be reset using the <code>Database:ResetAdminPassword</code> configuration setting.</p>
|
||||
<p >Users can be enabled/disabled and have a very granular set of rights associated to them that determine the actions they are allowed to take (i.e. Modify the user list or create instances). Users can be <em>database based</em> or <em>system based</em>. Database users are your standard web users with a username and password. System users, on the otherhand, are authenticated with the host OS. These users cannot have their password or names changed by TGS as they are managed by the system (and in reverse, login tokens don't expire when their password changes). The benefit to having these users is it allows the use of system ACLs for static file control. More on that later.</p>
|
||||
<h2><a class="anchor" id="autotoc_md35"></a>
|
||||
Instances</h2>
|
||||
<h3><a class="anchor" id="autotoc_md35"></a>
|
||||
Instances</h3>
|
||||
<p >A TGS deployment is made up with a set of instances, which each represent a production BYOND server. As many instances as desired can be created. Be aware, however, due to the nature of BYOND, this will quickly result in system resource exhaustion.</p>
|
||||
<p >An instance is stored in a single folder anywhere on a system and is made up of several components: The source code git repository, the BYOND installations, the compiler, the watchdog, chat bots, and static file management systems.</p>
|
||||
<h4><a class="anchor" id="autotoc_md36"></a>
|
||||
Instance Users</h4>
|
||||
<p ><a class="anchor" id="autotoc_md36"></a> </p><h5>Instance Users</h5>
|
||||
<p >All users with access to an instance have an InstanceUser object associated with the two that defines more rights specific to that instance (i.e. Deploy code, modify bots, edit other InstanceUsers).</p>
|
||||
<h3><a class="anchor" id="autotoc_md37"></a>
|
||||
Repository</h3>
|
||||
<h4><a class="anchor" id="autotoc_md37"></a>
|
||||
Repository</h4>
|
||||
<p >The <code>Repository</code> folder is a git repository containing the code of the game you wish to host. It can be cloned from any public or private remote repository and has capabilities to affect changes back to it. All the standard benefits of git are utilized (i.e. check out any revision or reference).</p>
|
||||
<p >Additional features become available if the remote repository is hosted on <a href="https://github.com/">https://github.com/</a>. Namely the Test Merge feature, which allows you to take a pull request opened on the repository and compile it into a game deployment for testing. Information about test merges is available in game via the DMAPI and via the main API as well.</p>
|
||||
<p >Manual operations on the repository while an instance is running may lead to git data corruption. Thankfully, it's simple enough to delete and reclone the repository via the API.</p>
|
||||
<h3><a class="anchor" id="autotoc_md38"></a>
|
||||
Byond</h3>
|
||||
<h4><a class="anchor" id="autotoc_md38"></a>
|
||||
Byond</h4>
|
||||
<p >The <code>Byond</code> folder contains installations of <a href="https://www.byond.com/">BYOND</a> or <a href="https://github.com/OpenDreamProject/OpenDream">OpenDream</a> versions. The version which is used by your game code can be changed on a whim (Note that only versions >= 511.1385 have been thouroughly tested. Lower versions should work but if one doesn't function, please open an issue report) and the server will take care of installing it.</p>
|
||||
<h4><a class="anchor" id="autotoc_md39"></a>
|
||||
Environment Variables</h4>
|
||||
<p ><a class="anchor" id="autotoc_md39"></a> </p><h5>Environment Variables</h5>
|
||||
<p >You can specify additional environment variables to launch your server/compiler with by adding <code>server.env</code>/<code>compiler.env</code> to your engine installation directory (i.e. <code><instance>/Byond/515.1530/server.env</code>). These are <a href="https://hexdocs.pm/dotenvy/dotenv-file-format.html">.env</a> files.</p>
|
||||
<h3><a class="anchor" id="autotoc_md40"></a>
|
||||
Compiler</h3>
|
||||
<h4><a class="anchor" id="autotoc_md40"></a>
|
||||
Compiler</h4>
|
||||
<p >The compiler deploys code from the <code>Repository</code> folder to the <code>Game</code> folder and compiles it either by autodetecting the <code>.dme</code> or having it set by configuration. Several other step are also run such as validating the DMAPI version and creating symlinks for static files are done at this point. The compiler also applies server side code modifications and duplicates compiled code for the watchdog as well (See following section).</p>
|
||||
<h3><a class="anchor" id="autotoc_md41"></a>
|
||||
Watchdog</h3>
|
||||
<h4><a class="anchor" id="autotoc_md41"></a>
|
||||
Watchdog</h4>
|
||||
<p >The watchdog is responsible for starting and keeping your server running. It functions by launching two servers which are hot-swapped on <code>/world/Reboot</code>s and during crashes to prevent downtime. This hot swapping feature is also what allows TGS to deploy updates to live servers without bringing them down.</p>
|
||||
<p >DreamDaemon can be finicky and will crash with several high load games or bad DM code. The watchdog has several failure prevention methods to keep at least one server running while these issues are sorted out.</p>
|
||||
<h3><a class="anchor" id="autotoc_md42"></a>
|
||||
Chat Bots</h3>
|
||||
<h4><a class="anchor" id="autotoc_md42"></a>
|
||||
Chat Bots</h4>
|
||||
<p >TGS supports creating infinite chat bots for notifying staff or players of things like code deployments and uptime in. Currently the following providers are supported</p>
|
||||
<ul>
|
||||
<li>Internet Relay Chat (IRC)</li>
|
||||
@@ -513,8 +508,8 @@ Chat Bots</h3>
|
||||
</ul>
|
||||
<p >More can be added by providing a new implementation of the <a href="src/Tgstation.Server.Host/Components/Chat/Providers/IProvider.cs">IProvider</a> interface</p>
|
||||
<p >Bots have a set of built-in commands that can be triggered via <code>!tgs</code>, mentioning, or private messaging them. Along with these, custom commands can be defined using the DMAPI by creating a subtype of the <code>/datum/tgs_chat_command</code> type (See <code>tgs.dm</code> for details). Invocation for custom commands can be restricted to certain channels.</p>
|
||||
<h3><a class="anchor" id="autotoc_md43"></a>
|
||||
Static Files</h3>
|
||||
<h4><a class="anchor" id="autotoc_md43"></a>
|
||||
Static Files</h4>
|
||||
<p >All files in game code deployments are considered transient by default, meaning when new code is deployed, changes will be lost. Static files allow you to specify which files and folders stick around throughout all deployments.</p>
|
||||
<p >The <code>StaticFiles</code> folder contains 3 root folders which cannot be deleted and operate under special rules</p><ul>
|
||||
<li><code>CodeModifications</code></li>
|
||||
@@ -523,16 +518,16 @@ Static Files</h3>
|
||||
</ul>
|
||||
<p >These files can be modified either in host mode or system user mode. In host mode, TGS itself is responsible for reading and writing the files. In system user mode read and write actions are performed using the system account of the logged on User, enabling the use of ACLs to control access to files. Database users will not be able to use the static file system if this mode is configured for an instance.</p>
|
||||
<p >This folder may be freely modified manually just beware this may cause in-progress deployments to error if done on Windows systems.</p>
|
||||
<h3><a class="anchor" id="autotoc_md44"></a>
|
||||
CodeModifications</h3>
|
||||
<h4><a class="anchor" id="autotoc_md44"></a>
|
||||
CodeModifications</h4>
|
||||
<p >When a deployment is made by the compiler, all the contents of this folder are copied over the repository contents. Then one of two code change modes are selected based on the prescense of certain files.</p>
|
||||
<p >If <code><target dme>.dme</code> is present, that .dme will be used instead of the repository's <code>.dme</code></p>
|
||||
<p >Otherwise the files <code>HeadInclude.dm</code> and <code>TailInclude.dm</code> are searched for and added as include lines to the top and bottom of the target <code>.dme</code> repsectively if they exist. These files can contain any valid DreamMaker code (Including <code>#include</code>ing other <code>.dm</code> files!) allowing you to modify the a repository's code on a per instance basis</p>
|
||||
<h3><a class="anchor" id="autotoc_md45"></a>
|
||||
EventScripts</h3>
|
||||
<h4><a class="anchor" id="autotoc_md45"></a>
|
||||
EventScripts</h4>
|
||||
<p >This folder can contain anything. But, when certain events occur in the instance, TGS will look here for <code>.bat</code> or <code>.sh</code> files with the same name and run those with corresponding arguments. List of supported events can be found <a href="src/Tgstation.Server.Host/Components/Events/EventType.cs">here</a>.</p>
|
||||
<h3><a class="anchor" id="autotoc_md46"></a>
|
||||
GameStaticFiles</h3>
|
||||
<h4><a class="anchor" id="autotoc_md46"></a>
|
||||
GameStaticFiles</h4>
|
||||
<p >Any files and folders contained in this root level of this folder will be symbolically linked to all deployments at the time they are created. This allows persistent game data (BYOND <code>.sav</code>s or code configuration files for example) to persist across all deployments. This folder contains a .tgsignore file which can be used to prevent symlinks from being generated by entering the names of files and folders (1 per line).</p>
|
||||
<p >This functionality has the following prerequisites:</p>
|
||||
<ul>
|
||||
@@ -553,8 +548,8 @@ GameStaticFiles</h3>
|
||||
<li>You are using the basic watchdog.</li>
|
||||
<li>Your world runs with the <code>Trusted</code> security level.</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" id="autotoc_md47"></a>
|
||||
Clients</h2>
|
||||
<h3><a class="anchor" id="autotoc_md47"></a>
|
||||
Clients</h3>
|
||||
<p >Here are tools for interacting with the TGS web API</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/tgstation/tgstation-server-webpanel">tgstation-server-webpanel</a>: Official client and included with the server. A react web app for using tgstation-server.</li>
|
||||
@@ -563,8 +558,8 @@ Clients</h2>
|
||||
<li><a href="https://www.nuget.org/packages/Tgstation.Server.Api">Tgstation.Server.Api</a>: A nuget .NET Standard 2.0 library containing API definitions for tgstation-server. Feature complete.</li>
|
||||
</ul>
|
||||
<p >Contact project maintainers to get your client added to this list</p>
|
||||
<h1><a class="anchor" id="autotoc_md48"></a>
|
||||
Backup/Restore</h1>
|
||||
<h2><a class="anchor" id="autotoc_md48"></a>
|
||||
Backup/Restore</h2>
|
||||
<p >Note that tgstation-server is NOT a backup solution, the onus is on the server runners.</p>
|
||||
<p >The <code>Repository</code> folder should be backed up on the remote server, do not rely on the instance copy to store changes.</p>
|
||||
<p >The <code>BYOND</code> and <code>Game</code> folders should never be backed up due to being intertwined with instance data.</p>
|
||||
@@ -572,16 +567,16 @@ Backup/Restore</h1>
|
||||
<p >The database should be fully backed up.</p>
|
||||
<p >To restore an installation from backups, first restore the instance <code>Configuration</code> folder in its new home. Then restore the database, modifying the <code>Path</code> column in the <code>Instances</code> table where necessary to point to the new instances. Then start the server pointed at the new database.</p>
|
||||
<p >Should you end up with a lost database for some reason or want to reattach a detached instance you can reattach an existing folder by creating an empty file named <code>TGS4_ALLOW_INSTANCE_ATTACH</code> inside it (This is automatically created when detaching instances). Then create a new instance with that path, this will bypass the empty folder check. Note that this will not restore things such as user permissions, server config options, or deployment metadata. Those must be reconfigured manually.</p>
|
||||
<h1><a class="anchor" id="autotoc_md49"></a>
|
||||
Troubleshooting</h1>
|
||||
<h2><a class="anchor" id="autotoc_md49"></a>
|
||||
Troubleshooting</h2>
|
||||
<p >Feel free to ask for help <a href="https://github.com/tgstation/tgstation-server/discussions">on the discussions page</a>.</p>
|
||||
<h1><a class="anchor" id="autotoc_md50"></a>
|
||||
Contributing</h1>
|
||||
<h2><a class="anchor" id="autotoc_md50"></a>
|
||||
Contributing</h2>
|
||||
<ul>
|
||||
<li>See CONTRIBUTING.md</li>
|
||||
</ul>
|
||||
<h1><a class="anchor" id="autotoc_md51"></a>
|
||||
Licensing</h1>
|
||||
<h2><a class="anchor" id="autotoc_md51"></a>
|
||||
Licensing</h2>
|
||||
<ul>
|
||||
<li>The DMAPI for the project is licensed under the MIT license.</li>
|
||||
<li>The /tg/station 13 icon is licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons 3.0 BY-SA</a>.</li>
|
||||
|
||||
Reference in New Issue
Block a user