Add PUBLIC_SEARCH config option

This commit is contained in:
dtonon 2026-06-09 20:00:44 +01:00
parent ea478c1e4b
commit 5887a5705e
3 changed files with 4 additions and 0 deletions

View file

@ -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_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_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_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_LABELS= # comma-separated discussion labels (e.g., bug,feature,question)
PUBLIC_BLOSSOM_URL= # Blossom server URL for uploads (e.g., https://blossom.primal.net) 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 # Theme color overrides — quote the value, a leading # is read as a comment otherwise

View file

@ -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_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_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_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_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_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. | | `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. |

View file

@ -19,6 +19,8 @@ if (MODE === "simple" && !GROUP_ID) {
throw new Error("PUBLIC_GROUP_ID is required in simple mode"); throw new Error("PUBLIC_GROUP_ID is required in simple mode");
} }
export const JOINCODE_REQUIRED = env.PUBLIC_JOINCODE === "yes"; 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 ?? "") export const LABELS = (env.PUBLIC_LABELS ?? "")
.split(",") .split(",")
.map((l) => l.trim()) .map((l) => l.trim())