Build llm-agents / build (pull_request) Skipped
Restrict the OAuth2 client to a Pocket ID group and keep email login available. Document how existing users can link their accounts while retaining note ownership.
65 lines
3.8 KiB
Markdown
65 lines
3.8 KiB
Markdown
# object
|
|
|
|
Object storage and the Nix binary cache, plus HedgeDoc and wastebin.
|
|
|
|
- **Source:** [`shill/containers/object.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/object.nix)
|
|
- **Host:** NixOS container on [`shill`](../README.md) (bind-mounts `/mnt/minio` and
|
|
`/mnt/nix-cache` read-write)
|
|
- **nixpkgs:** `mine`. The MinIO server, CLI, and service module come from `mine-stable`.
|
|
|
|
## Role
|
|
|
|
| Service | Port | Purpose |
|
|
| --- | --- | --- |
|
|
| MinIO | `9000` (S3) / `9001` (console) | S3-compatible object storage, `s3.nul.ie` + `*.s3.nul.ie` (virtual-host style via `MINIO_DOMAIN`), console at `minio.nul.ie`; region `eu-central-1`; data on the `/mnt/minio` XFS volume |
|
|
| Harmonia | `5000` | Nix binary cache at `nix-cache.nul.ie` — `harmonia-dev` cache serves `shill`'s `/nix/store` out of a dedicated store view rooted at `/var/lib/harmonia` (bind-mounted from `/mnt/nix-cache`), signed with the `nix-cache.key` secret; a `harmonia` user with authorized keys exists for cache pushes, including `slop-broker`'s on `palace`, which is restricted to the store protocol and GC roots (`services.slop-broker-cache`, see [`slop-broker.md`](../../../../slop-broker.md#binary-cache)) |
|
|
| HedgeDoc | `3000` | collaborative markdown notes at `md.nul.ie`; Postgres on [colony-psql](colony-psql.md); anonymous edits but no anonymous notes, email and [Pocket ID sign-in](#hedgedoc-sign-in), no open email registration |
|
|
| wastebin | `8088` | pastebin at `pb.nul.ie` |
|
|
| atticd | `8069` | **currently disabled** (`services.atticd.enable = false`) — an alternative Nix cache that would store locally and sit behind `nix-cache.nul.ie`; config (including the `object/atticd.env` secret) is kept around |
|
|
|
|
Everything public is fronted by [middleman](middleman.md) (see its vhost table). The
|
|
`minio-client` is installed and the user's `~/.mc/config.json` points at an age-secret config.
|
|
`minio-2025-10-15T17-29-55Z` is allowlisted via `permittedInsecurePackages` (flagged as a TODO).
|
|
|
|
## HedgeDoc sign-in
|
|
|
|
HedgeDoc uses the `hedgedoc` [Pocket ID](middleman.md#pocket-id) client with PKCE. Pocket ID
|
|
allows members of its `hedgedoc` group. Deploy `middleman` to register the client and group
|
|
before deploying `object`.
|
|
|
|
Before granting an existing HedgeDoc user group membership, link their verified Pocket ID
|
|
subject (`sub`) to their existing row in the `hedgedoc` Postgres database. On first sign-in
|
|
HedgeDoc looks up the user by `profileid` and creates a user if that subject has no match.
|
|
Linking the existing row keeps its note ownership and email/password login.
|
|
|
|
Verify the procedure on a copy of the database and take a backup before making the live change.
|
|
In `psql`, set `hedgedoc_user_id` to the existing user's UUID and `pocket_id_sub` to their
|
|
verified Pocket ID subject. Run the update in a transaction and commit only after it returns
|
|
exactly the expected row. If a Pocket ID login already created a separate row, resolve that
|
|
account before linking.
|
|
|
|
```sql
|
|
UPDATE "Users"
|
|
SET profileid = :'pocket_id_sub'
|
|
WHERE id = :'hedgedoc_user_id' AND profileid IS NULL
|
|
RETURNING id, email;
|
|
```
|
|
|
|
Add the user to the `hedgedoc` group, then verify in a fresh browser session that both login
|
|
methods open the same account and its existing private notes.
|
|
|
|
## Network assignments
|
|
|
|
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `object`).
|
|
|
|
## Backing services
|
|
|
|
- [colony-psql](colony-psql.md) — HedgeDoc's database (atticd too, when enabled).
|
|
- MinIO buckets back other boxes' services: Gitea LFS/packages (with the `middleman` MIME hack
|
|
for Docker manifests), Mastodon's `mastodon` bucket and the Bluesky PDS `pds` bucket on
|
|
[toot](toot.md).
|
|
|
|
## Notable config files
|
|
|
|
- [`nixos/boxes/colony/vms/shill/containers/object.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/object.nix) — container definition and all services
|