PDA

View Full Version : Dedicated server setup help



MarcusarilliuS_IRL
02-10-2017, 11:25
Hey guys.

I am trying to setup a dedicated server and having issues. I kinda hoped the dedicated server system in this would be like rfactor2, where you have a GUI desptop program to setup everything, but I am finding this quite unintuitive.

I enabled the http interface in the config file,


// Master enable/disable toggle.
enableHttpApi : true

but when I try to connect to the server @ 127.0.0.1:9000 it pops up saying to input a username and password.

I put a username and pass in the cfg file...


// User list. Map from user names to passwords, in plain text.
httpApiUsers : {
// "stepan" : "foo",
// "michal" : "bar",
"admin" : "pass",
}

// User groups. Map from group names to lists of users in said groups.
httpApiGroups : {
// "private" : [ "stepan", "michal" ],
// "admin" : [ "stepan" ],
"admin" : [ "admin" ],

I tried entering this combo (admin : pass) but it doesn't work.

Anyone got any idea how to do this? I wanted the http interface so I have a GUI to setup the server. I also wanted to know can you have the webpage open on your phone, or is there an app where you can control the server in real-time with this interface? I want to be able to skip to end of session, advance to next session, or change cars, tracks, ai settings etc. etc.?

Hopefully someone can give me some tips on this.

Mark.

optimalspieler
02-10-2017, 13:12
Just put in

{ "type" : "accept" }
for every filter.

IMO they over-engineered this way too much

MarcusarilliuS_IRL
02-10-2017, 13:29
Just put in

{ "type" : "accept" }
for every filter.

IMO they over-engineered this way too much

Thanks for the reply, and excuse my ignorance, but I'm not really sure what you mean. Here is a copy from my cfg. Could you show me where I can set this username and password please?


httpApiAccessFilters : {

// Public rules. The default is to accept everything.
"public" : [
{ "type" : "accept" }
],

// Private rules. The default is to accept queries from localhost, queries authenticated as users in the "private" group
// and to reject anything else.
"private" : [
{ "type" : "ip-accept", "ip" : "127.0.0.1/32" },
{ "type" : "group", "group" : "private" },
{ "type" : "reject-password" }
],

// Admin rules. The default is to accept queries from localhost, queries authenticated as users in the "admin" group
// and to reject anything else.
"admin" : [
{ "type" : "ip-accept", "ip" : "127.0.0.1/32" },
{ "type" : "group", "group" : "admin" },
{ "type" : "reject-password" }
],

}

// User list. Map from user names to passwords, in plain text.
httpApiUsers : {
// "stepan" : "foo",
// "michal" : "bar",
}

// User groups. Map from group names to lists of users in said groups.
httpApiGroups : {
// "private" : [ "stepan", "michal" ],
// "admin" : [ "stepan" ],
}

// Root directory where the static files for the web tool are located. Relative to current directory.
staticWebFiles: "web_files"

I would have assumed a desktop GUI program to set and run the server should be standard really. Never encountered such a fiddly way to get a server up and running before.

epinter
02-10-2017, 15:57
I use this way:



httpApiAccessLevels : {
// The default is empty, using defaults as defined by the endpoints themselves.

// But you could for example use this to change all access levels to public (not recommended!)
// "*" : "public"
"*" : "private"

// Or this to hide the status from public
// "" : "private"
// "status" : "private"

// And similar to hide the help and lists from public
// "api/help" : "private"
// "api/list*" : "private"

// As you can see from the example above, the paths should be written with no initial or trailing slashes.
}

httpApiAccessFilters : {

// Public rules. The default is to accept everything.
"public" : [
{ "type" : "accept" }
],

// Private rules. The default is to accept queries from localhost, queries authenticated as users in the "private" group
// and to reject anything else.
"private" : [
{ "type" : "ip-accept", "ip" : "127.0.0.1/32" },
{ "type" : "group", "group" : "private" },
{ "type" : "reject-password" }
],

// Admin rules. The default is to accept queries from localhost, queries authenticated as users in the "admin" group
// and to reject anything else.
"admin" : [
{ "type" : "ip-accept", "ip" : "127.0.0.1/32" },
{ "type" : "group", "group" : "admin" },
{ "type" : "reject-password" }
],

}

httpApiUsers : {
"xxxx" : "pass",
"yyyy" : "pass",
}

httpApiGroups : {
"private" : [ "xxxx", "yyyy" ],
"admin" : [ "xxxx","yyyy" ],
}

optimalspieler
02-10-2017, 18:15
Could you show me where I can set this username and password please?
Sure! There is a httpApiAccessFilters section in your config, change it like so:



httpApiAccessFilters : {

// Public rules. The default is to accept everything.
"public" : [
{ "type" : "accept" }
],

// Private rules. The default is to accept queries from localhost, queries authenticated as users in the "private" group
// and to reject anything else.
"private" : [
{ "type" : "accept" }
],

// Admin rules. The default is to accept queries from localhost, queries authenticated as users in the "admin" group
// and to reject anything else.
"admin" : [
{ "type" : "accept" }
],

}


Essentially this will make the web server accept all requests.

All those restrictions are in place because some people back in Project Cars 1 wanted to expose the web interface of their servers to the public, without the public being able to make changes.

MarcusarilliuS_IRL
02-10-2017, 18:24
Thanks for the reply. That allowed me to enter the http interface. I can't figure out how to create a session though. It says can't edit current session, try edit next. So I try to create a "next session" but doesn't seem to work. Still nothing shows up in current session. Never have I seen such an unintuitive system for setting up a dedicated server.

MerlinC
02-10-2017, 18:46
There is no session started automatically after you start the dedicated server. Seems that you have to start your game to start your session - see section how to use DS.

http://forum.projectcarsgame.com/showthread.php?22370-Dedicated-Server-HowTo-(Work-in-Progress)

Find the DS of project cars very confusing as well - especially due to lack of official setup/installation guide. The PDF distributed together with the DS software package is very brief and there is no good troubleshooting section included.

P.S.: I'm currently struggling with (I assume) firewall issues - as long as I have my server in the DMZ everything works fine. When I remove it from the DMZ I can't get it running anymore although I have configured port forwarding for all ports mentioned

MarcusarilliuS_IRL
02-10-2017, 19:01
Thanks for the info. I'll have a mess around again tomorrow with it and see if I have any luck. Hopefully they make a better system for this in the future.