all repos

mugit @ c543efd

馃惍 git server that your cow will love
2 files changed, 75 insertions(+), 11 deletions(-)
update readme and add mugit.service
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-05-14 21:09:52 +0300
Authored at: 2026-05-14 20:36:53 +0300
Change ID: kpqvyztlmkltmvtkmrkourlwtkwrkrxm
Parent: 3a70e61
M README.md
路路路
        15
        15
         ## Quick install & deploy

      
        16
        16
         

      
        17
        17
         ```sh

      
        
        18
        +# get binary

      
        18
        19
         git clone https://git.olexsmir.xyz/mugit.git

      
        19
        20
         cd mugit

      
        20
        21
         go build

      
        21
        
        -

      
        22
        22
         # or

      
        23
        23
         go install github.com/olexsmir/mugit@latest

      
        
        24
        +

      
        
        25
        +

      
        
        26
        +# start server

      
        
        27
        +mugit serve

      
        24
        28
         ```

      
        25
        29
         

      
        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.

      
        
        30
        +<details>

      
        
        31
        +<summary>Deploy guide</summary>

      
        
        32
        +

      
        
        33
        +  If you're on nixos feel free to use mugit's flake. See [example config](https://git.olexsmir.xyz/dotfiles/blob/master/nix/modules/services/mugit.nix) for a full reference.

      
        
        34
        +

      
        
        35
        +  1. Get a mugit binary.

      
        
        36
        +

      
        
        37
        +  Download it from [github releases](https://github.com/olexsmir/mugit/releases) or build it from source:

      
        
        38
        +  ```bash

      
        
        39
        +  git clone https://git.olexsmir.xyz/mugit.git

      
        
        40
        +  cd mugit

      
        
        41
        +  go build -o /usr/local/bin/mugit

      
        
        42
        +  ```

      
        
        43
        +

      
        
        44
        +  2. Create a user for mugit, and repo for your repo.

      
        
        45
        +  ```bash

      
        
        46
        +  useradd -r -d /var/lib/mugit -m -s /bin/sh mugit

      
        
        47
        +  mkdir -p /var/lib/mugit

      
        
        48
        +  ```

      
        
        49
        +

      
        
        50
        +  3. Configure

      
        
        51
        +  ```yaml

      
        
        52
        +  # file: /var/lib/mugit/config.yaml

      
        
        53
        +  meta:

      
        
        54
        +    host: git.example.com

      
        
        55
        +  repo:

      
        
        56
        +    dir: /var/lib/mugit

      
        
        57
        +  ```

      
        27
        58
         

      
        28
        
        -Start the server:

      
        29
        
        -```sh

      
        30
        
        -# start server with default config lookup

      
        31
        
        -mugit serve

      
        
        59
        +  4. Systemd service

      
        
        60
        +  ```bash

      
        
        61
        +  cp mugit/mugit.service /etc/systemd/system/mugit.service

      
        
        62
        +  systemctl enable --now mugit

      
        
        63
        +  ```

      
        32
        64
         

      
        33
        
        -# start with a custom config path

      
        34
        
        -mugit -c /path/to/config.yaml serve

      
        
        65
        +  5. SSH server integration

      
        35
        66
         

      
        36
        
        -# mirror your repo from github

      
        37
        
        -mugit repo new repo-name --mirror https://github.com/user/repo

      
        38
        
        -```

      
        
        67
        +  mugit integrates with the system's OpenSSH via `AuthorizedKeysCommand`. Add this to `/etc/ssh/sshd_config`:

      
        
        68
        +  ```

      
        
        69
        +  Match User mugit

      
        
        70
        +    AuthorizedKeysCommand /usr/local/bin/mugit shell keys %f

      
        
        71
        +    AuthorizedKeysCommandUser mugit

      
        
        72
        +  ```

      
        
        73
        +

      
        
        74
        +  Restart SSH:

      
        
        75
        +  ```bash

      
        
        76
        +  systemctl restart sshd

      
        
        77
        +  ```

      
        
        78
        +

      
        
        79
        +  5. Point reverse proxy to mugit, by default mugit runs on 8080 port.

      
        
        80
        +</details>

      
        
        81
        +

      
        39
        82
         

      
        40
        83
         ## Configuration

      
        41
        84
         

      路路路
        123
        166
         # create a mirror of an external repository

      
        124
        167
         mugit repo new myproject --mirror https://codeberg.org/user/repo

      
        125
        168
         mugit repo new myproject --private --mirror https://github.com/user/repo

      
        
        169
        +mugit repo new myproject --description "My awesome project"

      
        126
        170
         

      
        127
        171
         # toggle repository visibility

      
        128
        172
         mugit repo private myproject

      路路路
        130
        174
         # show and set repository description

      
        131
        175
         mugit repo description myproject

      
        132
        176
         mugit repo description myproject "My awesome project"

      
        
        177
        +

      
        
        178
        +# switch default branch

      
        
        179
        +mugit repo set-default myproject main

      
        
        180
        +

      
        
        181
        +# trigger mirror sync

      
        
        182
        +mugit repo sync myproject

      
        133
        183
         ```

      
        134
        184
         

      
        135
        185
         ## License

      
A mugit.service
路路路
        
        1
        +[Unit]

      
        
        2
        +Description=mugit

      
        
        3
        +After=network.target

      
        
        4
        +

      
        
        5
        +[Service]

      
        
        6
        +Type=simple

      
        
        7
        +User=mugit

      
        
        8
        +Group=mugit

      
        
        9
        +ExecStart=/usr/local/bin/mugit serve

      
        
        10
        +Restart=on-failure

      
        
        11
        +AmbientCapabilities=CAP_NET_BIND_SERVICE

      
        
        12
        +

      
        
        13
        +[Install]

      
        
        14
        +WantedBy=multi-user.target