Compare commits

..

28 Commits

Author SHA1 Message Date
7884f7f4f5 🎨
Took 3 minutes
2024-11-02 14:34:56 +01:00
a169eb92d9 Added extra_host example for NAS
Took 11 minutes
2024-11-02 14:27:49 +01:00
8c9dfd004e Use stable_online_version instead of stableOnlineVersionShort
This hopefully causes the stable tag to not be removed anymore for an unknown reason.
2024-11-01 17:50:52 +01:00
867635db16 Auto Update Factorio to stable version: 2.0.13 experimental version: 2.0.14 2024-11-01 15:23:21 +00:00
b7413607c4 Auto Update Factorio to stable version: 2.0.13 experimental version: 2.0.14 2024-11-01 14:20:23 +00:00
5d6f70b285 Auto Update Factorio to stable version: 2.0.13 experimental version: 2.0.13 2024-10-31 15:23:56 +00:00
a24e42b281 Auto Update Factorio to stable version: 2.0.13 experimental version: 2.0.13 2024-10-31 14:20:50 +00:00
d1142e3408 Auto Update Factorio to stable version: 2.0.12 experimental version: 2.0.13 2024-10-31 13:28:03 +00:00
4eb53b6e48 Auto Update Factorio to stable version: 2.0.12 experimental version: 2.0.12 2024-10-31 12:43:16 +00:00
f986f1c870 Auto Update Factorio to stable version: 2.0.12 experimental version: 2.0.13 2024-10-30 20:23:47 +00:00
bc760a9599 Auto Update Factorio to stable version: 2.0.12 experimental version: 2.0.13 2024-10-30 19:18:52 +00:00
d153e30f1c Auto Update Factorio to stable version: 2.0.12 experimental version: 2.0.12 2024-10-29 13:29:24 +00:00
cc5061d339 Auto Update Factorio to stable version: 2.0.12 experimental version: 2.0.12 2024-10-29 12:44:42 +00:00
14ae422463 Auto Update Factorio to stable version: 2.0.11 experimental version: 2.0.12 2024-10-28 18:30:19 +00:00
88ca95a1ae Auto Update Factorio to stable version: 2.0.11 experimental version: 2.0.12 2024-10-28 17:20:48 +00:00
64980b9db3 using absolute path over relative path for subscripts (#538) 2024-10-27 19:49:15 +01:00
85f8011105 Update README_zh_CN.md (#535)
fix spelling typo
2024-10-26 16:33:42 +02:00
cc8d89df84 Auto Update Factorio to stable version: 2.0.11 experimental version: 2.0.11 2024-10-26 09:20:52 +00:00
956ade4f0b Auto Update Factorio to stable version: 2.0.11 experimental version: 2.0.11 2024-10-26 08:25:28 +00:00
049d34ea9a Auto Update Factorio to stable version: 2.0.10 experimental version: 2.0.11 2024-10-25 16:27:26 +00:00
d01580b5a5 Auto Update Factorio to stable version: 2.0.10 experimental version: 2.0.11 2024-10-25 15:22:54 +00:00
25a283ad79 Readded REPO_TOKEN in checkout, because workflows are not triggered.
related #526
2024-10-24 16:17:01 +02:00
b172b16ff4 Auto Update Factorio to stable version: 2.0.10 experimental version: 2.0.10 2024-10-24 14:01:05 +00:00
eb150cff0d Auto Update Factorio to stable version: 2.0.10 experimental version: 2.0.10 2024-10-24 13:59:37 +00:00
b20d93e229 Change DLC_SPACE_AGE to enable specific Space Age mods (#530)
* Change variable DLC_SPACE_AGE to allow listing specific Space Age mods to enable

* Adjust DLC_SPACE_AGE note

Co-authored-by: Florian Kinder <florian.kinder@fankserver.com>

---------

Co-authored-by: Florian Kinder <florian.kinder@fankserver.com>
2024-10-23 23:54:02 +02:00
9562212254 Filter for path and remove tags
related #526
2024-10-23 23:53:11 +02:00
6060c7b722 Auto Update Factorio to stable version: 2.0.9 experimental version: 2.0.10 2024-10-23 21:20:20 +00:00
06baf6a186 Auto Update Factorio to stable version: 2.0.9 experimental version: 2.0.10 2024-10-23 20:24:52 +00:00
10 changed files with 67 additions and 27 deletions

View File

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

View File

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

View File

@ -13,6 +13,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_TOKEN }}
- name: Run update script - name: Run update script
run: ./update.sh run: ./update.sh

View File

@ -6,7 +6,8 @@
[中文](./README_zh_CN.md) [中文](./README_zh_CN.md)
<!-- start autogeneration tags --> <!-- start autogeneration tags -->
* `2`, `2.0`, `2.0.9`, `latest`, `stable`, `stable-2.0.9` * `2.0.14`, `latest`
* `2`, `2.0`, `2.0.13`, `stable`, `stable-2.0.13`
* `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`
@ -272,7 +273,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 | true | 2.0.8+ | | DLC_SPACE_AGE | Enables or disables the mods for DLC Space Age in mod-list.json[^1] | 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
@ -431,3 +432,8 @@ 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

@ -10,7 +10,7 @@
* `0.x.y` - 具体的版本 * `0.x.y` - 具体的版本
* `0.x-z` - 在该版本上的增量更新 * `0.x-z` - 在该版本上的增量更新
## 什么是 Facotrio ## 什么是 Factorio
> 摘录自 [steam factorio 页面](https://store.steampowered.com/app/427520/Factorio/) > 摘录自 [steam factorio 页面](https://store.steampowered.com/app/427520/Factorio/)

View File

@ -57,15 +57,21 @@
"1.1.110" "1.1.110"
] ]
}, },
"2.0.9": { "2.0.13": {
"sha256": "f499077b3e2c1313452c350f1faf17db31cae2a0fa738f69166e97c3caa3c86d", "sha256": "27b36901a39e593adf28418c0286142c6c7a9f83d156963c7369bd405a25c7d1",
"tags": [ "tags": [
"latest",
"stable", "stable",
"stable-2.0.9", "stable-2.0.13",
"2", "2",
"2.0", "2.0",
"2.0.9" "2.0.13"
]
},
"2.0.14": {
"sha256": "5a4bc4c3b2a97ed1fc58eb796321e848dcc64435bd91013dd9c78a14a8ce8815",
"tags": [
"latest",
"2.0.14"
] ]
} }
} }

