iz
Clone
0 watching0 forksRustAGPL-3.0567.3 KiB3950aceTahinli26 days ago34 commits
iz
iz is the family task board. It has columns, cards (with one level of subtasks, dependencies and
assignees), projects (tags), deadlines with meeting times and reminders, comments, attachments with
in-page viewers (images, media, PDF, spreadsheets, slides), an activity trail, and admin-defined mail
rules with a durable outbox. Sign-in goes through the family's im identity provider. Cards keep a manual
order (the default sort), an administrator can restore tasks deleted in the last 30 days, and an im
administrator is an administrator in iz whatever role is stored here.
Design notes are in docs/architecture.md. The HTTP contracts with im and in are in
docs/contracts.md, and the code conventions are in docs/conventions.md.
Build
cargo build --release -p iz-web
The binary is target/release/iz. Nothing in the build or the runtime uses Node. Use bun for any
JavaScript tooling.
Configuration
Copy the example and edit it:
cp config/iz.example.toml config/iz.toml
Or pass any path with --config <path>. The config path is chosen in this order: the --config
flag, then the IZ_CONFIG environment variable, then config/iz.toml. If the file does not exist,
iz writes the example there on first run.
Keys:
| Key | Meaning |
|---|---|
database |
SQLite database file. Its -wal and -shm files sit next to it, and they are created with mode 0600. Keep it inside data_dir; boot logs a warning when it is not. |
data_dir |
Directory for iz.key, the lock file, attachments and other local files. |
listen |
HTTP listen address. Keep it on 127.0.0.1 behind the reverse proxy. |
base_url |
Public URL used in links and mail. https://, or http:// only for localhost, 127.0.0.1 or ::1; no user name or password; no trailing slash. |
[oidc] |
issuer (the im origin, no trailing slash; https:// outside a local test), client_id, client_secret_file. Remove the section to run without sign-in. |
[in_store] |
enabled. Stores attachments in the in Files service instead of local disk. Off by default. |
[backup] |
dir (backup sets go here), interval_hours (1 to 168, default 24), keep (at least 1, default 14), healthcheck_url (optional, pinged after each good backup). Remove the section to turn scheduled backups off; boot then logs a warning that no backup sets are written. |
Unknown keys are an error at boot, so a typo stops the start instead of being ignored.
Secrets are never in the TOML:
- The OIDC client secret goes in the file named by
client_secret_file. The file must be mode0600or0400, owned by the service user. iz reads it at boot. - The SMTP password is entered in the
/settingspage. iz seals it in the database.
Production layout
The example unit and reverse proxy config assume this layout:
/usr/local/bin/iz: the binary./etc/iz/iz.toml: the config.data_dir = "/var/lib/iz/data"anddatabase = "/var/lib/iz/data/iz.db"./etc/iz/oidc_client_secret: the client secret, mode0600, owned byiz./var/lib/iz: the working directory. The data lives in/var/lib/iz/data. Backups can go in/var/lib/iz/backups. The unit makes all of/var/lib/izwritable and nothing else.
The reverse proxy example is deploy/ferron.conf. The unit is deploy/iz.service.
First run
-
Create the service user and directories:
sudo useradd --system --home-dir /var/lib/iz --shell /usr/sbin/nologin iz sudo install -d -m 0750 -o iz -g iz /var/lib/iz /var/lib/iz/data sudo install -d -m 0750 -o root -g iz /etc/iz -
Install the binary and the config:
sudo install -m 0755 target/release/iz /usr/local/bin/iz sudo install -m 0640 -o root -g iz config/iz.toml /etc/iz/iz.tomlEdit
/etc/iz/iz.tomlsodata_dir,databaseandbase_urlmatch the layout above. -
Register the client at
imand write its secret file (see the next section). -
Install the unit by hand. Nothing enables it for you:
sudo install -m 0644 deploy/iz.service /etc/systemd/system/iz.service sudo systemctl daemon-reload sudo systemctl enable --now iz -
Check it answers:
curl -fsS http://127.0.0.1:7654/healthzshould printok <build sha>.
On the first run iz creates iz.key in data_dir (32 random bytes, mode 0600). Sealed secrets in the
database, including the SMTP password, cannot be read without this key. Back up iz.key together with
the database, and store the copy somewhere other than the server. Losing iz.key means re-entering the
SMTP password and the sealed values, and any backup that lacks the key cannot restore those secrets.
Registering the client at im
iz is a client of im. Register it on the machine where im runs, with the im tools:
im client add --name iz --family-key iz \
--redirect-uri https://iz.example.com/auth/callback \
--post-logout-uri https://iz.example.com/ \
--backchannel-uri https://iz.example.com/auth/backchannel-logout \
--scopes "openid profile email directory.read files.service"
Replace https://iz.example.com with your base_url. If the flags differ, run im client add --help.
imprintsclient_idandclient_secret. The secret is shown once. Save it into the file named byclient_secret_file, mode0600, owned byiz.imgenerates theclient_iditself. Copy the printed value intoclient_idiniz.toml.- The scopes must include
openid profile emailfor sign-in,directory.readfor the people directory andfiles.servicewhen attachments are stored inin. - The redirect, post-logout and back-channel URLs are the paths iz serves:
{base_url}/auth/callback,{base_url}/and{base_url}/auth/backchannel-logout.
Then set the [oidc] section in iz.toml:
[oidc]
issuer = "https://im.example.com"
client_id = "<the client_id im printed>"
client_secret_file = "/etc/iz/oidc_client_secret"
Restart iz after changing the config. im client list shows the registered clients, and
im client disable <client_id> turns one off.
Backups
With a [backup] section, iz checks every minute whether a backup is due and writes a set into dir when the
last attempt (recorded in the database, so restarts do not reset it) is at least interval_hours old, or when none
was made yet. A failed attempt is retried at the interval, not every minute. It keeps the newest keep sets. A set
is a directory with:
iz.db: a consistent copy of the database,attachments/: the local attachment files,manifest.json: a SHA-256 for each file, andmanifest.mac: an HMAC-SHA256 ofmanifest.json, keyed fromiz.key.
While the server runs, an administrator can start a backup from the Settings page with the "Back up now" button
(it appears when [backup] dir is set). The running backup worker writes the set in the background. Only one run
is pending or running at a time: a press while one is pending or running starts nothing. The button is audited.
Backups do not copy iz.key. Keep that copy separately, as described in First run. A set can only be checked
and restored with the same iz.key that wrote it; a set without a valid manifest.mac is refused.
Restore with the server stopped:
sudo systemctl stop iz
iz restore --from /var/lib/iz/backups/<set dir>
sudo systemctl start iz
iz restore checks the set's manifest.mac, then the files against manifest.json, before it writes anything. A set that fails the
check is not restored. Do not copy the live database file by hand: it is written while iz runs.
Command line
Run these as the iz user, or with sudo -u iz, using the same config as the server.
iz serve: run the server. This is the default when no command is given.iz export --out DIR: write an export intoDIR. It never writes outsideDIR.iz restore --from <set dir>: restore a backup set. The server must be stopped.iz fsck: check the database and files. It is read-only.
export, restore and fsck refuse to run while the server holds the lock file data_dir/iz.lock.
Stop the service first. Exit status is 0 for success, 1 for a failure, and 2 for a usage error.
Logs go to stderr at info level. Set RUST_LOG to change the level. Under systemd, read them with
journalctl -u iz.
Where to read more
docs/architecture.md: modules, data model, routes, workers and rules.docs/contracts.md: the HTTP contracts shared withim(sign-in, logout, directory) andin(object store).docs/conventions.md: boot order, config rules, store and deploy rules.