Keep pre-rebrand dedicated installs compatible
This commit is contained in:
parent
c1b228475d
commit
cd423d0c70
4 changed files with 59 additions and 10 deletions
10
README.md
10
README.md
|
|
@ -60,6 +60,14 @@ the prior release. Manually return to the recorded previous release with:
|
|||
sudo ./scripts/rollback-native.sh
|
||||
```
|
||||
|
||||
Existing NETfishing native installations can be upgraded in place. If
|
||||
`/opt/netfishing-server` or `netfishing-server.service` already exists, the
|
||||
installer retains that layout and installs compatibility executable names for
|
||||
the old unit. New installations default to the Straywild paths and names. The
|
||||
legacy `NETFISHING_INSTALL_ROOT`, `NETFISHING_SERVICE_NAME`, and dedicated-game
|
||||
environment settings remain accepted; explicit Straywild settings take
|
||||
precedence.
|
||||
|
||||
Copy `config/server.cfg.example` to `/etc/straywild-server.cfg` and adjust the
|
||||
room name, UDP port, player limit, and public-listing preference. Set `TZ` in
|
||||
`/etc/straywild-server.env` to an IANA timezone such as `America/New_York` when
|
||||
|
|
@ -180,7 +188,7 @@ corresponding-source record for its exact game commit.
|
|||
The server PCK contains straywild creative assets and third-party material.
|
||||
Their governing terms, credits, and provenance are maintained once in the
|
||||
main game's
|
||||
[`docs/ATTRIBUTION.md`](https://forge.makearmy.io/woofmeow/straywild/src/branch/main/docs/ATTRIBUTION.md),
|
||||
[`docs/ATTRIBUTION.md`](https://forge.makearmy.io/woofmeow/netfishing/src/branch/main/docs/ATTRIBUTION.md),
|
||||
with the asset license and trademark terms beside that record. Every staged
|
||||
server package copies those files from its exact game source commit.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,15 +12,32 @@ fi
|
|||
|
||||
archive_path="$(readlink -f -- "$1")"
|
||||
checksum_input="$2"
|
||||
install_root="${straywild_INSTALL_ROOT:-/opt/straywild-server}"
|
||||
service_name="${straywild_SERVICE_NAME:-straywild-server.service}"
|
||||
if [[ -n "${straywild_INSTALL_ROOT:-}" ]]; then
|
||||
install_root="${straywild_INSTALL_ROOT}"
|
||||
elif [[ -n "${NETFISHING_INSTALL_ROOT:-}" ]]; then
|
||||
install_root="${NETFISHING_INSTALL_ROOT}"
|
||||
elif [[ -d /opt/netfishing-server ]]; then
|
||||
install_root="/opt/netfishing-server"
|
||||
else
|
||||
install_root="/opt/straywild-server"
|
||||
fi
|
||||
if [[ -n "${straywild_SERVICE_NAME:-}" ]]; then
|
||||
service_name="${straywild_SERVICE_NAME}"
|
||||
elif [[ -n "${NETFISHING_SERVICE_NAME:-}" ]]; then
|
||||
service_name="${NETFISHING_SERVICE_NAME}"
|
||||
elif command -v systemctl >/dev/null \
|
||||
&& systemctl cat netfishing-server.service >/dev/null 2>&1; then
|
||||
service_name="netfishing-server.service"
|
||||
else
|
||||
service_name="straywild-server.service"
|
||||
fi
|
||||
|
||||
if [[ ! -f "${archive_path}" ]]; then
|
||||
echo "Archive not found: $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "${install_root}" != /* || "${install_root}" == "/" ]]; then
|
||||
echo "straywild_INSTALL_ROOT must be a specific absolute directory." >&2
|
||||
echo "The install root must be a specific absolute directory." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
|
@ -171,6 +188,12 @@ else
|
|||
release_stage="$(mktemp -d "${releases_dir}/.incoming.XXXXXX")"
|
||||
install -m 0555 "${payload_dir}/straywildServer.x86_64" "${release_stage}/"
|
||||
install -m 0444 "${payload_dir}/straywildServer.pck" "${release_stage}/"
|
||||
# Old units can keep running while an operator schedules a deliberate
|
||||
# service-name and filesystem migration.
|
||||
install -m 0555 "${payload_dir}/straywildServer.x86_64" \
|
||||
"${release_stage}/NETfishingServer.x86_64"
|
||||
install -m 0444 "${payload_dir}/straywildServer.pck" \
|
||||
"${release_stage}/NETfishingServer.pck"
|
||||
install -m 0444 "${payload_dir}/BUILD_INFO" "${release_stage}/"
|
||||
install -m 0444 "${payload_dir}/SHA256SUMS" "${release_stage}/"
|
||||
install -m 0444 "${payload_dir}/SOURCE-CODE.md" "${release_stage}/"
|
||||
|
|
@ -207,7 +230,8 @@ if command -v systemctl >/dev/null && systemctl cat "${service_name}" >/dev/null
|
|||
if systemctl is-active --quiet "${service_name}"; then
|
||||
service_active=true
|
||||
unit_text="$(systemctl cat "${service_name}")"
|
||||
if [[ "${unit_text}" != *"${install_root}/current/straywildServer.x86_64"* ]]; then
|
||||
if [[ "${unit_text}" != *"${install_root}/current/straywildServer.x86_64"* \
|
||||
&& "${unit_text}" != *"${install_root}/current/NETfishingServer.x86_64"* ]]; then
|
||||
echo "Active ${service_name} does not use the current-release symlink." >&2
|
||||
echo "Migrate the unit while stopped before using this updater." >&2
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -10,12 +10,29 @@ if [[ ${EUID} -ne 0 ]]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
install_root="${straywild_INSTALL_ROOT:-/opt/straywild-server}"
|
||||
service_name="${straywild_SERVICE_NAME:-straywild-server.service}"
|
||||
if [[ -n "${straywild_INSTALL_ROOT:-}" ]]; then
|
||||
install_root="${straywild_INSTALL_ROOT}"
|
||||
elif [[ -n "${NETFISHING_INSTALL_ROOT:-}" ]]; then
|
||||
install_root="${NETFISHING_INSTALL_ROOT}"
|
||||
elif [[ -d /opt/netfishing-server ]]; then
|
||||
install_root="/opt/netfishing-server"
|
||||
else
|
||||
install_root="/opt/straywild-server"
|
||||
fi
|
||||
if [[ -n "${straywild_SERVICE_NAME:-}" ]]; then
|
||||
service_name="${straywild_SERVICE_NAME}"
|
||||
elif [[ -n "${NETFISHING_SERVICE_NAME:-}" ]]; then
|
||||
service_name="${NETFISHING_SERVICE_NAME}"
|
||||
elif command -v systemctl >/dev/null \
|
||||
&& systemctl cat netfishing-server.service >/dev/null 2>&1; then
|
||||
service_name="netfishing-server.service"
|
||||
else
|
||||
service_name="straywild-server.service"
|
||||
fi
|
||||
releases_dir="${install_root}/releases"
|
||||
|
||||
if [[ "${install_root}" != /* || "${install_root}" == "/" ]]; then
|
||||
echo "straywild_INSTALL_ROOT must be a specific absolute directory." >&2
|
||||
echo "The install root must be a specific absolute directory." >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ ! -L "${install_root}/current" || ! -L "${install_root}/previous" ]]; then
|
||||
|
|
|
|||
|
|
@ -96,11 +96,11 @@ cat >SOURCE-CODE.md <<EOF
|
|||
|
||||
straywild dedicated game-server code is licensed under GPL-3.0-or-later.
|
||||
|
||||
Source repository: https://forge.makearmy.io/woofmeow/straywild
|
||||
Source repository: https://forge.makearmy.io/woofmeow/netfishing
|
||||
Exact game source revision: ${game_commit}
|
||||
|
||||
Packaging source:
|
||||
https://forge.makearmy.io/woofmeow/straywild-dedicated-server
|
||||
https://forge.makearmy.io/woofmeow/netfishing-dedicated-server
|
||||
Exact packaging source revision: ${packaging_commit}
|
||||
EOF
|
||||
umask "${apply_umask}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue