Skip to content

Commit

Permalink
Merge pull request #1325 from tgstation/V5Prep
Browse files Browse the repository at this point in the history
A couple of changes to ensure a smooth transition to V5
  • Loading branch information
Cyberboss committed Sep 9, 2021
2 parents a850d30 + 83568dd commit becf2be
Show file tree
Hide file tree
Showing 25 changed files with 161 additions and 171 deletions.
20 changes: 10 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ You need the Dotnet 3.1 SDK and npm>=v5.7 (in your PATH) to compile the server.
The recommended IDE is Visual Studio 2019 which has installation options for both of these.

In order to run the integration tests you must have the following environment variables set:
- `TGS4_TEST_DATABASE_TYPE`: `MySql`, `MariaDB`, `PostgresSql`, or `SqlServer`.
- `TGS4_TEST_CONNECTION_STRING`: To a valid database connection string. You can use the setup wizard to create one.
- `TSG4_TEST_DISCORD_TOKEN`: To a valid discord bot token.
- `TGS4_TEST_DISCORD_CHANNEL`: To a valid discord channel ID that the above bot can access.
- `TGS4_TEST_IRC_CONNECTION_STRING`: To a valid TGS4 IRC connection string. See the code for [IrcConnectionStringBuilder](../src/Tgstation.Server.Api/Models/IrcConnectionStringBuilder.cs) for details.
- `TGS4_TEST_IRC_CHANNEL`: To a valid IRC channel accessible with the above connection.
- `TGS4_TEST_BRANCH`: Should be either `dev` or `master` depending on what you are working off of. Used for repository tests.
- (Optional) `TGS4_TEST_GITHUB_TOKEN`: A GitHub personal access token with no scopes used to bypass rate limits.
- `TGS_TEST_DATABASE_TYPE`: `MySql`, `MariaDB`, `PostgresSql`, or `SqlServer`.
- `TGS_TEST_CONNECTION_STRING`: To a valid database connection string. You can use the setup wizard to create one.
- `TSG_TEST_DISCORD_TOKEN`: To a valid discord bot token.
- `TGS_TEST_DISCORD_CHANNEL`: To a valid discord channel ID that the above bot can access.
- `TGS_TEST_IRC_CONNECTION_STRING`: To a valid IRC connection string. See the code for [IrcConnectionStringBuilder](../src/Tgstation.Server.Api/Models/IrcConnectionStringBuilder.cs) for details.
- `TGS_TEST_IRC_CHANNEL`: To a valid IRC channel accessible with the above connection.
- `TGS_TEST_BRANCH`: Should be either `dev` or `master` depending on what you are working off of. Used for repository tests.
- (Optional) `TGS_TEST_GITHUB_TOKEN`: A GitHub personal access token with no scopes used to bypass rate limits.

### Know your Code

Expand Down Expand Up @@ -240,9 +240,9 @@ The NuGet package Tgstation.Server.Client is another part of the suite which sho

_This section mainly applies to people with write access to the repository. Anyone is free to propose their work and maintainers will triage it appropriately._

When issues affecting the server come in, they should be lebeled appropriately and either put into the `V4 Backlog` milestone or current patch milestone depending on if it's a feature request or bug.
When issues affecting the server come in, they should be lebeled appropriately and either put into the `Backlog` milestone or current patch milestone depending on if it's a feature request or bug.

After a minor release, the team should decide at that time what will go into it and setup the milestone accordingly. At this point the `Backlog` label should be removed and replaced with `Ready` and the milestone changed from `V4 Backlog` to `v4.X.0` with X being the minor release version.
After a minor release, the team should decide at that time what will go into it and setup the milestone accordingly. At this point the `Backlog` label should be removed and replaced with `Ready` and the milestone changed from `Backlog` to `vX.Y.0` with X/Y being the major/minor release versions respectively.

Assign work before beginning on it. When work is started, replace the `Ready` label with the `Work In Progress` label.

