You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/anubis/main.go
+21-15Lines changed: 21 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -331,22 +331,28 @@ func main() {
331
331
slog.Warn("REDIRECT_DOMAINS is not set, Anubis will only redirect to the same domain a request is coming from, see https://anubis.techaro.lol/docs/admin/configuration/redirect-domains")
332
332
}
333
333
334
+
// If OpenGraph configuration values are not set in the config file, use the
Open Graph passthrough used to be configured with configuration flags / environment variables. Reference to these settings are maintained for backwards compatibility's sake.
Anubis is meant to sit between your reverse proxy (such as Nginx or Caddy) and your target service. One instance of Anubis must be used per service you are protecting.
9
8
10
9
<center>
@@ -30,7 +29,7 @@ TLS terminator)
30
29
Anubis is shipped in the Docker repo [`ghcr.io/techarohq/anubis`](https://github.com/TecharoHQ/anubis/pkgs/container/anubis). The following tags exist for your convenience:
|`latest`| The latest [tagged release](https://github.com/TecharoHQ/anubis/releases), if you are in doubt, start here. |
35
34
|`v<version number>`| The Anubis image for [any given tagged release](https://github.com/TecharoHQ/anubis/tags)|
36
35
|`main`| The current build on the `main` branch. Only use this if you need the latest and greatest features as they are merged into `main`. |
@@ -43,12 +42,24 @@ Anubis has very minimal system requirements. I suspect that 128Mi of ram may be
43
42
44
43
For more detailed information on installing Anubis with native packages, please read [the native install directions](./native-install.mdx).
45
44
46
-
## Environment variables
45
+
## Configuration
46
+
47
+
Anubis is configurable via environment variables and [the policy file](./policies.mdx). Most settings are currently exposed with environment variables but they are being slowly moved over to the policy file.
48
+
49
+
### Configuration via the policy file
50
+
51
+
Currently the following settings are configurable via the policy file:
|`BASE_PREFIX`| unset | If set, adds a global prefix to all Anubis endpoints. For example, setting this to `/myapp` would make Anubis accessible at `/myapp/` instead of `/`. This is useful when running Anubis behind a reverse proxy that routes based on path prefixes. |
53
64
|`BIND`|`:8923`| The network address that Anubis listens on. For `unix`, set this to a path: `/run/anubis/instance.sock`|
54
65
|`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. |
@@ -60,9 +71,9 @@ Anubis uses these environment variables for configuration:
60
71
|`ED25519_PRIVATE_KEY_HEX_FILE`| unset | Path to a file containing the hex-encoded ed25519 private key. Only one of this or its sister option may be set. |
61
72
|`METRICS_BIND`|`:9090`| The network address that Anubis serves Prometheus metrics on. See `BIND` for more information. |
62
73
|`METRICS_BIND_NETWORK`|`tcp`| The address family that the Anubis metrics server listens on. See `BIND_NETWORK` for more information. |
63
-
|`OG_EXPIRY_TIME`|`24h`| The expiration time for the Open Graph tag cache. |
64
-
|`OG_PASSTHROUGH`|`false`| If set to `true`, Anubis will enable Open Graph tag passthrough. |
65
-
|`OG_CACHE_CONSIDER_HOST`|`false`| If set to `true`, Anubis will consider the host in the Open Graph tag cache key. |
74
+
|`OG_EXPIRY_TIME`|`24h`| The expiration time for the Open Graph tag cache. Prefer using [the policy file](./configuration/open-graph.mdx) to configure the Open Graph subsystem.|
75
+
|`OG_PASSTHROUGH`|`false`| If set to `true`, Anubis will enable Open Graph tag passthrough. Prefer using [the policy file](./configuration/open-graph.mdx) to configure the Open Graph subsystem.|
76
+
|`OG_CACHE_CONSIDER_HOST`|`false`| If set to `true`, Anubis will consider the host in the Open Graph tag cache key. Prefer using [the policy file](./configuration/open-graph.mdx) to configure the Open Graph subsystem.|
66
77
|`POLICY_FNAME`| unset | The file containing [bot policy configuration](./policies.mdx). See the bot policy documentation for more details. If unset, the default bot policy configuration is used. |
67
78
|`REDIRECT_DOMAINS`| unset | If set, restrict the domains that Anubis can redirect to when passing a challenge.<br/><br/>If this is unset, Anubis may redirect to any domain which could cause security issues in the unlikely case that an attacker passes a challenge for your browser and then tricks you into clicking a link to your domain.<br/><br/>Note that if you are hosting Anubis on a non-standard port (`https://example:com:8443`, `http://www.example.net:8080`, etc.), you must also include the port number here. |
68
79
|`SERVE_ROBOTS_TXT`|`false`| If set `true`, Anubis will serve a default `robots.txt` file that disallows all known AI scrapers by name and then additionally disallows every scraper. This is useful if facts and circumstances make it difficult to change the underlying service to serve such a `robots.txt` file. |
@@ -138,6 +149,7 @@ STRIP_BASE_PREFIX=true
138
149
```
139
150
140
151
With this configuration:
152
+
141
153
- A request to `/myapp/api/users` would be forwarded to your target service as `/api/users`
142
154
- A request to `/myapp/` would be forwarded as `/`
0 commit comments