Commit graph

16 commits

Author SHA1 Message Date
8d3c43b160 feat: synthesize brand kit from appName when brandDir unset
Adds back `services.webapp.appName` (briefly removed in the previous
commit per #100's strict policy) so existing hosts keep working
without authoring full per-host brand kits.

Resolution order:
1. If brandDir is set, use it (full brand kit wins).
2. Else synthesize: take the flake's default logo + a brand.json
   carrying appName as both name and shortName.

This is NOT a VITE_APP_NAME env shim — it threads through the brand
kit pipeline properly (brand.json read by vite-branding.ts). Hosts
that need themed chrome / their own logo upgrade to a real brandDir.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-10 17:13:05 +02:00
fe13f3b283 refactor: delegate webapp build to flake.lib.mkWebapp
Drops the local stdenv.mkDerivation + fetchPnpmDeps in favor of
calling the webapp flake's own lib.mkWebapp (added in
aiolabs/webapp#97). The hub build now runs through the same
builder as the per-standalone builds in server-deploy, which means
ONE pnpmDepsHash lives in webapp's flake.nix and no other repo
carries one.

Options changed:
- ADDED  flake (required): the webapp flake input. Server-deploy
  hosts pin this to inputs.webapp (main) or inputs.webapp-dev
  (staging channel).
- ADDED  brandDir: path to the brand kit. Defaults to the flake's
  committed aiolabs default. Override for per-host branding (logo,
  manifest name, theme colors).
- REMOVED src: replaced by flake (which carries the source).
- REMOVED gitUrl, gitRef: replaced by flake input ref selection.
- REMOVED pnpmDepsHash: managed inside webapp's flake.nix now.
- REMOVED appName: per #99/#100's strict policy, VITE_APP_NAME is
  brand-controlled. Custom names flow through brandDir + brand.json,
  not env vars. Hosts that today set appName must either accept the
  default brand's name or supply a per-host brandDir.

Other options (nostrRelays, lnbitsBaseUrl, hubXUrl, …) flow into
the build via lib.mkWebapp's extraEnv.

nginx root moves from \$out/share/webapp to \$out/dist (lib.mkWebapp's
output layout).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-10 17:04:05 +02:00
9d82016399 rename: hubActivitiesUrl → hubEventsUrl
The activities module in webapp was renamed to events
(aiolabs/webapp#94). The corresponding hub-URL option here is the env
that drives src/pages/Hub.vue's "Events" chakra tile. Renames:

- Option: `hubActivitiesUrl` → `hubEventsUrl`
- Env passed to vite: `VITE_HUB_ACTIVITIES_URL` → `VITE_HUB_EVENTS_URL`
- Example URL: `/sortir/` → `/events/`

No backwards compatibility shim — hosts using `services.webapp
.hubActivitiesUrl = "…"` will need to switch to `hubEventsUrl` in the
same change as their flake-input bump.

Coordinated downstream:
- aiolabs/server-deploy: standalones.nix `hubUrlOption` maps
  `events → "hubEventsUrl"` (no more "historical naming" comment).
- aiolabs/webapp PR #94: `VITE_HUB_EVENTS_URL` consumed by
  `src/pages/Hub.vue` and documented in `.env.example`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-09 20:05:15 +02:00
33bc06440e feat: serve hub SPA shell with Cache-Control: no-cache
Hashed assets stay immutable via the existing regex location; the SPA
shell (index.html, served via tryFiles fallback for /, deep links, and
literal /index.html) now revalidates on every load so new deploys are
picked up without browsers holding a stale shell that references
deleted hashed assets. no-cache = cache + revalidate (304), not
"don't store" — bandwidth cost is a single conditional request per
page load.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-04 11:17:15 +02:00
ca19127584 feat: add lnbitsNostrTransportPubkey option
New services.webapp.lnbitsNostrTransportPubkey threads through as
VITE_LNBITS_NOSTR_TRANSPORT_PUBKEY at build time. Empty default
keeps existing hosts unaffected; set per-host to opt into addressing
the lnbits backend over Nostr (NIP-44 v2 kind-21000 RPC) instead of
plain HTTP.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 22:40:02 +02:00
638969c608 build: add pkgs.pnpm to nativeBuildInputs (pnpmConfigHook needs it on PATH) 2026-05-23 11:08:24 +02:00
3e0b1ed073 build: bump fetcherVersion 2 -> 3 to skip deprecation 2026-05-23 11:03:20 +02:00
3cd8f014f7 build: use top-level fetchPnpmDeps/pnpmConfigHook + fetcherVersion=2
Nixpkgs deprecated pkgs.pnpm.{fetchDeps,configHook} in favor of the
top-level pkgs.fetchPnpmDeps and pkgs.pnpmConfigHook. fetchPnpmDeps now
requires fetcherVersion to be set; 2 is correct for pnpm v9+ lockfiles.
2026-05-23 10:55:50 +02:00
391f8006fd build: switch from buildNpmPackage to pnpm.configHook
Webapp now uses pnpm (aiolabs/webapp#61); fetch deps from pnpm-lock.yaml
instead of package-lock.json.

- Replace buildNpmPackage with stdenv.mkDerivation + pnpm.fetchDeps
- Rename npmDepsHash option to pnpmDepsHash
- Drop npmFlags and makeCacheWritable (handled by pnpm.configHook)

Consumers must update their pnpmDepsHash. Set to lib.fakeHash on first
build to get the correct hash.
2026-05-23 10:43:59 +02:00
b36b3dbf61 feat: add hubRestaurantUrl option
Mirror of the existing hub{Activities,Libra,Wallet,Chat,Forum,Market,
Tasks}Url options for the restaurant chakra tile. Empty default
keeps existing hosts ghosted; populate via the auto-derivation in
server-deploy's webapp-standalones module when restaurant.enable is
true.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 20:18:17 +02:00
3015cbb546 refactor: remove unused apiKey option
VITE_API_KEY was only consumed by hasApiConfig() in src/lib/config and
by the activities standalone (which is built without VITE_API_KEY
anyway, so apiKey ended up an empty string downstream). Nothing in the
main webapp uses it to authenticate any request.

Removing the option is a breaking change for any downstream that sets
it, but server-deploy was the only consumer and has already been
updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 08:35:56 +02:00
7e96b87d67 refactor: rename hubCastleUrl option to hubLibraUrl
Matches the upstream webapp source rebrand (castle-app → libra-app,
commit 442a755 in aiolabs/webapp). The chakra hub now reads
VITE_HUB_LIBRA_URL instead of VITE_HUB_CASTLE_URL, so the option that
sets it is renamed accordingly.

Servers consuming this module need to update their NixOS configs:
  services.webapp.hubCastleUrl  →  services.webapp.hubLibraUrl

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:45:33 +02:00
8dff6af7ac feat: add hub URL options for chakra-tile linking
The webapp's chakra hub page (src/pages/Hub.vue) reads
VITE_HUB_<NAME>_URL at runtime to decide where each module tile
points. Without these env vars set, hubLink() returns null and
every chakra tile renders ghosted (non-link), which makes the hub
look broken on first visit.

Adds 7 new options on services.webapp:
  hubActivitiesUrl, hubCastleUrl, hubWalletUrl, hubChatUrl,
  hubForumUrl, hubMarketUrl, hubTasksUrl

Each maps 1:1 to VITE_HUB_<NAME>_URL during the buildNpmPackage
build phase. All default to "" which preserves the
ghosted-when-unset behaviour for hosts that don't deploy a given
module.

Per-host usage:

  services.webapp = {
    enable = true;
    hubMarketUrl     = "https://demo.${domain}/market/";
    hubChatUrl       = "https://demo.${domain}/chat/";
    hubWalletUrl     = "https://demo.${domain}/wallet/";
    hubForumUrl      = "https://demo.${domain}/forum/";
    hubTasksUrl      = "https://demo.${domain}/tasks/";
    hubActivitiesUrl = "https://demo.${domain}/sortir/";
    hubCastleUrl     = "https://demo.${domain}/castle/";
    ...
  };

Trailing-slash convention is recommended under path-mode deployment
to avoid an asset-resolution round-trip; see the webapp repo's
.env.example for the rationale.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 16:23:21 +02:00
631e425b80 Add demoMode option for demo login page
When enabled, sets VITE_DEMO_MODE=true which switches the login page
to LoginDemo.vue with auto-generated demo account creation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-25 16:39:32 +02:00
Patrick Mulligan
132e688d65 feat: add src option for flake-compatible pure evaluation
When services.webapp.src is set, it is used directly instead of
builtins.fetchGit. This allows passing a flake input as the source,
which is required for pure evaluation mode in Nix flakes.
2026-02-27 12:17:29 -05:00
b30b37d5ce Initial commit: Vue 3 webapp NixOS module 2026-01-15 12:57:23 +01:00