Expand Down
76 changes: 38 additions & 38 deletions .github/workflows/ci-suite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CI'
name: 'CI'

on:
push:
Expand All @@ -11,13 +11,13 @@ on:
- master

env:
TGS4_DOTNET_VERSION: 3.1.x
TGS4_TEST_DISCORD_CHANNEL: ${{ secrets.DISCORD_CHANNEL_ID }}
TGS4_TEST_DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
TGS4_TEST_IRC_CHANNEL: ${{ secrets.IRC_CHANNEL }}
TGS4_TEST_IRC_CONNECTION_STRING: ${{ secrets.IRC_CONNECTION_STRING }}
TGS4_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TGS4_RELEASE_NOTES_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}
TGS_DOTNET_VERSION: 3.1.x
TGS_TEST_DISCORD_CHANNEL: ${{ secrets.DISCORD_CHANNEL_ID }}
TGS_TEST_DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
TGS_TEST_IRC_CHANNEL: ${{ secrets.IRC_CHANNEL }}
TGS_TEST_IRC_CONNECTION_STRING: ${{ secrets.IRC_CONNECTION_STRING }}
TGS_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TGS_RELEASE_NOTES_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}

jobs:
dmapi-build:
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.TGS4_DOTNET_VERSION }}
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Checkout
uses: actions/checkout@v1
Expand All @@ -161,7 +161,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.TGS4_DOTNET_VERSION }}
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Checkout
uses: actions/checkout@v1
Expand All @@ -185,8 +185,8 @@ jobs:
name: Windows Integration Test
needs: dmapi-build
env:
TGS4_TEST_DATABASE_TYPE: SqlServer
TGS4_TEST_DUMP_API_SPEC: yes
TGS_TEST_DATABASE_TYPE: SqlServer
TGS_TEST_DUMP_API_SPEC: yes
concurrency: integration-windows-${{ github.head_ref }}
strategy:
max-parallel: 2
Expand All @@ -198,35 +198,35 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.TGS4_DOTNET_VERSION }}
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Set General__UseBasicWatchdog
if: ${{ matrix.watchdog-type == 'Basic' }}
run: echo "General__UseBasicWatchdog=true" >> $Env:GITHUB_ENV

- name: Set TGS4_TEST_CONNECTION_STRING
- name: Set TGS_TEST_CONNECTION_STRING
shell: bash
run: |
TGS4_CONNSTRING_VALUE="Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Initial Catalog=TGS_${{ matrix.watchdog-type }}_${{ matrix.configuration }};Application Name=tgstation-server"
echo "TGS4_TEST_CONNECTION_STRING=$(echo $TGS4_CONNSTRING_VALUE)" >> $GITHUB_ENV
TGS_CONNSTRING_VALUE="Server=(localdb)\MSSQLLocalDB;Integrated Security=true;Initial Catalog=TGS_${{ matrix.watchdog-type }}_${{ matrix.configuration }};Application Name=tgstation-server"
echo "TGS_TEST_CONNECTION_STRING=$(echo $TGS_CONNSTRING_VALUE)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v1

- name: Set TGS4_TEST_PULL_REQUEST_NUMBER
- name: Set TGS_TEST_PULL_REQUEST_NUMBER
if: ${{ github.event_name == 'pull_request' }}
run: echo "TGS4_TEST_PULL_REQUEST_NUMBER=${{ github.event.number }}" >> $Env:GITHUB_ENV
run: echo "TGS_TEST_PULL_REQUEST_NUMBER=${{ github.event.number }}" >> $Env:GITHUB_ENV

- name: Set TGS4_GITHUB_REF for PR
- name: Set TGS_GITHUB_REF for PR
if: ${{ github.event_name == 'pull_request' }}
run: echo "TGS4_GITHUB_REF=${{ github.base_ref }}" >> $Env:GITHUB_ENV
run: echo "TGS_GITHUB_REF=${{ github.base_ref }}" >> $Env:GITHUB_ENV

