dev-vcs/gitlab-shell:
purged unneeded ebuilds Package-Manager: portage-2.3.0
This commit is contained in:
parent
d30d161f5d
commit
1783bd8abe
4 changed files with 5 additions and 265 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
22 Oct 2016; Manuel Friedli <manuel@fritteli.ch> -gitlab-shell-3.4.0.ebuild,
|
||||||
|
-gitlab-shell-3.6.0.ebuild:
|
||||||
|
dev-vcs/gitlab-shell: purged unneeded ebuilds
|
||||||
|
|
||||||
*gitlab-shell-3.6.6 (22 Oct 2016)
|
*gitlab-shell-3.6.6 (22 Oct 2016)
|
||||||
|
|
||||||
22 Oct 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-shell-3.6.6.ebuild:
|
22 Oct 2016; Manuel Friedli <manuel@fritteli.ch> +gitlab-shell-3.6.6.ebuild:
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
AUX gitlab-shell-3.2.0-config-paths.patch 1826 SHA256 c83db7c37dcac577ce499eab4bb0168253f49d303ba1991fdec90d13cc3fe37a SHA512 7524b6b8cd7cd141a56c468efa303b1d21576ac9e03cb866cbf9dcac34e1b8d4f356333737050e2e5dfeb0f0ad904b3f548c40e1209c1f35054ed2027b1d8271 WHIRLPOOL fdbd2dfe43ff4a2af97227fbf8c4589ca3734ebf0320b7e9c5e8ea39882c49d45815a0ee3c765a141affacbe48f4063987b9664a918e0e216b49ca46a475cc5f
|
AUX gitlab-shell-3.2.0-config-paths.patch 1826 SHA256 c83db7c37dcac577ce499eab4bb0168253f49d303ba1991fdec90d13cc3fe37a SHA512 7524b6b8cd7cd141a56c468efa303b1d21576ac9e03cb866cbf9dcac34e1b8d4f356333737050e2e5dfeb0f0ad904b3f548c40e1209c1f35054ed2027b1d8271 WHIRLPOOL fdbd2dfe43ff4a2af97227fbf8c4589ca3734ebf0320b7e9c5e8ea39882c49d45815a0ee3c765a141affacbe48f4063987b9664a918e0e216b49ca46a475cc5f
|
||||||
DIST gitlab-shell-3.4.0.tar.gz 71972 SHA256 0ac8f18b1615194943e935b670d630a1ba9870ad876f7486256972c7be1d45d4 SHA512 1138e02dbf5169547e39eea87ac88f05009424c76f26b4b0f2cb3882eaefc9d7aa11e167c6d9309947da728fc5381a234b93e25a0ded4f87eb8d8c88baaa2b9c WHIRLPOOL ef9ff2b349af97019da56c2e0b850fc4885ad036074e7bce39ba6f12bea611b771becc5ebf3e1889a71078243488bbf7c93ed90e545844b36aeb42b79265ab2c
|
|
||||||
DIST gitlab-shell-3.5.0.tar.gz 73374 SHA256 6591b768a4f51c535e97e5632518583f6559a4202f4219739ad01a27161687ef SHA512 b5935c6f9b19bab1716901c8015e107f7fbc545646d5e35a6a943e1692d3ddd61efeb862f4d59efe75eda9c1117adf9d90b50f572ab0a69199069d1fc52e8718 WHIRLPOOL 938c600d0810867fc9aef62a286b05dc34bf52352612530d459614483e3c37b3cef6ee5b2dc11f7b041218cbe569d11f4f5f0240b9c28e613bd762c06786772e
|
DIST gitlab-shell-3.5.0.tar.gz 73374 SHA256 6591b768a4f51c535e97e5632518583f6559a4202f4219739ad01a27161687ef SHA512 b5935c6f9b19bab1716901c8015e107f7fbc545646d5e35a6a943e1692d3ddd61efeb862f4d59efe75eda9c1117adf9d90b50f572ab0a69199069d1fc52e8718 WHIRLPOOL 938c600d0810867fc9aef62a286b05dc34bf52352612530d459614483e3c37b3cef6ee5b2dc11f7b041218cbe569d11f4f5f0240b9c28e613bd762c06786772e
|
||||||
DIST gitlab-shell-3.6.0.tar.gz 74513 SHA256 4ad340fbd295b54ad92558fba9642d88b9759a46b9a5473c6a7d73faf9c4f9ce SHA512 beb2fa68f58adc58d5c6418e2a7dd0d15f007d730595dd8871298105dfec8140d9e14dd27350079f1878279a47b0b2096183c80dfd3c9744fd802332252b2005 WHIRLPOOL 32c6e57361ebdd1e031ea055a985a800a7e4c4f9312476c8b228484f02ba58618aa968ba598c5cc74966824029b12d1ec4c0a55e297d97a35c8b405f287aef66
|
|
||||||
DIST gitlab-shell-3.6.1.tar.gz 74806 SHA256 180dcce14e9caa9c7f09eefdb2e10189318a0f994c4931fae2acebd92e9e4fa3 SHA512 6f54b0a9ddccabb3971c48301292835ecf953e0a9bb3b9d1d78af416a42e3d2883a157ab02990e748b0e6b02805864c314fe9cd538834ab831f565f0c573ed3a WHIRLPOOL 1219213217d5ec280ee521c4f64328634402c795a4fbd10beac3481f4e622faf03859589ee641bbd34647b057c77bdef0d7e1a2906375c3de21cd6b4739a7826
|
DIST gitlab-shell-3.6.1.tar.gz 74806 SHA256 180dcce14e9caa9c7f09eefdb2e10189318a0f994c4931fae2acebd92e9e4fa3 SHA512 6f54b0a9ddccabb3971c48301292835ecf953e0a9bb3b9d1d78af416a42e3d2883a157ab02990e748b0e6b02805864c314fe9cd538834ab831f565f0c573ed3a WHIRLPOOL 1219213217d5ec280ee521c4f64328634402c795a4fbd10beac3481f4e622faf03859589ee641bbd34647b057c77bdef0d7e1a2906375c3de21cd6b4739a7826
|
||||||
DIST gitlab-shell-3.6.6.tar.gz 77199 SHA256 db3f54b561bb81059256c634967b181707e11cc25e30b0fa76eb034718d0eaf9 SHA512 d1d15687169f7b151caf3b371d6570099129a2a69d7732e6be7337f70aaef7e36c87e8aa5140e9697c7be36185743bb939d862790b440fc18d7a864d570fcb6b WHIRLPOOL 4161901369cc12a89fb89c41bd98cfc2cfdeb5aac6d317597ae11f10bcd401e4c18148ce9a20f5e967a6fb11559f33aa72c82dff1a52764c5a19bcd0f06250c1
|
DIST gitlab-shell-3.6.6.tar.gz 77199 SHA256 db3f54b561bb81059256c634967b181707e11cc25e30b0fa76eb034718d0eaf9 SHA512 d1d15687169f7b151caf3b371d6570099129a2a69d7732e6be7337f70aaef7e36c87e8aa5140e9697c7be36185743bb939d862790b440fc18d7a864d570fcb6b WHIRLPOOL 4161901369cc12a89fb89c41bd98cfc2cfdeb5aac6d317597ae11f10bcd401e4c18148ce9a20f5e967a6fb11559f33aa72c82dff1a52764c5a19bcd0f06250c1
|
||||||
EBUILD gitlab-shell-3.4.0.ebuild 3653 SHA256 7bf777fc3b5bda03f9a455874f62bb6260eeb73dd8727e4145ed0cda2e283465 SHA512 de5b78133d317155f5764d6888d421c4f2945ccb5972c032c05138344188eb0a0f85817431aa4348e2074667c901f44cf2b575f572aeb2620aab58a32ddba22b WHIRLPOOL e53de830c17bc9c784df06670c6fdc7465ba05ca40de42e4857e5a83421208f9bbb4381c2988fbabc85f86476d5c2b7301123392de132558bdd6f969726a9a57
|
|
||||||
EBUILD gitlab-shell-3.5.0.ebuild 3653 SHA256 3b73797e283ff4ec30c87d50a54a80cf6895c0c03dedc3ff34087b3037dd9fd5 SHA512 cc235d625f1eabac09822fbca06b706886601e550958338ea5ee7ccfdbbb85e2d96bb348b4ccce532c92d18389c63ddb78bcd77e407f789127fbb3d9ac32d0d9 WHIRLPOOL 4a8bb0ee8a1b547bb8517c300806457187a8fd1855b223cf079784733fdef55e2dd5fa9998da9523bcd3b021aa10d45cc74445bae5bd8f853e3355d6a1d6417a
|
EBUILD gitlab-shell-3.5.0.ebuild 3653 SHA256 3b73797e283ff4ec30c87d50a54a80cf6895c0c03dedc3ff34087b3037dd9fd5 SHA512 cc235d625f1eabac09822fbca06b706886601e550958338ea5ee7ccfdbbb85e2d96bb348b4ccce532c92d18389c63ddb78bcd77e407f789127fbb3d9ac32d0d9 WHIRLPOOL 4a8bb0ee8a1b547bb8517c300806457187a8fd1855b223cf079784733fdef55e2dd5fa9998da9523bcd3b021aa10d45cc74445bae5bd8f853e3355d6a1d6417a
|
||||||
EBUILD gitlab-shell-3.6.0.ebuild 3653 SHA256 9a71f83a1bb91c904a43807572477ea143098bf2c7d77bf6777a4b783f524002 SHA512 370c559478716fe31376b6607c233c213df7f0abb3a9ecfc66506cfb29088e63600aecd3046cb272ec32dcb33f3b23a70dbaff5eed9cf308e274236d6dff9e67 WHIRLPOOL 0eee77706d9569d37d1b2cf77d0beacb0e72416d06b9bd937fad1115241908c66b12db6b466a3b579411721cf0d56e7f9137977a7b1fd9f983d7c52b0cb9d724
|
|
||||||
EBUILD gitlab-shell-3.6.1.ebuild 3653 SHA256 c36f3fcec5b4f954c404e4f41a773461971116d7ad2bd484b05ef479c4915ad2 SHA512 fedce05647f773f5a7e54fd8764f8934666a51d9b5e8a5e93201bd504a042ade828cbb0043817b8552bdb4d1cdee6fd2404b17c4e9a7ed3ce75fc41e79c866fd WHIRLPOOL 4853bcfb4dfe1dd152645ce4d572797ba158d5edf53349f3d66489009b10ec2cd7a598beef46bc9b1e104891a3071e1cb9b67471e284b626023a9e1b46b559a8
|
EBUILD gitlab-shell-3.6.1.ebuild 3653 SHA256 c36f3fcec5b4f954c404e4f41a773461971116d7ad2bd484b05ef479c4915ad2 SHA512 fedce05647f773f5a7e54fd8764f8934666a51d9b5e8a5e93201bd504a042ade828cbb0043817b8552bdb4d1cdee6fd2404b17c4e9a7ed3ce75fc41e79c866fd WHIRLPOOL 4853bcfb4dfe1dd152645ce4d572797ba158d5edf53349f3d66489009b10ec2cd7a598beef46bc9b1e104891a3071e1cb9b67471e284b626023a9e1b46b559a8
|
||||||
EBUILD gitlab-shell-3.6.6.ebuild 3653 SHA256 49c383d1d5895069a6783e44d492935879801efd95f57548a81e10df48339038 SHA512 4e6dd5c34a56ed0e1fc45819c93239c61d900304cc8df20855f4e71e4fab234b5e81612f256155022f362f4f9a0959531a3999eb7ece9013914129e4343795cf WHIRLPOOL 92d40a6cb8dd19a42093a746e29ead878eeb9b0c741e23ca3e6213c0a14b820584633db8f2d5ac60cd28da15546232de417db72ccdf8608bc49ac333107f7193
|
EBUILD gitlab-shell-3.6.6.ebuild 3653 SHA256 49c383d1d5895069a6783e44d492935879801efd95f57548a81e10df48339038 SHA512 4e6dd5c34a56ed0e1fc45819c93239c61d900304cc8df20855f4e71e4fab234b5e81612f256155022f362f4f9a0959531a3999eb7ece9013914129e4343795cf WHIRLPOOL 92d40a6cb8dd19a42093a746e29ead878eeb9b0c741e23ca3e6213c0a14b820584633db8f2d5ac60cd28da15546232de417db72ccdf8608bc49ac333107f7193
|
||||||
MISC ChangeLog 1840 SHA256 e8a2f8fe31ce8058afca46a203fcdeb78610d2ccd9622559fd897ba8bcabdb53 SHA512 148492ad184379dbbf02e201fc8892361b411d840334bb16939865f80a2d656eaf860fb1675a464d0c24f0fb5d3c82410d1b0945c2655d0541ed4e5a61f59260 WHIRLPOOL 40d5819a5817782f53a08e71a2b8e9480425d9e45fd2bff5456a6b45937ba35cf2f062a1cd7f6e0f0a002ca6e99b3d2fdbc965d6ffbe0cb8c3fedef226a4be3b
|
MISC ChangeLog 1999 SHA256 2bc63e08adc90cd5216837c82621c8238a869ab699a3dcf38b568467c9142f9e SHA512 5d6bf2f3c3d312f5813fa035ecf22b0dd7648ec4b99ff38cf409bfc63fc3826ffd063c93ab0b4485e13ddaad89680fec39678c0c0d660280a8a13f69b3518ac5 WHIRLPOOL 904c6056d1b2a59604ae8cd468a288f07354ca2e9e18524682cf02065d0a2d5709698c89287911edb0c0172051ca9fe92e62a74edd37115fde33f6ecfcc1a59e
|
||||||
MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1
|
MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1
|
||||||
|
|
|
@ -1,130 +0,0 @@
|
||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
USE_RUBY="ruby20 ruby21"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="3043b31c458bf720843a84b35c9fbad5c1488c1d"
|
|
||||||
|
|
||||||
DESCRIPTION="SSH access and repository management for GitLab"
|
|
||||||
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell"
|
|
||||||
SRC_URI="https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz"
|
|
||||||
RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}"
|
|
||||||
|
|
||||||
LICENSE="MIT"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
DEPEND=""
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-vcs/git-2.7.4
|
|
||||||
dev-db/redis
|
|
||||||
virtual/ssh"
|
|
||||||
ruby_add_bdepend "
|
|
||||||
virtual/ruby-ssl"
|
|
||||||
|
|
||||||
MERGE_TYPE="binary"
|
|
||||||
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"${PN}-3.2.0-config-paths.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
GIT_USER="git"
|
|
||||||
DEST_DIR="/usr/share/${PN}"
|
|
||||||
DATA_DIR="/var/lib/git"
|
|
||||||
LOGS_DIR="/var/log/gitlab"
|
|
||||||
CONF_FILE="/etc/gitlab-shell.yml"
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
enewgroup ${GIT_USER}
|
|
||||||
enewuser ${GIT_USER} -1 /bin/bash ${DATA_DIR} "${GIT_USER}"
|
|
||||||
|
|
||||||
local git_shell=$(egetshell ${GIT_USER})
|
|
||||||
if [ ! ${git_shell} -ef '/bin/bash' ]; then
|
|
||||||
ewarn "User ${GIT_USER} already exists, but with the shell ${git_shell}."
|
|
||||||
ewarn "Changing shell to /bin/bash ..."
|
|
||||||
|
|
||||||
usermod -s /bin/bash ${GIT_USER} \
|
|
||||||
|| die "failed to change login shell for ${GIT_USER}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git|${DATA_DIR}|" \
|
|
||||||
-e "s|[\# ]*(log_file: ).*|\1\"${LOGS_DIR}/gitlab-shell.log\"|" \
|
|
||||||
config.yml.example || die "failed to filter config.yml.example"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e "s|File\.join(ROOT_PATH, 'config.yml')|'${CONF_FILE}'|" \
|
|
||||||
lib/gitlab_config.rb || die "failed to filter gitlab_config.rb"
|
|
||||||
}
|
|
||||||
|
|
||||||
all_ruby_install() {
|
|
||||||
# install lib
|
|
||||||
insinto ${DEST_DIR}; doins -r lib LICENSE README.md VERSION
|
|
||||||
|
|
||||||
# install scripts
|
|
||||||
exeinto ${DEST_DIR}/bin; doexe bin/*
|
|
||||||
exeinto ${DEST_DIR}/hooks; doexe hooks/*
|
|
||||||
exeinto ${DEST_DIR}/support; doexe support/*
|
|
||||||
|
|
||||||
# create symlinks to bin
|
|
||||||
local name; for name in $(basename -a bin/gitlab-*); do
|
|
||||||
dosym "${DEST_DIR}/bin/${name}" "/usr/bin/${name}"
|
|
||||||
done
|
|
||||||
|
|
||||||
insinto $(dirname ${CONF_FILE})
|
|
||||||
newins config.yml.example $(basename ${CONF_FILE})
|
|
||||||
|
|
||||||
# create symlink for .gitlab_shell_secret
|
|
||||||
einfo "creating symlink for .gitlab_shell_secret"
|
|
||||||
TOKEN_FILE="${DEST_DIR}/.gitlab_shell_secret"
|
|
||||||
dosym /opt/gitlab/.gitlab_shell_secret "$TOKEN_FILE"
|
|
||||||
|
|
||||||
# prepare directories
|
|
||||||
diropts -m750; dodir ${DATA_DIR}
|
|
||||||
diropts -m770; keepdir ${DATA_DIR}/repositories
|
|
||||||
diropts -m755; dodir ${LOGS_DIR}
|
|
||||||
|
|
||||||
# GitLab stupidly expects that gitlab-shell is in home of git user...
|
|
||||||
dosym ${DEST_DIR} ${DATA_DIR}/gitlab-shell
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${GIT_USER}:${GIT_USER} ${DATA_DIR} ${LOGS_DIR}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# check git home directory
|
|
||||||
local git_home=$(egethome ${GIT_USER})
|
|
||||||
if [ ! "${git_home}" -ef ${DATA_DIR} ]; then
|
|
||||||
ewarn "An authorized_keys is configured to be inside ${DATA_DIR}/.ssh,"
|
|
||||||
ewarn "but HOME of ${GIT_USER} user is located in ${git_home}. You must"
|
|
||||||
ewarn "either change the authorized_keys location in ${CONF_FILE},"
|
|
||||||
ewarn "or change home directory of ${GIT_USER} user to ${DATA_DIR}"
|
|
||||||
ewarn "and move ${git_home}/.ssh here."
|
|
||||||
ewarn
|
|
||||||
fi
|
|
||||||
|
|
||||||
local auth_dir="${git_home}/.ssh"
|
|
||||||
|
|
||||||
elog "Initializing authorized_keys file in ${auth_dir}"
|
|
||||||
mkdir -p ${auth_dir}
|
|
||||||
touch ${auth_dir}/authorized_keys
|
|
||||||
chmod -R u=rwX,go=- ${auth_dir}
|
|
||||||
chown -R ${GIT_USER}:${GIT_USER} ${auth_dir}
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "GitLab Shell was initialized. Repositories are located in"
|
|
||||||
elog "${DATA_DIR}/repositories, scripts in ${DEST_DIR}/bin."
|
|
||||||
elog "All gitlab-* scripts was symlinked to /usr/bin to be on your path."
|
|
||||||
elog
|
|
||||||
elog "You should change your gitlab_url in: ${CONF_FILE}."
|
|
||||||
}
|
|
|
@ -1,130 +0,0 @@
|
||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
USE_RUBY="ruby21 ruby23"
|
|
||||||
|
|
||||||
inherit eutils ruby-ng user
|
|
||||||
|
|
||||||
MY_PV="v${PV/_/-}"
|
|
||||||
MY_GIT_COMMIT="894d8c16866b58e74791c933968a5a08c7aeb901"
|
|
||||||
|
|
||||||
DESCRIPTION="SSH access and repository management for GitLab"
|
|
||||||
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell"
|
|
||||||
SRC_URI="https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=${MY_PV} -> ${P}.tar.gz"
|
|
||||||
RUBY_S="${PN}-${MY_PV}-${MY_GIT_COMMIT}"
|
|
||||||
|
|
||||||
LICENSE="MIT"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~amd64 ~x86 ~arm ~arm64"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
DEPEND=""
|
|
||||||
RDEPEND="
|
|
||||||
>=dev-vcs/git-2.7.4
|
|
||||||
dev-db/redis
|
|
||||||
virtual/ssh"
|
|
||||||
ruby_add_bdepend "
|
|
||||||
virtual/ruby-ssl"
|
|
||||||
|
|
||||||
MERGE_TYPE="binary"
|
|
||||||
|
|
||||||
RUBY_PATCHES=(
|
|
||||||
"${PN}-3.2.0-config-paths.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
GIT_USER="git"
|
|
||||||
DEST_DIR="/usr/share/${PN}"
|
|
||||||
DATA_DIR="/var/lib/git"
|
|
||||||
LOGS_DIR="/var/log/gitlab"
|
|
||||||
CONF_FILE="/etc/gitlab-shell.yml"
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
enewgroup ${GIT_USER}
|
|
||||||
enewuser ${GIT_USER} -1 /bin/bash ${DATA_DIR} "${GIT_USER}"
|
|
||||||
|
|
||||||
local git_shell=$(egetshell ${GIT_USER})
|
|
||||||
if [ ! ${git_shell} -ef '/bin/bash' ]; then
|
|
||||||
ewarn "User ${GIT_USER} already exists, but with the shell ${git_shell}."
|
|
||||||
ewarn "Changing shell to /bin/bash ..."
|
|
||||||
|
|
||||||
usermod -s /bin/bash ${GIT_USER} \
|
|
||||||
|| die "failed to change login shell for ${GIT_USER}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
all_ruby_prepare() {
|
|
||||||
# fix paths
|
|
||||||
sed -i -E \
|
|
||||||
-e "s|/home/git|${DATA_DIR}|" \
|
|
||||||
-e "s|[\# ]*(log_file: ).*|\1\"${LOGS_DIR}/gitlab-shell.log\"|" \
|
|
||||||
config.yml.example || die "failed to filter config.yml.example"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e "s|File\.join(ROOT_PATH, 'config.yml')|'${CONF_FILE}'|" \
|
|
||||||
lib/gitlab_config.rb || die "failed to filter gitlab_config.rb"
|
|
||||||
}
|
|
||||||
|
|
||||||
all_ruby_install() {
|
|
||||||
# install lib
|
|
||||||
insinto ${DEST_DIR}; doins -r lib LICENSE README.md VERSION
|
|
||||||
|
|
||||||
# install scripts
|
|
||||||
exeinto ${DEST_DIR}/bin; doexe bin/*
|
|
||||||
exeinto ${DEST_DIR}/hooks; doexe hooks/*
|
|
||||||
exeinto ${DEST_DIR}/support; doexe support/*
|
|
||||||
|
|
||||||
# create symlinks to bin
|
|
||||||
local name; for name in $(basename -a bin/gitlab-*); do
|
|
||||||
dosym "${DEST_DIR}/bin/${name}" "/usr/bin/${name}"
|
|
||||||
done
|
|
||||||
|
|
||||||
insinto $(dirname ${CONF_FILE})
|
|
||||||
newins config.yml.example $(basename ${CONF_FILE})
|
|
||||||
|
|
||||||
# create symlink for .gitlab_shell_secret
|
|
||||||
einfo "creating symlink for .gitlab_shell_secret"
|
|
||||||
TOKEN_FILE="${DEST_DIR}/.gitlab_shell_secret"
|
|
||||||
dosym /opt/gitlab/.gitlab_shell_secret "$TOKEN_FILE"
|
|
||||||
|
|
||||||
# prepare directories
|
|
||||||
diropts -m750; dodir ${DATA_DIR}
|
|
||||||
diropts -m770; keepdir ${DATA_DIR}/repositories
|
|
||||||
diropts -m755; dodir ${LOGS_DIR}
|
|
||||||
|
|
||||||
# GitLab stupidly expects that gitlab-shell is in home of git user...
|
|
||||||
dosym ${DEST_DIR} ${DATA_DIR}/gitlab-shell
|
|
||||||
|
|
||||||
# fix permissions
|
|
||||||
fowners -R ${GIT_USER}:${GIT_USER} ${DATA_DIR} ${LOGS_DIR}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# check git home directory
|
|
||||||
local git_home=$(egethome ${GIT_USER})
|
|
||||||
if [ ! "${git_home}" -ef ${DATA_DIR} ]; then
|
|
||||||
ewarn "An authorized_keys is configured to be inside ${DATA_DIR}/.ssh,"
|
|
||||||
ewarn "but HOME of ${GIT_USER} user is located in ${git_home}. You must"
|
|
||||||
ewarn "either change the authorized_keys location in ${CONF_FILE},"
|
|
||||||
ewarn "or change home directory of ${GIT_USER} user to ${DATA_DIR}"
|
|
||||||
ewarn "and move ${git_home}/.ssh here."
|
|
||||||
ewarn
|
|
||||||
fi
|
|
||||||
|
|
||||||
local auth_dir="${git_home}/.ssh"
|
|
||||||
|
|
||||||
elog "Initializing authorized_keys file in ${auth_dir}"
|
|
||||||
mkdir -p ${auth_dir}
|
|
||||||
touch ${auth_dir}/authorized_keys
|
|
||||||
chmod -R u=rwX,go=- ${auth_dir}
|
|
||||||
chown -R ${GIT_USER}:${GIT_USER} ${auth_dir}
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "GitLab Shell was initialized. Repositories are located in"
|
|
||||||
elog "${DATA_DIR}/repositories, scripts in ${DEST_DIR}/bin."
|
|
||||||
elog "All gitlab-* scripts was symlinked to /usr/bin to be on your path."
|
|
||||||
elog
|
|
||||||
elog "You should change your gitlab_url in: ${CONF_FILE}."
|
|
||||||
}
|
|
Loading…
Reference in a new issue