aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-03-25 10:10:02 -0400
committerXe Iaso <me@xeiaso.net>2025-03-25 16:58:59 -0400
commit2e080d2fe207c91c9fd6cb49bb0ce2186c19f82d (patch)
tree5b788492a2478d7bbdc0d118d94b344b61e5fb77 /docs
parent5b2c0e960d2fdfccf5dcff5d5b259303e697e79d (diff)
downloadanubis-Xe/key-bytes-in-flag.tar.xz
anubis-Xe/key-bytes-in-flag.zip
Apply suggestions from code reviewXe/key-bytes-in-flag
Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'docs')
-rw-r--r--docs/docs/admin/installation.mdx2
-rw-r--r--docs/src/components/RandomKey/index.tsx9
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() {
<BrowserOnly fallback={<div>Loading...</div>}>
{() => {
const [key, setKey] = useState<String>(genRandomKey());
- const [refresh, setRefresh] = useState<number>(0);
- useEffect(() => {
+ const genRandomKeyCb = useCallback(() => {
setKey(genRandomKey());
- }, [refresh]);
+ });
return (
<span>
<Code>{key}</Code>
<span style={{ marginLeft: "0.25rem", marginRight: "0.25rem" }} />
<button
onClick={() => {
- setRefresh((n) => n + 1);
+ genRandomKeyCb();
}}
>
♻️