Keep pre-rebrand dedicated installs compatible

This commit is contained in:
Alexander Sellite 2026-08-25 22:18:56 -04:00
parent c1b228475d
commit cd423d0c70
4 changed files with 59 additions and 10 deletions

View file

@ -60,6 +60,14 @@ the prior release. Manually return to the recorded previous release with:
sudo ./scripts/rollback-native.sh 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 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 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 `/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. The server PCK contains straywild creative assets and third-party material.
Their governing terms, credits, and provenance are maintained once in the Their governing terms, credits, and provenance are maintained once in the
main game's 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 with the asset license and trademark terms beside that record. Every staged
server package copies those files from its exact game source commit. server package copies those files from its exact game source commit.

View file

@ -12,15 +12,32 @@ fi
archive_path="$(readlink -f -- "$1")" archive_path="$(readlink -f -- "$1")"
checksum_input="$2" checksum_input="$2"
install_root="${straywild_INSTALL_ROOT:-/opt/straywild-server}" if [[ -n "${straywild_INSTALL_ROOT:-}" ]]; then
service_name="${straywild_SERVICE_NAME:-straywild-server.service}" 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 if [[ ! -f "${archive_path}" ]]; then
echo "Archive not found: $1" >&2 echo "Archive not found: $1" >&2
exit 1 exit 1
fi fi
if [[ "${install_root}" != /* || "${install_root}" == "/" ]]; then 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 exit 2
fi fi
@ -171,6 +188,12 @@ else
release_stage="$(mktemp -d "${releases_dir}/.incoming.XXXXXX")" release_stage="$(mktemp -d "${releases_dir}/.incoming.XXXXXX")"
install -m 0555 "${payload_dir}/straywildServer.x86_64" "${release_stage}/" install -m 0555 "${payload_dir}/straywildServer.x86_64" "${release_stage}/"
install -m 0444 "${payload_dir}/straywildServer.pck" "${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}/BUILD_INFO" "${release_stage}/"
install -m 0444 "${payload_dir}/SHA256SUMS" "${release_stage}/" install -m 0444 "${payload_dir}/SHA256SUMS" "${release_stage}/"
install -m 0444 "${payload_dir}/SOURCE-CODE.md" "${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 if systemctl is-active --quiet "${service_name}"; then
service_active=true service_active=true
unit_text="$(systemctl cat "${service_name}")" 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 "Active ${service_name} does not use the current-release symlink." >&2
echo "Migrate the unit while stopped before using this updater." >&2 echo "Migrate the unit while stopped before using this updater." >&2
exit 1 exit 1

View file

@ -10,12 +10,29 @@ if [[ ${EUID} -ne 0 ]]; then
exit 2 exit 2
fi fi
install_root="${straywild_INSTALL_ROOT:-/opt/straywild-server}" if [[ -n "${straywild_INSTALL_ROOT:-}" ]]; then
service_name="${straywild_SERVICE_NAME:-straywild-server.service}" 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" releases_dir="${install_root}/releases"
if [[ "${install_root}" != /* || "${install_root}" == "/" ]]; then 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 exit 2
fi fi
if [[ ! -L "${install_root}/current" || ! -L "${install_root}/previous" ]]; then if [[ ! -L "${install_root}/current" || ! -L "${install_root}/previous" ]]; then

View file

@ -96,11 +96,11 @@ cat >SOURCE-CODE.md <<EOF
straywild dedicated game-server code is licensed under GPL-3.0-or-later. 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} Exact game source revision: ${game_commit}
Packaging source: Packaging source:
https://forge.makearmy.io/woofmeow/straywild-dedicated-server https://forge.makearmy.io/woofmeow/netfishing-dedicated-server
Exact packaging source revision: ${packaging_commit} Exact packaging source revision: ${packaging_commit}
EOF EOF
umask "${apply_umask}" umask "${apply_umask}"