Updates and rollback
AFTAB checks for a new version once a day. An update restarts only the panel, in about a minute, so VPN connections stay up. Every update is checked against a signature before it runs, and keeps a way back for 7 days.
Update from the panel
Section titled “Update from the panel”Open Settings → Updates. The page shows the installed version and, when a newer one is out, “Version X is available” with what is new in it. Check again asks now. With Download new updates automatically on (the update_auto_download setting, on from the start), a new version is downloaded in the background as soon as it is found, so installing takes seconds, and you still choose when to install. Press Install now, or Download and install now if it is not downloaded yet, and the page follows the install until the panel is back on the new version.
From the command line, run sudo aftab update for the latest release, or sudo aftab update v1.2.3 for a version you name. It does what the page does, in the foreground.
How an update is trusted
Section titled “How an update is trusted”The published version comes from latest.json, which carries a signature. The release notes (WHATSNEW.md and WHATSNEW.fa.md) and the release’s checksum file carry signatures too, and the installer checks latest.json with the same keys before choosing a release. The program and the installer keep the newest trusted timestamp they have seen and refuse older copies of latest.json, so a mirror or a copy in between cannot announce a version that was never released, replay an older announcement to hide a halt, forge release notes, or hand out another file with a matching checksum. The archive must match the signed checksums, must hold AFTAB of the version you asked for and nothing outside its folder, and the installer in it checks the signature again before it replaces anything. A development build has no keys and cannot install updates.
If the server cannot reach GitHub, run the installer again with AFTAB_MIRROR set to an https mirror: the panel remembers it and checks through it.
Releases let out in steps
Section titled “Releases let out in steps”Update channel has two choices. Stable (recommended) releases come out in steps over up to 60 days, each panel at its own time. A panel’s time is worked out on the panel itself, from a hash of its own secret and the version, so nothing is reported to anyone. While your turn has not come, the page says “Version X is being let out in steps” and the date it reaches you, and Update now takes it earlier if you want. If the publisher found a problem and stopped a release, the page says it was stopped by its publisher: wait for the next one. sudo aftab update without a version takes no stopped release either, and neither does the installer on a new server; a release named by hand, such as sudo aftab update v1.2.3, still is.
Beta (early, for testing) is the update_channel setting set to beta. A beta is taken as soon as it is published, but only when it is newer than the stable release. Switch back to stable at any time.
Go back
Section titled “Go back”Before an update installs, the installer keeps the program it replaces, as /usr/local/bin/aftab.previous, and a copy of the database in /etc/aftab/rollback/, with a note of what the update was. They are kept for 7 days, and the panel removes them after that.
If the new version does not answer its own health check within a minute, the update rolls back by itself and the panel tells you. To go back later, run sudo aftab rollback, which asks first, or sudo aftab rollback -y. The old program is put back and the new one is kept as aftab.failed to look at. The database goes back too only when the update changed its layout, because the old program cannot read a new layout. Then the copy from before the update replaces it, and changes made since then, such as clients, usage and settings, are lost. The database it replaces is kept beside it.
Bridges and other programs
Section titled “Bridges and other programs”The program that bridges and exit servers run comes with each panel release, and they fetch their own copy from the panel. If one runs an older agent, the panel alerts you. Settings → Updates also lists the other programs on the server and their versions.
What can go wrong
Section titled “What can go wrong”- “Could not check”. GitHub could not be reached from this server. Use
AFTAB_MIRRORas above. - “There is no newer version to install”. There is none, or the release is still being let out and your turn has not come.
- “did not become healthy; going back to the previous version”. The new version did not answer in a minute and was rolled back. Read the log with
sudo aftab log, and try again later. sudo aftab rollbacksays the update is more than 7 days old. The previous version is no longer kept. Restore a backup instead: see Backups and restore.- The page stays on “Restarting the panel…”. Taking long? Run
sudo aftab restart, then check Monitoring and alerts.