Skip to content
hackers4peacePublic

About

Typescript library for Solid Application Interoperability

Resources

Stars

13 stars

Watchers

8 watching

Forks

Latest commit

 

History

1,007 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solid Application Interoperability in TypeScript

CI Matrix chat MIT license

Modules implementing the Solid Application Interoperability Specification.

Access request and grant services

The authorization agent exposes owner-scoped LWS and SAI services:

  • POST /.sai/access-requests/<base64url(owner)> accepts needs, delegation, and revocation access requests.
  • GET|HEAD /.sai/grants/<base64url(owner)> returns a read-only access grant view over the owner's grant registry.

The authorization agent advertises the endpoints in the owner's WebID and ClientID CID documents and in LWS storage descriptions. The old .sai/grants issuance POST route and interop:hasDelegationIssuanceEndpoint are not part of the current protocol.

Intended dependents

package
Solid Applications @janeirodigital/interop-application
Solid Authorization Agent @janeirodigital/interop-authorization-agent

Development

Docker shared services

The default setup assumes the docker command is available and runs Docker as a non-root user. It also requires mkcert.

The setup uses a modified Makefile and docker-compose.yaml from docker-shared-services.

Node.js

The project requires Node.js 26 or higher.

Local DNS

macOS

mkdir /etc/resolver/
sudo sh -c 'echo "nameserver 127.0.0.1" > /etc/resolver/docker'
sudo dscacheutil -flushcache

If port 53 is occupied, open Docker settings, go to Resources, then Network, and enable Use kernel networking for UDP.

To enable communication with the Docker network:

# Install via Homebrew
brew install chipmk/tap/docker-mac-net-connect

# Run the service and register it to launch at boot
sudo brew services start chipmk/tap/docker-mac-net-connect

Bootstrapping

npm install
npm run build
npm test

To create local certificates:

make cert-install

To start local development:

make up

It runs these services:

Community Solid Server

The Community Solid Server runs as the auth, registry, and data services in docker-compose.yaml, with configs in environments/css/. The services provide the Solid storage instances and the Solid-OIDC provider.

It is available at https://auth.docker, https://reg.docker, and https://*.data.docker. Seed the environment with devbox run seed.

Authorization agent

UI

The UI runs from ui/authorization. It is available at https://ui.auth.docker. Sign up in the UI first, then sign up with the service through Connect server. When the input is empty, the development configuration uses the local CSS as the default provider.

Vuejectron demo app

The demo app runs from examples/vuejectron. It is available at https://vuejectron.docker and requires signup and authorization. When the input is empty, the development configuration uses the local CSS as the default provider.

Localization

Weblate Libre hosting provides the translation project for all relevant components.

Translation status

Deployment

VPS

Create a VPS and add your public SSH key. The examples below use an aarch64 Hetzner CAX21. Adjust the flake host if you use another architecture.

DNS

Configure DNS for your domain. For me.example:

me.example.            A  <VPS IP>
*.me.example.          A  <VPS IP>
app.auth.me.example.   A  <VPS IP>
data.me.example.       A  <VPS IP>
*.data.me.example.     A  <VPS IP>

*.me.example covers auth, reg, id, and user WebIDs. Keep these records DNS-only and turn the Cloudflare proxy off. Caddy terminates TLS, and the WebID and SPARQL endpoints are addressed by their public origin. If you replace the VPS, update every A record that points to the old IP.

NixOS

nixos-anywhere replaces the VPS disk. Make sure the target has no data you need before continuing.

For the demo host, the flake provides wrappers:

# Fresh install of the base system. The host key is regenerated.
nix run .#install-demo-base -- root@<demo-host>

# Full install preserving the current host key. Use this when the secrets
# already match that key.
nix run .#install-demo -- root@<demo-host>

# Subsequent configuration changes.
nix run .#deploy-demo -- root@<demo-host>

# Roll back one generation.
nix run .#rollback-demo -- root@<demo-host>

The raw base install equivalent is:

nixos-anywhere \
  --flake .#hetzner-cloud-aarch64 \
  --target-host root@me.example \
  --build-on remote \
  --kexec-extra-flags "-c"

--kexec-extra-flags "-c" forces the legacy kexec_load syscall. The Hetzner CAX image with Ubuntu 26.04 rejects kexec_file_load with EADDRNOTAVAIL, which leaves the machine unreachable after kexec. The full-install wrapper also passes --copy-host-keys so existing ragenix secrets remain decryptable.

If you use --copy-host-keys, add that host key to nix/hosts/me/secrets.nix before you encrypt the secrets. Without it, read the new host key after the first boot and update the recipients before deploying.

Nix configuration

Start from the demo host:

cp -r nix/hosts/demo nix/hosts/me

Add a matching nixosConfigurations.me in flake.nix, and set the image tag to the release commit whose OCI images were published to Quay:

tag = "<release-commit-sha>";

The demo configuration uses https://auth.<domain>, https://app.auth.<domain>, https://reg.<domain>, and https://data.<domain>. Keep the flake host's origins and Caddy virtual hosts consistent.

Secret files

ragenix encrypts all secret files. Add the target host's ed25519 key to nix/hosts/me/secrets.nix:

let
  me = "ssh-ed25519 AAAA...";
in
{
  "secrets/cloudflare.age".publicKeys = [ me ];
  "secrets/auth.age".publicKeys = [ me ];
  "secrets/fuseki.age".publicKeys = [ me ];
  "secrets/garage.age".publicKeys = [ me ];
}

Encrypt or edit each file from nix/hosts/me:

RULES=./secrets.nix ragenix -e ./secrets/cloudflare.age
RULES=./secrets.nix ragenix -e ./secrets/auth.age
RULES=./secrets.nix ragenix -e ./secrets/fuseki.age
RULES=./secrets.nix ragenix -e ./secrets/garage.age
  • cloudflare.age holds CF_API_TOKEN=..., a Cloudflare token with Zone:Zone:Read and Zone:DNS:Edit for the zone. Caddy uses it for the ACME DNS-01 challenge. If the token has IP filtering, allow both the VPS IPv4 and IPv6 addresses because Caddy may reach the Cloudflare API over IPv6.
  • auth.age holds CSS_VAPID_PRIVATE_KEY=..., CSS_PUSH_SENDER=mailto:..., and CSS_ENCODED_PRIVATE_JWK=.... The public VAPID key in the host configuration must match the private key.
  • fuseki.age holds ADMIN_PASSWORD=... and CSS_FUSEKI_ADMIN=admin:... with the same password. Fuseki uses the first value, and the worker uses the second to create per-account datasets.
  • garage.age holds GARAGE_RPC_SECRET=..., GARAGE_ADMIN_TOKEN=..., and CSS_GARAGE_ADMIN_TOKEN=... with the same admin token. The worker uses the admin token to create per-data-pod buckets and keys.

Generate the VAPID pair with:

npx web-push generate-vapid-keys

Generate the base64url-encoded private JWK with:

node packages/repl/cmd.ts -- gen-jwk -b

CSS_PUSH_SENDER must be a mailto: or https: contact URI.

Applying the configuration

For a fresh install, nixos-anywhere installs the base system. Then deploy the demo host:

nix run .#deploy-demo -- root@<demo-host>

The raw command is:

nixos-rebuild switch \
  --no-reexec \
  --flake .#me \
  --target-host root@me.example \
  --build-host root@me.example

--no-reexec keeps nixos-rebuild from trying to execute the target's aarch64 nixos-rebuild on the local build machine.

Tip

If a one-shot service such as the Temporal schema or namespace setup fails because Postgres was not ready, re-run the command.

Caddy requests certificates through the Cloudflare DNS-01 challenge. Once the containers are healthy, the account management UI is at https://app.auth.me.example.

Funding

This project is funded through the NGI Zero Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Entrust Logo

About

Typescript library for Solid Application Interoperability

Resources

Stars

13 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages