Skip to content

Instantly share code, notes, and snippets.

View Cyberboss's full-sized avatar
💭
Always preocupied

Jordan Dominion Cyberboss

💭
Always preocupied
View GitHub Profile
@Cyberboss
Cyberboss / copypasta.md
Last active May 25, 2023 00:32
Why I won't rewrite tgstation-server in rust

Why I won't rewrite tgstation-server in rust

I love rust, debatably more than C#. But I'm never going to rewrite TGS in it. Here's why.

Systems vs Servers

INCOMPLETE

Dependency injection is a MASSIVE part of the current TGS architecture. To support such a thing in rust would involve a LOT of Box/Rc/Arc types for dyn traits. All that indirection would not be pretty to work with. I'd hope the compiler would be smart enough to devirtualize all the calls in a release build (where there is generally only one relevant implementation of an interface) but I can't even be sure of that.

@Cyberboss
Cyberboss / tgs.log
Created May 22, 2023 22:01
Weird TGS autostart DD crash
2023-05-21T20:41:08.1079377Z TEST SERVER START
2023-05-21T20:41:08.1079661Z [19:36:53] inf: Tgstation.Server.Host.Components.InstanceManager (Instance:|Job:|Request:|User:|Monitor:|Bridge:|Chat:|IR:|Node:)
2023-05-21T20:41:08.1079803Z tgstation-server-v5.12.2
2023-05-21T20:41:08.1080110Z [19:36:53] ftl: Tgstation.Server.Host.Components.InstanceManager (Instance:|Job:|Request:|User:|Monitor:|Bridge:|Chat:|IR:|Node:)
2023-05-21T20:41:08.1080404Z No `ConfigVersion` specified, your configuration may be out of date! The current version is "4.6.0"
2023-05-21T20:41:08.1080749Z [19:36:53] dbg: Tgstation.Server.Host.System.WindowsNetworkPromptReaper (Instance:|Job:|Request:|User:|Monitor:|Bridge:|Chat:|IR:|Node:)
2023-05-21T20:41:08.1080902Z Starting network prompt reaper...
2023-05-21T20:41:08.1081185Z [19:36:53] dbg: Tgstation.Server.Host.Core.Application (Instance:|Job:|Request:|User:|Monitor:|Bridge:|Chat:|IR:|Node:)
2023-05-21T20:41:08.1081473Z Content Root: D:\a\tgstation-server\tgstatio
@Cyberboss
Cyberboss / changelog.md
Created December 15, 2020 17:27
HTTP API V8 changelog circa 2020-12-15

HTTP API

  • File transfers have been revamped. The RawData model has been replaced with the FileTicketResult model. This contains one string field, fileTicket. Transfers are now done as standard application/octet-stream GET/PUT requests to the new /Transfer endpoint. Requests should be made to /Transfer?ticket=<fileTicket> after receiving a FileTicketResult. Returns HTTP 200/204 on successful transfers, or standard 409/410 ErrorMessages otherwise. Because of this change, the size limit for file transfers has been increased to 2GB. (#1153)
  • Added ErrorCode 97 for when a job fails due to waiting on an expired upload request. (#1153)
  • POST /Configuration no longer updates lastReadHash field of the returned ConfigurationFile model. (#1153)
  • Renamed the TestMergeParameters model field pullRequestRevision to targetCommitSha. (#1163)
  • Renamed Repository model field gitHubOwner to remoteRepositoryOwner. (#1163)
  • Renamed Repository model field gitHubName to `remoteRepositoryNam
@Cyberboss
Cyberboss / gist:f5b614e2d8571117166f50c48e0a96d5
Last active December 7, 2020 22:38
Changes since 7.3.2

For @alexkar598#2712

  • Instances will now allocate and pre-check the DreamDaemon and DMAPI validation ports can be used before they are created. Added error code 93 for when none are available. (#1136)
  • You can no longer modify DreamDaemon or DMAPI validation ports so that they would conflict with other ports in use by TGS or the system. Added error code 94 for when a conflict occurs. (#1136)
  • Added header X-Powered-By: tgstation-server to all responses. (#1134)
  • Added DreamDaemon additionalParameters field for adding additional command line -params options. (#1145)
  • File transfers have been revamped. The RawData model has been replaced with the FileTicketResult model. This contains one string field, fileTicket. Transfers are now done as standard application/octet-stream GET/PUT requests to the new /Transfer endpoint. Requests should be made to /Transfer?ticket=<fileTicket> after receiving a FileTicketResult. Returns HTTP 200/204 on successful transfers, or standard 409/410 `ErrorMessage
@Cyberboss
Cyberboss / ArtifactSizeViewer.csproj
Created October 5, 2020 19:44
View GitHub Artifact storage usage for a given repository. Launch with `<token with repo scope> <owning github user/org name> <repo name>`
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Octokit" Version="0.48.0" />
</ItemGroup>
@Cyberboss
Cyberboss / Program.cs
Created October 20, 2018 17:59
Symlink test one off
using System;
using BetterWin32Errors;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Text;
namespace Tgstation.Server.Host
{
@Cyberboss
Cyberboss / Program.cs
Created October 20, 2018 16:34
TGS4 diagnostic quickie
using System;
using System.IO;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Tgstation.Server.Api;
using Tgstation.Server.Api.Models;
using Tgstation.Server.Client;
namespace ConsoleApp1
{
@Cyberboss
Cyberboss / GetRefExample.cs
Created October 3, 2018 00:17
A byond like interface for asyncrounously cloning or fetching a repo at a given path and checking out a given reference
using LibGit2Sharp;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace GetRefExample
{
@Cyberboss
Cyberboss / Program.cs
Last active July 17, 2018 02:28
Try to bind 3337
using System;
using System.Net;
using System.Net.Sockets;
namespace Test3337
{
class Program
{
static void Main()
{
@Cyberboss
Cyberboss / tg_test.bat
Last active February 1, 2019 20:09
Quickly launch and join a tg test server. (Requires byond and docker installations)
@echo off
REM Shuts down when exiting dream seeker (Requires byond and docker installations)
REM remember to change the join ip if using a remote docker host
call docker pull tgstation/tgstation:latest
call docker run --rm -d --name=tg_quicktest -p 0.0.0.0:1337:1337 tgstation/tgstation:latest
call "%ProgramFiles(x86)%\BYOND\bin\dreamseeker.exe" 127.0.0.1:1337