diff --git a/dev-vcs/gitlab-shell/ChangeLog b/dev-vcs/gitlab-shell/ChangeLog index b8effe8..5fcf83b 100644 --- a/dev-vcs/gitlab-shell/ChangeLog +++ b/dev-vcs/gitlab-shell/ChangeLog @@ -3,6 +3,11 @@ -gitlab-shell-5.1.1.ebuild, -gitlab-shell-5.3.1.ebuild: dev-vcs/gitlab-shell: Purge obsolete versions of gitlab-shell +*gitlab-shell-5.11.0 (19 Feb 2018) + + 19 Feb 2018; Manuel Friedli +gitlab-shell-5.11.0.ebuild: + dev-vcs/gitlab-shell: Add ebuild for version 5.11.0 + *gitlab-shell-5.10.2 (17 Feb 2018) 17 Feb 2018; Manuel Friedli +gitlab-shell-5.10.2.ebuild: diff --git a/dev-vcs/gitlab-shell/Manifest b/dev-vcs/gitlab-shell/Manifest index 06cf7fc..b153644 100644 --- a/dev-vcs/gitlab-shell/Manifest +++ b/dev-vcs/gitlab-shell/Manifest @@ -7,8 +7,9 @@ DIST gitlab-shell-5.9.0.tar.gz 710920 SHA256 5085b531abd1c3ebbc73c7b77c05e674fe4 DIST gitlab-shell-5.9.3.tar.gz 711416 SHA256 43692b5ba3c9757ad201611b66f199a636e6d4b47c144ebfd5e8d9b9c996e127 SHA512 b58c7eac03152378bba7f965e630669b6d3628edc11e880500eca5a200d93777e164c3f31c1a241c7b5789d3cbbb19944005268c406d4371ccbe90f913be215e WHIRLPOOL 2ab0627c4ab532c6d291b8ebce6e5d34484bef8ac8cf3feee0d2c1ba2a8d7c570b6e36df1b1c6b121a49145d49b6d1a5d8a37a70ca3f8af70f3231125674a3d2 EBUILD gitlab-shell-5.10.0.ebuild 3927 SHA256 bfbbc8298d256f4f1051ab6c3fe59197ea933a798a521940bdae1f884b5954ff SHA512 6d2461f85b1d1232de89471f4e3fe35cbd6d59a5c644913c78c5b7cc868ab035ceec8c96b4973289fefaeb2e836edf7d7cf0bdf7c4364e6e947ba1b32b6c5b85 WHIRLPOOL e44a285e9264875cda07b3bae39fc5f17fd74f9d91927f2dc9d1cd4a34fc310ec2f73808c5096807265fe3dbd94269ce3e03e6b0d5a1ef176cd1236a1c0002ec EBUILD gitlab-shell-5.10.2.ebuild 3717 SHA256 f0733e56a42e32de7976321a41cb553e6805c7e3d3df41db7180e9a764516b3f SHA512 ae660c8f88b91bd183e786064122ae8e3504efaf5da181b9ad3c2911dd10c981767544a72380b6f23aaf7546b93bdca3e5a7679d54a2d8ee23795e800398106a WHIRLPOOL 72eac46110d8fc2550d52e73cf8577a2c9200b476b6ae1f0fc1bf225af2298b715f7ecb5d0bc3c78bfa75a9bbe39b32aeca036febdca8f8f5ede5c9260593259 +EBUILD gitlab-shell-5.11.0.ebuild 3717 SHA256 f0733e56a42e32de7976321a41cb553e6805c7e3d3df41db7180e9a764516b3f SHA512 ae660c8f88b91bd183e786064122ae8e3504efaf5da181b9ad3c2911dd10c981767544a72380b6f23aaf7546b93bdca3e5a7679d54a2d8ee23795e800398106a WHIRLPOOL 72eac46110d8fc2550d52e73cf8577a2c9200b476b6ae1f0fc1bf225af2298b715f7ecb5d0bc3c78bfa75a9bbe39b32aeca036febdca8f8f5ede5c9260593259 EBUILD gitlab-shell-5.8.0.ebuild 3908 SHA256 6f144e30269af1f4b608258da78553f64a1c6fb4e4ad532de4adcc4d93c8962d SHA512 e9131c8d9361a7321837c996b098b515b15cbd93c15067c000a5811d313fb167432bc415a5327a110adc6a92009d52cad78f12311552042c1b214b5df3eae9ba WHIRLPOOL e16d0ea02eceea491c8bc079cd1d4932d83340f1db3a9e249960b57e550ed65903610f0541d89ef616561f83f4c7fc771b1aedd115e48b80c62e72f62d7dbc3a EBUILD gitlab-shell-5.9.0.ebuild 3908 SHA256 91618dfa168fff385eb362572c8e65e1f72464ea4240b03e60cb554f7c872a8d SHA512 c16e5176dcfc866a696c4b1096b17bf15437ee77db92f28de79990688f146fa38ca2d345d1b3138072626086242f6c3e044a345435ea11ebd0455c3115c8bafe WHIRLPOOL 0b3d586d6c991a20c806ca5a53437aa8eb79eabfa64a26fb839d493052ae2d752dc65ec9626c3c7f62d6de9182d31870eb99c6018f6d490a30962f0b823eccd1 EBUILD gitlab-shell-5.9.3.ebuild 3908 SHA256 27290b4d2d5ceacaf991026c149ea2e1eaa270959490d9a8850596c8e7b4afed SHA512 daa5328dd238804860f8aa52cc4b09c484fc1477dfa6e60aa2fb424e27cc69121dea2c677e02832613ce0bc0023b9b23fe91c53dd455cbe689c6c09bb342138e WHIRLPOOL 8fa05924b1405f79656da46cfe7d22f1631a10ef19629f75fafdec11fe7b6d6fbc0db80ae2a31c81d3c11a9b412f39aa25234e7d5e318b6f4ebbd305af3f6781 -MISC ChangeLog 5833 SHA256 122b2e18ba78c963faa1f46153dd8e118cc1e7d929c181fce82f1bed26b707c9 SHA512 17376f31cc4bc73082c8c80021a70dce48d032cb63410abcae474e2184923612c13fedfc8b450a85a1e875d679a617bce461bbecb8a3c464f357c6c31acb85b8 WHIRLPOOL 5ea586f822f8e0b6d57a21b6eb372b0b33906c5c3c4ff5152b747cf5c5e7540f7551c175606d0afd46f94c9a67b38ff11bad8e9a1fe09421c78a2eb1418be4da +MISC ChangeLog 6005 SHA256 3cd5b207f4c40f4f90476b9ddd25c9fa5be708aa20251167fc3f8b32e90123eb SHA512 482c0b3f49d65b55f9e84ad07facb900f3cf32c8bb71e560597e7206bd908255944d9c99d7935cd53d070134fdececef084a4bbea5ee329f2a2b50bb6023ced3 WHIRLPOOL aff16fd4a35b648c156e883b0dfe85cf387f4f6ee10f0e551aaa3f6fe7adc8ee73e14b5080c148f7ec7e62f56921f08b5d3a29a8146a7fe718d0208489c548e7 MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1 diff --git a/dev-vcs/gitlab-shell/gitlab-shell-5.11.0.ebuild b/dev-vcs/gitlab-shell/gitlab-shell-5.11.0.ebuild new file mode 100644 index 0000000..75e1d1c --- /dev/null +++ b/dev-vcs/gitlab-shell/gitlab-shell-5.11.0.ebuild @@ -0,0 +1,132 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +USE_RUBY="ruby23" + +EGIT_REPO_URI="https://gitlab.com/gitlab-org/gitlab-shell.git" +EGIT_COMMIT="v${PV}" + +inherit eutils git-r3 user + +DESCRIPTION="SSH access and repository management for GitLab" +HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-shell" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~arm ~arm64" +IUSE="" + +CDEPEND=" + >=dev-lang/go-1.8.3 + virtual/ruby-ssl" + +DEPEND="" +RDEPEND=" + >=dev-vcs/git-2.7.4 + dev-db/redis + virtual/ssh" + +RESTRICT="mirror" + +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 +} + +src_prepare() { + epatch "${FILESDIR}/0001-${PN}-4.1.1-config-paths.patch" + epatch "${FILESDIR}/0002-${PN}-5.1.1-Makefile.patch" + # 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" + eapply_user +} + +src_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}" + + # Gitaly stupidly hardcodes the path to config.yml :( + MY_CONF_FILE="${DEST_DIR}/config.yml" + dosym "${CONF_FILE}" "${MY_CONF_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}." +} diff --git a/www-apps/gitlab-ce/ChangeLog b/www-apps/gitlab-ce/ChangeLog index fc789b4..f86e8c1 100644 --- a/www-apps/gitlab-ce/ChangeLog +++ b/www-apps/gitlab-ce/ChangeLog @@ -9,6 +9,14 @@ metadata.xml: www-apps/gitlab-ce: Purge all versions depending on + +files/08-gitlab-ce-10.4.4-general-config.patch, + +files/gitlab-10.4.4-sidekiq.init, +files/gitlab-10.4.4-unicorn.init, + +gitlab-ce-10.4.4.ebuild: + www-apps/gitlab-ce: Add ebuild for version 10.4.4. + *gitlab-ce-10.3.7 (17 Feb 2018) 17 Feb 2018; Manuel Friedli +gitlab-ce-10.3.7.ebuild: diff --git a/www-apps/gitlab-ce/Manifest b/www-apps/gitlab-ce/Manifest index bc5a2b4..cb14649 100644 --- a/www-apps/gitlab-ce/Manifest +++ b/www-apps/gitlab-ce/Manifest @@ -6,6 +6,9 @@ AUX 04-gitlab-ce-9.3.0-fix-check-task.patch 1090 SHA256 51ade91e5e7ef67e6d3c0e6e AUX 05-gitlab-ce-9.0.0-replace-sys-filesystem.patch 2436 SHA256 53fcd9fc123a0fcb671a8cbcb3b2dc61765e32be6836206ae0edea8cf0ae8203 SHA512 21636f298df7e762f59595f39fb50266f8737311f37aa2b9ba96bc29190b8a67eea01b09e3b589d0885da6b27beaa136fa66c7d98408a8e3ecb3ac6baf20d891 WHIRLPOOL e0c709dfc5f72e33207fd7d62a7db5a85c0ed4b6064d5d6a13bcce7d660d9ba144fe09d0985c16c313f06a4e02911729be132086735eac47ddff981874f31acc AUX 06-gitlab-ce-8.17.0-fix-webpack-config.patch 614 SHA256 0c1cdc25032322eff6c279435ba5f3fc349b30de0d55d86fad2616bd2bb7fef4 SHA512 f5ccb4d1849ab395ba4ec3c80735a1fedd9fa7f790c8b114d8dc8d1fc2c431d7b9e5645247485f0b8c1061a00ed61c21a5e50f49af0d76e232182c68868a163f WHIRLPOOL 6968ddefed74607c36cc66dc133dbf4942979d2ae867f819cf2e7e5c9701fe8dd86b266d923e6343971e6904f0ad1f35200971660df139edabcc9e0790fc107c AUX 07-gitlab-ce-10.0.7-yarn.patch 36442 SHA256 b45cfd739ca94058987c55458c89dba4cdbb1b9b9fc2e486d02e67e275044855 SHA512 931edab62e1218f84f08db72cc2f4ff95e53c6f88d755224de5e9dd19c230bb4b4c808accebd14c7bb06e6c57e4f101f7b4fb1843abb9a908d7f9f2b901d4e5f WHIRLPOOL 0f0ba8a1dfb38355bedebb17a8d174fa33a695be9da364bfebf3ffc5629eff5f462a9b66af65ad0fcc3b35f93c67c4b15a93e1962ae32225dbed45c87b30c5b1 +AUX 08-gitlab-ce-10.4.4-general-config.patch 4069 SHA256 d4b8c0f35fb695e193eb211e1f24938169c7e1e5de5f9191e69fef0b8d2a285f SHA512 c9e7e2456c43b9b3494adacd980a07e4f75ce07259622e2215a9a2f3cd7f4173473e5e0044f978ee8b84042a42eb49156cb1d9f258e4c32b1284beb1f5ac9524 WHIRLPOOL 368cb32ae93cd62b444d9124806d20dc80a18a64480fdbb765eeffc552da42a557e4fa3c06a0f5650d98a9948ce46e90a38c335ac07c7ff0f1ec4f7d16caf399 +AUX gitlab-10.4.4-sidekiq.init 1461 SHA256 99fd95716abde96f9a031cb22e04371c7dfe6bf53440154dcf94be9477d1a6f8 SHA512 8d536a3db5af3bdf04b92e0c1e9e9d65aacb3dff244729d32f28b8dd66f586cbd5a2e60b3e2f58c2be96c0c09708dc21275adca3f89fbdfa20e000e9563ee880 WHIRLPOOL e47f69b06fd0d60837fc7cab03eb4c4cf9111597b7b3e81c3c35b7fc83be12f85ac26ad6693ff30c95b91a998b0685128b303df5aa97ab7835f575ce199f141b +AUX gitlab-10.4.4-unicorn.init 4068 SHA256 a29c2741626fae15156117786d7ab63f4c68c5357d28c257a9da8e6d92ce71d7 SHA512 0dce3a14f113776bacb86eac602726a70ba3f71ee1a9310c7a2f427a658622b94e0550564360339b044a58c2db52ed6782de7675aa622b2ab9016ed93261b22a WHIRLPOOL 58a4c3328665dffcf9f96a2eeee495b9dcd550a41c26d8e256b44ca6ad247a84c909838e31f8de8673f94d767c077bb253c20f3a4321abe7d5de937f680ec215 AUX gitlab-8.13.0-sidekiq.service 990 SHA256 183ccbdb19a3dcc74cf1f1f865bf396466e06f7408ff7d3e92359b2a0e83f24c SHA512 c356baf65337739b08a0a4bfe24d3b68f557e9d6d95f479b39ec954ee6c2077e380f99d1e9e9390f5b038e093c0a46562f651512a6578dfa86977580159470a2 WHIRLPOOL 81d9ea9febf47d5fdb9c49a54bbc499bd796fc56bc1c16404fe4c74d00c4bb9fa9631e4cd4cf88d3c30a44c04b74b35a61cd4da9f2139a4abf61e758b4e5949a AUX gitlab-9.3.5-sidekiq.init 1464 SHA256 dc1d9a58845a699d5b797f476597e7d7a7171eb842b05639cd2e235c70a26edf SHA512 fe00243c815b0e4f826aada4f02c70659872673a36fe92ea1b72a94a21bacfb097260ac1623cc1fc9c74566fe5c6068a456c9dc6e1e1c02f42e86fd162573713 WHIRLPOOL 6d8618e1e0a14030c73840f58d6dd5f7ef221f448799c92978c42d6bd71bfd072f15508df931f408ede91158079cef7039e9e725cb217629a8b7e19f6c706978 AUX gitlab-9.3.5-unicorn.init 3748 SHA256 2fb8d62e52b2e59bed92de55834421b3858ca385c20ed7532f78a3c4cd6ba2c9 SHA512 6f7a6cded598f3f8174a4d39f06f1994aa77b22cb90fa7f1bb6f82919c9856c3eae1623f57636f2ee564b2bf6c660c82dd104e3c59455946db42e6cf44079ccb WHIRLPOOL f39d37b2f83046234616d056d046c844e24ccf434c96bc298acd0f53fcf0be57fc64352bfd66e45083f87e6be0ed817c89630309deee5f142c9343a46014a166 @@ -22,6 +25,7 @@ EBUILD gitlab-ce-10.0.7.ebuild 13568 SHA256 c164db3f0af93824bb97992b20b0bc5415bb EBUILD gitlab-ce-10.1.7.ebuild 13679 SHA256 9c1bec7e86d46422f87baecaece80197c506b758eab28fd85fc214512ff67e3c SHA512 6958f3f67b7d8729519175337b5e411b9d32fa3e7348105870d5f35c938e905cc60e7af23802b1b5835610c72e9a76ca50c229f5d862403ffd5065e82ee39d25 WHIRLPOOL 6caf644203291c7903f7c67a93e3f11a3f8d632e01384390742bc8b1fc4068e494f750c44817f0143a0f6eeaadbb4a7243c4194397fded59956363b49bd32ae4 EBUILD gitlab-ce-10.2.8.ebuild 13681 SHA256 0e02e1a51f335872facce2751aa23d8ff5b9cd8aa7359fed1cd0f5a3ed5bd1e7 SHA512 805d6a717b0dcdc6551f549722abb8322a51d6cee1eb807dabac1fe4b98ffd32fcf3667d1de7f845a08e9dfb72afa257c51c6382cbc48f5f23fe15b027724dde WHIRLPOOL 1c48b8ea54d65d1d2ea001c6af45c0a76f0587d815353675ce36245c721f4b2d9c5b48c608fe632743863f5db859c5ee0c96b95fe6b429fcdd7053d4e8fb86e8 EBUILD gitlab-ce-10.3.7.ebuild 14085 SHA256 cbff8442516b815e386974191d48464202b3b4f93e5d4688a71de08fadaeb89c SHA512 311e256f675c6cbb8e374448858e0adcfecd6a5432c4384a5d9c302a3c82dcab0aab0eb9a79d90f8f770dba0d1d984f0b7e3d53ce1e3b2c4c915aaa2facdbdd7 WHIRLPOOL 29674dc1a54311518047df70ecd21971b642bc7b8511d8c6ba3f754b7beae3de10c289704dcd214c7c5cf76f60772117c2649daac4d691b13387d758d2fb3f36 +EBUILD gitlab-ce-10.4.4.ebuild 13152 SHA256 6b226f67a85d25131a9acef87447a357ea67cc3f48e6aab927735de62fdbcaed SHA512 b8b43172d6b37ca3bbf84b7d2598ff558cebf84157a87957316d5f7168b52e8c91f87db853cf7a9c0843ab83540d811a4ad98da9c69343e87a0633b44f72b37b WHIRLPOOL d39bc072986261de7ddc35d58ee570eedfe8f01532dea8fa1423cfb40a5352453a1ba2647023032194ef44a87dfa7f0b4ca0dc96472c609ea3a49a1a5a339153 EBUILD gitlab-ce-9.5.10.ebuild 13526 SHA256 6e7c361f31989dd608eff4c8dd01b7301b142b4d38acdf38e61e2eecb2d4b285 SHA512 e33e56c8e49bd2ef03dd9af508b186f7908b8502960cbdb95ca9166631b84d5357c4965c0919e432ee5de9b9eeb33f68773ac405c24430568f9abb0d8e7354a6 WHIRLPOOL 3e866d785e8018096a92a223a2f6cedf4398cc07726a183d805005b3cd718fed2296edd63f5bc9d2b8849fe2298e9a61bf998a2241de2cd5ab4527f8ddaed325 -MISC ChangeLog 26636 SHA256 0e0699c1ad1342daacebb2daaafd5212c4ecfcf41f0017d9bff671af2ea68c6b SHA512 92d7b2c681984436bc9c8112ac64fd128f0fab5bbab7057094fbc017aa4d3bc99ca941b2101dfad8273e274f24a3ad985825bfe63b0677329b7efda51b75739a WHIRLPOOL 74b74bce5ed725ee8d0150c7f3249d82e9ded5d09b560d251c17c4daed041aad9fc2233b748177fa2523e0ebec935e2397b53be57caa8328460f8a1edc2c1981 +MISC ChangeLog 26925 SHA256 17ed6f6acaad109f9dee884b442a3845ece4b202d1a645bfa6694c337c0d3405 SHA512 bb830b972289a1dbece2329fe555a6afd06b29ebbb541c7b155408f92c8616a4e17fb139ee7bbf854d661f27b4c6f7e54e078301063b3eccd067f3742e00ab75 WHIRLPOOL 898c95a25d81ad987adbc8a8ea4a82c3e5c1d04b5e4b4bd0005f0a9efe9258f4d5829ad193db17cae58c641638f25f1f98a40d563255c09f5563d736611106fd MISC metadata.xml 665 SHA256 2a0cd67ad42f0cc6d8b88391cf6e3153a9883dab31aae8227c57c95f3f68890d SHA512 64b8fbae373d0a057f705f64c1d097dbfab893bd585e1db65ccdb06cda9569211c9b63fa168ac8de9f6d512a17759ecd20b54d818d2790a6f4c99d0ca73fddc3 WHIRLPOOL a81b21bb46aad9757a502628033eba546c686b83bbf1d651ecabba273c454cfb64574affc180db8358ced87eb638e8ad13d7c79c4cfb9a31e72c577d21ab433e diff --git a/www-apps/gitlab-ce/files/08-gitlab-ce-10.4.4-general-config.patch b/www-apps/gitlab-ce/files/08-gitlab-ce-10.4.4-general-config.patch new file mode 100644 index 0000000..244fdb1 --- /dev/null +++ b/www-apps/gitlab-ce/files/08-gitlab-ce-10.4.4-general-config.patch @@ -0,0 +1,96 @@ +diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example +index f2f05b3..0670112 100644 +--- a/config/gitlab.yml.example ++++ b/config/gitlab.yml.example +@@ -502,7 +502,7 @@ production: &base + # Gitaly settings + gitaly: + # Path to the directory containing Gitaly client executables. +- client_path: /home/git/gitaly/bin ++ client_path: /usr/bin + # Default Gitaly authentication token. Can be overriden per storage. Can + # be left blank when Gitaly is running locally on a Unix socket, which + # is the normal way to deploy Gitaly. +@@ -520,8 +520,8 @@ production: &base + # real path not the symlink. + storages: # You must have at least a `default` storage path. + default: +- path: /home/git/repositories/ +- gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port) ++ path: /var/lib/git/repositories/ ++ gitaly_address: unix:/run/gitlab/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port) + # gitaly_token: 'special token' # Optional: override global gitaly.token for this storage. + + ## Backup settings +@@ -549,12 +549,12 @@ production: &base + + ## GitLab Shell settings + gitlab_shell: +- path: /home/git/gitlab-shell/ +- hooks_path: /home/git/gitlab-shell/hooks/ ++ path: /usr/share/gitlab-shell/ ++ hooks_path: /usr/share/gitlab-shell/hooks/ + + # File that contains the secret key for verifying access for gitlab-shell. + # Default is '.gitlab_shell_secret' relative to Rails.root (i.e. root of the GitLab app). +- # secret_file: /home/git/gitlab/.gitlab_shell_secret ++ secret_file: /opt/gitlab/.gitlab_shell_secret + + # Git over HTTP + upload_pack: true +@@ -569,7 +569,7 @@ production: &base + workhorse: + # File that contains the secret key for verifying access for gitlab-workhorse. + # Default is '.gitlab_workhorse_secret' relative to Rails.root (i.e. root of the GitLab app). +- # secret_file: /home/git/gitlab/.gitlab_workhorse_secret ++ # secret_file: /opt/gitlab/.gitlab_workhorse_secret + + ## Git settings + # CAUTION! +@@ -667,8 +667,8 @@ test: + backup: + path: tmp/tests/backups + gitlab_shell: +- path: tmp/tests/gitlab-shell/ +- hooks_path: tmp/tests/gitlab-shell/hooks/ ++ path: /usr/share/gitlab-shell/ ++ hooks_path: /usr/share/gitlab-shell/hooks/ + issues_tracker: + redmine: + title: "Redmine" +diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example +index cc10da2..3c80d44 100644 +--- a/config/unicorn.rb.example ++++ b/config/unicorn.rb.example +@@ -33,12 +33,12 @@ worker_processes 3 + + # Help ensure your application will always spawn in the symlinked + # "current" directory that Capistrano sets up. +-working_directory "/home/git/gitlab" # available in 0.94.0+ ++working_directory "/opt/gitlab" # available in 0.94.0+ + + # Listen on both a Unix domain socket and a TCP port. + # If you are load-balancing multiple Unicorn masters, lower the backlog + # setting to e.g. 64 for faster failover. +-listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024 ++listen "/run/gitlab/gitlab.socket", :backlog => 1024 + listen "127.0.0.1:8080", :tcp_nopush => true + + # nuke workers after 30 seconds instead of 60 seconds (the default) +@@ -59,13 +59,13 @@ listen "127.0.0.1:8080", :tcp_nopush => true + timeout 60 + + # feel free to point this anywhere accessible on the filesystem +-pid "/home/git/gitlab/tmp/pids/unicorn.pid" ++pid "/run/gitlab/unicorn.pid" + + # By default, the Unicorn logger will write to stderr. + # Additionally, some applications/frameworks log to stderr or stdout, + # so prevent them from going to /dev/null when daemonized here: +-stderr_path "/home/git/gitlab/log/unicorn.stderr.log" +-stdout_path "/home/git/gitlab/log/unicorn.stdout.log" ++stderr_path "/var/log/gitlab/unicorn.stderr.log" ++stdout_path "/var/log/gitlab/unicorn.stdout.log" + + # combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings + # http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow diff --git a/www-apps/gitlab-ce/files/gitlab-10.4.4-sidekiq.init b/www-apps/gitlab-ce/files/gitlab-10.4.4-sidekiq.init new file mode 100644 index 0000000..20bc069 --- /dev/null +++ b/www-apps/gitlab-ce/files/gitlab-10.4.4-sidekiq.init @@ -0,0 +1,64 @@ +#!/sbin/openrc-run + +extra_started_commands="check" + +name="GitLab Sidekiq" +description="Sidekiq for GitLab" +description_check="Runs sanity checks" + +: ${gitlab_user:=@USER@} +: ${gitlab_base:="@GITLAB_BASE@"} +: ${rails_env:=production} + +: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"} +: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"} +: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"} + +sidekiq_command="/usr/bin/bundle" +sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}" + +check_command="sudo -u ${gitlab_user} -H /usr/bin/bundle" +check_command_args1="exec rake gitlab:env:info RAILS_ENV=${rails_env}" +check_command_args2="exec rake gitlab:check RAILS_ENV=${rails_env}" + +depend() { + need redis gitlab-workhorse + use net +} + +start() { + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")" + + ebegin "Starting ${name} - Sidekiq" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${sidekiq_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${sidekiq_command} -- ${sidekiq_command_args} + eend $? +} + +stop() { + ebegin "Stopping ${name} - Sidekiq" + start-stop-daemon --stop \ + --pidfile="${sidekiq_pidfile}" \ + --exec ${sidekiq_command} + eend $? +} + +check() { + ebegin "Running sanity checks for ${name}" + + cd /opt/gitlab + + ${check_command} ${check_command_args1} + + eend $? + + ${check_command} ${check_command_args2} + + eend $? +} diff --git a/www-apps/gitlab-ce/files/gitlab-10.4.4-unicorn.init b/www-apps/gitlab-ce/files/gitlab-10.4.4-unicorn.init new file mode 100644 index 0000000..94082db --- /dev/null +++ b/www-apps/gitlab-ce/files/gitlab-10.4.4-unicorn.init @@ -0,0 +1,157 @@ +#!/sbin/openrc-run + +extra_started_commands="restartsidekiq check" +extra_stopped_commands="backup" + +name="GitLab" +description="GitLab on Unicorns" +description_restartsidekiq="Restarts Sidekiq only" +description_check="Runs sanity checks" +description_backup="Creates a backup of your Gitlab database and files" + +: ${gitlab_user:=@USER@} +: ${gitlab_base:="@GITLAB_BASE@"} +: ${rails_env:=production} + +: ${server_pidfile:="/run/gitlab/unicorn.pid"} + +: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"} +: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"} +: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"} + +: ${mail_room_pidfile:="/run/gitlab/mail_room.pid"} +: ${mail_room_logfile:="@LOGS_DIR@/mail_room.log"} +: ${mail_room_config:="/etc/gitlab/mail_room.yml"} + +socket_dir="/run/gitlab" + +server_command="/usr/bin/bundle" +server_command_args="exec unicorn_rails -c ${gitlab_base}/config/unicorn.rb -E ${rails_env} -D" + +sidekiq_command="/usr/bin/bundle" +sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}" + +mail_room_command="/usr/bin/bundle" +mail_room_command_args="exec mail_room -q -c ${mail_room_config} >> ${mail_room_logfile} 2>&1" + +check_command="sudo -u ${gitlab_user} -H /usr/bin/bundle" +check_command_args1="exec rake gitlab:env:info RAILS_ENV=${rails_env}" +check_command_args2="exec rake gitlab:check RAILS_ENV=${rails_env}" + +backup_command="sudo -u ${gitlab:user} -H /usr/bin/bundle" +backup_args=" exec rake gitlab:backup:create RAILS_ENV=${rails_env}" + +depend() { + provide gitlab + need redis gitlab-workhorse gitlab-gitaly + use net +} + +start() { + ebegin "Starting ${name} - Unicorn servers" + + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${server_pidfile}")" + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")" + checkpath -d -o ${gitlab_user} -m755 "$(dirname "${mail_room_pidfile}")" + checkpath -d -o ${gitlab_user} -m700 "${socket_dir}" + + start-stop-daemon --start \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${server_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${server_command} -- ${server_command_args} + eend $? + + ebegin "Starting ${name} - Sidekiq" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${sidekiq_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${sidekiq_command} -- ${sidekiq_command_args} + eend $? + + if [ -e /etc/default/gitlab ]; then + . /etc/default/gitlab + if [ "${mail_room_enabled}" == "true" ]; then + ebegin "Starting ${name} - mail_room" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${mail_room_pidfile}" -m \ + --env RAILS_ENV=${rails_env} \ + --exec ${mail_room_command} -- ${mail_room_command_args} + eend $? + fi + fi +} + +stop() { + ebegin "Stopping ${name} - mail_room" + start-stop-daemon --stop \ + --signal QUIT \ + --pidfile=${mail_room_pidfile} \ + --exec ${mail_room_command} + eend $? + + ebegin "Stopping ${name} - Sidekiq" + start-stop-daemon --stop \ + --pidfile=${sidekiq_pidfile} \ + --exec ${sidekiq_command} + eend $? + + ebegin "Stopping ${name} - Unicorn servers" + start-stop-daemon --stop \ + --signal QUIT \ + --pidfile=${server_pidfile} \ + --exec ${server_command} + eend $? +} + +restartsidekiq() { + ebegin "Restarting ${name} - Sidekiq: Stopping" + start-stop-daemon --stop \ + --pidfile=${sidekiq_pidfile} \ + --exec ${sidekiq_command} \ + --progress \ + --retry 180 + + eend $? + + ebegin "Starting ${name} - Sidekiq" + + start-stop-daemon --start \ + --background --quiet \ + --chdir "${gitlab_base}" \ + --user=${gitlab_user} \ + --pidfile="${sidekiq_pidfile}" \ + --env RAILS_ENV=${rails_env} \ + --exec ${sidekiq_command} -- ${sidekiq_command_args} + eend $? +} + +check() { + ebegin "Running sanity checks for ${name}" + + cd /opt/gitlab + + ${check_command} ${check_command_args1} + + eend $? + + ${check_command} ${check_command_args2} + + eend $? +} + +backup() { + ebegin "Creating backup of ${name}" + cd /opt/gitlab + ${backup_command} ${backup_args} + eend $? +} diff --git a/www-apps/gitlab-ce/gitlab-ce-10.4.4.ebuild b/www-apps/gitlab-ce/gitlab-ce-10.4.4.ebuild new file mode 100644 index 0000000..8c81fb3 --- /dev/null +++ b/www-apps/gitlab-ce/gitlab-ce-10.4.4.ebuild @@ -0,0 +1,430 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +# Maintainer notes: +# - This ebuild uses Bundler to download and install all gems in deployment mode +# (i.e. into isolated directory inside application). That's not Gentoo way how +# it should be done, but GitLab has too many dependencies that it will be too +# difficult to maintain them via ebuilds. +# + +USE_RUBY="ruby23" + +EGIT_REPO_URI="https://gitlab.com/gitlab-org/${PN}.git" +EGIT_COMMIT="v${PV}" +EGIT_CHECKOUT_DIR="${WORKDIR}/all" + +inherit eutils git-r3 ruby-ng user systemd + +GITLAB_GITALY_VERSION="0.66.0" +GITLAB_PAGES_VERSION="0.6.0" +GITLAB_SHELL_VERSION="5.11.0" +GITLAB_WORKHORSE_VERSION="3.3.1" + +DESCRIPTION="GitLab is a free project and repository management application" +HOMEPAGE="https://about.gitlab.com/" + +RESTRICT="mirror" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~arm64" +IUSE="kerberos mysql +postgres +unicorn systemd pages rugged_use_system_libraries" + +## Gems dependencies: +# charlock_holmes dev-libs/icu +# grape, capybara dev-libs/libxml2, dev-libs/libxslt +# rugged dev-util/cmake, virtual/pkgconfig +# json dev-util/ragel +# pygments.rb python 2.7+ +# execjs net-libs/nodejs, or any other JS runtime +# pg dev-db/postgresql +# mysql virtual/mysql +# +GEMS_DEPEND=" + dev-libs/icu + dev-libs/libxml2 + dev-libs/libxslt + dev-libs/re2 + dev-util/ragel + >=net-libs/nodejs-4.3.0 + >=sys-apps/yarn-0.17.0 + postgres? ( >=dev-db/postgresql-9.6:* ) + mysql? ( virtual/mysql ) + kerberos? ( virtual/krb5 )" +CDEPEND=" + dev-util/cmake + virtual/pkgconfig" +COMMON_DEPEND=" + ${GEMS_DEPEND} + ~dev-vcs/gitlab-shell-${GITLAB_SHELL_VERSION} + >=dev-vcs/git-2.8.4 + ~www-servers/gitlab-workhorse-${GITLAB_WORKHORSE_VERSION} + kerberos? ( !app-crypt/heimdal ) + rugged_use_system_libraries? ( net-libs/http-parser dev-libs/libgit2:0/26 ) + pages? ( ~www-servers/gitlab-pages-${GITLAB_PAGES_VERSION} ) + ~www-servers/gitlab-gitaly-${GITLAB_GITALY_VERSION}" +DEPEND=" + ${CDEPEND} + ${COMMON_DEPEND}" +RDEPEND=" + ${COMMON_DEPEND} + >=dev-db/redis-2.8 + virtual/mta + systemd? ( sys-apps/systemd:0= )" +ruby_add_bdepend " + virtual/rubygems + >=dev-ruby/bundler-1.15.4" + +# +# fix-sendmail-config: +# Fix default settings to work with ssmtp that doesn't know '-t' argument. +# fix-redis-config-path: +# Point to the absolute location of redis_config.rb +# +PATCHES=( + "${FILESDIR}/01-${PN}-8.7.5-fix-sendmail-config.patch" + "${FILESDIR}/02-${PN}-9.0.0-fix-redis-config-path.patch" + "${FILESDIR}/03-${PN}-10.2.8-database.yml.patch" + "${FILESDIR}/04-${PN}-9.3.0-fix-check-task.patch" + "${FILESDIR}/05-${PN}-9.0.0-replace-sys-filesystem.patch" + "${FILESDIR}/06-${PN}-8.17.0-fix-webpack-config.patch" + "${FILESDIR}/08-${PN}-10.4.4-general-config.patch" +) + +MY_NAME="gitlab" +MY_USER="git" # should be same as in gitlab-shell + +DEST_DIR="/opt/${MY_NAME}" +CONF_DIR="/etc/${MY_NAME}" +LOGS_DIR="/var/log/${MY_NAME}" +TEMP_DIR="/var/tmp/${MY_NAME}" + +all_ruby_unpack() { + git-r3_fetch + git-r3_checkout +} + +all_ruby_prepare() { + # fix paths + sed -i \ + -e "s|/home/git/gitlab/tmp|/run/${MY_NAME}|g" \ + lib/support/nginx/gitlab || die "failed to filter nginx/gitlab" + + # modify default database settings for PostgreSQL + sed -i -E \ + -e 's|(username:).*|\1 gitlab|' \ + -e 's|(password:).*|\1 gitlab|' \ + -e 's|(socket:).*|\1 /run/postgresql/.s.PGSQL.5432|' \ + config/database.yml.postgresql \ + || die "failed to filter database.yml.postgresql" + + # rename config files + mv config/gitlab.yml.example config/gitlab.yml + mv config/unicorn.rb.example config/unicorn.rb + + local dbconf=config/database.yml + if use postgres && ! use mysql; then + mv ${dbconf}.postgresql ${dbconf} + rm ${dbconf}.mysql + elif use mysql && ! use postgres; then + mv ${dbconf}.mysql ${dbconf} + rm ${dbconf}.postgresql + fi + + # remove useless files + rm -r lib/support/{deploy,init.d} + use unicorn || rm config/unicorn.rb +} + +all_ruby_install() { + local dest=${DEST_DIR} + local conf=${CONF_DIR} + local logs=${LOGS_DIR} + local temp=${TEMP_DIR} + + # prepare directories + diropts -m750 + dodir ${logs} ${temp} + + diropts -m755 + dodir ${conf} ${dest}/public/uploads + + dosym ${temp} ${dest}/tmp + dosym ${logs} ${dest}/log + + # install configs + insinto ${conf} + doins -r config/* + dosym ${conf} ${dest}/config + + echo 'export RAILS_ENV=production' > "${D}/${dest}/.profile" + + # remove needless dirs + rm -Rf config tmp log + + # install the rest files + # using cp 'cause doins is slow + cp -Rl * "${D}/${dest}"/ + cp -Rl .??* "${D}/${dest}"/ + + # install logrotate config + dodir /etc/logrotate.d + cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF + ${logs}/*.log { + missingok + delaycompress + compress + copytruncate + } + EOF + + ## Install gems via bundler ## + + cd "${D}/${dest}" + + local without="development test aws" + local flag; for flag in mysql postgres unicorn kerberos; do + without+="$(use $flag || echo ' '$flag)" + done + local bundle_args="--deployment ${without:+--without ${without}}" + + use "rugged_use_system_libraries" && export RUGGED_USE_SYSTEM_LIBRARIES="YES" + + einfo "Running bundle install ${bundle_args} ..." + ${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed" + + einfo "Cleaning old gems ..." + ${RUBY} /usr/bin/bundle clean + + # clean gems cache + rm -Rf vendor/bundle/ruby/*/cache + rm -Rf vendor/bundle/ruby/*/bundler/gems/charlock_holmes-dde194609b35/.git + + ## RC script ## + + if use systemd ; then + ewarn "Beware: systemd support has not been tested, use at your own risk!" + systemd_newunit "${FILESDIR}/gitlab-8.13.0-sidekiq.service" "gitlab-sidekiq.service" + systemd_dounit "${FILESDIR}/gitlab-unicorn.service" + systemd_dounit "${FILESDIR}/gitlab-workhorse.service" + systemd_dounit "${FILESDIR}/gitlab-mailroom.service" + systemd_dotmpfilesd "${FILESDIR}/gitlab.conf" + else + local rcscript=gitlab-10.4.4-sidekiq.init + use unicorn && rcscript=gitlab-10.4.4-unicorn.init + + cp "${FILESDIR}/${rcscript}" "${T}" || die + sed -i \ + -e "s|@USER@|${MY_USER}|g" \ + -e "s|@GITLAB_BASE@|${dest}|g" \ + -e "s|@LOGS_DIR@|${logs}|g" \ + "${T}/${rcscript}" \ + || die "failed to filter ${rcscript}" + + newinitd "${T}/${rcscript}" "${MY_NAME}" + fi + + # fix permissions + fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs} +} + +pkg_postinst() { + elog "If this is an update from a previous version, stop your GitLab" + elog "instance and issue the following command to perform all required" + elog "migrations:" + elog " emerge --config \"=${CATEGORY}/${PF}\"" + elog "PLEASE NOTE: It's HIGHLY recommended to backup your database" + elog "before running the config phase. Run these commands (as root):" + elog + elog " cd /opt/gitlab" + elog " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" + elog + elog "If you're using OpenRC, you can use the following command:" + elog + elog " /etc/init.d/gitlab backup" + elog + elog "If this was a fresh install, follow these steps:" + elog + elog "1. Configure your GitLab's settings in ${CONF_DIR}/gitlab.yml." + elog + elog "2. Configure your database settings in ${CONF_DIR}/database.yml" + elog " for \"production\" environment." + elog + elog "3. Then you should create a database for your GitLab instance, if you" + elog " haven't done so already." + elog + if use postgres; then + elog "If you have local PostgreSQL running, just copy&run:" + elog " su postgres" + elog " psql -c \"CREATE ROLE gitlab PASSWORD 'gitlab' \\" + elog " NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" + elog " createdb -E UTF-8 -O gitlab gitlabhq_production" + elog " Note: You should change your password to something more random..." + elog + fi + elog "4. Finally execute the following command to initialize the environment:" + elog " emerge --config \"=${CATEGORY}/${PF}\"" + elog " Note: Do not forget to start Redis server first!" + elog + elog "If you're running GitLab behind an SSL proxy such as nginx or Apache and" + elog "you can't login after the upgrade, be sure to read the section about the" + elog "verification of the CSRF token in GitLab's trouble-shooting guide at" + elog "http://goo.gl/5XGRGv." + if use postgres; then + elog "Please note: As of GitLab 8.6, users of PostgreSQL need to enable the" + elog "`pg_trgm` extension by running the following command as a PostgreSQL" + elog "super user for *every* GitLab database:" + elog " CREATE EXTENSION IF NOT EXISTS pg_trgm;" + elog "For details, see the documentation at the GitLab website." + fi + if use mysql ; then + ewarn "You must grant the GitLab user permissions the following on the database:" + ewarn " mysql -u root -p -e \\" + ewarn " \"GRANT TRIGGER ON \`gitlab\`.* TO 'gitlab'@'localhost';\"" + ewarn "PLEASE also read this document about needed migrations on MySQL:" + ewarn + ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md" + ewarn + ewarn "Failing to follow those instructions may make the config phase fail!" + fi +} + +pkg_config() { + einfo "Checking configuration files" + + if [ ! -r "${CONF_DIR}/database.yml" ]; then + eerror "Copy ${CONF_DIR}/database.yml.* to" + eerror "${CONF_DIR}/database.yml and edit this file in order to configure your" + eerror "database settings for \"production\" environment." + die + fi + + local email_from="$(ryaml ${CONF_DIR}/gitlab.yml production gitlab email_from)" + local git_home="$(egethome ${MY_USER})" + + # configure Git global settings + if [ ! -e "${git_home}/.gitconfig" ]; then + einfo "Setting git user" + su -l ${MY_USER} -c " + git config --global user.email '${email_from}'; + git config --global user.name 'GitLab'" \ + || die "failed to setup git name and email" + fi + + su -l ${MY_USER} -c "git config --global repack.writeBitmaps true" + + # determine whether this is an update or a fresh install. we do this by + # checking whether the ${DEST_DIR}/.git directory exists or not + # + if [ -d "${DEST_DIR}/.git" ]; then + local update=true + else + local update=false + fi + + if use mysql ; then + ewarn "Please only proceed if you've read and understood the following page:" + ewarn "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md" + if [ "${update}" = 'true' ]; then + ewarn "Failing to follow those instructions may cause the upgrade to fail" + fi + ewarn + fi + + ewarn "Now is a good time to create a backup of your Gitlab installation, just in case." + ewarn "To do so, abort this configuration with Ctrl+C and type the following commands:" + ewarn " cd /opt/gitlab" + ewarn " sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production" + ewarn + ewarn "Press Ctrl+C to abort now or any key to continue." + read + + ## Initialize app ## + + local RAILS_ENV="production" + local RUBY=${RUBY:-/usr/bin/ruby} + local BUNDLE="${RUBY} /usr/bin/bundle" + + if [ "${update}" = 'true' ]; then + einfo "Migrating database ..." + exec_rake db:migrate + + einfo "Compiling GetText PO files ..." + exec_rake gettext:compile + + # https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496 + einfo "Migrating iids ..." + exec_rake migrate_iids + + einfo "Installing npm modules ..." + exec_rake yarn:install + + einfo "Cleaning old precompiled assets ..." + exec_rake gitlab:assets:clean + + einfo "Cleaning cache ..." + exec_rake cache:clear + else + # create dummy git repo as workaround for + # https://github.com/bundler/bundler/issues/2039 + einfo "Initializing dummy git repository to avoid false errors from bundler" + su -l ${MY_USER} -c " + cd ${DEST_DIR} + git init + git add README.md + git commit -m 'Dummy repository'" >/dev/null + + einfo "Initializing database ..." + exec_rake gitlab:setup + + einfo "Compiling GetText PO files ..." + exec_rake gettext:pack + exec_rake gettext:po_to_json + + einfo "Installing npm modules ..." + exec_rake yarn:install + fi + + einfo "Precompiling assests ..." + exec_rake gitlab:assets:compile + + if [ "${update}" = 'true' ]; then + ewarn + ewarn "This configuration script runs only common migration tasks." + ewarn "Please read guides on" + ewarn " https://github.com/gitlabhq/gitlabhq/blob/master/doc/update/" + ewarn "for any additional migration tasks specific to your previous GitLab" + ewarn "version." + fi + elog + elog "If you want to make sure that the install/upgrade was successful, start" + elog "Gitlab now and then run these commands (as root):" + elog + elog " cd /opt/gitlab" + elog " sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production" + elog " sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production" + elog + if ! use systemd ; then + elog "You may also run" + elog " /etc/init.d/gitlab check" + elog " for convenience." + fi +} + +ryaml() { + ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@" +} + +exec_rake() { + local command="${BUNDLE} exec rake $@ RAILS_ENV=${RAILS_ENV} NODE_ENV=${RAILS_ENV}" + + echo " ${command}" + su -l ${MY_USER} -c " + export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; export NODE_PATH=${DEST_DIR}/node_modules + cd ${DEST_DIR} + ${command}" \ + || die "failed to run rake $@" +} diff --git a/www-servers/gitlab-gitaly/ChangeLog b/www-servers/gitlab-gitaly/ChangeLog index 6fc6283..a803e84 100644 --- a/www-servers/gitlab-gitaly/ChangeLog +++ b/www-servers/gitlab-gitaly/ChangeLog @@ -6,6 +6,14 @@ -gitlab-gitaly-0.6.0.ebuild: www-servers/gitlab-gitaly: Purge obsolete versions of gitlab-gitaly +*gitlab-gitaly-0.66.0 (19 Feb 2018) + + 19 Feb 2018; Manuel Friedli + +files/0002-gitlab-gitaly-0.66.0-fix-config.toml.example.patch, + +files/gitlab-gitaly-0.66.0.conf, +files/gitlab-gitaly-0.66.0.init, + +gitlab-gitaly-0.66.0.ebuild: + www-servers/gitlab-gitaly: Add ebuild for version 0.66.0 + *gitlab-gitaly-0.59.2 (17 Feb 2018) 17 Feb 2018; Manuel Friedli diff --git a/www-servers/gitlab-gitaly/Manifest b/www-servers/gitlab-gitaly/Manifest index f50af0f..f659edd 100644 --- a/www-servers/gitlab-gitaly/Manifest +++ b/www-servers/gitlab-gitaly/Manifest @@ -2,12 +2,16 @@ AUX 0001-gitlab-gitaly-0.23.0-fix-Makefile.patch 253 SHA256 e1a3d0ea2d10145dd9d9 AUX 0002-gitlab-gitaly-0.35.0-fix-config.toml.example.patch 1015 SHA256 44cd87bb35224634ef9832f2d1e79de2ab27580101665a049eaf20f5ffae590d SHA512 9110e6f42babac04c98227ecfff3a961ec35fe6c487559e5a638676f409dbf6b0b133524b092322085cb7c7c41c5fc729c7b6be80bae10931efd5785172f01b2 WHIRLPOOL 8b0f1aa8c8c9c2ea4a8a5dbfd1e5a00603d587209b0967be82a9d78d0eabe4d350ac44fce80bfc9dac77ea2c0ff5d0f954e8cb4fb50ee778fb636599b1d8456f AUX 0002-gitlab-gitaly-0.43.1-fix-config.toml.example.patch 1095 SHA256 3e9558a127675bca052a9219265572504729380087665f2cd681c44d5545f101 SHA512 1ee6b6a127a6f7e82970c2e4270b42427a88bfbca5ba9d979d6667381d2a6cf934c77cc6e2f47af24a2810e0427285565bc42a0d26c36649a9177b917ac5a424 WHIRLPOOL f96a7dd2952d5a8d7652d5e6966c4e2d85c3a9785e824108068fab158f5871cd1a0ca0f88f563478c4f937ba2d9e3df489611d07c092ff0c4c9b6668f0abb5fb AUX 0002-gitlab-gitaly-0.59.2-fix-config.toml.example.patch 1183 SHA256 edd4dc6f1d1b56bfc902d79c0abb2d3b85b69cfe3b90e4250b804fafe00f49c3 SHA512 4a9bf3222e442fcd76cf62921a7f184e67784532c2c4706f3f7d3d1b7a13c874520dba6ef629d93aa1514ce3483827d1a11cf7a04ae530fb4ed67844be1e9353 WHIRLPOOL a93af879b93415470e41449390388f908dba17dc1ea5f4e47e5bbe80fcac11f85c64ce18899aa2ee084438598e24e2ddc72076c0d63bd8fc61de4f2ee8ee2cc0 +AUX 0002-gitlab-gitaly-0.66.0-fix-config.toml.example.patch 1309 SHA256 1fd8a1d8b15b713a53f9d5fc34be9a3c7bc081724f9e3fde582213fbdfe047cd SHA512 33ae00c2fadf085e5a1e12e48155144369fdf9db0fb7547a1d0695e903eb17859985d48af5765a544c68fa9186de23c7228348a38c431202e65deee26c3d3953 WHIRLPOOL 28c85bc36d3c42460dc2044245b71181ec6fa72737d2f2ccb565fc5b3a7e8e51f3315e166cc3067709f90ffd0ad489fe1745790036bb18be4dc8c8bc3377098c AUX gitlab-gitaly-0.11.2.conf 289 SHA256 da2640e0ac6a3f356d68f2825c78a1965703df292cd6631b2e884e1a9c7ecc87 SHA512 86f2b4dd283de117c3a371a98a1472d248a21a2c931be6644bec2406249e000fe2e55d031b523d6e64fa2eaa3addad27704f338f65cad6b559680c5c327b9614 WHIRLPOOL 18cb38b35c9a79c6eaaa15ed9bbbeb6dc502a0291f3bff2bf1f59a950556c4c3fd3742a4097ab784c1e9a12d2209b336f2bf688b0888e13bb1b7f78219bb6d87 AUX gitlab-gitaly-0.11.2.init 631 SHA256 32257b9e72c2ee201e5104f6eafc134920237f0f5465110edda4778dd92c17a2 SHA512 a0bf57f392a75b1a2875837ec1ad47b61317c6ae530d12e60ae3f62f69b0fb8ef48499b31751fab788df1a6ab842926a73443795a5888258f62e473e2953299a WHIRLPOOL 8185d1927c021be4b3de7c4e0228c68cba558b35c0894c6b17de7f24ebc42dd771593b2d9169f27c5a1ada90e14b2fdb651521ddf39660a77dece586c7f1d348 +AUX gitlab-gitaly-0.66.0.conf 319 SHA256 a5c264800874973e62abd163e5e9144ab698192fc5aaf62aa06488e4727bc54b SHA512 5c0548ba52cfac02388d45f1b88c7bd43df1fef103ba8be1000c0e48438fbe6c1c4cfd6e6c26c1afe0f9ccbfe05b10e2dd4f13c9615ecde32cd23b496a9bb8ca WHIRLPOOL 5eb849c3b24e1e4ec0b7eba8366143f36f4ba3243f02c17102bda15bde05dc8d77ba97768b9cd0dfe9bec18d5b0eaae948622e071c30b590207ce7dac2e026df +AUX gitlab-gitaly-0.66.0.init 692 SHA256 bb5e4bc7b2e1a8ac16aa0d2a548ce924d12f5eb8e0a6cc1bc7cff331d1ca8737 SHA512 5a760d58c4f96db585d2008964e3407393ce6547ded05d92d0ffa4ea62c691caf1c261543f3004bb45c14288603858768fcae9a817a4293e0454d2319e303975 WHIRLPOOL d87fef85569ba648d6713104f259276b2a377cb5657c7350c96fbb83f63d0ccc5d94c4a5a41cab4e0c01702fec9b9e52aae420d7a22abbb63c090072e603a518 EBUILD gitlab-gitaly-0.35.0-r2.ebuild 1143 SHA256 f27758444fefb15b9ea55cc9be68e8b47fdf5c6794b9ed32cadc95690b2dfd62 SHA512 5b7117c6a5c91e0168c495a18c08c815ae423dcebce644264d9161692ede29469c6585acfde682b0d60ccab6efa601a0259d2b44ceb5cc15a26096a2bfc318a8 WHIRLPOOL 8911c39960635981e0baa62cdf3425acc9f7167df940f4c43c52dbe020b208ad3192a01bf5f198ae0777cf5af27cc8e643455b30c1e0be3326a56aab1c3c8e10 EBUILD gitlab-gitaly-0.38.0-r1.ebuild 1035 SHA256 c667625968e0cb0530679184353724687bc193c0a8166fea0d9f8a516ce6db40 SHA512 e585a18c64a2e8aca2796c45066e1b1113cba9320a47f9af638fce171ac362060edac4216e7259628433e5b5facaebbf876bf807dd99f80ebd8c88e7cb726992 WHIRLPOOL 7f329f60fce603e61ebf90cc2aa0182d58574d449f096f3cf59c4751f1db9d5eb856d1fa0ee67c565d392261e45c784e25a3b4014f9a44857c31ca04af8cb70f EBUILD gitlab-gitaly-0.43.1.ebuild 1073 SHA256 594e68b869e53fe6fbdcf8fdade3889f55883b8b4ab17a2b064b3fd12a1ef739 SHA512 e3e7f045aa0565267bb516f685685c704841b5186dcca1282274ddd9392b734ac7808cb99d587ced3c87a357dc5af02bca99056386f0db0f9ecd07bba9e6e18e WHIRLPOOL 1329e9b461fe5c7386aa127a815602c655f8411a030537de9a247ea033723cfd60eb00a38e39cb775c985607b90b0e30fe55a9ef6856b49204a2ddc8427afa1c EBUILD gitlab-gitaly-0.52.1.ebuild 1073 SHA256 594e68b869e53fe6fbdcf8fdade3889f55883b8b4ab17a2b064b3fd12a1ef739 SHA512 e3e7f045aa0565267bb516f685685c704841b5186dcca1282274ddd9392b734ac7808cb99d587ced3c87a357dc5af02bca99056386f0db0f9ecd07bba9e6e18e WHIRLPOOL 1329e9b461fe5c7386aa127a815602c655f8411a030537de9a247ea033723cfd60eb00a38e39cb775c985607b90b0e30fe55a9ef6856b49204a2ddc8427afa1c EBUILD gitlab-gitaly-0.59.2.ebuild 1073 SHA256 a9899ddb752550e82510d101a93286cb6b872b8faa53d008e55af3ddc2d2e685 SHA512 da7ba77fe0a9234c5e4f5994a3c7fa9c11a93cdd6f9cff3ab5a658f6a9385a0bea8f00cee878a43c9580632c9837c305b293e8609f3e284b958f7b514ef10c81 WHIRLPOOL e4b12a160c2cfc08da4fd36fcbde8dcd1f383acbd5211c50dfcea1610e4e5105ca9720f9f8c34a7ab41fe2c33a77d3129ae527fd94f3b8d0259e9c2e4ec9a027 -MISC ChangeLog 5421 SHA256 38b7a6c60727154d97de468eaf2a423514dc1c44e737b01cc300a1204fcd6d4b SHA512 cd79f5250a73a2779da59804eba07a928917c59df50595bb6c514edc98dc17f52c7659d45fa646b3e24c4a0da339880ea767b8a62d8f759d41a0cf49646e4e8c WHIRLPOOL ccf79eeabead609aba596d1946e0c7fc14f987a3c4deadc8dd460ecd316a5186df45c12e846cf7d02270a5f17c9a2b583da812ec50efd0fe263d001983f2f399 +EBUILD gitlab-gitaly-0.66.0.ebuild 1086 SHA256 bd5b1734d6354c2e7bbf6e815700b38c81f7325bf1d222b9c74576852529dcd3 SHA512 4fe2be263fbf16ab7f9f24f06f82d1a60b3b30322f3f72fc6ddd5a13763f137da3ce122b81d747bb8b4c733e0bb6fa7e53a51f5ce186f1690ae256b8712c41a6 WHIRLPOOL c3e34cda3ef250cefeb761e8b1b1c53fea6e22d7f21269000081f18a7858b8153256c770e01f5df1dfd43ba219172d4f74992f6244fef8ca166fb35fa6a21fc5 +MISC ChangeLog 5738 SHA256 e5fcf5e7943167e8a4c9b429d5dbaf032b718694f4412324c1bd9f7c2b75d6f1 SHA512 bf8b90a7911aa4437658608cc25d42bdfcb96fe225e65f79ec99fcaaea20e421d3cd2a26d441bf20cfd1b70650a51026dcb3c8e8838f50de13f6e24344c2d4bc WHIRLPOOL cfa2f4bf573d5699f00fb93348c08a79ad25de98cc52b64f2ce0302a07100ed25cc93938e70a33ebc801eeeb03709b8a4ca1b5b6f158272639c90977e83225e7 MISC metadata.xml 248 SHA256 7b43be15755627edf5c12cf1b50c607d781558640bf8375d685d51d7ade99a32 SHA512 29f9b96b0a77546cce6a8bffd82fae2fd0939d32a7a05ffd0d91f9250a019a3ddaa599b93988c82daabb9c4c4b284dd947e2c47f6ca7727b8539cffa91bcb8c2 WHIRLPOOL 993013c9878ead35469db13d3072f694a341ee654182e0c31d0678f5dd6de4bdc8d59a0b7bb6d685dc41ea6b55dac518cd8034131baea8002170c680e50304d1 diff --git a/www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.66.0-fix-config.toml.example.patch b/www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.66.0-fix-config.toml.example.patch new file mode 100644 index 0000000..3b2ca91 --- /dev/null +++ b/www-servers/gitlab-gitaly/files/0002-gitlab-gitaly-0.66.0-fix-config.toml.example.patch @@ -0,0 +1,43 @@ +diff --git a/config.toml.example b/config.toml.example +index 10f8cce..f65b5b9 100644 +--- a/config.toml.example ++++ b/config.toml.example +@@ -1,9 +1,9 @@ + # Example Gitaly configuration file + +-socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket" ++socket_path = "/run/gitlab/gitaly.socket" + + # The directory where Gitaly's executables are stored +-bin_dir = "/home/git/gitaly" ++bin_dir = "/usr/bin" + + # # Optional: listen on a TCP socket. This is insecure (no authentication) + # listen_addr = "localhost:9999" +@@ -19,7 +19,7 @@ bin_dir = "/home/git/gitaly" + + [[storage]] + name = "default" +-path = "/home/git/repositories" ++path = "/var/lib/git/repositories" + + # # You can optionally configure more storages for this Gitaly instance to serve up + # +@@ -40,7 +40,7 @@ path = "/home/git/repositories" + + [gitaly-ruby] + # The directory where gitaly-ruby is installed +-dir = "/home/git/gitaly/ruby" ++dir = "/var/lib/gitlab-gitaly/ruby" + + # # Gitaly-ruby resident set size (RSS) that triggers a memory restart (bytes) + # max_rss = 300000000 +@@ -53,7 +53,7 @@ dir = "/home/git/gitaly/ruby" + + [gitlab-shell] + # The directory where gitlab-shell is installed +-dir = "/home/git/gitlab-shell" ++dir = "/usr/share/gitlab-shell" + + # # You can adjust the concurrency of each RPC endpoint + # [[concurrency]] diff --git a/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.66.0.conf b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.66.0.conf new file mode 100644 index 0000000..0377216 --- /dev/null +++ b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.66.0.conf @@ -0,0 +1,9 @@ +CONFIGFILE=/etc/gitlab/gitaly-config.toml +RUNAS_USER=git +RUNAS_GROUP=${RUNAS_USER} +LOGFILE=/var/log/gitlab/gitlab-gitaly.log +PIDFILE=/run/gitlab/gitlab-gitaly.pid + +# This must match the setting in /etc/gitlab/gitaly-config.toml +# If not using a socket, simply comment out or delete the next line. +SOCKETDIR=/run/gitlab diff --git a/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.66.0.init b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.66.0.init new file mode 100644 index 0000000..1828380 --- /dev/null +++ b/www-servers/gitlab-gitaly/files/gitlab-gitaly-0.66.0.init @@ -0,0 +1,20 @@ +#!/sbin/openrc-run + +start() { + ebegin "Starting gitlab-gitaly" + + checkpath -f -m 640 -o ${RUNAS_USER}:${RUNAS_GROUP} "${LOGFILE}" + checkpath -d -m 700 -o ${RUNAS_USER}:${RUNAS_GROUP} "$(dirname ${PIDFILE})" + [ -z "${SOCKETDIR}" ] || checkpath -d -m 700 -o ${RUNAS_USER}:${RUNAS_GROUP} "${SOCKETDIR}" + + start-stop-daemon --start --exec /usr/bin/gitlab-gitaly --pidfile "${PIDFILE}" \ + --make-pidfile --background --user ${RUNAS_USER}:${RUNAS_GROUP} --stdout "${LOGFILE}" --stderr "${LOGFILE}" \ + -- ${CONFIGFILE} + eend $? +} + +stop() { + ebegin "Stopping gitlab-gitaly" + start-stop-daemon --stop --exec /usr/bin/gitlab-gitaly --pidfile "${PIDFILE}" --user ${RUNAS_USER}:${RUNAS_GROUP} + eend $? +} diff --git a/www-servers/gitlab-gitaly/gitlab-gitaly-0.66.0.ebuild b/www-servers/gitlab-gitaly/gitlab-gitaly-0.66.0.ebuild new file mode 100644 index 0000000..42c751f --- /dev/null +++ b/www-servers/gitlab-gitaly/gitlab-gitaly-0.66.0.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +EGIT_REPO_URI="https://gitlab.com/gitlab-org/gitaly.git" +EGIT_COMMIT="v${PV}" + +inherit eutils git-r3 user + +DESCRIPTION="Gitaly is a Git RPC service for handling all the git calls made by GitLab." +HOMEPAGE="https://gitlab.com/gitlab-org/gitaly" +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~arm" + +DEPEND=">=dev-lang/go-1.8.3 + dev-ruby/bundler" +RDEPEND="${DEPEND}" + +src_prepare() { + epatch "${FILESDIR}/0001-${PN}-0.23.0-fix-Makefile.patch" + epatch "${FILESDIR}/0002-${PN}-0.66.0-fix-config.toml.example.patch" + eapply_user +} + +src_install() { + # TODO fowners, fperms on config.toml.example + insinto "/etc/gitlab" + newins "config.toml.example" "gitaly-config.toml" + newconfd "${FILESDIR}/${PN}-0.66.0.conf" "gitlab-gitaly" + newinitd "${FILESDIR}/${PN}-0.66.0.init" "gitlab-gitaly" + into "/usr" + newbin "gitaly" "gitlab-gitaly" + + # install gitaly-ruby + insinto "/var/lib/gitlab-gitaly" + doins -r "ruby" + fperms 0755 /var/lib/gitlab-gitaly/ruby/bin/{gitaly-ruby,ruby-cd} +}