Srcds on docker

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Srcds on docker

Geo B.
I am currently looking to migrate all my public servers to docker but there are still some issues:

1- As docker doesn't know it's own external ip, we have to bind srcds to 0.0.0.0 or the container crash. This also lead to another issue, if you try to assign another IP address than the default gateway of your box, it will result in a crash.

2- also related to bind issue, nobody can join someone playing on a docker server because the broadcasted ip is 0.0.0.0

And there are more issues related to it.

The actual workaround is to share the host network with the container using net: host but this is a REAL security breach.

I know that Vitaliy already added a car to broadcast sourcetv ip using docker (kind of NAT), maybe instead of reworking srcds it could be possible to add 1 car ( why not using +net_public_address ? ) to force broadcast the right IP ? 
This would not fix all issues as this is a workaround, maybe a real rework of srcds is needed but containers is the future of hosting and as Valve is pushing some update (http logs) maybe it could be interesting to go in this way. 

_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Srcds on docker

Felix Spittel
Hey,

what you need is the ip address associated with the network interface. This is how you are able to get it inside of a container: 

ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1

If you used this inside of a script assign it to a variable:

IP="$(ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1)"

You might have to escape " depending on your shell

IP="$(ifconfig eth0 | grep \"inet addr:\" | cut -d : -f 2 | cut -d \" \" -f 1)"

You might also have to install net-tools for Debian based images.


Just pass it like this -ip $IP


If you use an Orchestrator like Cattle with Rancher, there might be different ways: 


works in Rancher

2017-05-30 22:50 GMT+02:00 Geo B. <[hidden email]>:
I am currently looking to migrate all my public servers to docker but there are still some issues:

1- As docker doesn't know it's own external ip, we have to bind srcds to 0.0.0.0 or the container crash. This also lead to another issue, if you try to assign another IP address than the default gateway of your box, it will result in a crash.

2- also related to bind issue, nobody can join someone playing on a docker server because the broadcasted ip is 0.0.0.0

And there are more issues related to it.

The actual workaround is to share the host network with the container using net: host but this is a REAL security breach.

I know that Vitaliy already added a car to broadcast sourcetv ip using docker (kind of NAT), maybe instead of reworking srcds it could be possible to add 1 car ( why not using +net_public_address ? ) to force broadcast the right IP ? 
This would not fix all issues as this is a workaround, maybe a real rework of srcds is needed but containers is the future of hosting and as Valve is pushing some update (http logs) maybe it could be interesting to go in this way. 

_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers


_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Srcds on docker

Geo B.
The problem is if we bind srcds to public IP of the box, the container just crash because it can't allocate an IP that it doesn't see (look screenshot)
Binding to 0.0.0.0 solve the problem but then, status etc doesn't works.

About LAN config, i haven't triied for now, but someone reported that the servers doesn't show on LAN tabs except if he uses net: host but i didn't had the time to try it myself.

I am currentyl not at home but i could give a more complete lists of waht works and what not in a few days. I could setup a docker env if you need it.

@Felix, I'm aware of that, the problem is that the container just crash if i bind something else than 0.0.0.0.


________________

BACHELOT Geoffrey
Tel: <a href="tel:%2B33%206%2019%2044%2000%2042" value="+32495311024" style="color:rgb(17,85,204)" target="_blank">+33 6 19 44 00 42

2017-05-30 23:24 GMT+02:00 Felix Spittel <[hidden email]>:
Hey,

what you need is the ip address associated with the network interface. This is how you are able to get it inside of a container: 

ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1

If you used this inside of a script assign it to a variable:

IP="$(ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1)"

You might have to escape " depending on your shell

IP="$(ifconfig eth0 | grep \"inet addr:\" | cut -d : -f 2 | cut -d \" \" -f 1)"

You might also have to install net-tools for Debian based images.


Just pass it like this -ip $IP


If you use an Orchestrator like Cattle with Rancher, there might be different ways: 


works in Rancher

2017-05-30 22:50 GMT+02:00 Geo B. <[hidden email]>:
I am currently looking to migrate all my public servers to docker but there are still some issues:

1- As docker doesn't know it's own external ip, we have to bind srcds to 0.0.0.0 or the container crash. This also lead to another issue, if you try to assign another IP address than the default gateway of your box, it will result in a crash.

2- also related to bind issue, nobody can join someone playing on a docker server because the broadcasted ip is 0.0.0.0

And there are more issues related to it.

The actual workaround is to share the host network with the container using net: host but this is a REAL security breach.

I know that Vitaliy already added a car to broadcast sourcetv ip using docker (kind of NAT), maybe instead of reworking srcds it could be possible to add 1 car ( why not using +net_public_address ? ) to force broadcast the right IP ? 
This would not fix all issues as this is a workaround, maybe a real rework of srcds is needed but containers is the future of hosting and as Valve is pushing some update (http logs) maybe it could be interesting to go in this way. 

_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers


_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers


_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Strange bug or wrong cvars...

MiShU # gameserver-syndicate.de
hey mates,

i have a strange bug on one of our servers. i have no more ideas what
could cause the problem so i hope someone of you have an idea.

Its a public with sourcemod and the mapchooser plugin is active.
Everything works fine, BUT:
If the Match (maxrounds 30) is over, the Map dont change instantly. It
restart the map and after the warmuzp time, the map changed to the map
voted before.

There is no "mp_match_end_restart 1" in any server-config.

Thanks for any ideas!

_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange bug or wrong cvars...

MiShU # gameserver-syndicate.de
Nevermind...

mp_match_end_changelevel "1" wasnt set to 1, whyever! My fault, sry and
thx! ;)




Am 31.05.2017 um 20:30 schrieb MiShU # gameserver-syndicate.de:

> hey mates,
>
> i have a strange bug on one of our servers. i have no more ideas what
> could cause the problem so i hope someone of you have an idea.
>
> Its a public with sourcemod and the mapchooser plugin is active.
> Everything works fine, BUT:
> If the Match (maxrounds 30) is over, the Map dont change instantly. It
> restart the map and after the warmuzp time, the map changed to the map
> voted before.
>
> There is no "mp_match_end_restart 1" in any server-config.
>
> Thanks for any ideas!
>
> _______________________________________________
> Csgo_servers mailing list
> [hidden email]
> https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers



_______________________________________________
Csgo_servers mailing list
[hidden email]
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers
Loading...