Publishing services
A service on a member, such as a NAS at home, can be reached from the internet by name. A device with a public address passes the connections on; the encryption ends at the member.
What it is
You run a service at home, say a document server on your NAS, and want to open
it from any browser as docs.example.org. Your router at home opens no port
for this, and its address is in no public record.
A few words first:
- A domain is a name you own on the internet, such as
example.org. - A DNS record is an entry at your DNS provider that says which address a name points to.
- TLS is the encryption a browser uses for
https://addresses. - A certificate proves to the browser that the server really is
docs.example.org. juist gets one from Let’s Encrypt. - An ingress is a device of your network with a public address, a small
VPS for example, that an admin gave the role
ingress. It takes connections on port 443, reads the name the browser asks for, and passes the connection through the tunnel to the member that publishes the name.
- browseranywhere
Asks for docs.example.org.
- TLSvpsingress
Reads the name in the TLS ClientHello and passes the connection on.
- WireGuardnastarget
Ends TLS, with a certificate from Let's Encrypt.
- HTTP127.0.0.1:8080service
Gets the plain connection.
The ingress ends no TLS, so it never sees the content. TLS ends at the NAS, and the NAS passes the plain connection on to the service. One ingress serves every name of the network.
Setting it up
Set the network’s domain, give the VPS the role, and publish the name docs on
nas:
juist network domain example.org
juist grant vps ingress
juist publish add nas docsdocs goes to port 443 on the NAS, unless you give another port after the
name. Where a change needs more than one admin, it waits for the others
(how changes are approved).
Point *.example.org at the VPS’s public address, for every name at once, or
docs.example.org alone.
juist ingress serveIt asks once for sudo, starts the juist-ingress service, and opens ports 443
and 80. Port 80 only redirects to https.
Its operator, the local user who manages the device, agrees to serve the name and says where the plain connection goes:
juist publish serve docs=127.0.0.1:8080juist gets a certificate through the ingress and ends TLS here. It prints
serving docs.example.org and
ending TLS for docs.example.org to 127.0.0.1:8080.
juist grant and juist publish add name the next step and the device it
runs on. Run there by that device’s operator, they take that step too.
juist invite vps --ingress admits a new device as the ingress at once.
Keeping the server away from your network
A server published from a full member reaches the network and the member’s LAN once someone breaks into it. Publish from one only what you would put on the internet anyway.
A service member keeps the server away from them: a juistd of its own beside the service, with no privilege, which every device keeps from opening any connection to it. Only its replies pass. Run it beside the service, for instance in a container on the service’s network:
juistd --serve immich=immich-server:2283 --home /var/lib/juist
juist -s /var/lib/juist/daemon.sock join 'juist:…' --name immichThen, on an admin’s device, juist grant immich service and
juist publish add immich immich. It ends TLS itself, with a certificate from
Let’s Encrypt, and answers nothing but what it publishes and log sync. It has
no way out, so a service that downloads things at its first
start needs that done beforehand.
Good to know
- A published name is one label under the domain:
docs.example.org, nota.docs.example.organd notexample.org. Publishing the domain itself is planned. - Without
=ADDR, as injuist publish serve, the service ends TLS itself and holds its own certificate, as it would facing the internet. juist publish add nas docs --proxyhands the service the client’s address in a PROXY protocol v2 header.- Members that turned names on with
juist names onreach a name published on 443 directly through the tunnel, with the same certificate (Names). juist publishlists the published names.juist publish remove nas docsstops publishing one.juist publish serve --stopandjuist ingress serve --stopundo the two serve steps.- An ingress runs on Linux, for now, and so does juist’s own TLS. A target on FreeBSD ends TLS in the service itself.
- An ingress is never a voucher or an exit node, and routes no subnet. Every member takes from it only connections to the ports it publishes and serves, and log sync. Everything else from it is dropped.
- The ingress runs as its own user,
juist-ingress, holds no key of the network, and may ask juistd one thing: what is published. - An ingress whose view of the network is stale serves nothing. If its juistd stops answering, the names go down within ten seconds.
Whoever controls the ingress can get a certificate for your names and intercept public clients. Members that turned names on are not affected, since they connect to the target directly. A CAA record, a DNS record that says who may issue certificates for the domain, bound to the target’s ACME account would close that gap. juist cannot give you that record yet.
If something goes wrong
| You see | What to do |
|---|---|
the network has no domain to publish under | juist network domain example.org first |
on nas, juist status: Published says not served here: not agreed to on this device (juist publish serve) | run juist publish serve on nas |
on vps, juist status: Ingress says not running on this device (juist ingress serve) | run juist ingress serve on vps |
juist ingress on vps: nothing to serve | no name is published and served yet; a hint says when the view is stale |
the ingress does not answer on 443: … | journalctl -u juist-ingress shows why |
the terminator does not answer on … | journalctl -u juist-serve shows why |