Home

Login

Settings

english

./update

Remote Update Utility

Overview

The Focus™ remote update utility ("update") is a Linux console program, which allows you to update a Focus™ instance either to or from a remote installation.

It assumes that you deal with one local installation of Focus™ and one remote installation of Focus™.

You can either push your local changes to the remote installation or you can pull remote changes to the local installation.

The push is only relevant for you, if you are participating in the further development of the Focus™ platform itself (you are changing or extending the source code of Focus™); push is comparable to an incremental deployment from a development+test environment to a production environment.

The pull assumes that there is a central master web location hosting the Focus™ directory structure on a standard web server (e.g. Apache or NGINX) and make it thereby available to many other local installations, which obtain incremental authorative code updates from there.

The update process is based on a so-called manifest file, which describes all relevant directories and files in ZML and can be edited with a plain text editor.

Push Mode

The push mode assumes that you make changes to the source code and supplementary files in the local installation, also optionally extending and changing the local manifest file.

It then is able to automatically check the need of a directory or file update on the remote installation (based on SHA-256 hash checksums, which are calculated locally and remotely on-the-fly).

Thus only changed (or new) local files are transferred to the remote installation and the entire process is much faster, compared to a brute force copy.

Pull Mode

The pull mode assumes that there are regular changes to the source code and supplementary files in the remote installation and that the manifest file is maintained in the remote location.

The pull operation obtains the remote manifest file and verifies the need of a local update based on a SHA-256 hash checksum stored in the manifest file compared to an on-the-fly calculated checksum of the corresponding local file.

The pull operation is designed with no custom processing part on the remote end (just a standard web server), so that such a setup can scale up for a 1 to many pull distribution.

Let us have a look at the manifest file, as it is at the core of the entire update process.

Poll Mode

The poll mode works like a reverse push mode.

It first downloads the specified remote manifest file and then performs exactly the same update process of directories and files, but initiated the other way around.

This is for example helpful if you have a main development installation on the Internet and the current installation is on a local corporate network, which is not directly accessible from the Internet.

The Manifest File

Every installation of Focus™ contains a file called manifest.zml.
It looks like this (we only show the first couple of lines to be able to explain how it works; the real file is a little more than 200 lines long):

[url]https://focus.litehouse.dev[/url]
[token]859c8a36926c4b8e9a3db5b9440612d7[/token]

[item] [name]LICENSE.txt[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]README.txt[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]TODO.txt[/name] [type]file[/type] [mode]update[/mode] [/item]

