Update README with setup instructions

This Patch Does Not Apply To The Current Repository
Sarah@auth.lopeos.org submitted a patch request Feb 15, 2025 21:59
  • Title: Update ReadME
  • Author: Sarah Jamie Lewis <sarah@openprivacy.ca>

README.md

@@ -1,1 +1,41 @@
-# Senary - lightweight, mostly static software forge
            +# Senary - lightweight, mostly static software forge

            +

            +

            +## Configuration

            +

            +The directory you run senary from should a copy of the `templates` directory in 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/`