all repos

mugit @ cd1222a

🐮 git server that your cow will love

mugit/readme(view raw)

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
mugit
-----

A cgit/gitweb-like server that your cow will love.

FEATURES
- Web interface - browse repositories, view commits, files, and diffs
- Git Smart HTTP - clone over https (use ssh for pushing)
- Git over SSH - push and clone over ssh
- Private repositories - repositories that are only accessible via ssh
- Mirroring - Automatically mirror repositories (supports github auth)
- CLI - for managing your repos

INSTALL

Clone it, `go build` it.

You can also you nix flake if you're on nixos.

CONFIG

Uses yaml for configuration, look for a 'config.yaml' in:
1. `/var/lib/mugit/config.yaml`
2. `$XDG_CONFIG_HOME/mugit/config.yaml` (or `~/.config/mugit/config.yaml`)
3. `/etc/mugit/config.yaml`

Pass `--config` flag to point it elsewhere

Example config:

    server:
      host: 0.0.0.0
      port: 5555

    meta:
      # title and description you see on the index page
      title: My Git Server
      description: A place for my projects
      # used for clone urls and go-import meta tag
      host: git.example.com

    repo:
      # where all your repo live (maybe die too). mugit doesn't traverse subdirs
      dir: /var/lib/mugit
      # readme files to look for
      readmes:
        - README.md
        - readme.md
      # master branches name to look for
      masters:
        - main
        - master

    ssh:
      enable: true
      port: 2222
      # path to ssh private key for ssh server to use
      # you can generate it with: ssh-keygen -f key/path
      host_key: /var/lib/mugit/ssh_host_key
      # list of keys that are allowed to access private repos
      keys:
        - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPLLJdkVYKZgsayw+sHanKPKZbI0RMS2CakqBCEi5Trz
        - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPQ0Qz0DFB+rGrD8ScUqbUTZ1/O8FHrOBF5bIAGQgMj 

    mirror:
      enable: true
      # with which interval sync repo
      interval: 1h
      # github token for avoiding github rate limiting
      github_token: "ghp_xxxxxxxxxxxx"


CLI

    # start server
    mugit serve

    # run with custom config
    mugit -c /path/to/config.yml serve

    # create new repository
    mugit repo new myproject

    # create new private repository
    mugit repo new --private myproject

    # create new mirror
    mugit repo new myproject --mirror https://github.com/user/repo
    mugit repo new myproject --mirror https://codeberg.org/user/repo

    # toggle repository private status
    mugit repo private myproject

    # get repository description
    mugit repo description myproject

    # set new description
    mugit repo description myproject "My awesome project"


LICENSE

mugit is licensed under MIT.