blob: a520e5f6acce0848db79b2a75f03e2d977ca86cf (
plain)
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
42
43
44
45
46
47
48
49
50
|
# faGIT
> Free Association Git
This is a git ssh server that allows for both private and public repositories, as well as most notably for anyone to create forks simply by pushing to a branch named `pr/<somename>`. This branch can only be pushed to again by that same ssh key (or the owner of the repo).
This is the free association in **FA**git, allowing anyone without association to the server to create pull requests, without having to use `git send-mail` (although maybe more people should learn how to use that).
Maybe in the future i will find it in my heart to integrate a `git send-mail` receiver that creates pr branches automatically.
## Installation
### Basic structure
Find a good place for the binary (you can generate one using `cargo build --release`. find yours in `target/`) to be saved. Also find a data directory. You will need to have one toml file for basic config including uber admin keys.
You will also need a `git` user. You will also need to find a repo storage folder. Here is one possible layout:
// TODO: make all of this say that the config path are hardcoded and important to /etc/fagit/fagit.toml
```
/opt/fagit/fagit: binary, owned by root
/opt/fagit/fagit.toml: config, owned by root
/opt/fagit/store/: folder containing repositories, owned by the git user
```
Note that the store folder is owned by the git user, since when actually modifying repos fagit will run as the git user. Note also that the fagit.toml contains only minimal metadata and most of the actual config can be done by pushing to the `meta.git` repo.
### Config file
Here is an example config file:
```toml
[ssh]
user = "git" # log in with the user git
[paths] # All of these paths need to be absolute
binary = "/opt/fagit/fagit"
config = "/opt/fagit/fagit.toml" # Note that the config must have the correct path to itself
store = "/opt/fagit/store/"
[[operator]] # Note that this admin user does not get any permissions aside from being able to access the meta repo
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINg2WYMRKINwbH5UCqqK2qq/qW0gG1NnaALHqEyU4NzM"
```
### SSH authorization
Edit `/etc/ssh/sshd_config` to include `AuthorizedKeysCommand /opt/fagit/fagit auth /opt/fagit/fagit.toml "%u" "%h" "%t" "%k"`. You might also need to set `AuthorizedKeysCommandUser root`.
|