all repos

mugit @ dbbfe17

🐮 git server that your cow will love

mugit/README.md (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
update readme, 2 months ago
1
# mugit
2
3
A lightweight, self-hosted Git server that your cow will love.
4
5
[See it in action!](https://git.olexsmir.xyz)
6
7
## Features
8
- Web interface — browse repositories, view commits, files, and diffs (no javascript required).
9
- Git Smart HTTP — clone over HTTPS (use SSH for pushing).
10
- Git over SSH — push and clone repos over SSH.
11
- Mirroring — automatically mirror repos from other forges (supports GitHub authentication).
12
- Private repositories — repos accessible only via SSH
13
- CLI — command-line for managing your repositories
14
15
## Quick install & deploy
16
17
```sh
18
git clone https://git.olexsmir.xyz/mugit.git
19
cd mugit
20
go build
21
22
# or
23
go install github.com/olexsmir/mugit@latest
24
```
25
26
For nixos, you can use our flake, see [my config](https://git.olexsmir.xyz/dotfiles/blob/master/nix/modules/services/mugit.nix) for reference.
27
28
Start the server:
29
```sh
30
# start server with default config lookup
31
mugit serve
32
33
# start with a custom config path
34
mugit -c /path/to/config.yaml serve
35
36
# mirror your repo from github
37
mugit repo new repo-name --mirror https://github.com/user/repo
38
```
39
40
## Configuration
41
42
mugit uses YAML for configuration. By default the server looks for a configuration file in this order (override with `-c` / `--config`):
43
1. `./config.yaml`
44
2. `/etc/mugit.yaml`
45
3. `/var/lib/mugit/config.yaml`
46
47
48
Durations follow Go's duration syntax (examples: `1h`, `30m`, `5s`). See: [https://pkg.go.dev/time#ParseDuration]
49
50
Minimal configuration example:
51
52
```yaml
53
meta:
54
  host: git.olexsmir.xyz
55
56
repo:
57
  dir: /var/lib/mugit
58
```
59
60
Full example:
61
62
```yaml
63
server:
64
  host: 0.0.0.0 # bind address (0.0.0.0 = all interfaces)
65
  port: 5555    # HTTP port (defaults to 8080 when omitted)
66
67
meta:
68
  title: "My Git Server"    # site title shown on index page
69
  description: "A place for my projects"
70
  host: git.example.com     # used for clone URLs and go-import meta tag
71
72
repo:
73
  dir: /var/lib/mugit   # directory with repositories
74
  # Default README filenames (applied when omitted):
75
  readmes:
76
    - README.md
77
    - readme.md
78
    - README.html
79
    - readme.html
80
    - README.txt
81
    - readme.txt
82
    - readme
83
84
# ssh: push/clone over SSH
85
ssh:
86
  enable: true
87
  user: "git" # user as which the app operates (default "git")
88
  # Only these public keys can access private repos and push to others.
89
  keys:
90
    - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA......
91
    - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA......
92
93
# mirror: automatic mirrors of external repositories
94
mirror:
95
  enable: true
96
  interval: 1h  # sync frequency
97
  # Tokens can be provided directly, or read from environment/file:
98
  # - literal: "ghp_xxxxxxxxxxxx"
99
  # - from env: "$env:GITHUB_TOKEN" (will read $GITHUB_TOKEN)
100
  # - from file: "$file:/abs/path/to/token.txt"
101
  github_token: "$env:GITHUB_TOKEN"
102
103
cache:
104
  home_page: 5m   # cache index/home page
105
  readme: 1m      # cache rendered README per repo
106
  diff: 15m       # cache computed diffs
107
```
108
109
## CLI
110
111
```sh
112
# start server
113
mugit serve
114
115
# create new public repository
116
mugit repo new myproject
117
118
# create new private repository
119
mugit repo new --private myproject
120
121
# create a mirror of an external repository
122
mugit repo new myproject --mirror https://codeberg.org/user/repo
123
mugit repo new myproject --private --mirror https://github.com/user/repo
124
125
# toggle repository visibility
126
mugit repo private myproject
127
128
# show and set repository description
129
mugit repo description myproject
130
mugit repo description myproject "My awesome project"
131
```
132
133
## License
134
135
mugit is licensed under the MIT License.