-
Notifications
You must be signed in to change notification settings - Fork 6
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
Figure out a way to do a general "server-settings.json" and override the values per instance #8
Comments
I'm not experienced enough with bash to make this work in bash, would it be fine to introduce a dependency on Python and make a Python script which does this? I'd suggest we create these new init.conf variables:
|
Oh and if we're going this way, why not also include the user token with these so we can get rid of |
Yes, we can actually put the whole "server-settings.json" file settings into the init.conf and generate the file from it. That would be ideal and give full control and ability to override specific options on an instance level only, As far as bash goes - i'm not an expert too - it is quite basic: cat >/etc/factorio/$INSTANCE_NAME/server-settings.json <<EOF
{
"name": "${GAME_NAME}",
"description": "${GAME_DESCRIPTION}",
"tags": [${GAME_TAGS}],
"_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
"max_players": ${GAME_PLAYERS},
"_comment_visibility": ["public: Game will be published on the official Factorio matching server",
"lan: Game will be broadcast on LAN"],
"visibility":
{
"public": true,
"lan": true
},
"_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
"username": "$GAME_USERNAME",
"password": ""$GAME_USER_PASSWORD,
"_comment_token": "Authentication token. May be used instead of 'password' above.",
"token": "$GAME_TOKEN",
"game_password": "${GAME_PASSWORD}",
..........
"admins": [${GAME_ADMIN_LIST}]
}
EOF And you define those in the global init.conf with default values and then override what you need in the instance specific file how you need it. The only thing I do not know right now is how to deal with lists that are GAME_ADMIN_LIST and GAME_KEYWORDS as you need to provide a list as |
I think there needs to be a base file and ability to override certain values if needed. Mostly these are:
Everything else is basically the same - I do not change other settings from instance to instance.
The basic premise here is that I need to add a person to the default admin list and right now I will have to go through each instance config file and add him in. Also, I need to copy the config file each time.
We can just have a template file with bash variable substitutions and write it to the instance folder with each start/restart of the service, that way all the updates are going to be propagated each server update.
The text was updated successfully, but these errors were encountered: