Skip to content

Commit

Permalink
acct-user/git: Add git user, UID 196
Browse files Browse the repository at this point in the history
Add 'git' user.  UID 196 is used on Arch Linux for gitolite which serves
the same purpose as 'git' in Gentoo.

Note that since we have multiple git hosting providers in Gentoo,
and they use disjoint home directories, we need to use USE flags to
control the provider used.  Upon switching flags, the home directory
for git user will be updated accordingly to permit SSH access.

Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
mgorny committed Sep 8, 2019
1 parent fe4099e commit c3708bc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
29 changes: 29 additions & 0 deletions acct-user/git/git-0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit acct-user

DESCRIPTION="Git repository hosting user"

IUSE="gitea gitolite"
REQUIRED_USE="^^ ( gitea gitolite )"

ACCT_USER_ID=196
ACCT_USER_HOME_OWNER=git:git
ACCT_USER_HOME_PERMS=750
ACCT_USER_SHELL=/bin/sh
ACCT_USER_GROUPS=( git )

acct-user_add_deps

pkg_setup() {
if use gitea; then
ACCT_USER_HOME=/var/lib/gitea
elif use gitolite; then
ACCT_USER_HOME=/var/lib/gitolite
else
die "Incorrect USE flag combination"
fi
}
15 changes: 15 additions & 0 deletions acct-user/git/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Michał Górny</name>
</maintainer>
<use>
<flag name="gitea">Set home directory for git hosting
via <pkg>www-apps/gitea</pkg>.</flag>
<flag name="gitolite">Set home directory for git hosting
via <pkg>dev-vcs/gitolite</pkg>
or <pkg>dev-vcs/gitolite-gentoo</pkg>.</flag>
</use>
</pkgmetadata>

0 comments on commit c3708bc

Please sign in to comment.