Skip to content

Commit

Permalink
nuc: Fix git server ownership and permissions
Browse files Browse the repository at this point in the history
Define the `git` as system user and delete its home directory.  Make it
part of the group `git`.

Make the git repositories owned by git user and group and adjust the
permissions:

    chown -R git:git /srv/git
    find /srv/git -type d -exec chmod 750 {} \;
    find /srv/git -type f -exec chmod 640 {} \;

Finally, run `cgit` as the group `git` so it can read the repositories.
  • Loading branch information
wagdav committed Oct 27, 2024
1 parent d0ff380 commit 605a527
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ in
imports = [ ./consul-catalog.nix ];

users.users.git = {
isNormalUser = true;
isSystemUser = true;
group = "git";
shell = "${pkgs.git}/bin/git-shell";
openssh.authorizedKeys.keys = (import ./keys.nix).dwagner;
};
users.groups.git = { };

services = {
cgit.git = {
enable = true;
user = "cgit";
group = "cgit";
group = "git";
scanPath = "/srv/git";
settings = {
enable-git-config = true;
Expand Down

0 comments on commit 605a527

Please sign in to comment.