Skip to content

Commit 2e080d2

Browse files
Xeryanccn
andcommitted
Apply suggestions from code review
Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Signed-off-by: Xe Iaso <me@xeiaso.net>
1 parent 5b2c0e9 commit 2e080d2

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

docs/docs/admin/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Anubis uses these environment variables for configuration:
4646
| `BIND` | `:8923` | The network address that Anubis listens on. For `unix`, set this to a path: `/run/anubis/instance.sock` |
4747
| `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. |
4848
| `DIFFICULTY` | `5` | The difficulty of the challenge, or the number of leading zeroes that must be in successful responses. |
49-
| `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. |
49+
| `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. |
5050
| `METRICS_BIND` | `:9090` | The network address that Anubis serves Prometheus metrics on. See `BIND` for more information. |
5151
| `METRICS_BIND_NETWORK` | `tcp` | The address family that the Anubis metrics server listens on. See `BIND_NETWORK` for more information. |
5252
| `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. |

docs/src/components/RandomKey/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from "react";
1+
import { useState, useCallback } from "react";
22
import Code from "@theme/CodeInline";
33
import BrowserOnly from "@docusaurus/BrowserOnly";
44

@@ -20,17 +20,16 @@ export default function RandomKey() {
2020
<BrowserOnly fallback={<div>Loading...</div>}>
2121
{() => {
2222
const [key, setKey] = useState<String>(genRandomKey());
23-
const [refresh, setRefresh] = useState<number>(0);
24-
useEffect(() => {
23+
const genRandomKeyCb = useCallback(() => {
2524
setKey(genRandomKey());
26-
}, [refresh]);
25+
});
2726
return (
2827
<span>
2928
<Code>{key}</Code>
3029
<span style={{ marginLeft: "0.25rem", marginRight: "0.25rem" }} />
3130
<button
3231
onClick={() => {
33-
setRefresh((n) => n + 1);
32+
genRandomKeyCb();
3433
}}
3534
>
3635
♻️

0 commit comments

Comments
 (0)