Compare commits

..

No commits in common. "b20d93e22929980e963430d0efa253dc37ab2338" and "6eb0cd96d8952c9a07651e44c2a8dacc71b09de1" have entirely different histories.

5 changed files with 17 additions and 49 deletions

View File

@ -4,10 +4,8 @@ on:
push: push:
branches: branches:
- master - master
paths: tags:
- buildinfo.json - latest
# workaround for #526
workflow_dispatch:
jobs: jobs:
build: build:

View File

@ -4,10 +4,6 @@ on:
push: push:
branches: branches:
- master - master
paths:
- README.md
# workaround for #526
workflow_dispatch:
jobs: jobs:
docker-description: docker-description:

View File

@ -6,8 +6,7 @@
[中文](./README_zh_CN.md) [中文](./README_zh_CN.md)
<!-- start autogeneration tags --> <!-- start autogeneration tags -->
* `2`, `2.0`, `2.0.9`, `stable`, `stable-2.0.9` * `2`, `2.0`, `2.0.9`, `latest`, `stable`, `stable-2.0.9`
* `2.0.10`, `latest`
* `1`, `1.1`, `1.1.110`, `stable-1.1.110` * `1`, `1.1`, `1.1.110`, `stable-1.1.110`
* `1.0`, `1.0.0` * `1.0`, `1.0.0`
* `0.17`, `0.17.79` * `0.17`, `0.17.79`
@ -273,7 +272,7 @@ These are the environment variables which can be specified at container run time
| UPDATE_MODS_ON_START | If mods should be updated before starting the server | | 0.17+ | | UPDATE_MODS_ON_START | If mods should be updated before starting the server | | 0.17+ |
| USERNAME | factorio.com username | | 0.17+ | | USERNAME | factorio.com username | | 0.17+ |
| CONSOLE_LOG_LOCATION | Saves the console log to the specifies location | | | | CONSOLE_LOG_LOCATION | Saves the console log to the specifies location | | |
| DLC_SPACE_AGE | Enables or disables the mods for DLC Space Age in mod-list.json[^1] | true | 2.0.8+ | | DLC_SPACE_AGE | Enables or disables the mods for DLC Space Age in mod-list.json | true | 2.0.8+ |
| MODS | Mod directory to use | /factorio/mods | 2.0.8+ | | MODS | Mod directory to use | /factorio/mods | 2.0.8+ |
**Note:** All environment variables are compared as strings **Note:** All environment variables are compared as strings
@ -432,8 +431,3 @@ Use the `PORT` environment variable to start the server on the a different port,
* [bplein](https://github.com/bplein/docker_factorio_server) - Coded scenario support * [bplein](https://github.com/bplein/docker_factorio_server) - Coded scenario support
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Contributed version updates * [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Contributed version updates
* [carlbennett](https://github.com/carlbennett) - Contributed version updates and bugfixes * [carlbennett](https://github.com/carlbennett) - Contributed version updates and bugfixes
[^1]: Space Age mods can also be individually enabled by using their name separated by space.
Example 1: Enable all by using `true`
Example 2: Enable all by listing the mod names `space-age elevated-rails quality`
Example 3: Enable only Elevated rails `elevated-rails`

View File

@ -60,18 +60,12 @@
"2.0.9": { "2.0.9": {
"sha256": "f499077b3e2c1313452c350f1faf17db31cae2a0fa738f69166e97c3caa3c86d", "sha256": "f499077b3e2c1313452c350f1faf17db31cae2a0fa738f69166e97c3caa3c86d",
"tags": [ "tags": [
"latest",
"stable", "stable",
"stable-2.0.9", "stable-2.0.9",
"2", "2",
"2.0", "2.0",
"2.0.9" "2.0.9"
] ]
},
"2.0.10": {
"sha256": "2d7dd212fa6f715218a5e33bad7d593af8998fa7bf7ce727343159ee1f8c23f4",
"tags": [
"latest",
"2.0.10"
]
} }
} }

View File

@ -4,8 +4,6 @@ set -eou pipefail
# Path to the mod-list.json file # Path to the mod-list.json file
MOD_LIST_FILE="$MODS/mod-list.json" MOD_LIST_FILE="$MODS/mod-list.json"
ALL_SPACE_AGE_MODS=("elevated-rails" "quality" "space-age")
if [[ ! -f "$MOD_LIST_FILE" ]]; then if [[ ! -f "$MOD_LIST_FILE" ]]; then
# Create the mod-list.json file if it doesn't exist # Create the mod-list.json file if it doesn't exist
echo '{"mods":[{"name":"base","enabled":true}]}' > "$MOD_LIST_FILE" echo '{"mods":[{"name":"base","enabled":true}]}' > "$MOD_LIST_FILE"
@ -28,30 +26,18 @@ disable_mod()
# Enable or disable DLCs if configured # Enable or disable DLCs if configured
if [[ ${DLC_SPACE_AGE:-} == "true" ]]; then if [[ ${DLC_SPACE_AGE:-} == "true" ]]; then
# Define the DLC mods # Define the DLC mods
ENABLE_MODS=(${ALL_SPACE_AGE_MODS[@]}) DLC_MODS=("elevated-rails" "quality" "space-age")
elif [[ ${DLC_SPACE_AGE:-} == "false" ]]; then
# Define the DLC mods
DISABLE_MODS=(${ALL_SPACE_AGE_MODS[@]})
else
ENABLE_MODS=()
DISABLE_MODS=()
for SPACE_AGE_MOD in "${ALL_SPACE_AGE_MODS[@]}"; do # Iterate over each DLC mod
REGEX="(^|\s)$SPACE_AGE_MOD($|\s)" for MOD in "${DLC_MODS[@]}"; do
if [[ "$DLC_SPACE_AGE" =~ $REGEX ]]; then enable_mod "$MOD"
ENABLE_MODS+=($SPACE_AGE_MOD) done
else else
DISABLE_MODS+=($SPACE_AGE_MOD) # Define the DLC mods
fi DLC_MODS=("elevated-rails" "quality" "space-age")
# Iterate over each DLC mod
for MOD in "${DLC_MODS[@]}"; do
disable_mod "$MOD"
done done
fi fi
# Iterate over each DLC mod to enable
for MOD in "${ENABLE_MODS[@]}"; do
enable_mod "$MOD"
done
# Iterate over each DLC mod to disable
for MOD in "${DISABLE_MODS[@]}"; do
disable_mod "$MOD"
done