release / deb (push) Successful in 17s
- doctor [<name>] [--fix]: checks the system (user, programs, folders, zips, units and leftover copies in /etc, sandbox access to moved folders, journal, polkit, daemon, orphaned boot links and schedules) and each instance (ownership, server zip, config paths, mods, ports, failed starts/backups), with a fix for each. --fix applies the safe ones and re-checks them. - backup enable|disable|now|list: a systemd timer per instance (terraria-backup@.timer, Persistent=), saving the world first, into /var/lib/terraria/backups/<name>/ (group-readable), pruning only scheduled backups. rename carries the schedule, delete removes it. upgrade's backups move there too. - fetch vanilla|tmodloader [<version>] [--list] [--upgrade <name>]: downloads from terraria.org / tModLoader's GitHub releases, checks GitHub's sha256 and the zip, names it with its version. - terractld may write /etc/systemd/system, for backup enable and doctor --fix over --host. - Units, tmpfiles, packaging, completion, docs and changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 KiB
16 KiB
Changelog
0.0.12 - 2026-10-02
- New
fetchcommand to download server zips intodist/, named with their version:terractl fetch tmodloader [<version>]downloads from tModLoader's GitHub releases (default: the latest stable) and checks it against the SHA-256 checksum GitHub publishes.terractl fetch vanilla [<version>]downloads from terraria.org (default: its newest; older versions by number,1449or1.4.4.9).--listshows the versions available (tModLoader: stable and preview), and which are already downloaded.--upgrade <name>switches an instance to the zip withupgraderight after.- Every zip is checked (complete, and the right kind) before it's put in
dist/; zips already there aren't downloaded again. If a site doesn't have the version or can't be reached, it says so and where to download it by hand. - Members of the
terrariagroup can use it withoutsudo(except--upgrade). Needscurl.
- Scheduled backups, with a systemd timer per instance (
terraria-backup@<name>.timer):sudo terractl backup enable <name> [--every <when>] [--keep <number>](default: daily, keeping the newest 14).--everytakeshourly,daily,weekly, a time such as04:30, or any systemd calendar expression. Missed backups are made after the machine starts again.backup now <name>makes one immediately,backup disable <name>stops the schedule (existing backups are kept), andbackup list [<name>]shows schedules, the last and next run, and the backups.- Each backup saves the world first if the server is running (as
exportdoes) and goes in/var/lib/terraria/backups/<name>/(TERRARIA_BACKUPSin/etc/default/terractl), readable by theterrariagroup. Only scheduled backups are pruned. renametakes the schedule along,deleteturns it off, and purging the package removes the schedules (not the backups).
- New
doctorcommand:terractl doctor [<name>] [--fix]checks the system (user, programs including ICU and curl, folders, zips, the systemd units and old copies in/etcthat replace them, sandbox access to moved folders, journal access, polkit, the daemon, leftovers of deleted instances) and each instance (file ownership and modes, its server zip, paths inserverconfig.txt, missing mods, shared ports, failed starts and backups). Each problem comes with the command that fixes it.--fixapplies the safe fixes:fix-perms, folder and zip permissions, journal access, theReadWritePaths=drop-in for moved folders, and boot links or backup schedules of instances that are gone. It exits with status 1 if a problem remains. - The daemon (
terractld.service) may now write to/etc/systemd/system, sobackup enableanddoctor --fixalso work through--host. - Warnings about moved folders now also suggest
terractl doctor --fix. - New
upgradecommand to change an instance's server version, up or down:terractl upgrade <name>lists the zips indist/for its type, marking the installed, pinned and newest ones. Theterrariagroup can use it withoutsudo.sudo terractl upgrade <name> <zip>|latestchecks the zip first (right type, readable byterraria, contains the server, passesunzip -t), stops the server (saving the world), backs up its worlds and configs to/var/lib/terraria/backups/<name>/, pinsZIP=, unpacks the zip right away and starts the server again if it was running. If unpacking fails, the instance is left as it was.--no-backupskips the backup.- Going to an older version needs
--downgrade, because worlds saved by a newer version can't be opened by an older one. - Bash completion offers the instance's zips. Works with
--host.
reinstallnow always unpacks the same version again. Before, an instance with a blankZIP=picked the newest zip indist/, soreinstallcould silently upgrade it. It now pins the zip the instance runs first, and refuses if that zip is gone fromdist/. It also keeps the record of the installed version (server/.installed) until the new unpack is done.list,new,importandenablewarn whenTERRARIA_BASEorTERRARIA_DISTis somewhere the services' sandbox doesn't allow (the instances folder not inReadWritePaths=, or either folder under/home), and print the exact drop-in to add. The daemon (terractld.service) is checked too when it's on. A server that can't create its folder now says why in its log, instead of only "Read-only file system".- The guide's "Changing locations" now covers bind mounts (the simplest way to use another disk) as well as drop-ins, and a new section explains keeping instances or zips under
/home. journal-accessis offered by tab completion and listed in the guide's command reference.upgrade, andprepare/runstarted as root, check first that theterrariauser can run the terractl being used. A copy under/rootis refused with an explanation, beforeupgradestops the server, instead of failing withenv: Permission denied.terractlrun by a relative path (e.g.sudo ./bin/terractl prepare <name>from a source tree) no longer fails to switch to theterrariauser.- New
fix-permscommand:sudo terractl fix-perms <name>gives every file of an instance back to theterrariauser and reapplies the usual modes (group can read, others nothing; server binaries executable), e.g. after copying worlds in as root. Symlinks are not followed. Works with--hosttoo. listwarns about zips indist/that theterrariauser can't read (e.g. copied in withscp -pfrom a private file), andinfolists them asunreadable_zip=. A server that fails to install because of one now says how to fix it (sudo chmod 644 <zip>) instead of just "cannot read", and a missing zip is reported as not found.
0.0.11 - 2026-09-30
- The servers now log to their own journal (systemd log namespace
terraria), which members of theterrariagroup can read.attachandcmdtherefore show output toterrariagroup members withoutsudoor thesystemd-journalgroup, and without access to the rest of the system's logs. Read it directly withjournalctl --namespace=terraria -u terraria@<name>. - New
/etc/systemd/journald@terraria.conffor the servers' journal size and retention (default: up to 256 MB). - New internal
terractl journal-access, run as root before each server start: creates the servers' journal folder (never/var/log/journalitself) and gives theterrariagroup read access, repairing existing journal files too. - The note shown by
attachandcmdwhen output can't be read now distinguishes "not in theterrariagroup" from "in it, but the journal isn't set up yet". - New polkit rule (
/usr/share/polkit-1/rules.d/50-terractl.rules): members of theterrariagroup cansystemctl start,stopandrestartterraria@<name>withoutsudo.enable,disableand all other units still need root. Needspolkitd0.106 or newer, now a recommended package; Ubuntu 22.04's polkit can't run the rule. - New
enableanddisablecommands:terractl enable <name> [--now]makes a server start at boot (--nowalso starts it),terractl disable <name> [--now]stops that (--nowalso stops it, saving the world). They need root, likesystemctl enable.enablerefuses names without an instance, so a typo can't create a new instance at boot.newandimportnow suggestterractl enable <name> --now. listhas a newBOOTcolumn showing whether each server starts at boot (enabled,disabled, or e.g.masked).- Manage other hosts, like LXD/Incus remotes:
sudo terractl daemon enablestartsterractld.service, a daemon other hosts connect to (HTTPS, TCP port 7776;TERRACTL_LISTENin/etc/default/terractlchanges it). It's off until enabled.daemon disableanddaemon statusturn it off and show its state.daemon enableprints a command with a one-time token (valid for 24 hours); running it on another computer,terractl remote add <token>, adds the host as a remote named after its hostname (orremote add <name> <token>).sudo terractl daemon tokenmakes tokens for more computers,daemon statuslists the trusted ones, anddaemon revoke <name>removes one. Adding a host again replaces the old remote, e.g. after a revoke.remote listandremote removemanage remotes, which are stored per user.terractl --host <remote> <command>runs any command on a remote, includingattach,watchandexport/import/mods addwith files from your computer. The daemon runs it as root there, with messages adjusted toterractl --host <remote> ....terractl copyandterractl movecopy, move or rename instances, on one host or between hosts ([<remote>:]<name>). Paths and ports follow the destination's settings, and a missing server zip is copied along.movestops the source first, starts it again if the transfer fails, and starts the moved instance where it was running before.- Security: the token carries the daemon's certificate fingerprint, which the client checks on every connection; each computer gets its own key, and the daemon stores only hashes. The daemon runs as root with systemd sandboxing.
- Written in Python (standard library only), in
/usr/lib/terraria-server-manager/terractl-remote. The package now depends onpython3andopenssl.
- New
start,stopandrestartcommands, the same assystemctl start|stop|restart terraria@<name>, for this host and for--host.startrefuses names that have no instance. The service's own stop step is nowterractl service-stop; units that still callterractl stop <name> <pid>keep working. - New
renamecommand:terractl rename <name> <new name>renames the folder, updatesserverconfig.txt, and carries over the service (stopped and started again if it was running, and still starting at boot). The port and unpacked server are kept.movewithin one host uses it. - New
infocommand: this host's folders, zips and instances, or an instance's type, port, server zip and state, askey=valuelines. importreplaces aZIP=pin that's an absolute path not present on this host with the zip of the same name in this host'sdist/.- Messages that suggest a command now suggest
terractlcommands (terractl stop <name>rather thansystemctl stop terraria@<name>), withsudoonly when it's needed: not in a root shell, and not forterrariagroup members starting, stopping or restarting a server. - New
watchcommand:terractl watch <name> [-n <lines>] [-q]follows the server's output likeattach, but never sends input, so it's safe to leave open. Works for theterrariagroup withoutsudo, and while the server is stopped.-qleaves out the lines about what it's doing. - Bash completion for the new commands, remote names after
--host, and<remote>:<name>forcopyandmove. - Clearer messages when
runorprepareis typed withoutsudo(the old one, "must run as root or 'terraria'", read as if theterrariagroup were enough), and whenstopis typed by hand. - Upgrading: running servers keep logging to the system journal until restarted; the package lists the ones to restart.
0.0.10 - 2026-09-30
cmdnow prints the server's reply to the command, instead of only saying where to find it. It waits until the server has been quiet for a second, up to 5 seconds.attachandcmdnow explain when you can send commands but not see the server's output. That happens for members of theterrariagroup who aren't root or insystemd-journal. Previouslyattachshowed nothing, without saying why.- Replaced a
${var:+...}expansion with an explicitifinimport's summary message (ShellCheck SC2016). The output is unchanged.
0.0.9 - 2026-09-28
- New
exportcommand:terractl export <name> [file.tar.gz] [--with-server]archives an instance'sinstance.conf,serverconfig.txtanddata/(worlds, mods, mod configs). If the server is running under systemd, it is asked to save first. Archives are created readable only by their owner, sinceserverconfig.txtcan contain the server password.--with-serveralso includes the unpacked server software (and tModLoader's .NET), for hosts without internet access. - New
importcommand:terractl import <name> <file.tar.gz>creates an instance from an export, adeletebackup, or an archive of an old/opt/terrariainstance. Archives are checked before extracting (no paths outside the instance folder, no links or special files). Paths inserverconfig.txtare updated, a port already used by another instance is replaced with a free one, the server version the world was exported with is pinned, and ownership is set to theterrariauser. - One server per instance:
runholds a lock (<instance>/.lock) for the server's whole lifetime, released automatically when it exits or crashes. A secondrun, or starting the service while a copy started by hand is running, is refused. prepareandreinstall --cleanrefuse to run while the instance's server is running, soserver/and .NET are never replaced or deleted under it.deleterefuses to continue if the server is still running outside systemd.listshows servers started by hand asrunning (outside systemd).stoptyped by hand now explains to usesystemctl stopinstead of silently doing nothing.- Fixed relative paths given on the command line (e.g.
terractl mods <name> add tmod-export) being looked up from/instead of the current directory. - Bash completion for
exportandimport.
0.0.8 - 2026-09-28
- Bash completion for
terractl: commands, instance names,newtypes, console commands forcmd,reinstall/deleteoptions, andmodsactions and mod names. Installed toshare/bash-completion/completions/terractlby bothmake installand the package.
0.0.7 - 2026-09-28
- Fixed ShellCheck warnings that made
make check(and thereforemake deb) fail when ShellCheck is installed: simplified the development-copy check in--version(SC2140), and marked the intentional unquoted unit list inprerm(SC2086).
0.0.6 - 2026-09-28
- Renamed the command from
terraria-instancetoterractl, and the package fromterraria-instancetoterraria-server-manager. The new package replaces the old one automatically; see "Upgrading from the terraria-instance package" in the guide. - Settings file moved from
/etc/default/terraria-instanceto/etc/default/terractl. - New
terractl --version. - New Makefile:
make check,make deb,make install,make uninstall. - Restructured the source into a git repository layout.
0.0.5 - 2026-09-28
- Fixed
attach: detaching with Ctrl-D printed "jpid: unbound variable" and left ajournalctlprocess running.
0.0.4 - 2026-09-28
- The .NET runtime that tModLoader downloads on first start (and its logs) is now kept when an instance is upgraded or re-unpacked.
- New
reinstall --cleanto discard .NET as well and download it again.
0.0.3 - 2026-09-28
- New
modscommand:list,add,enable,disable,remove. Accepts the Windows export folder directly and sets file ownership. newandpreparenow createdata/Modsfor tModLoader instances.
0.0.2 - 2026-09-28
- Fixed
preparefailing for tModLoader zips when run as root from a directory theterrariauser can't enter (e.g./root).
0.0.1 - 2026-09-28
- First Debian package. Uses
/var/lib/terrariainstead of/opt/terrariaand/terraria, creates theterrariauser and directories with sysusers.d and tmpfiles.d, and stops instances cleanly when removed. prepareandrunswitch to theterrariauser when started as root, so no files end up owned by root.- New
deletecommand, with an automatic backup. listno longer aborts when an instance's config can't be read.