Connect to a server
How the Client App connects to a Pagis server, and the trust that a connection gives the server.
Connect only to a server you trust
When you connect to a server, this computer becomes a Host of that server. The server and its Administrator can then run commands on this computer, with the same access as you. They can also start a Coding Harness on this computer, which runs as you. Connect only to a server whose Administrator you trust.
Set up the connection
"Connect to a Pagis server" shows the "Server address or sign-in link"
field. The setup page takes the address of the server, such as
pagis.example.com, or a sign-in link of
the server, and nothing else: no email address and no password. It checks
the address before it sends it: an empty or malformed address gets a message
under the field, and the field takes the focus. The main process checks the
request again and refuses a request with no address in words for a person.
The client installs nothing, supervises nothing and keeps no key. It checks
that a Pagis server answers at the address and that its release is inside
the client's Compatibility Range: the client's own version and every later
version that promises the same API. When the server has no Administrator
yet, the client says so and names the Administration Interface that
finishes setup. Each of these problems shows under the field, and the setup
window stays. When the checks pass, the client keeps an id, the origin and
its host as a label in userData/servers.json. Each server has its own
window and persistent session partition, persist:server-<id>. Its
Session, cookies and Product App storage stay apart from every other
server. An address with Continue opens the server's own sign-in page
in that window. The client registers this machine as a Host of each
server whose partition holds a Session.
Sign in with the browser
Enter the server address and select Sign in with the browser. The
system browser shows the origin and TLS state, and its password manager
can fill your password. The page takes a password or a Sign-In Link, as
the server permits. After sign-in it makes a one-use Sign-In Link bound
to the Client App's random verifier, ends the browser Session and returns
to Pagis through pagis://auth. If the browser does not open Pagis,
select Return to the app.
The Client App accepts only the state that it made for that server,
once and within five minutes. It opens the Sign-In Link in that server's
window. The page trades the secret with the verifier for a Session in
that server's partition. The verifier and state stay in memory. A
program that also registers pagis cannot trade a caught link without
the verifier. Each other pagis:// link opens nothing.
Keep several servers
The application menu and tray list your servers by host. The first nine have Command-1 to Command-9 on macOS and Control-1 to Control-9 on Linux. Select a server to show its window. Add a Server… opens the connect screen with the same trust statement for each server. Remove This Server stops that server's Host link, clears its partition storage and removes it from the list.
A Client App that installs a Local Installation keeps only that server. Not built: a Client App with both a Local Installation and connected servers.
Connect with a sign-in link
An installation in Remote Access signs in a browser or an app on another
machine with a Sign-In Link, and never with a password
(ADR-0028).
A link is an address of the server, https://<host>/sign-in#<secret>, and
it signs in one client, one time. Get a link in one of these ways:
- From a browser or an app where you are signed in. Under Settings → Sessions, select Sign in another browser or app, then copy the link. The link is good for five minutes.
- From an Administrator. An invite is a link for your first Session, and it is good for seven days. An Administrator makes a new invite with New invite under People in the Administration Interface.
- With
pagis pairon the machine of the server. The command prints a link that is good for five minutes (Sign-In Links).
Paste the whole link in the field, then select Continue. The client
checks the origin of the link as it checks an address: the https rule, the
health route, the Compatibility Range and the setup of the server. It keeps
only the id, origin and host label in userData/servers.json. The secret of the
link goes to no file, no client storage and no log. The product window then
opens at the link. The page of the link posts the secret to the server, and
the answer puts the Session cookie in the cookie jar of the product window.
The client then registers this machine as a Host of the server, as after a
sign-in with a password. The Sessions list of the Person names the Session
"Pagis on macOS" or "Pagis on Linux".
A link with no secret, such as a copy that lost the part after #, gets a
message under the field, and the client sends nothing. A link that is spent
or expired opens a page that says so. The page names the three ways to a new
link, and it links to the sign-in page of the server. On an installation in
Remote Access, that sign-in page takes no password from this machine: it has
one field, Paste a sign-in link. Paste a new link there, also when the
client connected before and its Session ended.
Start the Client App again
The client checks the range again on every start and refuses a server outside it, with a message that says which end to update. The next start opens the same servers, each signed in while its Session lasts. When a server does not answer, or its release is outside the range, the setup page says so and offers "Try again" and "Choose another setup". It offers no repair, because the client installed nothing. Quit stops no process, because the client started none.
Updates
A connected Client App follows the oldest release of its stored servers (ADR-0027). Its Compatibility Range refuses a server older than itself, so it takes only the Update to the oldest release of its stored servers, and never an Update past it. At each check (at start, every 24 hours, and from "Check for Updates…"), it reads the release of each stored server from the health route:
- When every stored server runs a newer release, the client downloads the Update to the oldest of those releases from its feed on GitHub. It checks and installs that Update as in Updates. So when the Administrator updates the server past the Compatibility Range, the check at the next start gets the Update that this client needs.
- When any stored server runs the same release or an older one, there is no Update. "Check for Updates…" says that Pagis is up to date with its server, and names both releases.
- When any stored server does not answer, the check fails and gives that reason.
The client prepares nothing for a restart, because it supervises no server. "Restart to Update" asks no question about Runs, because the Runs belong to the server.
Only over https
The client connects to a server only over https://. It refuses an
http:// address before it sends a request, unless the host is loopback
(127.0.0.1, [::1] or localhost), such as an SSH tunnel. The refusal
names the two ways to an https:// address: Remote Access on a local
installation (Serve several People), and a proxy
that holds TLS in front of a server. A servers.json entry that holds an
http:// origin of another computer fails at the start, and the setup page
shows the refusal. The client follows no redirect before the product window
opens, and uses the TLS certificate check of the platform. On an https://
origin, its cookie jar holds the Session cookie as Secure, also where the
server set it without Secure (ADR-0024).
The trust of a connection
When you connect to a server, this computer becomes a Host of that server.
The server and its Administrator can then run commands on this computer, with
the same access as you. Under "Connect to a Pagis server", the setup page states this in
one line under the Server address field: "Connect only to a server you
trust." The client registers as a Host of the
signed-in Person and runs every dispatch frame the server sends, as the OS
user who started it. The approval, the effect class, the allow rules for each
machine and the audit row all live on the server, and the client applies no
check of its own, on purpose: a second confirmation here would ask a question
the server's approval card already asked, and it would not change the trust.
So a person who takes control of the server can also run commands on this
computer (ADR-0015). The client trusts the server that TLS authenticates, and
it registers as a Host on no clear-text connection to another machine.
The server and its Administrator can also start a Coding Harness, such as Claude Code, on this computer. The client starts the program that the server names, in the directory that the server names, as the OS user who started the client, and copies the bytes of the program to the server and back. The client applies no check of its own here either. A Client App of a local installation starts a Coding Harness for its own server in the same way (ADR-0033).