Server Setup
A server holds the documents, the accounts and the permissions, and keeps everybody’s edits in step. It is the same program you already have — there is nothing else to install.
You have three options, in increasing order of effort:
| Option | Good for |
|---|---|
| Local share | Two people in the same room, right now. Just a password |
| Server inside the app | A small group, when one machine is usually on |
| Headless server | A team. Runs on a box with no screen, starts with the machine |
Option 1: a local share
First give the share a password: in File > Settings > Server Files, select the entry
named localshare, add a permission of type Password, and choose what someone who knows the
password may do. Then open a document and choose Collaboration > Server > Share
Document. Other people on the same network find it with Collaboration > Browse Local
Shares…, open it, and type the password. A share with no password set turns everyone else
away.
Sharing also hands you an invite link — ord://your-address:port/localshare — for the
networks where automatic discovery does not get through. Send it, and opening it joins the
share; it can also be pasted into Open Link… or the Browse Local Shares box, or given on
the command line.
Sharing runs the server inside the app for you, on the port set on the Server Users page. Nothing is stored anywhere but your machine, and the share ends when you choose Unshare Document or close the program. There are no accounts, so there are no per-person permissions — everybody with the password gets the same ones.
Option 2: the server inside the app
- Open File > Settings > Server Users and set the address other people use to reach this machine and the port to listen on (8642 unless you change it).
- On the same page, add at least one account — yours — with full admin permissions: Add User, then Change Password.
- Collaboration > Server > Start Server.
- Everybody, you included, connects to it as described under Connecting to it. The File Navigator’s New File and Upload File put documents on it.
The server keeps its documents in your data folder. While it is stopped, the File Navigator browses that same folder offline.
Collaboration > Server > Stop Server saves everything, tells everybody the server is stopping, and disconnects them. Connected to a server from elsewhere, someone with Manage Server can restart it with Restart Server on the Server Users page — useful for a headless server nobody is sitting at.
While the server inside the app is running, its server settings pages (Server Users, Server Files, Server Folders) stay open to you on this computer, and what you change there takes effect at once, for everybody connected. They are disabled only while something else holds those settings: a headless server using the same data folder, or a document you are sharing locally. To change a headless server’s settings, connect to it with an admin account, which lets you change them live.
Option 3: a headless server
This is the arrangement for a team. No window, no display, no logged-in desktop session. The
steps below assume the program is installed in /opt/ordstyle and runs as an account of its
own, ordstyle.
1. Create its account and data folder
The server keeps its users, its documents and its certificate in a data folder. On a
desktop that is Documents/OrdStyle in your home folder; for a server, name one with
--data-dir so it does not depend on which account runs it:
sudo useradd --system --home-dir /var/lib/ordstyle --shell /usr/sbin/nologin ordstyle
sudo mkdir -p /var/lib/ordstyle
sudo chown ordstyle: /var/lib/ordstyle
Pass the same --data-dir to every command below, and run each one as ordstyle, so that
everything it writes belongs to that account. All traffic is encrypted: on its first start
the server makes its own certificate there, and each person’s program asks once whether to
trust it — and warns if the certificate later changes.
2. Create the first user
There is no default account, so the first one is made from the command line. The value is
name:password:permissions, where the last part is the admin permission bits (see
Permissions); 511 is every admin permission:
sudo -u ordstyle /opt/ordstyle/ordstyle --data-dir /var/lib/ordstyle --adduser "alice:her-password:511"
This creates server.db if it does not exist, and gives the account a home folder,
/home/alice. In it, alice has every folder permission except Upload Scripts, and every
document permission except Admin Document on the documents there; a document she creates
is her own, with every permission, as it is anywhere. Everybody after this can be added from
inside the program.
Run
--adduseronly while the server is stopped. It does not wait for a running server, and a running server rewrites the whole ofserver.dbfrom memory when it stops, so an account added underneath it is lost. The password cannot contain a:, since that separates the three parts — set a password like that afterwards with Change Password.
3. Start it
sudo -u ordstyle /opt/ordstyle/ordstyle --data-dir /var/lib/ordstyle --server --port 8642
8642 is the default, and the port an ord:// link assumes when it names none — use it unless
something else on the machine already has it.
| Option | Effect |
|---|---|
-s, --server |
Run with no GUI |
--port <n> |
Listen on this port. 0 picks a free one |
--data-dir <dir> |
Keep everything in this folder |
--lock-timeout <seconds> |
Let another user take over a settings lock held longer than this (default 600; 0 never) |
--server-debug |
Verbose logging. May include user names and document paths, so keep it off in normal use |
It prints a line when it is up, and stops on Ctrl+C.
What it keeps, and where
Everything sits in the data folder:
| File or folder | Holds |
|---|---|
server.db |
Users, groups, permissions, folders, document records |
docs/ |
The documents themselves, in the folder tree you see in the File Navigator |
server-local.crt, server-local.key |
The server’s own certificate and key, made on its first start |
audit.log |
A log of administrative actions |
groupchats.dat |
Group chat history |
dm_data.dat |
Direct messages |
pending_notifications.dat |
Mentions waiting for people who were offline |
Back up the whole folder. If you only take part of it, take server.db and docs/
together. The documents are plain text, so a directory of them is perfectly happy in Git or
any other version control alongside the database. Keep server-local.key too: a restored
server with a new key makes everybody confirm it again.
The server takes a lock file while it runs, and refuses to start if the same data folder is already in use by the File Navigator or an open Settings dialog. That is deliberate — two processes writing one document store is how document stores get corrupted.
Connecting to it
On each person’s machine:
- File > Settings > Connection Settings.
- Add the server: a nickname, its address, its port, and their user name.
- Collaboration > Connect to Server, which signs them in and opens the File Navigator (Ctrl+Shift+J reopens it) to browse what they may open.
A link of the form ord://host:port connects and opens the File Navigator, and
ord://host:port/Plans/q3.ord goes straight to one document — so either can be sent round or
bookmarked. On port 8642 the :port can be left out. Collaboration > Copy Document Link
produces the second kind for whatever is open, and Open Link… follows one that arrives by
mail or chat. A server the reader has not used before asks for their user name and password,
and offers to add it to their list.
Rather than handing out passwords, you can send an invite code from the Server Users page. The recipient pastes it into Accept Invite on their Connection Settings page and the account creates itself, already in the right groups with the right permissions. See User Management.
Keeping it running
On Linux, a systemd unit is the usual way:
[Unit]
Description=OrdStyle collaboration server
After=network.target
[Service]
Type=simple
User=ordstyle
ExecStart=/opt/ordstyle/ordstyle --data-dir /var/lib/ordstyle --server --port 8642
Restart=on-failure
[Install]
WantedBy=multi-user.target
--data-dir matters. The program picks its data folder from the first of these that is set:
--data-diron the command line.- The
ORD_DATA_DIRenvironment variable. - A file named
ordstyle.portablebeside the program, which makes the program’s own folder the data folder. - The data folder chosen in Settings, by the account that runs it.
Documents/OrdStylein that account’s home folder.
The server’s own settings — the port it falls back to without --port, the settings-lock
timeout without --lock-timeout, how often it writes documents to disk — come from the
running account’s settings file, .config/OrdStyle/OrdStyle.conf in its home folder. For the
ordstyle account above that is /var/lib/ordstyle/.config/OrdStyle/OrdStyle.conf; with no
such file, the defaults apply.
Next steps
- User management — accounts, groups and invites
- Permissions — who may do what
- Collaboration — what it is like to use