From 5887a5705e45368f059fef344ebfd1009701ee73 Mon Sep 17 00:00:00 2001 From: dtonon Date: Tue, 9 Jun 2026 20:00:44 +0100 Subject: [PATCH] Add PUBLIC_SEARCH config option --- .env.example | 1 + README.md | 1 + src/lib/config.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.env.example b/.env.example index f618555..570c9e7 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ PUBLIC_MODE=simple # simple | full (single forum vs. many ro PUBLIC_GROUP_ID=mygrouprandomid # required in simple mode; the single forum's group id (ignored in full mode) PUBLIC_TITLE= # top-bar title; empty falls back to the group name PUBLIC_JOINCODE=no # yes | no — show an invite-code field when a join is rejected +PUBLIC_SEARCH=no # yes | no — enable the search box (requires a relay with NIP-50 support) PUBLIC_LABELS= # comma-separated discussion labels (e.g., bug,feature,question) PUBLIC_BLOSSOM_URL= # Blossom server URL for uploads (e.g., https://blossom.primal.net) # Theme color overrides — quote the value, a leading # is read as a comment otherwise diff --git a/README.md b/README.md index 8d76132..f49aba9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Squalk is configured entirely through environment variables (all prefixed `PUBLI | `PUBLIC_GROUP_ID` | in simple mode | — | The single forum's group id. Required when `PUBLIC_MODE=simple`; ignored in full mode, where rooms are selected at runtime. | | `PUBLIC_TITLE` | no | group name | Title shown in the top bar. When empty it falls back to the group's name. | | `PUBLIC_JOINCODE` | no | `no` | `yes` to show an invite-code field when a join request is rejected (for code-gated relays). | +| `PUBLIC_SEARCH` | no | `no` | `yes` to show a search box at the top of the homepage. Requires a relay with NIP-50 search support. | | `PUBLIC_LABELS` | no | — | Comma-separated discussion labels offered when composing, e.g. `bug,feature,question`. | | `PUBLIC_BLOSSOM_URL` | no | — | Blossom server URL used for media uploads, e.g. `https://blossom.primal.net`. Uploads are disabled when unset. | | `PUBLIC_ACCENT_COLOR` | no | `#e32a6d` | Override the accent (primary) color. Quote the value (`"#00ff00"`) — an unquoted leading `#` is read as a comment. The hover shade is derived automatically. | diff --git a/src/lib/config.ts b/src/lib/config.ts index 65e8e5b..bdaefeb 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -19,6 +19,8 @@ if (MODE === "simple" && !GROUP_ID) { throw new Error("PUBLIC_GROUP_ID is required in simple mode"); } export const JOINCODE_REQUIRED = env.PUBLIC_JOINCODE === "yes"; +// Requires a relay with NIP-50 support. +export const SEARCH_ENABLED = env.PUBLIC_SEARCH === "yes"; export const LABELS = (env.PUBLIC_LABELS ?? "") .split(",") .map((l) => l.trim())