- name: Set TGS4_GITHUB_REF for push
- name: Set TGS_GITHUB_REF for push
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
TEMP_GITHUB_REF="${{ github.event.ref }}"
echo "TGS4_GITHUB_REF=${TEMP_GITHUB_REF##*/}" >> $GITHUB_ENV
echo "TGS_GITHUB_REF=${TEMP_GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Clean package cache as a temporary workaround for actions/setup-dotnet#155
run: dotnet clean && dotnet nuget locals all --clear
Expand Down Expand Up @@ -329,31 +329,31 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.TGS4_DOTNET_VERSION }}
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Set Sqlite Connection Info
if: ${{ matrix.database-type == 'Sqlite' }}
run: |
echo "TGS4_TEST_DATABASE_TYPE=Sqlite" >> $GITHUB_ENV
echo "TGS4_TEST_CONNECTION_STRING=Data Source=TGS_${{ matrix.watchdog-type }}_${{ matrix.configuration }}.sqlite3;Mode=ReadWriteCreate" >> $GITHUB_ENV
echo "TGS_TEST_DATABASE_TYPE=Sqlite" >> $GITHUB_ENV
echo "TGS_TEST_CONNECTION_STRING=Data Source=TGS_${{ matrix.watchdog-type }}_${{ matrix.configuration }}.sqlite3;Mode=ReadWriteCreate" >> $GITHUB_ENV
- name: Set PostgresSql Connection Info
if: ${{ matrix.database-type == 'PostgresSql' }}
run: |
echo "TGS4_TEST_DATABASE_TYPE=PostgresSql" >> $GITHUB_ENV
echo "TGS4_TEST_CONNECTION_STRING=Application Name=tgstation-server;Host=127.0.0.1;Username=postgres;Password=postgres;Database=TGS__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV
echo "TGS_TEST_DATABASE_TYPE=PostgresSql" >> $GITHUB_ENV
echo "TGS_TEST_CONNECTION_STRING=Application Name=tgstation-server;Host=127.0.0.1;Username=postgres;Password=postgres;Database=TGS__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV
- name: Set MariaDB Connection Info
if: ${{ matrix.database-type == 'MariaDB' }}
run: |
echo "TGS4_TEST_DATABASE_TYPE=MariaDB" >> $GITHUB_ENV
echo "TGS4_TEST_CONNECTION_STRING=Server=127.0.0.1;uid=root;pwd=mariadb;database=tgs__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV
echo "TGS_TEST_DATABASE_TYPE=MariaDB" >> $GITHUB_ENV
echo "TGS_TEST_CONNECTION_STRING=Server=127.0.0.1;uid=root;pwd=mariadb;database=tgs__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV
- name: Set MySQL Connection Info
if: ${{ matrix.database-type == 'MySql' }}
run: |
echo "TGS4_TEST_DATABASE_TYPE=MySql" >> $GITHUB_ENV
echo "TGS4_TEST_CONNECTION_STRING=Server=127.0.0.1;Port=3307;uid=root;pwd=mysql;database=tgs__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV
echo "TGS_TEST_DATABASE_TYPE=MySql" >> $GITHUB_ENV
echo "TGS_TEST_CONNECTION_STRING=Server=127.0.0.1;Port=3307;uid=root;pwd=mysql;database=tgs__${{ matrix.watchdog-type }}_${{ matrix.configuration }}" >> $GITHUB_ENV
echo "Database__ServerVersion=5.7.31" >> $GITHUB_ENV
- name: Set General__UseBasicWatchdog
Expand All @@ -363,20 +363,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v1

- name: Set TGS4_TEST_PULL_REQUEST_NUMBER
- name: Set TGS_TEST_PULL_REQUEST_NUMBER
if: ${{ github.event_name == 'pull_request' }}
run: echo "TGS4_TEST_PULL_REQUEST_NUMBER=${{ github.event.number }}" >> $GITHUB_ENV
run: echo "TGS_TEST_PULL_REQUEST_NUMBER=${{ github.event.number }}" >> $GITHUB_ENV

- name: Set TGS4_GITHUB_REF for PR
- name: Set TGS_GITHUB_REF for PR
if: ${{ github.event_name == 'pull_request' }}
run: echo "TGS4_GITHUB_REF=${{ github.base_ref }}" >> $GITHUB_ENV
run: echo "TGS_GITHUB_REF=${{ github.base_ref }}" >> $GITHUB_ENV

- name: Set TGS4_GITHUB_REF for push
- name: Set TGS_GITHUB_REF for push
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
TEMP_GITHUB_REF="${{ github.event.ref }}"
echo "TGS4_GITHUB_REF=${TEMP_GITHUB_REF##*/}" >> $GITHUB_ENV
echo "TGS_GITHUB_REF=${TEMP_GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Run Integration Test
run: |
Expand Down Expand Up @@ -658,7 +658,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.TGS4_DOTNET_VERSION }}
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Checkout
uses: actions/checkout@v1
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tgstation-server v4:
# tgstation-server:

![CI](https://github.com/tgstation/tgstation-server/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/tgstation/tgstation-server/branch/master/graph/badge.svg)](https://codecov.io/gh/tgstation/tgstation-server)

Expand All @@ -12,7 +12,7 @@ This is a toolset to manage production BYOND servers. It includes the ability to

### Legacy Servers

Older server versions can be found in the V# branches of this repository. Note that V4 is nearly fully incompatible with existing installations. Only some static files may be copied over: https://github.com/tgstation/tgstation-server#static-files
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

Expand All @@ -23,7 +23,7 @@ Older server versions can be found in the V# branches of this repository. Note t

### Installation

1. [Download the latest V4 release .zip](https://github.com/tgstation/tgstation-server/releases/latest). The `ServerService` package will only work on Windows. Choose `ServerConsole` if that is not your target OS or you prefer not to use the Windows service.
1. [Download the latest release .zip](https://github.com/tgstation/tgstation-server/releases/latest). The `ServerService` package will only work on Windows. Choose `ServerConsole` if that is not your target OS or you prefer not to use the Windows service.
2. Extract the .zip file to where you want the server to run from. Note the account running the server must have write and delete access to the `lib` subdirectory.

#### Windows
Expand Down Expand Up @@ -67,7 +67,7 @@ docker run \
-p 5000:5000 \ # Port bridge for accessing TGS, you can change this if you need
-p 0.0.0.0:<public game port>:<public game port> \ # Port bridge for accessing DreamDaemon
-v /path/to/your/configfile/directory:/config_data \ # Recommended, create a volume mapping for server configuration
-v /path/to/store/instances:/tgs4_instances \ # Recommended, create a volume mapping for server instances
-v /path/to/store/instances:/tgs_instances \ # Recommended, create a volume mapping for server instances
-v /path/to/your/log/folder:/tgs_logs \ # Recommended, create a volume mapping for server logs
tgstation/server[:<release version>]
```
Expand All @@ -79,7 +79,7 @@ Important note about port exposure: The internal port used by DreamDaemon _**MUS

Note although `/app/lib` is specified as a volume mount point in the `Dockerfile`, unless you REALLY know what you're doing. Do not mount any volumes over this for fear of breaking your container.

The configuration option `General:ValidInstancePaths` will be preconfigured to point to `/tgs4_instances`. It is recommended you don't change this.
The configuration option `General:ValidInstancePaths` will be preconfigured to point to `/tgs_instances`. It is recommended you don't change this.

Note that this container is meant to be long running. Updates are handled internally as opposed to at the container level.

Expand All @@ -89,7 +89,7 @@ If using manual configuration, before starting your container make sure the afor

### Configuring

The first time you run TGS4 you should be prompted with a configuration wizard which will guide you through setting up your `appsettings.Production.yml`
The first time you run TGS you should be prompted with a configuration wizard which will guide you through setting up your `appsettings.Production.yml`

This wizard will, generally, run whenever the server is launched without detecting the config yml. Follow the instructions below to perform this process manually.

Expand All @@ -107,7 +107,7 @@ The latter two are not recommended as they cannot be dynamically changed at runt

Create an `appsettings.Production.yml` file next to `appsettings.yml`. This will override the default settings in `appsettings.yml` with your production settings. There are a few keys meant to be changed by hosts. Modifying any config files while the server is running will trigger a safe restart (Keeps DreamDaemon instances running). Note these are all case-sensitive:

- `General:ConfigVersion`: 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 (This field did not exist before v4.4.0).
- `General:ConfigVersion`: 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.

- `General:MinimumPasswordLength`: Minimum password length requirement for database users

Expand Down Expand Up @@ -137,7 +137,7 @@ Create an `appsettings.Production.yml` file next to `appsettings.yml`. This will

- `ControlPanel:AllowedOrigins`: Set the Access-Control-Allow-Origin headers to this list of origins for all responses (also enables all headers and methods). This is overridden by `ControlPanel:AllowAnyOrigin`

- `Elasticsearch`: tgstation-server-v4 also supports automatically ingesting its logs to ElasticSearch. You can set this up in the setup wizard, or with the following configuration:
- `Elasticsearch`: tgstation-server also supports automatically ingesting its logs to ElasticSearch. You can set this up in the setup wizard, or with the following configuration:
```yml
Elasticsearch:
Enable: true
Expand Down Expand Up @@ -356,11 +356,13 @@ Instances can be either part of a swarm or not. Once in the database they cannot
## Usage
tgstation-server v4 is controlled via a RESTful HTTP json API. Documentation on this API can be found [here](https://tgstation.github.io/tgstation-server/api.html). 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.
tgstation-server is controlled via a RESTful HTTP json API. Documentation on this API can be found [here](https://tgstation.github.io/tgstation-server/api.html). 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.
### Updating
TGS 4 can self update without stopping your DreamDaemon servers. Any V4 release made to this repository is bound by a contract that allows changes of the runtime assemblies without stopping your servers. Database migrations are automatically applied as well. Because of this REVERTING TO LOWER VERSIONS IS NOT OFFICIALLY SUPPORTED, do so at your own risk (check changes made to `/src/Tgstation.Server.Host/Models/Migrations`).
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. Because of this REVERTING TO LOWER VERSIONS IS NOT OFFICIALLY SUPPORTED, do so at your own risk (check changes made to `/src/Tgstation.Server.Host/Models/Migrations`).
Major version updates may require additional action on the part of the user (apart from the configuration changes).
#### Notifications
Expand Down Expand Up @@ -446,7 +448,7 @@ Any files and folders contained in this root level of this folder will be symbol
### Clients
Here are tools for interacting with the TGS 4 web API
Here are tools for interacting with the TGS web API
- [tgstation-server-webpanel](https://github.com/tgstation/tgstation-server-webpanel): Official client and included with the server (WIP). A react web app for using tgstation-server.
- [Tgstation.Server.ControlPanel](https://github.com/tgstation/Tgstation.Server.ControlPanel): Official client. A cross platform GUI for using tgstation-server. Feature complete but lacks OAuth login options.
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RUN apt-get update \

EXPOSE 5000

ENV General__ValidInstancePaths__0 /tgs4_instances
ENV General__ValidInstancePaths__0 /tgs_instances
ENV FileLogging__Directory /tgs_logs

WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Integration tests will ensure they match across the board -->
<Import Project="ControlPanelVersion.props" />
<PropertyGroup>
<TgsCoreVersion>4.14.2</TgsCoreVersion>
<TgsCoreVersion>4.15.0</TgsCoreVersion>
<TgsConfigVersion>4.0.0</TgsConfigVersion>
<TgsApiVersion>9.2.0</TgsApiVersion>
<TgsApiLibraryVersion>9.2.0</TgsApiLibraryVersion>
Expand Down
Loading

0 comments on commit becf2be

Please sign in to comment.