/

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Senary - lightweight, mostly static software forge


## Configuration

The directory you run senary from should contain a copy of the `templates` directory from this repository, and also a `senary.json` file like below:

```
{
    "BaseDir":"./static/",
    "RepoDir":"./repos/",
    "RequestsDir":"./requests",
    "CallbackURI": "https://example.com/callback",
    "ClientID": "https://example.com/",
    "MaintainerDomains": [""],

    "RepoBases": ["./clonedrepos"]
}
````

An explanation of each field follows:

* `BaseDir` - a path to a copy of the `static` directory for this repository
* `RepoDir` - a path to a folder where static caches of each repo will be saved
* `RequestsDir` - a path to a folder where issues and pull requests will be saved
* `RepoBases` - a list of directories where locally cloned repositories can be found.

### IndieAuth Support

* `ClientID` - the domain you will be hosting senary on. Note that per the IndieAuth spec, the final slash ('/') is important.
* `CallbackURI` - the url that IndieAuth authorization servers will use to callback to the app, usually `<ClientID>/callback`
* `MaintainerDomains` - a list of domains for which authenticated users will be considered to have maintainer priviledges (the ability to moderate requests, and apply patches) **Security Note: Any authorization server listed here effectively has the ability to update code in repositories, and as such you should limit this list to authorization servers under your control**

## Repository Configuration

Senary has the ability to front https git clone requests, if the server is properly configured for them. To do so:

1. Set up a [bare repo](https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server) for each repository you want to expose.
2. Ensure that each bare repo has `receivepack = false` under its `[http]` config. This will ensure that users cannot push to your repository. (Senary has additional gating which ensures that the receivepack url is not exposed, this is defense-in-depth)
3. For each bare repo, create a clone in one of the directories list in `RepoBases`, this can be done locally `git clone <bare repo path>`
4. Run `./senary build`, this should result in a static html copy of repo resources being created in `<RepoDir>/reponame/`