# pi-hoole `pi-hoole` is a collection of tools to enforce access control for self-hosted pijul repositories. It can be seen as a cgit-like solution, for authenticated (public key, SSH) and anonymous accesses. You can grant read and write accesses to a whole repository, or to a determined subset of branches. `pi-hoole` is distributed under the terms of the AGPL v3. ## Getting Started ### Building From Source It should not be a surprise that `pi-hoole` is versioned under `pijul`, with the patch format introduced by `pijul-0.9`. Fair warning, use `pijul-0.10.1` and you should be able to clone the `pi-hoole` repository. ```bash pijul clone https://pijul.lthms.xyz/pijul/pi-hoole ``` Under the hood, `pi-hoole` is implemented in Haskell. We will need `stack` to build it. ```bash cd pi-hoole stack build ``` We are using the latest lts available, but `pi-hoole` has already been built with `lts-10` (but does not build with older ones). This build three executables: * `pi-hoole-cfg` generates a `.authorized_keys` file to enforce access control for SSH. * `pi-hoole-shell` is called to determine if a authenticated user is allowed to perform a given `pijul` command. * `pi-hoole-web` is a HTTP proxy to enforce access control for anonymous requests. ### Installing In order to use `pi-hoole` on your server, the first step is to create a new, dedicated user (*e.g.* `pijul`). You then need to make `pijul` and `pi-hoole-shell` available to this user. Currently, we do not provide any packaging solution to that end, but this might change in the future. Although it is not mandatory, we consider both `pi-hoole-cfg` and `pi-hoole-web` have also been made available for the `pijul` user. ### Configuring `pi-hoole` executables assume the configuration files are stored at `${XDG_CONFIG_DIRECTORY}/pi-hoole`, that is `~/.config/pi-hoole` by default. In this directory, `pi-hoole` will scan the `keys/` directory, if it exists, to know the list of authorized authenticated users. One user may have as many public key as required. Keys should be saved in file with the following filename scheme: `(\.