anubis/docs/docs/admin/native-install.mdx
Xe Iaso d40b5cfdab
lib: move config to yaml (#307)
* lib: move config to yaml

Signed-off-by: Xe Iaso <me@xeiaso.net>

* web: run go generate

Signed-off-by: Xe Iaso <me@xeiaso.net>

* Add Haiku to known instances (#304)

Signed-off-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>

* Add headers bot rule (#300)

* Closes #291: add headers support to bot policy rules

* Fix config validator

* update docs for JSON -> YAML

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs: document http header based actions

Signed-off-by: Xe Iaso <me@xeiaso.net>

* lib: add missing test

Signed-off-by: Xe Iaso <me@xeiaso.net>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>
Co-authored-by: Asmodeus <46908100+AsmodeumX@users.noreply.github.com>
Co-authored-by: Neur0toxine <pashok9825@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-21 00:09:27 +00:00

139 lines
3.0 KiB
Plaintext

---
title: Installing Anubis with a native package
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
Download the package for your system from [the most recent release on GitHub](https://github.com/TecharoHQ/anubis/releases).
Install the Anubis package using your package manager of choice:
<Tabs>
<TabItem value="deb" label="Debian-based (apt)" default>
Install Anubis with `apt`:
```text
sudo apt install ./anubis-$VERSION-$ARCH.deb
```
</TabItem>
<TabItem value="tarball" label="Tarball">
Extract the tarball to a folder:
```text
tar zxf ./anubis-$VERSION-$OS-$ARCH.tar.gz
cd anubis-$VERSION-$OS-$ARCH
```
Install the binary to your system:
```text
sudo install -D ./bin/anubis /usr/local/bin
```
Edit the systemd unit to point to `/usr/local/bin/anubis` instead of `/usr/bin/anubis`:
```text
perl -pi -e 's$/usr/bin/anubis$/usr/local/bin/anubis$g' ./run/anubis@.service
```
Install the systemd unit to your system:
```text
sudo install -D ./run/anubis@.service /etc/systemd/system
```
Install the default configuration file to your system:
```text
sudo install -D ./run/default.env /etc/anubis
```
</TabItem>
<TabItem value="rpm" label="Red Hat-based (rpm)">
Install Anubis with `dnf`:
```text
sudo dnf -y install ./anubis-$VERSION.$ARCH.rpm
```
OR
Install Anubis with `yum`:
```text
sudo yum -y install ./anubis-$VERSION.$ARCH.rpm
```
OR
Install Anubis with `rpm`:
```
sudo rpm -ivh ./anubis-$VERSION.$ARCH.rpm
```
</TabItem>
</Tabs>
Once it's installed, make a copy of the default configuration file `/etc/anubis/default.env` based on which service you want to protect. For example, to protect a `gitea` server:
```text
sudo cp /etc/anubis/default.env /etc/anubis/gitea.env
```
Copy the default bot policies file to `/etc/anubis/gitea.botPolicies.yaml`:
<Tabs>
<TabItem value="debrpm" label="Debian or Red Hat" default>
```text
sudo cp /usr/share/doc/anubis/botPolicies.yaml /etc/anubis/gitea.botPolicies.yaml
```
</TabItem>
<TabItem value="tarball" label="Tarball">
```text
sudo cp ./doc/botPolicies.yaml /etc/anubis/gitea.botPolicies.yaml
```
</TabItem>
</Tabs>
Then open `gitea.env` in your favorite text editor and customize [the environment variables](./installation.mdx#environment-variables) as needed. Here's an example configuration for a Gitea server:
```sh
BIND=[::1]:8239
BIND_NETWORK=tcp
DIFFICULTY=4
METRICS_BIND=[::1]:8240
METRICS_BIND_NETWORK=tcp
POLICY_FNAME=/etc/anubis/gitea.botPolicies.yaml
TARGET=http://localhost:3000
```
Then start Anubis with `systemctl enable --now`:
```text
sudo systemctl enable --now anubis@gitea.service
```
Test to make sure it's running with `curl`:
```text
curl http://localhost:8240/metrics
```
Then set up your reverse proxy (Nginx, Caddy, etc.) to point to the Anubis port. Anubis will then reverse proxy all requests that meet the policies in `/etc/anubis/gitea.botPolicies.json` to the target service.
For more details on particular reverse proxies, see here:
- [Apache](./environments/apache.mdx)
- [Nginx](./environments/nginx.mdx)