|
| 1 | +# Setup |
| 2 | + |
| 3 | +Follow these steps to install Glutton on your system. |
| 4 | + |
| 5 | +## Environment Requirements |
| 6 | + |
| 7 | + |
| 8 | +- **Linux Required:** Glutton must be built and run on a Linux system. |
| 9 | +- **Non-Linux Users:** For Windows or macOS, use Docker or the VSCode Dev Container Extension. |
| 10 | +- **WSL Users:** When using WOS, we recommend running glutton with the [xanmod-kernel-WSL2](https://github.com/Locietta/xanmod-kernel-WSL2) |
| 11 | +- For setting up the development environment using VS Code Dev Containers, refer to: |
| 12 | + - [Install Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) |
| 13 | + - [Learn More](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +Ensure you have [Go](https://go.dev/dl/) installed (recommended version: **Go 1.21** or later). In addition, you will need system packages for building and running Glutton: |
| 18 | + |
| 19 | +### Debian/Ubuntu |
| 20 | + |
| 21 | +```bash |
| 22 | +sudo apt-get update |
| 23 | +sudo apt-get install gcc libpcap-dev iptables |
| 24 | +``` |
| 25 | + |
| 26 | +### Arch Linux |
| 27 | +```bash |
| 28 | +sudo pacman -S gcc libpcap iptables |
| 29 | +``` |
| 30 | + |
| 31 | +### Fedora |
| 32 | +```bash |
| 33 | +sudo dnf install gcc libpcap-devel iptables |
| 34 | +``` |
| 35 | + |
| 36 | +## Building Glutton |
| 37 | + |
| 38 | +Clone the repository and build the project: |
| 39 | + |
| 40 | +```bash |
| 41 | +git clone https://github.com/mushorg/glutton.git |
| 42 | +cd glutton |
| 43 | +make build |
| 44 | +``` |
| 45 | + |
| 46 | +This will compile the project and place the server binary in the `bin/` directory. |
| 47 | + |
| 48 | +## Testing the Installation |
| 49 | + |
| 50 | +```bash |
| 51 | +bin/server --version |
| 52 | +``` |
| 53 | +Replace `<network_interface>` (e.g., `eth0`) with the interface you want to monitor. You should see output similar to: |
| 54 | + |
| 55 | +```bash |
| 56 | + _____ _ _ _ |
| 57 | + / ____| | | | | | |
| 58 | +| | __| |_ _| |_| |_ ___ _ __ |
| 59 | +| | |_ | | | | | __| __/ _ \| '_ \ |
| 60 | +| |__| | | |_| | |_| || (_) | | | | |
| 61 | + \_____|_|\__,_|\__|\__\___/|_| |_| |
| 62 | +
|
| 63 | + |
| 64 | +glutton version v1.0.1+d2503ba 2025-02-21T05:48:07+00:00 |
| 65 | +``` |
| 66 | +
|
| 67 | +## Usage |
| 68 | +
|
| 69 | +Glutton can be configured using several command-line flags: |
| 70 | +
|
| 71 | +- **--interface, -i**: `string` - Specifies the network interface (default: `eth0`) |
| 72 | +- **--ssh, -s**: `int` - If set, it overrides the default SSH port |
| 73 | +- **--logpath, -l**: `string` - Sets the file path for logging (default: `/dev/null`) |
| 74 | +- **--confpath, -c**: `string` - Defines the path to the configuration directory (default: `config/`) |
| 75 | +- **--debug, -d**: `bool` - Enables debug mode (default: `false`) |
| 76 | +- **--version**: `bool` - Prints the version and exits |
| 77 | +- **--var-dir**: `string` - Sets the directory for variable data storage (default: `/var/lib/glutton`) |
| 78 | +
|
| 79 | +For example, to run Glutton with a custom interface and enable debug mode, you might use the following command: |
| 80 | +
|
| 81 | +```bash |
| 82 | +bin/server --interface <network_interface> --debug |
| 83 | +``` |
| 84 | +
|
| 85 | +Replace `<network_interface>` (e.g., `eth0`) with the interface you want to monitor. The command starts the Glutton server, which sets up TCP/UDP listeners and applies iptables rules for transparent proxying. |
| 86 | +
|
| 87 | +**Configuration:** Before deployment, ensure your configuration files, in the `config/` folder by default, are properly set up. For detailed instructions, refer to the [Configuration](configuration.md) page. |
| 88 | +
|
| 89 | +## Docker |
| 90 | +
|
| 91 | +To deploy using Docker: |
| 92 | +
|
| 93 | +1. Build the Docker image: |
| 94 | + |
| 95 | + ``` |
| 96 | + docker build -t glutton . |
| 97 | + ``` |
| 98 | +
|
| 99 | +2. Run the Container: |
| 100 | + |
| 101 | + ``` |
| 102 | + docker run --rm --cap-add=NET_ADMIN -it glutton |
| 103 | + ``` |
| 104 | +
|
| 105 | +The Docker container is preconfigured with the necessary dependencies (iptables, libpcap, etc.) and copies the configuration and rules files into the container. |
| 106 | +
|
0 commit comments