From 2e080d2fe207c91c9fd6cb49bb0ce2186c19f82d Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 25 Mar 2025 10:10:02 -0400 Subject: Apply suggestions from code review Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Signed-off-by: Xe Iaso --- docs/docs/admin/installation.mdx | 2 +- docs/src/components/RandomKey/index.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/docs/admin/installation.mdx b/docs/docs/admin/installation.mdx index 8059319..3f5e904 100644 --- a/docs/docs/admin/installation.mdx +++ b/docs/docs/admin/installation.mdx @@ -46,7 +46,7 @@ Anubis uses these environment variables for configuration: | `BIND` | `:8923` | The network address that Anubis listens on. For `unix`, set this to a path: `/run/anubis/instance.sock` | | `BIND_NETWORK` | `tcp` | The address family that Anubis listens on. Accepts `tcp`, `unix` and anything Go's [`net.Listen`](https://pkg.go.dev/net#Listen) supports. | | `DIFFICULTY` | `5` | The difficulty of the challenge, or the number of leading zeroes that must be in successful responses. | -| `ED25519_PRIVATE_KEY_HEX` | | The hex-encoded ed25519 private key used to sign Anubis responses. If this is not set, Anubis will generate one for you. | +| `ED25519_PRIVATE_KEY_HEX` | | The hex-encoded ed25519 private key used to sign Anubis responses. If this is not set, Anubis will generate one for you. This should be exactly 64 characters long. See below for details. | | `METRICS_BIND` | `:9090` | The network address that Anubis serves Prometheus metrics on. See `BIND` for more information. | | `METRICS_BIND_NETWORK` | `tcp` | The address family that the Anubis metrics server listens on. See `BIND_NETWORK` for more information. | | `SOCKET_MODE` | `0770` | _Only used when at least one of the `*_BIND_NETWORK` variables are set to `unix`._ The socket mode (permissions) for Unix domain sockets. | diff --git a/docs/src/components/RandomKey/index.tsx b/docs/src/components/RandomKey/index.tsx index f1eb63a..e7ced3e 100644 --- a/docs/src/components/RandomKey/index.tsx +++ b/docs/src/components/RandomKey/index.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useState, useCallback } from "react"; import Code from "@theme/CodeInline"; import BrowserOnly from "@docusaurus/BrowserOnly"; @@ -20,17 +20,16 @@ export default function RandomKey() { Loading...}> {() => { const [key, setKey] = useState(genRandomKey()); - const [refresh, setRefresh] = useState(0); - useEffect(() => { + const genRandomKeyCb = useCallback(() => { setKey(genRandomKey()); - }, [refresh]); + }); return ( {key}