Gateways to other networks¶
A gateway connects Unseenet to another network, so groups from there can be read and answered here, and an Unseenet group can, if its owner wants it, be read and answered from there. The software lives in its own repository, unseenet/unseenet-gateway, and the rules every gateway follows are UN-RFC 0023, with one profile per network.
Pre-alpha, lab only
The gateways run against a lab setup. Export to Usenet is not implemented yet, and nothing is connected to real Usenet peers.
Groups from another network¶
Groups from another network live under a top-level hierarchy named after that network, so you can always see where a group comes from:
| Network | In Unseenet | Profile | State |
|---|---|---|---|
| Usenet | usenet.*, e.g. usenet.comp.misc |
UN-RFC 0024 | import, in the lab |
| Nostr groups (NIP-29) | nostr.* |
UN-RFC 0026 | import, export and portals, in the lab |
| FidoNet | fido.* |
- | planned |
| Matrix rooms (public, unencrypted) | matrix.*, e.g. matrix.matrix-org.python |
UN-RFC 0037 (draft) | import and export, tested against Synapse |
Each gatewayed group is an ordinary moderated group whose moderator is
the gateway, so nodes and clients carry it without knowing anything about
gateways. Every imported post is signed by the gateway and says where it
came from: the network, its ID there, its date and its author there
(Origin-* headers). From Nostr the original signed event comes along too,
so a reader can check that the gateway did not change it.
When you answer a gatewayed post from Unseenet, your answer goes to the gateway as a submission, and the gateway sends it on to the other network under the gateway's name.
Bring your room to Unseenet¶
If you moderate a public, unencrypted Matrix room, you can have it gatewayed without asking anyone first:
- Find a gateway.
unseenet gateways --network matrixlists the gateways that announced themselves in the directoryunseenet.gateways: their name, the account to invite, what they do and who runs them. The project's own is@gateway:unseenet.org. The list is not a recommendation; anybody can run a gateway. - Invite its account to your room. Your invitation is the room's consent.
- Its operator decides. The gateway sends its operator a request, and
joins the room when it is approved. The group appears as
matrix.<server>.<room>, for examplematrix.matrix-org.unseenet-lounge. If it is declined, the invitation is declined with the operator's reason.
To stop, kick the gateway's account. Spaces, private and encrypted rooms are never gatewayed.
More than one gateway¶
A room can invite several gateways, so it does not depend on one host (UN-RFC 0038). The first gateway creates the group. A second one asks the group's owner to join. Once the owner approves, both are listed in the group, and they take turns: messages are carried once, by whichever gateway's turn it is. If one stops, the others go on. A group stays active while at least one of its gateways announces it in the directory. A group that no gateway announces any more stops, and its posts expire as usual.
Unseenet groups on another network: portals¶
A portal goes the other way: an Unseenet group, say dk.snak, gets a
counterpart on another network where people can read and write without
Unseenet software. For Nostr that is a NIP-29 group on a relay such as the
project's own wss://nostr.unseenet.org.
A portal publishes what Unseenet authors wrote outside Tor, where it may be kept for years. That is a different promise, so:
- Only the group's owner can open a portal, by listing it in the group's settings, and a gateway stops when it is removed.
- You are told. Before your first post in a group with a portal, the client says that it will also be published on the other network, outside Tor.
- Only open groups. Closed groups, private messages and encrypted posts are never published.
Shares¶
A share (UN-RFC 0060) is a reference, never a copy, on the other network too:
- Out. A plain share of a post that is on Nostr as well becomes a
repost there (NIP-18: kind 16 for a group's events, kind 6 for a plain
note); a share with a comment becomes a quote, your words with a
qtag and anostr:link. A share of something that is not on Nostr, and every share to Matrix, goes as your words and the shared post'sunseenet:address. The shared post's own text is never sent on your behalf. - In. A Nostr repost of something the gateway carries becomes a plain
share in groups that take them (a feed), and a new thread quoting it
becomes a share with a comment; anything else comes in as an ordinary post
with a
nostr:link. Chat groups take no shares. - Share notices (someone shared your post) stay in Unseenet.
Where a post asks not to be shared (Sharing: no), the node already
refuses shares of it, so none reaches a gateway.
What a gateway never does¶
A gateway never learns or records who wrote an Unseenet post or where it came from - the same promise every node makes. It can stop a key; it cannot identify a person (UN-RFC 0023 section 6.2).
Running a gateway or writing an adapter¶
A gateway is a shared core with one adapter per network. Usenet and Nostr are the reference adapters; one for another network can be written by anyone, in its own package, without changing the gateway. Setup and the adapter contract are in the gateway's README. A new network also needs a profile UN-RFC and its hierarchy reserved in the root list (UN-RFC 0018).
In Docker¶
ghcr.io/unseenet/gateway has the gateway, its Usenet and Nostr adapters and
Tor, for amd64 and arm64. It is published for releases only, signed with
cosign. Everything it keeps - gateway.toml, the keys, its state and Tor's -
is in the volume at /data.
docker run --rm -v gateway:/data ghcr.io/unseenet/gateway # writes an example gateway.toml
docker run --rm -it -v gateway:/data ghcr.io/unseenet/gateway keys # asks for the passphrases
docker run --rm -it -v gateway:/data ghcr.io/unseenet/gateway sh # edit /data/gateway.toml (vi)
docker run -d --name gateway -v gateway:/data \
-e UNSEENET_GATEWAY_PASSPHRASE=... ghcr.io/unseenet/gateway # run
With compose.yaml
the passphrases are Docker secrets (unseenet_gateway_passphrase,
unseenet_gateway_group_passphrase) instead of the environment, and the
container runs with a read-only root file system and no capabilities beyond
handing /data to its own user. Any gateway command runs the same way:
docker compose run --rm gateway create-groups.
- Tor runs in the container, and
socks_port = 9050ingateway.tomlreaches it. To use a Tor outside it, setTOR_SOCKS(then none is started) and pointsocks_portat it. - Beside a homeserver, a relay or INN in the same compose project,
address them by service name in
gateway.toml(server = "inn:119",relay = "ws://relay:7777"). - The group key should leave the host after
create-groups: copy/data/keys/group-owner.keyout (docker cp) and delete it from the volume.