[item] [name]asset[/name] [type]dir[/type] [mode]create[/mode] [/item]
[item] [name]asset/Amaranth-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/FantaisieArtistique-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/GoudyMediaeval-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/Josefin-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/JulyRainstorm-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/Kalam-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/Lato-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/Merriweather-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/Roboto-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/TravelingTypewriter.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/Ubuntu-Regular.ttf[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/bg_field.jpg[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/bg_island.jpg[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/bg_redsea.png[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/bg_seahorizon.jpg[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/bg_wind.jpg[/name] [type]file[/type] [mode]update[/mode] [/item]
[item] [name]asset/click.mp3[/name] [type]file[/type] [mode]update[/mode] [/item]
...

The ZML tag [url] defines the address of the remote installation and the ZML tag [token] defines the secret certificate of a remote user, who has the system property set to true (as push updating is a sensitive system-related function).

After these two tags, an unlimited number of [item] tags can follow.

They define either directories or files, which are officially part of Focus™.

The [name] tag inside the [item] tag defines the relative directory path of a directory or file inside the Focus™ installation directory.

The [type] tag defines whether the item is a directory (dir) or a file (file).

The [mode] tag defines the update mode (or in other words what to do).

The following modes are available, depending on the type of the item:

Directory [type]dir[/type]
create (create a directory if it does not exist yet)
destroy (unconditionally remove a directory and everything below)
refresh (refreshes an entire directory and everything below)
none (take no action)

File [type]file[/type]
update (overwrite a file if it needs updating)
updatelive (overwrite a file if it needs updating, even if it is in use)
delete (unconditionally delete a file)
none (take no action)

The destroy (directory) and delete (file) modes allow you to remove deprecated directories or files on the remote installation.

These are usually only needed to run once (e.g. if you want to remove a source code file which is no longer part of Focus™ or if you want to remove a directory completely and force replacing it with a completely new content).

Invoking "update"

You can start the Focus™ remote update utility by typing the following inside of your local Focus™ installation directory:

./update

If no parameters are given, the usage will be displayed:

focus.update(main) 2025-12-28 14:54:29: update v1.0 2025-10-31 (Focus™ Remote Update Utility)
focus.update(main) 2025-12-28 14:54:29: (using configuration in focus.ini)
focus.update(main) 2025-12-28 14:54:29: usage: ./update [help,build,hash,push,trypush,pull,restart,shutdown] ([url]) [manifestfile]

Building a Manifest File from Scratch

"update" allows you to build a new manifest file from scratch (which will include ALL directories and files inside of the Focus™ installation directory).

To do so, you have to enter a command like the following:

./update build manifestdemo.zml

The output will be the following:

focus.update(main) 2025-12-28 14:54:29: update v1.0 2025-10-31 (Focus™ Remote Update Utility)
focus.update(main) 2024-05-14 16:52:23: (using configuration in focus.ini)
focus.update(main) 2024-05-14 16:52:23: collecting file and directory information
focus.update(main) 2024-05-14 16:52:23: writing manifest file: manifestdemo.zml
focus.update(main) 2024-05-14 16:52:23: manifest file successfully compiled: manifestdemo.zml

The produced manifestdemo.zml file will contain all directories and files below the local Focus™ installation directory, transformed into [item] tags.

You can now edit the manifestdemo.zml file with a plain text editor and remove everything, which does not belong to an official Focus™ installation (and set the [url] and [token] tags to the correct values for your remote installation).

Pushing an Update to the Remote Installation

Now you can make changes to the local installation and also modify the manifest file if necessary.

If you want to update your remote installation, you enter the following command:

./update push manifestdemo.zml

This will connect to your remote installation, go through your manifest file item-by-item, will check the need for updating and if necessary will act according to the specified modes.

It will update the remote install from the local installation.

The update is a verbose operation; each and every action taken will be printed to the screen.

Polling an Update from the Remote Installation

To perform the process in reverse, enter the following command:

./update poll manifestdemo.zml

This will connect to your remote installation, download the manifest file, will check the need for updating and if necessary will act according to the specified modes.

It will update the local installation from the remote installation.

Performing a Push or Poll Dry Run

If you just want to test whether the push or poll operation works and which actions on files and directories have to be taken, you can use the trypush or trypoll command instead of the push or poll command.

This looks and feels like the real push or poll, but will actually not perform the update on the remote or local side.

Adding Hashes to the Manifest File

The push or poll operations do not require this step, as the local and remote hashes are calculated on-the-fly.

In contrast, the pull operation requires the pre-calculated hash codes as part of the manifest file, as it is designed to scale up to many clients and as it only requires a remote static web server to function.

You can add the hashes in the format of a [hash]...[/hash] tag to a previously generated or manually created manifest file with the following command:

./update hash manifestdemo.zml

This command will parse all local files mentioned in the manifest file and will calculate the hashes, which are then stored in a 2nd file with an appended 2 (In the above example this would be the file manifestdemo.zml2).

This 2nd manifest file is the one you require for a pull update.

Pulling an Update from a Remote Location

To pull an update from a central authorative location, you can enter the following command:

./update pull https://updatefocus.litehouse.dev manifestdemo.zml2

This will obtain the specified manifest file from the specified remote location and perform the update based on the content of the manifest file.

Restarting the Remote Instance

After a successful update, you usually need to restart the remote (or local) instance to pick up the newest executable.

This can be achieved by entering the following command while connected to the instance which needs to be restarted:

./update restart manifestdemo.zml

Your instance will restart (which usually takes a couple of seconds).

Stopping the Remote Instance

If (for whatever reason) you need to shutdown the remote (or local) instance of Focus™, you can do so with the following command:

./update shutdown manifestdemo.zml

The Focus™ process will stop and you will need operating system access to restart the process again at a later point-in-time.

This is only helpful in emergency situations (e.g. the occurrence of a security issue).

0ms