Apply suggestions from code review

Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-03-25 10:10:02 -04:00
parent 5b2c0e960d
commit 2e080d2fe2
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -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. |
+4 -5
View File
@@ -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();
}}
>