Documentation:

Managing Sites and Apps

Determine the list of available Apps and Accessories:

To see the list of currently available Apps and Accessories, execute:

% pacman -Sl hl

hl stands for “headless”, i.e. Apps and Accessories that do not require a display or keyboard attached to the device running UBOS.

Display the currently installed Sites and Apps

To list the currently installed Sites and Apps, execute:

% sudo ubos-admin listsites

To find out about options for this command, add --help as an argument to the command.

Display Site information

To show information about a currently installed Site with hostname hostname, execute:

% sudo ubos-admin showsite --hostname <hostname>

Interactively create a new Site with a single App

To quickly set up a new Site with a single installed App at that Site without having to edit Site JSON manually, execute:

% sudo ubos-admin createsite

If you wish to use SSL/TLS encryption. you need to decide whether you would like to use a self-signed certificate (recommended for your home network but not for publicly accessible website), an official certificate that you have purchased, or a letsencrypt.org certificate (either work for publicly available websites). Depending on that:

% sudo ubos-admin createsite --tls

will ask you to provide the purchased certificate files. Alternatively:

% sudo ubos-admin createsite --tls --selfsigned

or

% sudo ubos-admin createsite --tls --letsencrypt

To generate the Site JSON without deploying the Site, e.g. in order to then manually edit the Site JSON:

% sudo ubos-admin createsite --dry-run --out <site.json>

This will save the created Site JSON in <site.json>. You can deploy it with ubos-admin deploy --file <site.json>

For an annotated example, see Setting up your first web App.

If you are curious what UBOS does under the hood, please refer to ubos-admin createsite.

Deploy a Site

To deploy a Site for the first time, or to update an already-deployed Site, with Site JSON file <site.json>, execute:

% sudo ubos-admin deploy [--quiet] [--siteid <siteid>] ... --file <site.json>

You can manually create the Site JSON, or have UBOS create it for you, by executing:

% sudo ubos-admin createsite --dry-run

and interactively answering the questions asked. For an annotated example, see Setting up your first web App.

When deploying a Site over the network, option --stdin may be preferable over option --file. For example, if you maintain your Site JSON files on your workstation’s desktop, the following command allows you to quickly deploy a new Site, or update an existing Site, on your UBOS device (hostname ubos-pc.local) over ssh:

% cat <site.json> | ssh shepherd@ubos-pc.local sudo ubos-admin deploy --stdin

Note: ubos-admin createsite is just a wrapper around ubos-admin deploy.

Warning

If you redeploy a Site using a different configuration (e.g. the new configuration does not contain the same set of Apps as before), this operation may throw away valuable data, as this does not create a backup of your data.

To perform a backup first to file ~/backup.ubos-backup, and then redeploy the Site, execute:

% sudo ubos-admin deploy --backup ~/backup.ubos-backup --file <site.json>

If you are curious what UBOS does under the hood, please refer to ubos-admin deploy.

Undeploy a Site

To undeploy a Site with hostname <hostname>, execute:

% sudo ubos-admin undeploy --hostname <hostname>

Warning

This does not create a backup of your data. You need to do that yourself first if you would like to retain the data from the to-be-undeployed Site.

To perform a backup first to file ~/backup.ubos-backup, and then undeploy the Site, execute:

% sudo ubos-admin undeploy --backup ~/backup.ubos-backup --hostname <hostname>

To undeploy all currently deployed Sites at the same time, execute:

% sudo ubos-admin undeploy --all

Use with care.

If you are curious what UBOS does under the hood, please refer to ubos-admin undeploy.