View File

@ -6,8 +6,8 @@ services:
args: args:
# Check buildinfo.json for supported versions and SHAs # Check buildinfo.json for supported versions and SHAs
# https://github.com/factoriotools/factorio-docker/blob/master/buildinfo.json # https://github.com/factoriotools/factorio-docker/blob/master/buildinfo.json
- VERSION=2.0.9 - VERSION=2.0.13
- SHA256=f499077b3e2c1313452c350f1faf17db31cae2a0fa738f69166e97c3caa3c86d - SHA256=27b36901a39e593adf28418c0286142c6c7a9f83d156963c7369bd405a25c7d1
ports: ports:
- "34197:34197/udp" - "34197:34197/udp"
- "27015:27015/tcp" - "27015:27015/tcp"
@ -22,3 +22,8 @@ services:
# - PORT=34198 # - PORT=34198
# - PRESET=deathworld # - PRESET=deathworld
# - ADDR=::1 # - ADDR=::1
# # Uncomment the following line to enable the use of the host's network stack,
# # which may be necessary for some setups like NAS or when using some proxy service like firewall rules.
# extra_hosts:
# - "host.docker.internal:host-gateway"

View File

@ -4,6 +4,8 @@ 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"
@ -26,18 +28,30 @@ 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
DLC_MODS=("elevated-rails" "quality" "space-age") ENABLE_MODS=(${ALL_SPACE_AGE_MODS[@]})
elif [[ ${DLC_SPACE_AGE:-} == "false" ]]; then
# Iterate over each DLC mod
for MOD in "${DLC_MODS[@]}"; do
enable_mod "$MOD"
done
else
# Define the DLC mods # Define the DLC mods
DLC_MODS=("elevated-rails" "quality" "space-age") DISABLE_MODS=(${ALL_SPACE_AGE_MODS[@]})
else
ENABLE_MODS=()
DISABLE_MODS=()
# Iterate over each DLC mod for SPACE_AGE_MOD in "${ALL_SPACE_AGE_MODS[@]}"; do
for MOD in "${DLC_MODS[@]}"; do REGEX="(^|\s)$SPACE_AGE_MOD($|\s)"
disable_mod "$MOD" if [[ "$DLC_SPACE_AGE" =~ $REGEX ]]; then
ENABLE_MODS+=($SPACE_AGE_MOD)
else
DISABLE_MODS+=($SPACE_AGE_MOD)
fi
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

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -eoux pipefail set -eoux pipefail
INSTALLED_DIRECTORY=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
FACTORIO_VOL=/factorio FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}" LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}" GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
@ -40,10 +41,10 @@ if [[ $NRTMPSAVES -gt 0 ]]; then
fi fi
if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
./docker-update-mods.sh ${INSTALLED_DIRECTORY}/docker-update-mods.sh
fi fi
./docker-dlc.sh ${INSTALLED_DIRECTORY}/docker-dlc.sh
EXEC="" EXEC=""
if [[ $(id -u) == 0 ]]; then if [[ $(id -u) == 0 ]]; then

View File

@ -73,8 +73,8 @@ rm -f -- "$tmpfile"
# Update tag by stable # Update tag by stable
cp buildinfo.json "$tmpfile" cp buildinfo.json "$tmpfile"
if [[ $stableOnlineVersionShort == "$stableCurrentVersionShort" ]]; then if [[ "$stable_online_version" == "$stable_current_version" ]]; then
jq --arg stable_current_version "$stable_current_version" --arg stable_online_version "$stable_online_version" --arg sha256 "$stable_sha256" 'with_entries(if .key == $stable_current_version then .key |= $stable_online_version | .value.sha256 |= $sha256 | .value.tags |= . - [$stable_current_version] + [$stable_online_version] else . end)' "$tmpfile" > buildinfo.json jq --arg stable_current_version "$stable_current_version" --arg stable_online_version "$stable_online_version" --arg sha256 "$stable_sha256" 'with_entries(if .key == $stable_current_version then .key |= $stable_online_version | .value.sha256 |= $sha256 | .value.tags |= . - [$stable_current_version] + [$stable_online_version, "stable"] else . end)' "$tmpfile" > buildinfo.json
else else
jq --arg stable_current_version "$stable_current_version" --arg stable_online_version "$stable_online_version" --arg sha256 "$stable_sha256" --arg stableOnlineVersionShort "$stableOnlineVersionShort" --arg stableOnlineVersionMajor "$stableOnlineVersionMajor" 'with_entries(if .key == $stable_current_version then .value.tags |= . - ["latest","stable",$stableOnlineVersionMajor] else . end) | to_entries | . + [{ key: $stable_online_version, value: { sha256: $sha256, tags: ["latest","stable",("stable-" + $stable_online_version),$stableOnlineVersionMajor,$stableOnlineVersionShort,$stable_online_version]}}] | from_entries' "$tmpfile" > buildinfo.json jq --arg stable_current_version "$stable_current_version" --arg stable_online_version "$stable_online_version" --arg sha256 "$stable_sha256" --arg stableOnlineVersionShort "$stableOnlineVersionShort" --arg stableOnlineVersionMajor "$stableOnlineVersionMajor" 'with_entries(if .key == $stable_current_version then .value.tags |= . - ["latest","stable",$stableOnlineVersionMajor] else . end) | to_entries | . + [{ key: $stable_online_version, value: { sha256: $sha256, tags: ["latest","stable",("stable-" + $stable_online_version),$stableOnlineVersionMajor,$stableOnlineVersionShort,$stable_online_version]}}] | from_entries' "$tmpfile" > buildinfo.json
fi fi