Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: containerisation support #90

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

devOwlish
Copy link

@devOwlish devOwlish commented Oct 31, 2024

The issue

When the server is started in a container or behind NAT, a client can't get past authorization screen. This happens because the game server IP is always a private one, which isn't accessible from outside.

To demonstrate the issue, let's take Orion Client logs ( some lines have been omitted ):

20:22:14:213: CSocket::Connecting to 127.0.0.1:2593 <-- Connect to the "login server"
20:22:14:213: CBaseSocket::Connecting to 127.0.0.1:2593
20:22:29:357: --- ^(15071) r(+46 => 203) Server:: Servers List
20:22:30:558: CBaseSocket::OnCloseConnection
20:22:30:559: CSocket::Connecting to 172.22.0.2:2593 <-- Advertised "game server" IP, which is a virtual one 
20:22:30:559: CBaseSocket::Connecting to 172.22.0.2:2593
20:22:40:618: ERROR!!! Socket connectToHost return error: (2) 'Unknown error'

The solution

To solve the issue, we should be able to enforce S_Address being selected instead of any existing IP discovery, i.e.:

public static string S_Address = "127.0.0.1";
public static bool S_EnforceAddress = true;

which allows the server to be run in Docker locally. In case of running in a VPS/VDS or in a Kubernetes cluster, we can set it to

public static string S_Address = "<IP OF A LOAD BALANCER>";
public static bool S_EnforceAddress = true;

Misc

Also, I've included Dockerfile, docker-compose.yaml, and some changes to .gitignore to make it easier to contribute.

Please let me know if something needs to be changed!
Thanks!

@devOwlish devOwlish closed this Nov 13, 2024
@devOwlish
Copy link
Author

Let's give it a shot

@devOwlish devOwlish reopened this Nov 13, 2024
Copy link
Contributor

@creiht creiht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to validate that it does work both in Docker, and standalone on Windows with the .exe. I also verified that the data files are also set up correctly so that either way will work off of the same save.

I've added a couple of comments and requests that I think would make this a little more user friendly and hopefully remove some of the initial confusion around if docker was now the only way to run SoS.

I would like to see this get added, and it would not be a huge lift to maintain. It also lays the groundwork for eventually automating the building of the executable, and opens up more options people who want to run their own servers.

@devOwlish devOwlish requested a review from creiht December 24, 2024 00:49
@devOwlish
Copy link
Author

Sorry for the delay, I've been too much excited of playing the SoS with my friends :)

Also to be noted, all of the time the shard has been hosted with the changes proposed, and we've encountered no troubles.

@devOwlish
Copy link
Author

Also, we've been playing on the very version of these -> https://github.com/devOwlish/sos_shard/actions

@devOwlish
Copy link
Author

@creiht Please review the changes when you'll have some spare time. Thanks!

@sosarian-scribe
Copy link
Contributor

Shouldn't we integrate the instructions in the Manual.pdf to be consistent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants