cleaned up old ebuilds of gitlabhq

This commit is contained in:
Manuel Friedli 2015-05-12 14:53:10 +02:00
parent 7584b2eb2e
commit aa124c983d
59 changed files with 0 additions and 9858 deletions

View file

@ -1,99 +1,23 @@
AUX config.ssh 245 SHA256 5bf5d5a357e88b71e14a12bb28ea68d0286ed29118045aa944484b84b6fa5e4b SHA512 52dbec481cd45136e72370713ab20a41616dccb252e75b884b66e2494aaefe7795719169906dcad5030dcbe33201d021bdad1f7a99120ac40a64611290ff8759 WHIRLPOOL 9b991ad20787e0e7274136ddb8e22e1082360d580f8576feb722730b5c3f3fa22992f671f7916e191052a78d8d688d32044b39059dc7146d14c2da57fa891214
AUX gitlab-sidekiq-7.service 1192 SHA256 3d1bdb5e653448a46ff2530321090ac5c8897121f6361c09c4714b0387c3d42d SHA512 45e8fd0092ba45af62019b5a4f073cfaa050320d208e0ce9ebfe881024e7a9123283fb16635373d898827e156806738bba42a736b5d2ba5c5228167fedaf367d WHIRLPOOL 892911ffd089d13877481ee2589c016b1f67874f209d1757e67d42b5f7c0aa1d5f2010576a35becf7966dfcadbd00b68654067e00bc17b75e30cfc64a43bcf21
AUX gitlab-sidekiq-noslot.init 972 SHA256 614b405d16e2042d013dae510796620d42461512705fad2a90a7f558e0051c33 SHA512 afd3837ae660d47297c6d65180ae5f3ec6a15c1c8ea23aa5b715ca2fc5b628f3d868adf265c16521e940e5aeb53e4a70a2ec6c0acfacb6b39a1fb5bc669672fd WHIRLPOOL 434ae6e789fc8894a9c83bd538de804784c23072129c79fe0c209848e0c8e1a3d607ce9f7f9da617a25c874ce81d276d010d5ae2d3bf95e25034e9048cbd747a
AUX gitlab-sidekiq.init 979 SHA256 f9bc02031b0418e4c765fae37bb40cd9e16dbe5b1a7f5c105a2d7ba3568b0195 SHA512 e3311f1110fca02a378a9f74704d9241884a1973e90be1dbd663809b524528eda25e3ad0ac5d20737f6ccd78343582557ac579adb976473f8aabc0320172921f WHIRLPOOL 365d539cceacb5ff9171aa7316ac061ef4b4a8d63e6d4a26395afb841878a08bdd1b9bf2709602dc90f15a1ed5ff8566a0e8239e8ab9184e84814a16993f3aeb
AUX gitlab-sidekiq.service 1174 SHA256 f1c2ba4de65ce317d55543e6327214a0f309e980e26fc97da0931530d2e66e93 SHA512 2a563133d917e075d231decefb0241679d3cbc0ac648ddf9eff0fe07ce7a136badf8fca62c34143235819dc9be7f3a202e59b3dec9fa4446dff0473f87ee2361 WHIRLPOOL 70b701c98c5e8947f8f886d45160109239fd6ed6d20fb860b38309c7edf71c90c84388f876d6e129daad85e0265f116e41b978a00b8ea0905836ce9addcfa34b
AUX gitlab-unicorn-6.init 1663 SHA256 ba211c63d559cbca510483d5536d28131e08f67dc8914444a2c85b27c7a92b60 SHA512 a574b3bb5b9af3e3a707045ac6d783bab73bab1db033d07999b3d06789da0853bc3de0bba39a3c154e5b1ab385926ee3ec4487f4c797708a318fa5df22827069 WHIRLPOOL 497cf52ebb4b33cc6bbd81e53d4961878b2ea9dc42bacabf7a32686e52a54c22eed73836705e80714d7b759cfd2ee1929e6aa12083435f265c472270e158f72a
AUX gitlab-unicorn-7.init 1671 SHA256 714d5ba2fdba3287357120ff82b3fececc2baff1d037366ace4ccd4bc46eed9d SHA512 ca62bd581b03af2b4d8fa7429193f6075d1c286b672c184aca91d5d1ea9f0de1980a3c6e3cde73e6b0a79655c511eb0c19fd36083a4d9544db1ae78234ef3aeb WHIRLPOOL b6ba697eac3dab059a1199cc801baa60f5b3eb911b0bbe59478c105b1976a1e8fb49bb66f12a53d20b67a25e1fc8487d14b4d474650ef3259999ca8c5503eabf
AUX gitlab-unicorn.init 1657 SHA256 5fe794938b27d25488affc174e4761f5a3a1f9b15489a05f3839b13e4fd5b5ef SHA512 5e005ec26151afb4cdc8eb83592fad6814bb2a3ac8e9f642de83e70cd8615bdf969803a2479f8f72a70e0ae5ab5559da205965b55b3b4cdfdc9aa74055eef6fe WHIRLPOOL 6c61db597311ac618822fb22d7f51c830e5c011ce8e4c790338b3203a4483f3dd121bbd9cc33d7e1f92a2b0527e59816742f8ef0fd531c4c28c36d886fc94196
AUX gitlab-unicorn.service 917 SHA256 282c1b08ec13b8670018985278a25d013d6336ab23b0ee815cb36b34ba678391 SHA512 6288c7c096fb38976c5b6218e46b7da53dfea73e834d1902876d0b15e1173fc56600c511e5941c2f6f61e2f5ef50a7cca476ee14a19b516599d6eb0594e2b8e7 WHIRLPOOL 33de53ae81af49d02d8e8a4e2e741bbccfa5e657939f433515ee7fe81aa55a706e094062ebcb67b7dbf19d21bd37070f4294e095cd955c2f94dc2c3842a008d5
AUX gitlab.conf 137 SHA256 e0cceea29f2c3e1f7c94a9ab37640a31d4966b106cc01f47fc77b5c721aa9489 SHA512 7d41510eb288e47676d1bf60e92cedd04ec07e1af12cfcfcb5b75d4eed5ee320f41d3369831f9a2361c570289b885f4f00cb365e418a0d66bee6a5a78060582d WHIRLPOOL 27ea7e1109ed34367664c0e4d7cc968d300e6e2bdc3a66f0eba87023a1659f14115cf25535f438f7947a19b1c51c1452d3bb23db120442ba3be20b310a87317f
AUX gitlab.logrotate 191 SHA256 9c02c26f5faa443cd576599462c6a8206d62495ab9671098a5f0e379f216541b SHA512 2212a8e5f2d4704256d5abb92b5a1201b20f82b04610758e734d163792a60b78f482017510169666a70ed9352b171177d05237ffe87988cacb764c5ef7ba5443 WHIRLPOOL f61297015311316554e63af4822b8d274f5a2378e829e5c14bb22e642b0d83023446acff45a13aa354f127543ce1552c99488b92ed8f39d86959343c7e67bbee
AUX gitlabhq-4.0.0-fix-checks-gentoo.patch 1936 SHA256 d1775b91fa55f3706793771fd98564a06322e3dfc07970a6fd3497709507f527 SHA512 45e1e55fc9ed514e1cb18c5d4bc8b514fb995035e1ff9cf58b6bc238271bd3468fad1af23f53035b7c43a1a7becf51234522953064eefedcae8b507e5b7cfd7a WHIRLPOOL b18cc3df85b6251b823219657397ea89f9f08c67b57b64e09bfedfa341a04aa6910acb4876c2bcca2b853e27bf5ee43a1f2237625b84f183edab134cf08fa17a
AUX gitlabhq-4.0.0-fix-gemfile.patch 1736 SHA256 b37a447b38e5303e94205fda9ce131f5c8828c323974e9ed30253d53938d7640 SHA512 6e5e875a53bb2efda1153c6ef8275f93cd8b9eb8d936b34a6df6f0db3bc577099fbc22f2e6c844ee8629af13c4d4fed968b0c5d3360ebdcee1136010a04be34e WHIRLPOOL 1f24e69f52df32d75863295378a781da4ff6df22699a77d1b9f53a98c78df81a1cd0136b60695fe28ff904dcb32c87b6e67b4ae324c070c873bfefc3bd3d6c2e
AUX gitlabhq-4.0.0-fix-passenger.patch 1156 SHA256 f2ccaad4e349cb8c965ed46607a78f7d738ed434565fc7d80b15ac92121a29a0 SHA512 31906f2a8831ce0484279bbac68d9935dca52e831cf8c473746a51d1b2de4077f40726544a09b10b80890c72b9028bda7b294fb19ccec5df5a312f5a2ce3d1aa WHIRLPOOL 384912fc1c1ae5da05e98525b435417f6488d3927e285fd16d3cf7659bc376bf5e801e3bc3be7f4de480c7302cc1d7edc3fa88825e82836dbaf0606f8218e662
AUX gitlabhq-4.0.0-fix-resque-pg.patch 415 SHA256 c1b764777a0089020893f05649b6d15cf8c60611e90d9d0b3e74ee29bcb57614 SHA512 83639200bbc49350ab9bfc033c0a5401967ad2ab6b23bbdcd948c09dc5e2c05b7b17ae144751b410b9d67e2c3cc76a7b268dcfc0381ce9385bc5c3e8507f969e WHIRLPOOL 2fd974d4a2db04de2b1c6dbef320319dc33be553faf3dd7a40e5af20d2aecd245da35354fc6568f98e8fbb40da1e11eda41e60d6353c32664132fdd6a478e56d
AUX gitlabhq-4.0.0-fix-wiki-pg.patch 2871 SHA256 c27f7ebd8614d217d824782dd65f9e2e12c7bc507a3eb01339a8a962279483f0 SHA512 6f86728574e495ab9604855be43a3739194b0f81ba9dd9dd3fdb76ca950400d1068119be4190612030cfe8e2c59cb771cc434dbe9cc0ad55329953178fe6d8fb WHIRLPOOL 4bb437cc63ad721a3826da4d796d2d79a79f140fa02a18b1d36cfa5b1caaea082888bd950ead666f24d5951ddbc9f81ef0d4914aae61dd262eae6e31dcb501ac
AUX gitlabhq-4.0.0-google-analytics.patch 3490 SHA256 52eb67c29fa6f41e8776ce2ba8d86c098fa2583a827541aae7ffe5c496da42d7 SHA512 7a4d551e69d15dcd7f180c34381f98f80b76d6a0fa0b8d702d74bf0f6178b80bb6c9595e8d9ab3b56e4ede249532294adb8727c7bebb73fddf67e71e88117e8b WHIRLPOOL 85a62da7088c5e11d5a727ecf2057c831a4f3c8c42cc8a69c5d8778dfda495b351d72c45e73ced2e7876c7cb56a37eefaab125f32ca48fde3078c7e92e7a31fb
AUX gitlabhq-4.0.0-performance.patch 6391 SHA256 7857a5f3c0789680cd3be2bfdea5981a97521726aac49430cbf9ef21069113a4 SHA512 573fb038c91eb7749f4fca50f8ef51f70895e5b695eabeb59553831850fe957c130f8e32aa3e866133d10ee3129b39e8fcfb7b6200b8f058a98989d8c1bfaec8 WHIRLPOOL 2f37d70ba9295bd38399e7411162ec339854ae283129df7e743054363eb4f7c130c1bd3cf1f93ccc97ab416bed1f9a86abcb398c2b979eada0cff89554ede96c
AUX gitlabhq-4.0.0-public-projects.patch 5611 SHA256 e006809ab10496e31432496504f720a78a9cffc00f49f1b3ba267f323e0dc674 SHA512 d0e39b502504cd2d76419f57c1ea4061b8f9166317f11c1690df1c1bc41f278efbcd11a3762990a18a2141088c14c7446697559a95c1c5214487f179be099370 WHIRLPOOL 6d10625a101a8839f27be2dd9813126b9cee6f38267c345199ff51800c7c2e711add38c0d51667c80df68c5489d2c8404722ad69f0748d9ef86e25103a3aea51
AUX gitlabhq-4.0.0-r1-fix-gemfile.patch 3189 SHA256 f6efec5d8ed7533adade361efcbd0d485d5b7ca9d9dd9f4b4d3a30264804fcca SHA512 fbf4685db1501fc85d0dc16bbae614ebe21b4546dbde8cd52a0ca8b0be0b818c4737835d833e09cfc621edc70583bb7c8f002f28734ced3ffd0c8ae906467f44 WHIRLPOOL b92a8c3e7df5b97ffe21aad1ec4ceaf4a0904e5d758f8994b771e51218f0998fa8043d654d6a5cabfd0d2d82da9481caf640baf5e1f25395a7c7156798095320
AUX gitlabhq-6.0.2-fix-gemfile.patch 2103 SHA256 f4d07fd2a8b59a7a89f3b522324f059ce00ce4292d1647d161d64d3c8fc27995 SHA512 dbd439d2338240622cd63e09703035bd676266edf1ceba90b402e78f500d3a80ef32a63ef1a178d12b0ca9f9e60e250b3c3e287772a6cba25d2371372b1e02af WHIRLPOOL 4fb037080c5d4051c9f38c2f3d32521ee5241cab6348ffabd9c8c606413526fc127a71e70079e296aaf34b055cdb874879cf46e1378617ac393669fbb5da90b8
AUX gitlabhq-6.0.2-fix-project-name-regex.patch 1203 SHA256 9ffa0c164384c00de3953a57c1f3984fe08cfcd996216ea7fece0ffa70ea91d6 SHA512 04bc0d2940f551d8b8c283b402cfb992dcd34900154d15a9372c4b560d0d07900923268a24785cfa647894f6a3ade8a0db3f84075d1365387dd2ef6a2cf11bec WHIRLPOOL 21250714ea6e273e0133673171812b1725228a60c616eece52c7feaf1a475c40a633f96d25d7e7089f6a6670ad21eae85d4bdc8728c63b483eb6b813381606be
AUX gitlabhq-6.0.2-fix-sendmail-config.patch 731 SHA256 51f0d0af2a7c048d7cff56cf27955632f340ca67f9d460af840cf34ed60ca574 SHA512 b10d5b8d89927404d25345e17ba37ca4e7848b04c2ca20c5eef14eaac43d9ba14b62ae4c0d532eefaf6f9a2944578e84eb65a3420335d32495855c4807eec356 WHIRLPOOL 66f6443f311f2355ffd4efaea914f462816a1966a715b3b5ffaaa26b41bdced928b9905b8606f06fac3c2ccf20741553cfed2615430287bede01cf376aae2a60
AUX gitlabhq-6.0.2-ldap-user-mapping.patch 7176 SHA256 202c21c2cc2ca26cabf648ba61d0269a73ea12dd8ea67f07c003c911620d4205 SHA512 40644e71f2977ef5fa26b260c151b96589ab57e5fbef5403614e22da0475f211f01569fe54865ea0ffb944431843dac02db997a5d5d64733dda3a878c9b09b97 WHIRLPOOL 7889c3052a370849b0a329dc8fa745e6f61754578807b2527312b3d09b34ec3c6c4bfc7a85315aff9e56488f6c66661ef025d5b2510e010266e935080214a0f4
AUX gitlabhq-6.5.1-email-custom-reply_to.patch 1816 SHA256 e0c56d2c26de1b3715473116f1337e5c184e42d2224eda5f448823018376e660 SHA512 08709c2421e5fad9f070fdf14992680a9afed81cb4348cdd726ab4476843b088d3bbd2bc6a1f74d54b6724bb0fee5e35562244eae043c02a6086950d5b2b2f31 WHIRLPOOL 288af9d299590645f2049f0b3013adf78cbdac974e4d5190cdf51e5dfe8cc9f2b60998a949383277a555a6d222da54cd610aa4b25571cad62314b1522958210b
AUX gitlabhq-6.5.1-fix-gemfile.patch 1996 SHA256 5cf252093179dc8868a335c9a792331b31b147c545bf7f7ed33efc061707b356 SHA512 39f2c585fa160ab54120f40ce451a2337e2f932382bc419a3a032215adaedc147ba29bf134e63fe973d0b8df6178f3c7a6797631ba059831a3b94a3dbfc39480 WHIRLPOOL f43fc4a03f76893f58cf33a04b563a0c4cfbb45888dcf4139fc30a9bf4d57c9becedbcd2448f494aa264aeb83a439c09996398a30d4e23a6652221ac3ac13669
AUX gitlabhq-6.5.1-fix-ldap-dn-case.patch 649 SHA256 37b217c56ccbed79a13e7d657572433c307867d62aa8e21c7ab1c537733b0d4f SHA512 99508485b83c21a9ba70b5d65ed082baf2fca1f6542d4118f24de841dc1eb35f9639ab5afcf46342043d9fc8b7c76e5ae7e8d749c7faa0263de91213415a22c1 WHIRLPOOL cb41be068a5b727e22ee917741dbd71ff363efc003502d37956a08fe741b57ab7507b066b784229c6b5a9691c884971ab138de3457e58c5d8ad619b770e31c27
AUX gitlabhq-6.5.1-fix-project-name-regex.patch 997 SHA256 a9e321bf7a986d86dbb87f1af3360ce71d60de5a9d6d3e23b12e469240ecd8bd SHA512 d0883c30b1d542e20908c8efa46cacab337fc70e902894a01707468b033be88ce6af865d78d5bc8830c74fbca55fc1c70286a4a95b9b6c82f06f0d0720e40b35 WHIRLPOOL 16f89f870d5b317015f08e415db323baac6f99ad789c7555f16c37ca918a9706c05b4ff527661d8399814fc7847895f5079a621d98c8c427da59deaaa2a3bd89
AUX gitlabhq-6.5.1-ldap-custom-mapping.patch 3276 SHA256 d335fc980a891a7a24cbb96ec7a4109bb3fc3a89ebc8c797d787e69fff74e7d2 SHA512 7cb523db97986eb94d0feda7be0eb8f400b9df744f25a44a783925059ae97671400bebfbe75b6d803640e4eb828abea193dcde26a2e6d5f103dc9d0913772365 WHIRLPOOL 76d81fd7075bb6dd52b622c6f2147393dd5fcf8e42addb82e9431a019c445f5703a77f31db71a62e05561eb05be8195bf05da0be83cd20db57659a057f7b0481
AUX gitlabhq-6.6.5-email-custom-reply_to.patch 1617 SHA256 320405e34892d5fc3f1e6ccc9ed043623e540b0d2daa18184c01a038d3bb558c SHA512 5117743fd42dafa2ebf107b9c25ca0d5b79e02aa987cfc9380aef6270ab5417db69b2d59740fd59d4d828a128d1ae4cb26eef895387e89cabb3581c855ef9254 WHIRLPOOL 4634491c9611b97e0d2203b3656ef3ceb175b21c0cad0bb564ac728884cc983a39f5a68f84b9a387c60e36524e8c58efcc563f6590527e768b68b3218c84c762
AUX gitlabhq-6.6.5-ldap-custom-mapping.patch 3052 SHA256 64e47278393ba4442037bb684a44c1538e671683cfaa9dfcb9bf61e5265da03a SHA512 f1e9ad71e4b95e6cb4f56179d1a9f92b5a2b7c59a425f4c9620c3bb6cd68c9bd2ae4e443f8a29d84455b029d99ba248517b44b1b8e9ddeeca249a6e749bf095f WHIRLPOOL c2045af7b8b766a3e154a1a8fa83a469df4111b352973533f902c16abfeee161d1f4cf88861847f64dad36e39ca65a796598e9d75ddad5a8e9f160707af349a3
AUX gitlabhq-6.7.5-email-custom-reply_to.patch 1628 SHA256 0a5e1043a453395cc552626072677b6ad6de843980d3f480f6b98469c2f7ccc2 SHA512 7fe754dcfb3e8fb15daad059b4582dcbefb61da2bd12fe73ec5eee4b77ac9a2116e25365fbb3503b76f6048ae707230333a5439a63b59f946e2da37a8cecf92e WHIRLPOOL fca02b390e5edee5a58538f620fc7f5ff7632dcfd3d2b31befc4dcd46338e2345db337ee888dc2b6d7d456bcb426d44989a8a01f4176ac05491712012bc98b23
AUX gitlabhq-6.7.5-fix-gemfile-lock.patch 830 SHA256 11fccb5c51e49e7994cfce5b9e478625642b8ad23ea301b3989e9e69cf29dff8 SHA512 8578f5651e10dda68c16a7e9065dd86eb5db6278b8a08342d93854a2a8b259782887d6afedf35d61def12190d10f588c4fb5f279b09a5c86ea0fa58f9d3a5df5 WHIRLPOOL 5ca8afa60cd3c86463103b3a5acea236d584ffc662fe07775620b9d656bb37b09dea95523b6edbfa02052aa5983cec70551eec7e213ff5fbac56256f9f1ad180
AUX gitlabhq-6.7.5-fix-gemfile.patch 2161 SHA256 7f1f6fef287a00a0f794ad31a81cced87a5ac6a31e79e27be6530f92d66a2598 SHA512 24bb78ea36886764911af7825c0ade796dbd24ee99ee19e418d4478bc4d4dcbdb4ffcfd63b615a842a320234c4e6b0b851094abdd0c5be0a5cd80308a00d380a WHIRLPOOL 6345e2ec96c52f79545f21fb330e8517925c04f162dc2cbad959c1eb59fd65e89be4cc45d1510ef662e43a26541e840e02742adb9474569a44e80771df773d7f
AUX gitlabhq-6.7.5-fix-project-name-regex.patch 1148 SHA256 bb0e175e56412aaef647fb0a3cc31f0e1dfdc12983d4195ab9375b2ecd929c46 SHA512 7b9db9068edbf99c9226fecf4ac3154110481a7b69020ee05d1318ee6f4105d53c45ca14317f917825c9769d317a8815830638a371fd8f5d6af031b361bef65a WHIRLPOOL 0c333f523230ec49089017087dce328e79e646efeaec5c9520f541775d717c45cabf3173199405b55b836285d0fa9c27764f250eb7f19fe4f1909514caf879e9
AUX gitlabhq-6.7.5-ldap-custom-mapping.patch 2992 SHA256 0fa8d8225552b0a2305f2876399272ced64ae7c3c7af1fed9b59a4b74448d5b7 SHA512 d62c7560c4472faf2c08c5a6700f0dfe58e945f376c0bccef4593849c16d30c8adf3ce8b856fe69c944afbaf75b1d957ae411bba766d87b0fdbba8c8c8172d2d WHIRLPOOL 8e0e2165adb5d3a87ca254550d8072829c74e3bdb34e86bcbb47af3009bb0a2d21e24cda91e489148d20d543c4d8310267527233d57dcc4fe94770167f4fef11
AUX gitlabhq-6.8.2-fix-gemfile-lock.patch 340 SHA256 524b7524b61c61978430442e0d13bc39f1e324ad7d1bc33308f82094e53acfa2 SHA512 d60c42f11b32bc87de84a4ddf122339ae39bf29d5e921175b510c86fb02a0f216c9f4a55d4653618893f82fca1b28eb77ad4fa35a0cdbf9f5275c004cb91e41b WHIRLPOOL ce9a734daa468e55ddb69193f8c1bfd84462167bbd0b921c79636de916e11bef986df39a3d51a1188e3bb0b83084966d36fc8f8cc6501dc21ab78d0c8b0d98da
AUX gitlabhq-6.8.2-fix-gemfile.patch 2073 SHA256 6cccaba8d4483e4e8390ec518e474e2137985d490163cfcc0cef090fc80e0277 SHA512 75c21c7c5103d13009427739d591a268b7d9d43add0a3d0c2f3188a054c0963a4b525c024664732ad6ff5429adddfde49d98b74285a0de21c351143692839b73 WHIRLPOOL 4ec488ae566c5781eff17cead6c83002ef4a5055c02f3bf07ed8955985a8e3b7fe61fd4b5b116e4cb74787fb4b3f9caa820a9c67b297c007eed7f0be2d461261
AUX gitlabhq-6.8.2-ldap-custom-mapping.patch 2579 SHA256 82aaae2c64554e9c00dfb8f1d66884512f509752c74b03fe430d3ba7e7a5c18d SHA512 82e1900473b96d0067b477f76fae7445dc000a520bebe0f9cbdd7e02063b146005aa63594f508e3a592e89b04ac26b425b8a186bbd474b538c918d74c6abb9a7 WHIRLPOOL 953ddf4b70a9caf29afeaee50939c3bc3ec4a4f53cb484f50f151e7a8d6ab2d03303deb4c26c931fa836fa84b5935522630ffed7d266fcd9cb6982a6148e6882
AUX gitlabhq-7.0.0-email-custom-reply_to.patch 1814 SHA256 7db95e36e2ef661f846209a612affc0e6276894bce6abf7acc686cd2398c76a5 SHA512 64aa56d83a9ccafaeafd808436e19388450ef7b6aff9bc1406e84033f624993923446a83bea32ec8987addb9c0ccb0d65ed9dc7cc30f181183634d8d5610aa2e WHIRLPOOL 5f23b4e7c2b482314f826508c50e9845e042e9a6b5d85f3f49f7db9ed140a35a9d07967f9b6a5c7dea481ad7e4dd5d682b4734921cc3adc0c4e37822ad4db234
AUX gitlabhq-7.0.0-fix-gemfile.patch 2185 SHA256 48070f5cd7e16ce27abad8e2cf80493add671cd1383c758e5fffa696ed9452bc SHA512 f4cd487e17153f6cc60219f76df54574102b2ec2b154b2b9ddbf142a9e9d0188d3a8b4dbdec284d6b6be01a9c242d083440f50e8ced83f7c726fa2cce98720dd WHIRLPOOL fd9c550339bbf953d9bdc46cbc7552883a5eaafea60a0778e0dea4cc00defe548283b9ada02982f7063005233c72081623c1ef18f499ad5d6acf544af424da46
AUX gitlabhq-7.0.0-ldap-custom-mapping.patch 2708 SHA256 8592744ba8b373b2e89c76d7ceb6c755bd46e2c2de6143b3f1d9967e4b6e5fb3 SHA512 a172444da26ddc9dfebe0c0ead4a2eb73a77ac44dfd9b3dbcf2b3faa679d963db080d2979d707e337b99f8e6384ccfd323f5d6e70921d193e99db75a4ba45b38 WHIRLPOOL d25e1f78342c781d26b84c09bd7eba08b46375c2f353b358f838602253dc2fe57807a437fc0c2891a6bc2893eba0bb278bd605ab8b6c837101a783c84536095b
AUX gitlabhq-7.1.1-fix-gemfile.patch 2184 SHA256 9ba304baa5a17f1b0637fe243f551ddcc22cf32c3e82b7dc5b1a5cc0c5fc5876 SHA512 db8757874f136fc6a1d138feadbad6f8dfc773446f969b76a4715901dac02c04c978133ef3e9218b9c4a3d0173f53c0d14608ae123ee300a803529cbf232a1d1 WHIRLPOOL 27adf9392f3f1cbc6288afc1aabc174850a689f47f015c9d638b62769607e6e4f5ebe8bcb3811ee189ceeddef7c5bca384b322d15c0008b8867887f26d6188e2
AUX gitlabhq-7.1.1-fix-project-name-regex.patch 638 SHA256 9f3dfcdc4365422037ecc8854b10e2cf96f4fb9508a6d5214b16c3545ca1353b SHA512 4606eade95b75e31eb791d793e3571c4e998c2d451e1f92ce70fba06e3a29c74a17f2fedba24ded4dbdc6db3da87960890552869fd8790caed26ff6fbb201717 WHIRLPOOL 6470de727d060556cc1413ac23f3c3198035f3cd7b05a291f7dedfcd9071a5afecca57c15f7387a84d9c1830118e47fae4fc72ba2f2e67c346bf18c4dae09865
AUX gitlabhq-7.10.3-fix-project-name-regex.patch 674 SHA256 5291d514c19a8d330802d73a6c874e22d90b237231f0e4ed4c7a5ecc062c59f4 SHA512 74603047095e2f3bb8581a1d3bffebb68a3cccb7a0a4c962b98aafd221159100a6fe104eea096518889367526df306d7bf8c2dcc07a28c5d8de4164500cf2612 WHIRLPOOL 35e78af7cc503d2b26aa4cd8b630429bc60e10a3ef27cbed4cebc9d4c9c98049692a21e68b492db336427dffa4ba0e499d8b960d69017a86f9bbbd94ec21d0db
AUX gitlabhq-7.6.2-fix-gemfile.patch 2402 SHA256 9abfdff94da0fe5b6db4d740688af179b93cf56c1ecb915c12bc0a5440295c4b SHA512 ce948a768a0803794e102b062fcdfc7569879f3ac649a1cc86f222053810dc758dbecc41834d06a1f6a3e5e03cf36dcb368e24a47401dfac7f6b8c5197706359 WHIRLPOOL ac7696de8bd143dec22cf3e31807249bd1bb58424edeb8de7745afffa8007ecefd577ce11dfe5de2080d87ab19eb7198ddd2d89f06eb96b5e4c70e2476594f27
AUX gitlabhq-7.7.1-fix-gemfile.patch 2322 SHA256 0ae2e911fdd2b8c4902222b19efb73d12178c40a9e17a8c98b272ae7378782ab SHA512 d1c4f79325bfe4ec71befe209264339baa61c3028e884318d718a4115eaa866d594e88b5f6b222beb0746cf7e07e92012b3097bb287da01df025d1ed7fad5987 WHIRLPOOL 253e496a91453f90ab640ccb03bc02f2e1ee9a439a3278a6d21feb36d87518d7b834c7f2a012ad14c2bbc42b36817f7d8a093940f91a2d913bf7913191193a7a
AUX gitlabhq-7.7.1-fix-project-name-regex.patch 715 SHA256 b026094b1f910226ddef2365d55d555ba6ebb99c17abc1eceb3906a101bf9f1b SHA512 041eb436089508266a572ec97d5c2d934747f1937fedb81bc18b9a85ace663cd0628d409e037e78d7381c8e968b9913121e09ca152fa35a7b372642b93643cdf WHIRLPOOL d548d403201be0068027dc73b63870845c6c109ee820af4495ed9969165a0fa39a837c0343fe2686a297f845dcc7306fa71fd98ff4941ccf584842d1046748b9
AUX gitlabhq-7.8.0-email-custom-reply_to.patch 1853 SHA256 ccf123b164fa323a212bb2b53104e0dc8d1bd0ecbc0a0dc3b41fa58740ba6779 SHA512 67b4f4624bd7fe91b78b28b2265f7166110611fe2a32ded733aff65291e7562af4bd3b0d3345a45991a537486eda4606cd82347b907b09c6ff47d55d40969227 WHIRLPOOL 678716e8dfa794055a7d4827a7f1e9bc67475738ed7308d5cc28a7661a99acf927cb91a59dd01055cdbde9690bb3dc10b87c53569351267dea2e86117140af5e
AUX gitlabhq-7.8.0-fix-gemfile.patch 2123 SHA256 935a72dd9cdbb12de6c95ca5e3fba066b5fcf368830f9e4c7ce4466feab20400 SHA512 70960437b1e5e5054ee28134104a1cabdf95ac6a7f034f755f97eb859d526662ab9e6313fd1c72b6838c308df5173a0d08896f137f8f737c6c0a6e7b7f54bfc3 WHIRLPOOL 8d7cbc26934f2d0e993c75565a17992c3c44a7ab51e6154bf7a91667e0e1c5837cb6546730bea882772b042c6353459f20e59a9a95d56d130f6db8ce4d2d1123
AUX gitlabhq-7.9.3-email-custom-reply_to.patch 1787 SHA256 278b23ce845f39a4342af8647a5453f69a34769c14bb221b250bbff9f59dea4d SHA512 d98ca57a7c1a46c6af8ffd86973cb0c7646dd7545b7ee17bafc3e025cc3be01b4a9f876a1b505be9b098054a194bd14ec79cd8d633afbdc74d845e376460a55a WHIRLPOOL 52298d14cefed3d86bf183524561101a5795b5de9ee33611196019fcb4bc43975f0330dba187eb16d8a96eb4cc865c8e38fbcd351d19b290d79f4fb2e4f78b11
AUX gitlabhq-7.9.3-fix-gemfile.patch 1456 SHA256 ad7deb355b74a156ef04c031ff45946a4852d273b30c4bae2be5b2cb11d0d683 SHA512 f0535f57338833f734701ab9c64a1a1dc9f7d6e7c634756c18e98bd5c6811876e2cbc7d64bd93297d5717d1d1e4f9213c7982c32770000698dc7a718a7b00155 WHIRLPOOL dfc2083e7c3c7895a01f4e1e588610f542a38a636ce9af1165b5c0fa4301fa91a6b58f24833ab9e754ea3024e48894b6b58ee9e3d2acec6cddcc1ecc515b097b
DIST gitlabhq-6.7.5.tar.gz 10229484 SHA256 547ed2807cccf08c11450a9df035dad8db66ab9f9d693db29e3aa1ee65edbae0 SHA512 a90c0cd3954bf20ece9e98626216a42afcb0cc07e0cb23874ab2065757805ac38a8dcf4e93d804a33caeecaf2c6e94d8566f5700cd4161ef9a0aaac089b9ded8 WHIRLPOOL 4d8f5ff3a1245c5e13fc3ff8f819160017dd4dba9f6a48c0f851272da5c97f45162d3e53f327002f1ecde7f31dd5f392bed8503b1b306d913bf63827777cdbcd
DIST gitlabhq-6.8.2.tar.gz 10558471 SHA256 db9400d5ffadd3564bbee6e388c90d7f4c8f88450e67213aad11df2d137534ec SHA512 0f57c6bb3b9e89a5bbf7ae4c774e54480518f185f2e50270a7dd921eb2a2322f3e6866ca70741582fad4f99b372ba025fbab15108c291d53ebf04cfaec2f9b75 WHIRLPOOL 73ebd0fb0faef7afd48398ec4e73c8f4175f3dc2a9450ae391b4d3a66b54e0d77f901f518738eb98cc267691559094d4ebecd4c0a7c18fa671c3a1aee4dfe4d2
DIST gitlabhq-6.9.2.tar.gz 10566288 SHA256 2c01b223c3e889c7a45d3815f352c0546a337286d395e4d49df5ecedc1a57dc0 SHA512 b51b4e261666c14f782ce7edbbda24b6d32bb080c5444249f5c38e5233398b30f50a17cc8cbee18d75e57ba11ec3deeab4ffd1a6d6257c1858f8fe63e5138e54 WHIRLPOOL a3b9a8149fab69443b769aa145eb2c9a99bfc9f4a080edf0a6bd46c4771247b6f1c729bf5185e63bf63a02d654145362b7c8e9fefef6f0cdf1f4f30a32cf9dcb
DIST gitlabhq-7.0.0.tar.gz 10678947 SHA256 72f0585cb54c70d1da6ca8e705e19cb3715cf79908c807015146ac628ef9e1ba SHA512 4eec41624e24060c904d4f07685bb213b4f7eb28e10820faf42bc9aabbbd6c74262663a91e1b9f2c09f008228d6b602e77a34245a9c6dedb1e9f813f13fa3193 WHIRLPOOL fb955ade8df35efbb4a1cbec1ef883f711be355d7558b737a5a598e6c1bd099e2379258d6e7f2db32e77b6cb1778e31d0b9e5bf5950845eda764afaae309901f
DIST gitlabhq-7.1.1.tar.gz 11977881 SHA256 3a0268dfa8747f64acbd1121fd2b927aa7c52e5013ca1c27621a3a28bdc7773c SHA512 8469e7ca93a171f752db6586e66150bacd2cffadb25077fe321164af9d9ecb2d7bd30c29e632d585fa20ae729fea7b522ee70cce91c5a378c098f5f0f4b521f7 WHIRLPOOL 13bba5996e0c4b5c89b5e4954c08a5a41482575a88105489ba7f614dea5437e9cfaaad0087e461c1abfb331142d834cf9941d54fda2aef8d1dc12320cf2febb7
DIST gitlabhq-7.10.3.tar.gz 5690032 SHA256 e0d442b3c2bc4ae19bc0f146bc9ee0c07275616323f3aa9ae68a6021cd9e0e42 SHA512 46c59389aa9d699747cbea4790ef89f38b2d7c9a7b7452369be6eba47a3136c1ea8fa12c8a74a40e6700d83a238fc6aee78c7a22468878417e1f201e4f4e077b WHIRLPOOL 37ade7b0c5e33eb1ca018b461e12bbd83d15d89b0201e17e2857d595fca8f3fa783098fc7e090789a00786a83d7299f3597e664a2cf1fe9ea66690c4c8a325d2
DIST gitlabhq-7.2.0.tar.gz 2694271 SHA256 5333b5da7d54a3b714a6d2e438414c1a7c3435ac6b1f42d18e55db60d975e183 SHA512 95ce8db984e77f66fc344add6735c44683cb48963d403056cb74a771e33133184a83a7ec6005262d50c0a2ee11610c3815c2a9675a2969ca6ff55c4098b3440c WHIRLPOOL 7a2705b44805453a866fd3ad6c02b5176a48d574259768ef2682367b835aaa059951a7df1bc1ad0e97d9513c58a56d91b6947e85a4873168b481482f16bb7f65
DIST gitlabhq-7.2.1.tar.gz 2694643 SHA256 4ef07e8d9db33b95a9016f6b66b4c90a3a5f84c607812255564a41c8fb4beb44 SHA512 f3c6ff968225b3dc3a35cd0d5e81262d2e1b4b195913e146e60aea6006be0928ca4b39b0f4148a4cdf20f5ff0daebdfe4a2c66c027019da002e26dfbff412542 WHIRLPOOL 53286bfb5c2f9ef5525bb3e781c29894286c794dc93dde29ad86de429860f814dd7be12e6ea71d209a60f55bf51241113e113ad9397d40b3ba5d5d5b5f1a4085
DIST gitlabhq-7.3.0.tar.gz 2719960 SHA256 799791397b86f447e81aebedab1b98ef5161807fbd1b03b88776bd479e5a59c9 SHA512 b08dcf572793622796e7f9cbdec5a37071eb950424923e365d224392fd2614539249f672b1e62ed546e076eafdd64bbe7da3b785d1b43d3a3d982064b7021342 WHIRLPOOL d72b918ada104a92781613e0d90c93f1692ee60eaf7ce7b7bfb6f17865b67d57330d154192b0113835e4ed713f08c29954ffa70637f9f002f08eb4aa9b87d2b0
DIST gitlabhq-7.3.1.tar.gz 2720648 SHA256 6a0ca2764be820d2951268cbaca43e4d064d8b51bb6b0d4ad6409c66226ca86e SHA512 e2f5d131c1939ec51f27c4aaf092181ec749f6137b96e0e4128f2b1e61d3e1a249ee62df28350d9ace6744a313e7a8ed3b6ba12d49314b824caa30fb5341d27d WHIRLPOOL 9b56f5922a1b31c271ec99790a465a3142ee03b4ec4f113b41c58bde21972edc44f71661eeaf9f016182cc2e60e4f8cab45b39600123ff35f5fad0a1db928361
DIST gitlabhq-7.3.2.tar.gz 2720541 SHA256 31b97e1c4a2d30c40ca39e94e1f1adb087cb2c87633ee0f75f335d3463b093c8 SHA512 073ed1e4c83f6cb6d88e853fd1db9814ebd40202f375caf8db0a3acb476b444bbbebbc57ca9a246d024699d25306bc5bef4a01096e203bfa0b7dc0439ebd8afd WHIRLPOOL 9e9917eb56389b234cf664d4a228c33615f4abc0b9b7b70fe89fef125e426f068d3499bbe5b5a82f906b5345350039fbc05960e14e814ff048b161af654055c2
DIST gitlabhq-7.4.2.tar.gz 4189724 SHA256 b116c49b032e5cd3529698aed3174b6f02748c2778017712b44c9cb7cedec55f SHA512 c4e8d88d3f835e2b31b63c9ebb8ee4da75ca9149fa87e4ec9f51b64937ede7e5d526916c415ca4b327ef83f2b318066c3bea0c3486a091c39a20324cdc4ac14a WHIRLPOOL a6faa91ebb8cb591bfb921e1a9bc1f665cdcda2254303814d4e3f799e3b43cbd33fe98d53cfb07b44946025ff02064d36ca253e8bf84d1466116b576df190f11
DIST gitlabhq-7.4.3.tar.gz 4189957 SHA256 e03092298526bafb65336a14944570083f96e960f9bdabf8e4e52a403e42a5f8 SHA512 24228e31c7422215309838b1c8c9f24d8b2c77691b480365548ade36be53368bd9cc04e8065386e83b501f8f3f97f365634297a1af2c93c285cddad2f8150af8 WHIRLPOOL 785b6ba8c2c94456c005b7fbca265a762990e24c5164d742d8cb34a0f370c604aec23490ceb034007444ffe65223e163a58364aa01c1d617404a3278ac77f0d7
DIST gitlabhq-7.5.1.tar.gz 4221894 SHA256 cbaef29b55c35b1428fb4678be76500e7f0c292aa72314fa457d94c61fb5e00d SHA512 fc99100aab666819c06df96fc7979cb108a42249d811482c64473a51ec38e89d325346a4e069666a9130cff9eab21a470e68724cbe53d135bf4dc3b52a6b8930 WHIRLPOOL d86887f196cdc8d2690ff0a788c70994b7192d39b89d47c63a8b0baad8102c22efac3b3dc6556eefba7bb5cb12aaad347e5adb7d9a5a591fd8ca1d7de3a5b493
DIST gitlabhq-7.5.3.tar.gz 4222058 SHA256 533afcf5b9a0683d2f920a436e552af8d8e953c78d03f150cfb8dcfa0da3112d SHA512 18e9d5ee9d39c8e11101d370228b8edd38ccbfc1b7d768977f3cdd575604d7f72f897484749f9d74988b91f8195c0b9452a47a6f83acb6a7890d4aac9dd9f1a7 WHIRLPOOL 0bf347b12c2d2b5d4bf4bbcd0ff790bccfa100d0ff818a77e0843e3ff1ce87a627cd541bd7e5d8160f0954477809c8539ac1c309c3bcbc0e0b517ad3f30193de
DIST gitlabhq-7.6.2.tar.gz 4238734 SHA256 bc8f92dacca6be48c7a34b60a727e0755a44742500164c131dde7b88bedb71f0 SHA512 ecff2159536c72c82e34aadaaa02e2ee29ec494e7caf132665139622dcb6ba94af15295a0a8bbdeb550a9c2777284cd67cf57b7940b49da98e288a48577ba1b0 WHIRLPOOL 8b4fa295e82c9d61cc0c9a0e5e84b65ac2528f4afacada065e37214234b98d6aee90abe9d1599b8827e459f5ad503fccbab00f1d7528b89735f1617f4d55507c
DIST gitlabhq-7.7.1.tar.gz 4438938 SHA256 b3399006bb7b89c1622bee52562bff4ab9681fe4c31c127858c39dfb720e1bb1 SHA512 378ba79ad7d191895fc54b3f99ca2ff1e871e07a4557a0dab3b03f3815dfe6fec069f47da58573ad21acb25ed5d7efb249b79c65655c7607db0f9c4f6a2597bb WHIRLPOOL f87d3a8aeac0a3a6dce39806e5e2df7c9a852578627a1ee5875625795044cbe655fff1ffb7635d7cedda662b55c87959cd14f3e9f2e74e075e72a288c5ad4850
DIST gitlabhq-7.7.2.tar.gz 4439065 SHA256 7c99367be815d231ba4b349a7f0a3d2470ae13ac2910d01d085f46890961b714 SHA512 5853d7989e75c03b7f8df24378bf25d9b49ffc858f6421f809bfcc11177905d9706307d048b880316331c74c79914a3ebdd032682414c76ac6b082e3813be074 WHIRLPOOL eb56dadcda422cfccf263f838ec225359ed9490a3c34df8a3d4a9b1f08ad98900374d81214217f27132b29d104b5102ec3d95f0c6bc10a8eca7088f9e5c9bbbd
DIST gitlabhq-7.8.0.tar.gz 5303213 SHA256 a7b3836b1071ee58f986197b08c3d91fc85524a5ce3050f7ef6697088850a242 SHA512 fff5240f8286a3d084ac158a262ab1c285c1b685769e1a707e0317e67fd0c27205970c51338589a59c8192eb4a87c7e43b2ecbbaa5da8f5f243024f364285983 WHIRLPOOL bd8ed138b888ab46ecfa172045e79520db5f48ce95b119a1af752db4988ee62c73be753773d4cc5dea4fd029d4bf6a78293291e050a7b1e2776b0a84deff2357
DIST gitlabhq-7.8.1.tar.gz 5302130 SHA256 4308a945b605caa369c0cafc22fbf7aa9f6cf9143ab200cde86c9c9308849153 SHA512 ac789c6264e599f44e50edf4ff09187293f1d2a7f4fc9460b3f28d5753a4d868247fe68a443e50c2bcbd75871ed7a124f1d49e84565da954c83f36154b4cc302 WHIRLPOOL ceb7f82f86d31264321fec76b5344d908327546ba9c2ceec7ad81cd8eaba7832450459251cd3e52825ae00f926f8d74205681abc8e867f97d44eea195dca4652
DIST gitlabhq-7.8.4.tar.gz 5302883 SHA256 84b2f2ed08aa524bcd85145921b99d176da1ed5210ebd00ef16b65b0c69c0c29 SHA512 35d803754b46b11087665f766279cd5b5fe348ba48cec3d889dc393ffa407f50bf9aea8564fd1f3e5fe1b513eec3a4e4e5032ed9c4f6e47189c59a7a60a515ff WHIRLPOOL d97911ac6cf5dcddffd784ee757846ca11c8134f80f88f9fbbb1ef90a3ed7a189ba00c126686fd34ba8889e0fafa0fe0059c9613ab922a1f155d8bfca5777d53
DIST gitlabhq-7.9.3.tar.gz 5390351 SHA256 265bf36d8560b8cac59a24474dc8addb7854435600589faae2c46f40bc232b18 SHA512 2387ae0228dbb75d5c58bb7240a7a04a7c36edbc994f9aac4d26509b1163e3e65779958f985de11474693ec6a09e0662d8af8a6fd78f13507e1d9ab38a4092d8 WHIRLPOOL 800148f5490c9a559604d47cb4a1733afbc6dd3bc79755b7985152c2514335d0e15ecef5c4a250bcbae821db8d0dbbaf2457e55b9b6abec4068777282b98ea01
DIST gitlabhq-7.9.4.tar.gz 5392634 SHA256 bbc6a0647832f983322ce2c80f3d642354709b32de28f8ba6009c508c3600ece SHA512 2503c32143df3d46bd7abb8956aa3e65d436f02bd993024c5fbd4838f90b746de44f5a78f82572b6d9e312f34e5ae27a4c51706ae9ae315c069cd14519e8d90d WHIRLPOOL 6bd1d8a451693c8906fe32c5705f57aacb59c69c1168d9d7461e7a6665b3ae7326ebaaaa1799af4c4d246fd6a071383eba48729dc4627de6ca75180771aa6db8
EBUILD gitlabhq-6.7.5.ebuild 10973 SHA256 d74d454bd9972f15d21a3454e39a78ab042ccb3444cbbedb25da01d40335361b SHA512 b5494ee857055022da0803277d6a8b84d1fa1d9af66a853eedafdd3fa4993dfe4a66962581234333b16f41b6d605cfe6a207a4d2706c90d921fbc54474deb296 WHIRLPOOL 03026c7b7029c8bc7d5e5ad05c38e4b507be6c4f36b488753120d7d0849522a9e557c5b04adcac4c22eced0fbc1432fd16e7447198092b6691ccc529147d9dcf
EBUILD gitlabhq-6.8.2.ebuild 10595 SHA256 24317d99bb9d0e220c11a37709b1b701b9cd7bf7b9fe3adead666c531569dcf0 SHA512 2f3f5e38b33edfdff35f3888e694984e97d897d7c64c0aa6cc35149d253e7211560dbd918b12e891c0d1d009241e53e255a2a3be91beb5a3954d148c4554315e WHIRLPOOL 4dca44d6e271ec14252e3a4690e6736d64133d3d115ec19b77d37cb5a2a3d3a46e9820dae48df5d7fa79dd0ca9c6b178b9dca85811bc0e78b7964580b0696b59
EBUILD gitlabhq-6.9.2.ebuild 10616 SHA256 4221acadb5ac65ca3d662a2a560ff6343e04e0ca14dbd1b5bdd8f6a07812f7be SHA512 161c587d219c0dfd54b92805f7378aa7b1750bb25e632a16b67e3d24b28fab95f8f4272d685dfc70f1d7bfb15449a208fbb8b343dd8f902d8855034ed7f855d1 WHIRLPOOL effe560de13a29de88bf42aa927ddc2781373722a0e9a83ebef8942b0128208e35658a6b43d1bdc2d6e2b80c43b836dc8cc431f5d38912c201c789f70076e245
EBUILD gitlabhq-7.0.0.ebuild 10489 SHA256 dc516d152236488ce8f054a6beed86fe57383d5ca9ecc8d851f22124153a5665 SHA512 e8d50428e0ab88e68a6e8d8978edf0670c29e1acf0202829f50e3a8240859f5a2e7a761b0b0073742145d45e1cabf9f450250fd3bd89ecbcc995f41b0ba183f1 WHIRLPOOL 162364a3b5f9b0095f1f8923527119d109cb62c04047a398e45b411a23737c6aec15c54ab1680dafd8a59ab63f24b81eea5fbbbcb99e5f75383073c74d235d8c
EBUILD gitlabhq-7.1.1.ebuild 10496 SHA256 932f9fd44585eead0138bfff19f151d8d7a1ca7b2502833ba7c4c08a34727a40 SHA512 6a97d71a28c078a0020afbb238e73859a26d02c532ed588af9a1b266abf5a3117e838a335f58a71671a6b460e34159b6db534434416a49f83421054b45da0adf WHIRLPOOL 64baeddf75c071bc1e9b8a4e572f8eed7d607f862defc1b6c3432fa6ad7a38986d55170c72d195f7fdf48b68eb3adc734e192df6a1a28f19a50f28c53dc7aea3
EBUILD gitlabhq-7.10.3.ebuild 11280 SHA256 b68816f36f41d7c2771448db041b56c9c12d82b6326856e37c26b0d763463e2a SHA512 f7ad09d20d0c5a9167f5e9118ca56a6ce9b441e5c80d3d83dc5ed43d8809026cb285941747283c0813651a89fc3a0e25d0a1c11ab9efdf282dfeb8349214ae7b WHIRLPOOL 0b34c86392af8607a4a30c3b51dd4ec0816d4af0183e50cbe750105a644c0b6bcfc34454bd78cbdb6a5d358954cf390593778e3f5aa6ad453604f6e4a4722e05
EBUILD gitlabhq-7.2.0-r1.ebuild 10595 SHA256 373abd70eb2fdf0fed9be0f3977d1df8a5f94b9ea1e2afacf0746d42ce56cb6a SHA512 fa621dc17428785e06be60012469cc5711017ea2b403ae6cce06d6099d6258dbadba13f1ba7d32193bfc1b1bce9f58774dc61cc9061091cc105df3b6b87a91f7 WHIRLPOOL dfef55ddc4dd17e4814f290852b8183b173627d4d50fff84d8f293efb358e9f27f4dda892b734fdb89b17496b2a87743146cbcb3f5140f6fb3e0f7576fc01ddf
EBUILD gitlabhq-7.2.0.ebuild 10557 SHA256 c392f2569835fd1908f2765ed6974cdb4415ca4630a73e52d41625a4eb306452 SHA512 d2aff74fa6ec12760a1c83028f613dd769bad1b410f7d52c365581e6ff11b313392bf83208e641d5257ae77501457871fefacfd4f241793317779b7090d0b2d8 WHIRLPOOL 95df94eadbaee34bc0f8a49dded23bb24bdec5791affcf7c3283803deafa809b39f0295269ae57e16ccde40701a3389e73deb775a82261369a38ec32cb264ef8
EBUILD gitlabhq-7.2.1.ebuild 10595 SHA256 373abd70eb2fdf0fed9be0f3977d1df8a5f94b9ea1e2afacf0746d42ce56cb6a SHA512 fa621dc17428785e06be60012469cc5711017ea2b403ae6cce06d6099d6258dbadba13f1ba7d32193bfc1b1bce9f58774dc61cc9061091cc105df3b6b87a91f7 WHIRLPOOL dfef55ddc4dd17e4814f290852b8183b173627d4d50fff84d8f293efb358e9f27f4dda892b734fdb89b17496b2a87743146cbcb3f5140f6fb3e0f7576fc01ddf
EBUILD gitlabhq-7.3.0.ebuild 10554 SHA256 86eee0c2acc21da9020fc7dcb9383df15ce518fc4a9d4b3d5d50bf79b7ce37f4 SHA512 a6a0cc02fa579e1dd853bc1f01e5a33c14891d2e3ace2c2a8446df2286f6d02016f071a4c3536cc3b0ba301d793bd73819ed4812b1512f93452150edcd528bbd WHIRLPOOL ad569e0d3772936b01f69b768100de2c4fd81ed724b16b727d811a2c2212b796d06dc864c58ca2f826994db9ce9d49b28c2e4a5b1306ae2f66eaf991aec5c5d4
EBUILD gitlabhq-7.3.1.ebuild 10554 SHA256 86eee0c2acc21da9020fc7dcb9383df15ce518fc4a9d4b3d5d50bf79b7ce37f4 SHA512 a6a0cc02fa579e1dd853bc1f01e5a33c14891d2e3ace2c2a8446df2286f6d02016f071a4c3536cc3b0ba301d793bd73819ed4812b1512f93452150edcd528bbd WHIRLPOOL ad569e0d3772936b01f69b768100de2c4fd81ed724b16b727d811a2c2212b796d06dc864c58ca2f826994db9ce9d49b28c2e4a5b1306ae2f66eaf991aec5c5d4
EBUILD gitlabhq-7.3.2.ebuild 10554 SHA256 bc1d484887ce7ad25d1cddeeb46677cc503d74638ddbb631d0afe5457643e47a SHA512 3b7d2220ffe95f6348af09efa62106ab77a89ae16448ea2bfd5b91748c9a5b3853823f24c6626ec53816e2035eff549bca3a4b45a3596cacb36967d2b96fec0e WHIRLPOOL a2bf0e9638fd18444e6534ae433e549e2259d8e30af3b4910392c271178d5a03fcb67a44f2118a69cbe5ec87affd769120c1cafc23b848041f35cf6e9e12e4bd
EBUILD gitlabhq-7.4.2.ebuild 10576 SHA256 7fdcfdfa51e7b2ed8b523879009c0cd19c2734b50e75267132d67b492cc1bcec SHA512 b255d439a4585373023591e352e6b1c9adcd3aa18b7bbf06a2bf18058c95247788b7fcdb80a197c726a96450d711bf5a2b98799673579b52ea255c4fdf2763c3 WHIRLPOOL e844febc7d6e0454bac997cedf5d723983a1f9afa808eaceda3abf8780b2da320883e12eb0dacca1d5a6f35219f7f40472ab9270630cff2718d00f26e628be21
EBUILD gitlabhq-7.4.3.ebuild 10576 SHA256 7fdcfdfa51e7b2ed8b523879009c0cd19c2734b50e75267132d67b492cc1bcec SHA512 b255d439a4585373023591e352e6b1c9adcd3aa18b7bbf06a2bf18058c95247788b7fcdb80a197c726a96450d711bf5a2b98799673579b52ea255c4fdf2763c3 WHIRLPOOL e844febc7d6e0454bac997cedf5d723983a1f9afa808eaceda3abf8780b2da320883e12eb0dacca1d5a6f35219f7f40472ab9270630cff2718d00f26e628be21
EBUILD gitlabhq-7.5.1.ebuild 10904 SHA256 821abc6ca9c2b87f18aa3279068ead6c25ed5d652a0ac725dc5c53a6eb9baf08 SHA512 f0ff1487b022ed7884a4883b4e0fe36229918a3c93ea24ed315da7eda8cbc664974444e4efb7275e26008c5ef75e872d0fe1f76eda43d7aaa2223649faf5d554 WHIRLPOOL a20c720e9ad3a440b89d09df0a02dfef4f63cfab2102a69da20e5f38925daf97f8a8d339e4c9d997e0f0a05b9f71ad3932d6cdc20e6561696d2286bb7d510589
EBUILD gitlabhq-7.5.3-r1.ebuild 10907 SHA256 3c8b8cabc75968beda5a351b746ab53c7e644d16c437bc54af51fd62283a1917 SHA512 e42b3605ab405a798467713f723ddff553ecef81b2f16baad9bd93653da15fb23e47aa7f28d5cc93eaabf3e8eeb70201dc6f8ae6192b42da82be0a754e54704d WHIRLPOOL eae1bb4dc43c178f61fd8fe5784c1e02f385969dc7237ce9c140774266f4a583f911617014602c1e72c0f8f525edc7b6e620c748045419640f0f0bdc8dc6f0d3
EBUILD gitlabhq-7.5.3.ebuild 10904 SHA256 821abc6ca9c2b87f18aa3279068ead6c25ed5d652a0ac725dc5c53a6eb9baf08 SHA512 f0ff1487b022ed7884a4883b4e0fe36229918a3c93ea24ed315da7eda8cbc664974444e4efb7275e26008c5ef75e872d0fe1f76eda43d7aaa2223649faf5d554 WHIRLPOOL a20c720e9ad3a440b89d09df0a02dfef4f63cfab2102a69da20e5f38925daf97f8a8d339e4c9d997e0f0a05b9f71ad3932d6cdc20e6561696d2286bb7d510589
EBUILD gitlabhq-7.6.2.ebuild 10931 SHA256 c2a5797b88d035885c4f931e169bbe794c4928cf598948d212044656a07e2506 SHA512 1384abcb7bf73d86da420da3b01504cccdc19244057a0c87232e83e9be1a78408efbfb378b723829b656159ad21eb1430a6cb4e7e183522b4009889ade5bfa02 WHIRLPOOL 6c097ef160efeb4027a6e28bdd962f2fe1917cd1f3cdb9457059449204cf46a31330d37e6a37d9728c14f8e562fe17e1483ab44ec152cead00a445e6b52d6efc
EBUILD gitlabhq-7.7.1.ebuild 10923 SHA256 c92d84d7c2a8a65b5876c39aa80d5c76eac8a2a8981d035638c9c835833a06cd SHA512 ae35bdf266887cad09cac95919aa4cc08faa277d0414955cdea621d8e3eb650a6ddda008c6c2a653d89df95c576dd17c2ab737444149fdb96d77a5ec18149753 WHIRLPOOL 16f34fade989e704fbab6ab2779a363b6f370a4e586adff56022775184fd74fbcd6b7aec4eaa32ef60435b618596e452eb586489731c6bc8cb459a7b3cd76b2a
EBUILD gitlabhq-7.7.2.ebuild 10938 SHA256 4c4336138456d9efe0cc7d6827c6c19be0edfeb874847202e566225e991e5991 SHA512 29d42285a1fdb55813d2811251ccdfd65b9a4eb62055191d038b0d1a2848476f68e639e4fa777260d200f36a8a7ab187b71339eff136126fd41a4478f31ff117 WHIRLPOOL c1657a6bc4d6af99d12ae562edcd84553b68b7996c7088b865c177cdb12236abd8e450e12755713ab42fb4d4418651da4ecaf8415d604de52546da208da93861
EBUILD gitlabhq-7.8.0.ebuild 10952 SHA256 5da8b8804b2bc89755c6be45aa057da0c34af34ac8b01e1a8fc4a95820fb8330 SHA512 cfd53fb5c9f07dc174b4985c66ba781f15eae514e153cf2a5d53e4ae753a23d086ed303b118e750ec4e6cf29a71f4fe486f091f301a06a8863b28d79fb9e5918 WHIRLPOOL 52fa14e9b6bbfacaa23f9629e0aee7c1557f0c913e9ed6ea10fb82fdc6dd3b43a406a05b104729b46448fe491e4d17cc05e12b3a7318f314263415231e687edf
EBUILD gitlabhq-7.8.1.ebuild 10966 SHA256 b5d3b822a4ce401b50909f0663bef4dacf7c9673c51bbbe2f600533f3bf7c365 SHA512 630b0b2bcda6fb7c5b407b4c094e35ad9de74ea9e6fd959f914f9944cd543ced2c3f9b1e8d3f98c6d3f1e0a3f6873e4ca64817ae3fe2aed61c4e656995e8ef62 WHIRLPOOL 3cede9b536a86cce0cc024a957d7b29c472cf60223ba9321bbe9e4b885cb9a58c3438d07708280a76dafb811551c3576559c4e6ec71b2050c3e81e88f460bce4
EBUILD gitlabhq-7.8.4.ebuild 11421 SHA256 bb3de388ee40f9d63789c65da6d331f543870e88371c65a1f56ad019bf13d07f SHA512 600e93ceb3b4dbf018197e1462e14501bb6a36e1febead7078743034137e442d9104e505a4de622a6ca6108ef0f2427f4feb08bd2dddf95cae3830b2aa744984 WHIRLPOOL 2d30fe945665abe83ca138a49b18eb808d555b9a1f00e61c197cc3bfbc3167a1b46359e639893628f0dcb2bad871571ba416982685602c5a9195240986083906
EBUILD gitlabhq-7.9.3.ebuild 11316 SHA256 491ab8495fe600a625a03826d5f4f0a70cd54781c69b35de4eefaa7d4bbca5d0 SHA512 c80a1a04c3090603bd2f795624a97ed9e69451d4027321ffa7291b252a643a7cc14b50303b5fec0968b79101b3d3c304ff9d3731dd897cfb2e7a0d7fc4ed177f WHIRLPOOL 84dba3eb8abc110fb88b71db1cf4ed1f1085109c6af330094e50a7eedd18ce4721a5157745978a2705a93d1b21d53d57a80acf85a121926259d723235dcce416

View file

@ -1,10 +0,0 @@
Host localhost
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
BatchMode yes
CheckHostIP no
AddressFamily inet
PreferredAuthentications publickey
ControlMaster auto
ControlPath ~/.ssh/ssh-%r-%h:%p.sock
ControlPersist 24h

View file

@ -1,30 +0,0 @@
# cat /etc/systemd/system/gitlab-sidekiq.service - for personal use
# cat /var/lib/systemd/system/gitlab-sidekiq.service - for package devs
#####################################################
#
# GitLab version : 5.x - 7.x
# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91, Stefan Tatschner (rumpelsepp)
# Downloaded from : https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/init/systemd
#
####################################################
[Unit]
Description=GitLab Sidekiq Worker
Requires=redis.service
Wants=mysqld.service postgresql.service
After=redis.service mysqld.service postgresql.service
[Service]
Type=forking
User=git
WorkingDirectory=/opt/gitlab-6
Environment=RAILS_ENV=production
SyslogIdentifier=gitlab-sidekiq
PIDFile=/run/gitlab/sidekiq.pid
ExecStart=/usr/bin/bundle exec "sidekiq -d -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P /run/gitlab/sidekiq.pid -d -L /var/log/gitlab/sidekiq.log >> /var/log/gitlab/sidekiq.log 2>&1"
ExecStop=/usr/bin/bundle exec "sidekiqctl stop /run/gitlab/sidekiq.pid >> /var/log/gitlab/sidekiq.log 2>&1"
[Install]
WantedBy=multi-user.target

View file

@ -1,67 +0,0 @@
#!/sbin/runscript
name="GitLab-@SLOT@"
description="GitLab @SLOT@ on Unicorns"
: ${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_queues:="@QUEUES@"}
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 -q ${sidekiq_queues} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
depend() {
provide gitlab
need redis
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}")"
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 $?
}
stop() {
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 $?
}

View file

@ -1,10 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
@LOG_DIR@/*.log {
missingok
delaycompress
compress
copytruncate
}

View file

@ -1,58 +0,0 @@
--- a/lib/tasks/gitlab/info.rake 2012-12-25 00:33:12.066872526 +0100
+++ b/lib/tasks/gitlab/info.rake 2012-12-25 00:33:55.682878240 +0100
@@ -12,6 +12,9 @@
debian_version = File.read('/etc/debian_version')
"Debian #{debian_version}"
end
+ os_name ||= if File.readable?('/etc/gentoo-release')
+ File.read('/etc/gentoo-release')
+ end
os_name.squish!
# check if there is an RVM environment
--- a/lib/tasks/gitlab/check.rake 2012-12-25 01:47:35.162380668 +0100
+++ b/lib/tasks/gitlab/check.rake 2012-12-25 01:49:49.006346565 +0100
@@ -20,8 +20,8 @@
check_gitlab_config_not_outdated
check_log_writable
check_tmp_writable
- check_init_script_exists
- check_init_script_up_to_date
+# check_init_script_exists
+# check_init_script_up_to_date
check_satellites_exist
finished_checking "GitLab"
@@ -254,7 +254,7 @@
start_checking "Environment"
check_gitlab_in_git_group
- check_issue_1056_shell_profile_error
+# check_issue_1056_shell_profile_error --don't need on Gentoo
check_gitlab_git_config
check_python2_exists
check_python2_version
@@ -542,7 +542,7 @@
def check_gitolite_is_up_to_date
print "Using recommended version ... "
- if gitolite_version.try(:start_with?, "v3.04")
+ if gitolite_version.try(:start_with?, "3.2")
puts "yes".green
else
puts "no".red
@@ -838,11 +838,13 @@
gitolite_version_file = "#{gitolite_home}/gitolite/src/VERSION"
if File.readable?(gitolite_version_file)
File.read(gitolite_version_file)
+ else
+ run("equery -q list -F '$version' 'gitolite'")
end
end
def has_gitolite3?
- gitolite_version.try(:start_with?, "v3.")
+ gitolite_version.try(:start_with?, "3.")
end
end

View file

@ -1,48 +0,0 @@
diff --git a/Gemfile b/Gemfile
index 49fbcad04fcdbb0d9a46c79e9185e10013c00f33..14b3553ffb8ae9bcb88c55b2d2772a926771cc55 100644
--- a/Gemfile
+++ b/Gemfile
@@ -28,6 +28,9 @@ gem 'yaml_db', git: "https://github.com/gitlabhq/yaml_db.git", ref:
gem 'grack', git: "https://github.com/gitlabhq/grack.git", ref: 'ba46f3b0845c6a09d488ae6abdce6ede37e227e8'
gem 'grit_ext', git: "https://github.com/gitlabhq/grit_ext.git", ref: '8e6afc2da821354774aa4d1ee8a1aa2082f84a3e'
+# Patched to fix issues with compiling on Gentoo
+gem "charlock_holmes", git: "https://github.com/ISSIntel/charlock_holmes.git", ref: '994dcf37aba066250750866e13bb51e3d5e72898'
+
# Gitolite client (for work with gitolite-admin repo)
gem "gitolite", '1.1.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index d8be14ba80ab191d6001e601026d27cdfa8fbb54..60f98ef22a8daf77ef08b58c52fab8f0cf560b51 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,6 +6,13 @@ GIT
database_cleaner (0.9.1)
GIT
+ remote: https://github.com/ISSIntel/charlock_holmes.git
+ revision: 994dcf37aba066250750866e13bb51e3d5e72898
+ ref: 994dcf37aba066250750866e13bb51e3d5e72898
+ specs:
+ charlock_holmes (0.6.9)
+
+GIT
remote: https://github.com/ctran/annotate_models.git
revision: be4e26825b521f0b2d86b181e2dff89901aa9b1e
specs:
@@ -129,7 +136,6 @@ GEM
carrierwave (0.7.1)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
- charlock_holmes (0.6.9)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
chosen-rails (0.9.8)
@@ -461,6 +467,7 @@ DEPENDENCIES
bootstrap-sass (= 2.2.1.1)
capybara
carrierwave (~> 0.7.1)
+ charlock_holmes!
chosen-rails (= 0.9.8)
coffee-rails (~> 3.2.2)
colored

View file

@ -1,29 +0,0 @@
--- /dev/null 2012-12-22 21:17:05.856026005 +0100
+++ /config/initializers/passenger_fix.rb 2013-01-01 23:11:18.717833817 +0100
@@ -0,0 +1,26 @@
+if defined?(PhusionPassenger)
+
+ # When you're using Passenger with smart-lv2 (default) or smart spawn method,
+ # Resque doesn't recognize that it has been forked and should re-establish
+ # Redis connection. You can see this error message in log:
+ # Redis::InheritedError, Tried to use a connection from a child process
+ # without reconnecting. You need to reconnect to Redis after forking.
+ #
+ # This solution is based on
+ # https://github.com/redis/redis-rb/wiki/redis-rb-on-Phusion-Passenger
+ #
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
+ # do nothing if we're not in smart spawning mode
+ return unless forked
+
+ # reconnect to Redis
+ Resque.redis.client.reconnect
+
+ # reconnect to cache store unless :memory_store or :null_store is used
+ unless [ActiveSupport::Cache::MemoryStore,
+ ActiveSupport::Cache::NullStore].include? Rails.cache.class
+ Rails.cache.instance_variable_get(:@data).reset
+ end
+ end
+end
+

View file

@ -1,13 +0,0 @@
--- a/lib/tasks/resque.rake 2012-12-25 14:39:00.679594127 +0100
+++ b/lib/tasks/resque.rake 2012-12-25 14:40:14.003591438 +0100
@@ -3,6 +3,10 @@
task "resque:setup" => :environment do
Resque.after_fork do
Resque.redis.client.reconnect
+
+ # Without that you will see exception:
+ # 'PGError: ERROR: prepared statement "a1" already exists'
+ ActiveRecord::Base.establish_connection
end
end

View file

@ -1,93 +0,0 @@
diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb
index a93afe114df68c026716911fa49963a0c77db016..0be71d465a28779db3ed646df9ac116fea73e49a 100644
--- a/app/controllers/wikis_controller.rb
+++ b/app/controllers/wikis_controller.rb
@@ -2,9 +2,9 @@ class WikisController < ProjectResourceController
before_filter :authorize_read_wiki!
before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
before_filter :authorize_admin_wiki!, only: :destroy
-
+
def pages
- @wikis = @project.wikis.group(:slug).order("created_at")
+ @wikis = @project.wikis.last_revisions.order("created_at")
end
def show
@@ -49,7 +49,7 @@ class WikisController < ProjectResourceController
def history
@wikis = @project.wikis.where(slug: params[:id]).order("created_at")
end
-
+
def destroy
@wikis = @project.wikis.where(slug: params[:id]).delete_all
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index 252a97e8cca647dda190cec95f3a9bbe8129181e..53d52ec2a19760a7e6d37e38e8858c1ed92433cc 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -47,6 +47,19 @@ class Wiki < ActiveRecord::Base
new_wiki
end
+ # Scope with last revisions of pages (i.e. newest page per project_id
+ # and slug).
+ #
+ # return:
+ # ActiveRecord::Relation
+ #
+ def self.last_revisions
+ t1 = arel_table.alias(table_name + '1')
+ where(
+ id: from(t1).select(t1[:id].maximum).where(project_id: t1[:project_id], slug: t1[:slug])
+ )
+ end
+
def set_slug
self.slug = self.title.parameterize
end
diff --git a/spec/factories.rb b/spec/factories.rb
index abc0d37470176e57eb8006e0af64dbb4fbbebb02..8357fe2127f358c3e82f06b9cc3c575e5d9ae6b2 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -138,9 +138,10 @@ FactoryGirl.define do
end
factory :wiki do
- title
- content
+ sequence(:title) { |n| "wiki#{n}" }
+ content "Content"
user
+ project
end
factory :snippet do
diff --git a/spec/models/wiki_spec.rb b/spec/models/wiki_spec.rb
index 9750b81d303ecd1105a6c2bbe2d6b76aa79edd5b..a8967e95b200f45e26374be419f90375870c8d4a 100644
--- a/spec/models/wiki_spec.rb
+++ b/spec/models/wiki_spec.rb
@@ -32,4 +32,22 @@ describe Wiki do
it { should validate_presence_of(:content) }
it { should validate_presence_of(:user) }
end
+
+ describe "#last_revisions" do
+ let(:project) { create(:project) }
+ before do
+ %w(p1 p2).each do |title|
+ %w(old new).each do |content|
+ create(:wiki, title: title, slug: title, project: project, content: content)
+ end
+ end
+ end
+ subject(:last_revisions) { project.wikis.last_revisions.all }
+
+ its(:count) { should == 2 }
+ it "should return each page once" do
+ last_revisions.map(&:title).should =~ %w(p1 p2)
+ end
+ end
+
end

View file

@ -1,81 +0,0 @@
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 52715a265bd49e0cc54a0f524351c15a70ea3c66..359d5cdaef52cd27322c9dfd71890c46c9f16bc7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -160,4 +160,8 @@ module ApplicationHelper
image_tag("authbuttons/#{file_name}",
alt: "Sign in with #{provider.to_s.titleize}")
end
+
+ def analytics_enable?
+ Gitlab.config.analytics.enabled and Rails.env.production?
+ end
end
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 4a0f60d36c26b5f5eb3a02d44a7da39bacaae04b..013ff6d15e02ea1e0c08b06b391fe865e7ba94f5 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -15,3 +15,4 @@
- if current_controller?(:issues)
= auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
= csrf_meta_tags
+ = render "shared/google_analytics" if analytics_enable?
diff --git a/app/views/shared/_google_analytics.html.haml b/app/views/shared/_google_analytics.html.haml
new file mode 100644
index 0000000000000000000000000000000000000000..e8d4b9146680fb4da666d1462881f991bb1661fe
--- /dev/null
+++ b/app/views/shared/_google_analytics.html.haml
@@ -0,0 +1,9 @@
+:javascript
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', '#{ Gitlab.config.analytics.tracking_id }']);
+ _gaq.push(['_trackPageview']);
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index f47625eb132ab304a71e35bf2ccf998fbe413c1f..3a603159cfab83ce078f839cf8c14ddf934dd837 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -1,4 +1,4 @@
-# # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # #
# Gitlab application config file #
# # # # # # # # # # # # # # # # # #
#
@@ -109,3 +109,13 @@ git:
max_size: 5242880 # 5.megabytes
# Git timeout to read commit, in seconds
timeout: 10
+ git_timeout: 10
+
+#
+# 4. Other settings:
+# ==========================
+
+# Google Analytics
+analytics:
+ enabled: false
+ tracking_id: '_your_tracking_id'
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 4fe3ced4d8d1f7021a4e8cc8064a1ceaf74d65bc..6699c7f896781da77ecc4e525a7acf53b12c80cb 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -266,8 +266,6 @@ class Settings < Settingslogic
app['gravatar_ssl_url'] || 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm'
end
-
-
def gitlab_on_non_standard_port?
![443, 80].include?(gitlab.port.to_i)
end
@@ -350,3 +348,6 @@ Settings.git['max_size'] ||= Settings.pre_40_config ? Settings.git_max_size : 5
Settings.git['bin_path'] ||= Settings.pre_40_config ? Settings.git_bin_path : '/usr/bin/git'
Settings.git['timeout'] ||= Settings.pre_40_config ? Settings.git_timeout : 10
Settings.git['path'] ||= Settings.git.bin_path # FIXME: Deprecated: remove for 4.1
+
+Settings['analytics'] ||= Settingslogic.new({})
+Settings.analytics['enabled'] ||= false

View file

@ -1,190 +0,0 @@
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -147,9 +147,8 @@ module ApplicationHelper
end
def project_last_activity project
- activity = project.last_activity
- if activity && activity.created_at
- time_ago_in_words(activity.created_at) + " ago"
+ if project.last_activity_date != project.created_at
+ time_ago_in_words(project.last_activity_date) + " ago"
else
"Never"
end
diff --git a/app/models/event.rb b/app/models/event.rb
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -38,7 +38,7 @@ class Event < ActiveRecord::Base
delegate :title, to: :merge_request, prefix: true, allow_nil: true
belongs_to :author, class_name: "User"
- belongs_to :project
+ belongs_to :project, touch: true
belongs_to :target, polymorphic: true
# For Hash only
diff --git a/app/models/project.rb b/app/models/project.rb
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -227,7 +227,8 @@ class Project < ActiveRecord::Base
end
def last_activity_date
- last_event.try(:created_at) || updated_at
+ # touched when any associated event is saved
+ updated_at
end
def project_id
diff --git a/db/migrate/20121227190440_touch_projects_last_activity.rb b/db/migrate/20121227190440_touch_projects_last_activity.rb
--- /dev/null
+++ b/db/migrate/20121227190440_touch_projects_last_activity.rb
@@ -0,0 +1,18 @@
+class TouchProjectsLastActivity < ActiveRecord::Migration
+ def up
+ Project.record_timestamps = false
+
+ Project.find_each do |project|
+ last_event = project.events.order(:created_at).last
+ if last_event and last_event.created_at > project.updated_at
+ project.update_attribute(:updated_at, last_event.created_at)
+ end
+ end
+
+ Project.record_timestamps = true
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20121219095402) do
+ActiveRecord::Schema.define(:version => 20121227190440) do
create_table "events", :force => true do |t|
t.string "target_type"
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb
--- a/spec/models/event_spec.rb
+++ b/spec/models/event_spec.rb
@@ -30,6 +30,17 @@ describe Event do
it { should respond_to(:commits) }
end
+ describe "Save" do
+ let(:event) { create(:event) }
+ let(:project) { create(:project) }
+
+ it "should touch associated project" do
+ event.stub(project: project)
+ event.project.should_receive(:touch)
+ event.save!
+ end
+ end
+
describe "Push event" do
before do
project = create(:project)
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -163,22 +163,18 @@ describe Project do
describe "last_activity methods" do
let(:project) { create(:project) }
- let(:last_event) { double(created_at: Time.now) }
+ let(:last_event) { create(:event) }
describe "last_activity" do
- it "should alias last_activity to last_event"do
+ it "should alias last_activity to last_event" do
project.stub(last_event: last_event)
project.last_activity.should == last_event
end
end
- describe 'last_activity_date' do
- it 'returns the creation date of the project\'s last event if present' do
- project.stub(last_event: last_event)
- project.last_activity_date.should == last_event.created_at
- end
-
- it 'returns the project\'s last update date if it has no events' do
+ describe "last_activity_date" do
+ it "should alias last_activity_date to updated_at" do
+ project.stub(updated_at: Time.now)
project.last_activity_date.should == project.updated_at
end
end
diff --git a/app/roles/authority.rb b/app/roles/authority.rb
--- a/app/roles/authority.rb
+++ b/app/roles/authority.rb
@@ -19,21 +19,25 @@ module Authority
end
def repository_readers
- keys = Key.joins({user: :users_projects}).
- where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER)
- keys.map(&:identifier) + deploy_keys.map(&:identifier)
+ repository_members[UsersProject::REPORTER]
end
def repository_writers
- keys = Key.joins({user: :users_projects}).
- where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER)
- keys.map(&:identifier)
+ repository_members[UsersProject::DEVELOPER]
end
def repository_masters
- keys = Key.joins({user: :users_projects}).
- where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER)
- keys.map(&:identifier)
+ repository_members[UsersProject::MASTER]
+ end
+
+ def repository_members
+ keys = Hash.new {|h,k| h[k] = [] }
+ UsersProject.select("keys.identifier, project_access").
+ joins(user: :keys).where(project_id: id).
+ each {|row| keys[row.project_access] << [row.identifier] }
+
+ keys[UsersProject::REPORTER] += deploy_keys.pluck(:identifier)
+ keys
end
def allow_read_for?(user)
diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml
--- a/app/views/events/_event.html.haml
+++ b/app/views/events/_event.html.haml
@@ -2,14 +2,14 @@
%div.event-item
%span.cgray.right
#{time_ago_in_words(event.created_at)} ago.
+ - cache event do
+ = image_tag gravatar_icon(event.author_email), class: "avatar s24"
- = image_tag gravatar_icon(event.author_email), class: "avatar s24"
-
- - if event.push?
- = render "events/event/push", event: event
- .clearfix
- - elsif event.note?
- = render "events/event/note", event: event
- - else
- = render "events/event/common", event: event
+ - if event.push?
+ = render "events/event/push", event: event
+ .clearfix
+ - elsif event.note?
+ = render "events/event/note", event: event
+ - else
+ = render "events/event/common", event: event

View file

@ -1,141 +0,0 @@
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 1fcadbfefbaf4d015d68ab7bc349f67becb717df..9d6a9449fcdcfbd138c7f8d4feb1e6b0e5a11926 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -14,6 +14,8 @@ class DashboardController < ApplicationController
@projects.personal(current_user)
when 'joined' then
@projects.joined(current_user)
+ when 'public' then
+ @projects.public_only
else
@projects
end
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 2d80c6720b79da74ae9e4d20d816b2433f3082a8..946ec1e1128da3f55ac9b7198b6c0fbdc1d4aba7 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -27,6 +27,8 @@ class Ability
elsif project.guest_access_for?(user)
rules << project_guest_rules
+ elsif project.public?
+ rules << project_public_rules
end
if project.namespace
@@ -104,6 +106,10 @@ class Ability
]
end
+ def project_public_rules
+ project_report_rules
+ end
+
def group_abilities user, group
rules = []
diff --git a/app/models/project.rb b/app/models/project.rb
index 3e5c912e0b47a22cc5489b9cbfb1dd53da5095e9..f10a6afde27ce4226677c0aa28aabd7497fb4a9d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -30,7 +30,7 @@ class Project < ActiveRecord::Base
class TransferError < StandardError; end
attr_accessible :name, :path, :description, :default_branch, :issues_enabled,
- :wall_enabled, :merge_requests_enabled, :wiki_enabled, as: [:default, :admin]
+ :wall_enabled, :merge_requests_enabled, :wiki_enabled, :private_flag, as: [:default, :admin]
attr_accessible :namespace_id, :owner_id, as: :admin
@@ -87,7 +87,7 @@ class Project < ActiveRecord::Base
class << self
def authorized_for user
projects = includes(:users_projects, :namespace)
- projects = projects.where("users_projects.user_id = :user_id or projects.owner_id = :user_id or namespaces.owner_id = :user_id", user_id: user.id)
+ projects = projects.where("users_projects.user_id = :user_id or projects.owner_id = :user_id or namespaces.owner_id = :user_id or projects.private_flag = false", user_id: user.id)
end
def active
diff --git a/app/roles/authority.rb b/app/roles/authority.rb
--- a/app/roles/authority.rb
+++ b/app/roles/authority.rb
@@ -20,2 +20,3 @@ module Authority
def repository_readers
+ return ['@all'] if public?
diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml
index 27c22872d501456bc4b7fd4bfd2a31c45b0a0a53..793f6a22ac3a96540c4f18e518d2197de51482bf 100644
--- a/app/views/admin/projects/_form.html.haml
+++ b/app/views/admin/projects/_form.html.haml
@@ -24,6 +24,10 @@
= f.label :default_branch, "Default Branch"
.input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;")
+ .clearfix
+ = f.label :private_flag, "Private"
+ .input= f.check_box :private_flag
+
%fieldset.adv_settings
%legend Features:
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 634b1836754a026cd26a32a30e4b0745629fc1e5..7bcedf6156e341ce7be48bee56cf1087ba63ccdb 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -102,6 +102,13 @@
%td
= check_box_tag :post_receive_file, 1, @project.has_post_receive_file?, disabled: true
+ %tr
+ %td
+ %b
+ Private:
+ %td
+ = check_box_tag :private_flag, 1, @project.private?, disabled: true
+
%br
%h5
Team
diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml
index cffafb5445c2b476018974c500f3e924dd8ee9c7..058e13f1741a52aedf7632052f745bf52ee00bbe 100644
--- a/app/views/dashboard/_projects.html.haml
+++ b/app/views/dashboard/_projects.html.haml
@@ -15,6 +15,8 @@
= link_to "Personal", dashboard_path(scope: 'personal')
= nav_tab :scope, 'joined' do
= link_to "Joined", dashboard_path(scope: 'joined')
+ = nav_tab :scope, 'public' do
+ = link_to "Public", dashboard_path(scope: 'public')
%ul.well-list
- projects.each do |project|
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 7044d1f20be1183c446de80268903f3018b7646e..2073b78d0606b688ffda69209130a4fb9f6d513c 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -23,6 +23,11 @@
= f.label :default_branch, "Default Branch"
.input= f.select(:default_branch, @project.heads.map(&:name), {}, style: "width:210px;")
+ .control-group
+ = f.label :private_flag, "Private"
+ .controls
+ = f.check_box :private_flag
+
%fieldset.features
%legend Features:
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 83a769760987b719e10892723c78ae797bed01d0..31ce053a7657d3d834a99d33faa5c6ebdfa03fbe 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -42,7 +42,7 @@ describe Project do
describe "Mass assignment" do
it { should_not allow_mass_assignment_of(:namespace_id) }
it { should_not allow_mass_assignment_of(:owner_id) }
- it { should_not allow_mass_assignment_of(:private_flag) }
+ it { should allow_mass_assignment_of(:private_flag) }
end
describe "Validation" do

View file

@ -1,105 +0,0 @@
--- a/Gemfile 2012-12-23 12:58:41.000000000 +0100
+++ b/Gemfile 2013-01-02 01:05:20.267204968 +0100
@@ -14,6 +14,9 @@
gem "mysql2", group: :mysql
gem "pg", group: :postgres
+# Cache store adapter for Memcached
+gem "dalli", group: :memcached
+
# Auth
gem "devise", "~> 2.1.0"
gem 'omniauth', "~> 1.1.1"
@@ -28,8 +31,12 @@
gem 'grack', git: "https://github.com/gitlabhq/grack.git", ref: 'ba46f3b0845c6a09d488ae6abdce6ede37e227e8'
gem 'grit_ext', git: "https://github.com/gitlabhq/grit_ext.git", ref: '8e6afc2da821354774aa4d1ee8a1aa2082f84a3e'
+# Patched to fix issues with compiling on Gentoo
+gem "charlock_holmes", git: "https://github.com/ISSIntel/charlock_holmes.git", ref: '994dcf37aba066250750866e13bb51e3d5e72898'
+
# Gitolite client (for work with gitolite-admin repo)
-gem "gitolite", '1.1.0'
+# Forked version with important performance patch (will be merged to upstream soon)
+gem "gitolite", git: "git://github.com/jirutka/gitolite.git", ref: '75d64ea15aa51557034fae44c578438f85249f1e'
# Syntax highlighter
gem "pygments.rb", git: "https://github.com/gitlabhq/pygments.rb.git", branch: "master"
--- a/Gemfile.lock 2012-12-23 12:58:41.000000000 +0100
+++ b/Gemfile.lock 2013-01-02 01:05:20.271204975 +0100
@@ -1,4 +1,14 @@
GIT
+ remote: git://github.com/jirutka/gitolite.git
+ revision: 75d64ea15aa51557034fae44c578438f85249f1e
+ ref: 75d64ea15aa51557034fae44c578438f85249f1e
+ specs:
+ gitolite (1.1.0)
+ gratr19 (~> 0.4.4.1)
+ grit (~> 2.5.0)
+ hashery (~> 1.5.0)
+
+GIT
remote: https://github.com/bmabey/database_cleaner.git
revision: f89c34300e114be99532f14c115b2799a3380ac6
ref: f89c34300e114be99532f14c115b2799a3380ac6
@@ -6,6 +16,13 @@
database_cleaner (0.9.1)
GIT
+ remote: https://github.com/ISSIntel/charlock_holmes.git
+ revision: 994dcf37aba066250750866e13bb51e3d5e72898
+ ref: 994dcf37aba066250750866e13bb51e3d5e72898
+ specs:
+ charlock_holmes (0.6.9)
+
+GIT
remote: https://github.com/ctran/annotate_models.git
revision: be4e26825b521f0b2d86b181e2dff89901aa9b1e
specs:
@@ -129,7 +146,6 @@
carrierwave (0.7.1)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
- charlock_holmes (0.6.9)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
chosen-rails (0.9.8)
@@ -147,6 +163,7 @@
colorize (0.5.8)
crack (0.3.1)
daemons (1.1.9)
+ dalli (2.6.0)
devise (2.1.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
@@ -190,10 +207,6 @@
pygments.rb (>= 0.2.13)
github-markup (0.7.4)
gitlab_meta (4.0)
- gitolite (1.1.0)
- gratr19 (~> 0.4.4.1)
- grit (~> 2.5.0)
- hashery (~> 1.5.0)
grape (0.2.2)
activesupport
hashie (~> 1.2)
@@ -461,9 +474,11 @@
bootstrap-sass (= 2.2.1.1)
capybara
carrierwave (~> 0.7.1)
+ charlock_holmes!
chosen-rails (= 0.9.8)
coffee-rails (~> 3.2.2)
colored
+ dalli
database_cleaner!
devise (~> 2.1.0)
draper (~> 0.18.0)
@@ -477,7 +492,7 @@
github-linguist (~> 2.3.4)
github-markup (~> 0.7.4)
gitlab_meta (= 4.0)
- gitolite (= 1.1.0)
+ gitolite!
grack!
grape (~> 0.2.1)
grit!

View file

@ -1,82 +0,0 @@
--- a/Gemfile 2013-09-10 00:16:33.951426871 +0200
+++ b/Gemfile 2013-09-10 01:02:00.745109650 +0200
@@ -120,11 +120,14 @@
# Sanitize user input
gem "sanitize"
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
group :assets do
gem "sass-rails"
gem "coffee-rails"
gem "uglifier"
- gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
--- a/Gemfile.lock 2013-09-10 00:16:40.079441559 +0200
+++ b/Gemfile.lock 2013-09-10 01:03:51.837297421 +0200
@@ -1,4 +1,11 @@
GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
+GIT
remote: https://github.com/ctran/annotate_models.git
revision: 18a4e2eb77c8f3ef695b563e4a7ca45dfede819b
specs:
@@ -69,7 +76,6 @@
activesupport (>= 3.2.0)
celluloid (0.14.1)
timers (>= 1.0.0)
- charlock_holmes (0.6.9.4)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
chosen-rails (1.0.0)
@@ -271,7 +277,6 @@
addressable (~> 2.3)
letter_opener (1.1.1)
launchy (~> 2.2)
- libv8 (3.11.8.17)
listen (1.2.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
@@ -407,7 +412,6 @@
redis-store (~> 1.1.0)
redis-store (1.1.3)
redis (>= 2.2.0)
- ref (1.0.5)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.13.0)
@@ -493,9 +497,6 @@
stringex (1.5.1)
temple (0.6.5)
test_after_commit (0.2.0)
- therubyracer (0.11.4)
- libv8 (~> 3.11.8.12)
- ref
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
@@ -556,6 +557,7 @@
bootstrap-sass
capybara
carrierwave
+ charlock_holmes!
chosen-rails (= 1.0.0)
coffee-rails
colored
@@ -634,7 +636,6 @@
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,32 +0,0 @@
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index b4be46d..2120f5a 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Gitlab
module Regex
extend self
@@ -7,7 +9,7 @@ module Gitlab
end
def project_name_regex
- /\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/
+ /\A\p{Word}[\p{Word}\-:\. ]*\z/
end
def name_regex
diff --git a/app/models/project.rb b/app/models/project.rb
index d8fa6cb..c4e5427 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -73,7 +73,7 @@ class Project < ActiveRecord::Base
validates :description, length: { within: 0..2000 }
validates :name, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.project_name_regex,
- message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter or digit should be first" }
+ message: "only letters, digits, spaces & '_' '-' '.' ':' allowed. Letter or digit should be first" }
validates :path, presence: true, length: { within: 0..255 },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.path_regex,

View file

@ -1,207 +0,0 @@
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 59a4d1f..e48dfe7 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -103,6 +103,10 @@ production: &base
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
allow_username_or_email_login: true
+ mapping:
+ name: 'cn'
+ username: 'uid'
+ email: 'mail'
## OmniAuth settings
omniauth:
@@ -131,7 +135,14 @@ production: &base
# - { name: 'github', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET' }
-
+ ## User Mapping Procs
+ # These procs allow for custom mapping of user information from LDAP / Omniauth
+ # onto your user model.
+ #
+ # user_mapping:
+ # name: ->(auth) { auth.info.name.to_s }
+ # username: ->(auth) { auth.info.email.to_s.downcase.match(/^[^@]*/)[0] }
+ # email: ->(auth) { auth.info.email.to_s.downcase }
#
# 3. Advanced settings
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index e0207c6..c079cc4 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -36,6 +36,7 @@ end
# Default settings
Settings['ldap'] ||= Settingslogic.new({})
+Settings.ldap['mapping'] ||= Settingslogic.new({})
Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
Settings.ldap['allow_username_or_email_login'] = false if Settings.ldap['allow_username_or_email_login'].nil?
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index de70c5c..bea8191 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -33,13 +33,14 @@ module Gitlab
def create_from_omniauth(auth, ldap = false)
provider = auth.provider
uid = auth.info.uid || auth.uid
- uid = uid.to_s.force_encoding("utf-8")
- name = auth.info.name.to_s.force_encoding("utf-8")
- email = auth.info.email.to_s.downcase unless auth.info.email.nil?
+ uid = uid.to_s.force_encoding('utf-8')
+ name = extract(:name, auth, ldap).force_encoding('utf-8')
+ username = extract(:username, auth, ldap).force_encoding('utf-8')
+ email = extract(:email, auth, ldap).force_encoding('utf-8')
ldap_prefix = ldap ? '(LDAP) ' : ''
raise OmniAuth::Error, "#{ldap_prefix}#{provider} does not provide an email"\
- " address" if auth.info.email.blank?
+ " address" if email.blank?
log.info "#{ldap_prefix}Creating user from #{provider} login"\
" {uid => #{uid}, name => #{name}, email => #{email}}"
@@ -48,7 +49,7 @@ module Gitlab
extern_uid: uid,
provider: provider,
name: name,
- username: email.match(/^[^@]*/)[0],
+ username: username,
email: email,
password: password,
password_confirmation: password,
@@ -101,5 +102,31 @@ module Gitlab
def ldap_conf
@ldap_conf ||= Gitlab.config.ldap
end
+
+ private
+
+ def extract(field_name, auth, ldap = false)
+ @ldap_mapper ||= Gitlab.config.ldap.mapping rescue Hash.new
+ @mapper ||= begin
+ defaults = {
+ name: ->(auth) { auth.info.name.to_s },
+ username: ->(auth) { auth.info.email.to_s.downcase.match(/^[^@]*/)[0] },
+ email: ->(auth) { auth.info.email.to_s.downcase },
+ }
+ extras = Gitlab.config.user_mapping rescue Hash.new
+ defaults.merge(extras)
+ end
+
+ if ldap && !@ldap_mapper[field_name].nil?
+ begin
+ ldap_attr = @ldap_mapper[field_name].to_sym
+ Array(auth.extra.raw_info[ldap_attr])[0]
+ rescue
+ raise "(LDAP) Failed to get '#{@ldap_mapper[field_name]}' for #{field_name} for #{auth.info.uid}"
+ end
+ else
+ @mapper[field_name].call(auth)
+ end
+ end
end
end
diff --git a/spec/lib/auth_spec.rb b/spec/lib/auth_spec.rb
index 903d276..cf9e7b7 100644
--- a/spec/lib/auth_spec.rb
+++ b/spec/lib/auth_spec.rb
@@ -4,7 +4,7 @@ describe Gitlab::Auth do
let(:gl_auth) { Gitlab::Auth.new }
before do
- Gitlab.config.stub(omniauth: {})
+ Gitlab.config.stub(omniauth: {}, ldap: {})
@info = mock(
uid: '12djsak321',
@@ -74,9 +74,22 @@ describe Gitlab::Auth do
end
describe :create_from_omniauth do
+ before do
+ @raw_info = {
+ cn: 'John Black',
+ mail: [ 'john.black@email.com' ],
+ nickname: 'jonny'
+ }
+
+ @ldap_auth = mock(
+ info: @info,
+ extra: mock(raw_info: @raw_info),
+ provider: 'ldap'
+ )
+ end
+
it "should create user from LDAP" do
- @auth = mock(info: @info, provider: 'ldap')
- user = gl_auth.create_from_omniauth(@auth, true)
+ user = gl_auth.create_from_omniauth(@ldap_auth, true)
user.should be_valid
user.extern_uid.should == @info.uid
@@ -92,9 +105,59 @@ describe Gitlab::Auth do
user.provider.should == 'twitter'
end
+ it "should still import without extra mapping" do
+ Gitlab.config.stub(omniauth: {})
+ user = gl_auth.create_from_omniauth(@ldap_auth, true)
+
+ user.should be_valid
+ user.extern_uid.should == @info.uid
+ user.provider.should == 'ldap'
+ end
+
+ it "should have user details from procs" do
+ Gitlab.config.stub(omniauth: {}, user_mapping: {})
+ Gitlab.config.user_mapping[:name] = ->(auth) { 'TestName' }
+ Gitlab.config.user_mapping[:email] = ->(auth) { 'email@somewhere.com' }
+ Gitlab.config.user_mapping[:username] = ->(auth) { 'TestUsername' }
+
+ user = gl_auth.create_from_omniauth(@ldap_auth, true)
+ user.should be_valid
+ user.extern_uid.should == @info.uid
+ user.name.should == 'TestName'
+ user.email.should == 'email@somewhere.com'
+ user.username.should == 'TestUsername'
+ end
+
+ it "should modify value using proc" do
+ Gitlab.config.stub(omniauth: {}, user_mapping: {})
+ Gitlab.config.user_mapping[:username] = ->(auth) { auth.info.email.to_s.downcase.split('@').first }
+
+ user = gl_auth.create_from_omniauth(@ldap_auth, true)
+ user.should be_valid
+ user.extern_uid.should == @info.uid
+ user.username.should == 'john'
+ end
+
+ it "should be able to use raw ldap information through simple ldap mapping" do
+ Gitlab.config.ldap.stub(mapping: { name: 'cn', email: 'mail' })
+
+ user = gl_auth.create_from_omniauth(@ldap_auth, true)
+ user.should be_valid
+ user.extern_uid.should == @info.uid
+ user.name.should == 'John Black'
+ user.email.should == 'john.black@email.com'
+ end
+
+ it "should raise an error if an invalid field is in ldap mapping" do
+ Gitlab.config.ldap.stub(mapping: { name: 'invalid' })
+
+ expect {
+ gl_auth.create_from_omniauth(@ldap_auth, true)
+ }.to raise_error
+ end
+
it "should apply defaults to user" do
- @auth = mock(info: @info, provider: 'ldap')
- user = gl_auth.create_from_omniauth(@auth, true)
+ user = gl_auth.create_from_omniauth(@ldap_auth, true)
user.should be_valid
user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit

View file

@ -1,39 +0,0 @@
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index aec4c57..eec1480 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -16,7 +16,7 @@ class Notify < ActionMailer::Base
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
default from: Gitlab.config.gitlab.email_from
- default reply_to: "noreply@#{Gitlab.config.gitlab.host}"
+ default reply_to: Gitlab.config.gitlab.email_reply_to
# Just send email with 3 seconds delay
def self.delay
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index c63e8cb..776d930 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -37,6 +37,9 @@ production: &base
# Email address used in the "From" field in mails sent by GitLab
email_from: gitlab@localhost
+ # Email address used in the "Reply-To" field in mails send by GitLab (default: no-reply@<host>)
+ email_reply_to: no-reply@localhost
+
# Email address of your support contact (default: same as email_from)
support_email: support@localhost
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index ea391ca..580d65b 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -82,6 +82,7 @@ Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_reply_to'] ||= "no-reply@#{Settings.gitlab.host}"
Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'

View file

@ -1,84 +0,0 @@
--- a/Gemfile
+++ b/Gemfile
@@ -137,13 +137,16 @@
# Sanitize user input
gem "sanitize"
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
gem "sass-rails"
gem "coffee-rails"
gem "uglifier"
-gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,4 +1,11 @@
GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
+GIT
remote: https://github.com/gitlabhq/markup.git
revision: 61ade389c1e1c159359338f570d18464a44ddbc4
ref: 61ade389c1e1c159359338f570d18464a44ddbc4
@@ -70,7 +77,6 @@
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.2.2)
code_analyzer (0.4.3)
sexp_processor
@@ -267,7 +273,6 @@
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.3)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -401,7 +406,6 @@
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
mime-types (>= 1.16)
@@ -488,9 +492,6 @@
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -561,6 +562,7 @@
bootstrap-sass (~> 3.0)
capybara
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -644,7 +646,6 @@
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,20 +0,0 @@
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb
index 59f0fa6..8afd64f 100644
--- a/lib/gitlab/ldap/user.rb
+++ b/lib/gitlab/ldap/user.rb
@@ -83,8 +83,14 @@ module Gitlab
private
+ # Override superclass method to use our case-insensitive find_by_uid
+ def find_by_uid_and_provider
+ find_by_uid(uid)
+ end
+
def find_by_uid(uid)
- model.where(provider: provider, extern_uid: uid).last
+ # LDAP distinguished name is case-insensitive
+ model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last
end
def provider

View file

@ -1,28 +0,0 @@
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Gitlab
module Regex
extend self
@@ -7,7 +9,7 @@
end
def project_name_regex
- /\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/
+ /\A\p{Word}[\p{Word}\-:\. ]*\z/
end
def name_regex
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -85,7 +85,7 @@
validates :description, length: { maximum: 2000 }, allow_blank: true
validates :name, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.project_name_regex,
- message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter or digit should be first" }
+ message: "only letters, digits, spaces & '_' '-' '.' ':' allowed. Letter or digit should be first" }
validates :path, presence: true, length: { within: 0..255 },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.path_regex,

View file

@ -1,99 +0,0 @@
diff --git a/Gemfile b/Gemfile
index fe8e54e..b33a74e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -36,7 +36,8 @@ gem "gitlab_git", "~> 4.0.0"
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
# LDAP Auth
-gem 'gitlab_omniauth-ldap', '1.0.3', require: "omniauth-ldap"
+# Patched for attributes mapping customization
+gem 'gitlab_omniauth-ldap', '1.0.4', require: 'omniauth-ldap', git: 'https://github.com/jirutka/omniauth-ldap.git', ref: 'b55852bfc9b46ecf790a2c5526386702350eab89'
# Syntax highlighter
gem "gitlab-pygments.rb", '~> 0.5.4', require: 'pygments.rb'
diff --git a/Gemfile.lock b/Gemfile.lock
index d0f185b..46543e3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,6 +6,17 @@ GIT
charlock_holmes (0.6.9.4)
GIT
+ remote: https://github.com/jirutka/omniauth-ldap.git
+ revision: b55852bfc9b46ecf790a2c5526386702350eab89
+ ref: b55852bfc9b46ecf790a2c5526386702350eab89
+ specs:
+ gitlab_omniauth-ldap (1.0.4)
+ net-ldap (~> 0.3.1)
+ omniauth (~> 1.0)
+ pyu-ruby-sasl (~> 0.0.3.1)
+ rubyntlm (~> 0.1.1)
+
+GIT
remote: https://github.com/gitlabhq/markup.git
revision: 61ade389c1e1c159359338f570d18464a44ddbc4
ref: 61ade389c1e1c159359338f570d18464a44ddbc4
@@ -193,11 +204,6 @@ GEM
gitlab-linguist (~> 2.9.5)
gitlab-pygments.rb (~> 0.5.4)
gitlab_meta (6.0)
- gitlab_omniauth-ldap (1.0.3)
- net-ldap (~> 0.3.1)
- omniauth (~> 1.0)
- pyu-ruby-sasl (~> 0.0.3.1)
- rubyntlm (~> 0.1.1)
gon (5.0.1)
actionpack (>= 2.3.0)
json
@@ -587,7 +593,7 @@ DEPENDENCIES
gitlab-pygments.rb (~> 0.5.4)
gitlab_git (~> 4.0.0)
gitlab_meta (= 6.0)
- gitlab_omniauth-ldap (= 1.0.3)
+ gitlab_omniauth-ldap (= 1.0.4)!
gon (~> 5.0.0)
grape (~> 0.6.1)
grape-entity (~> 0.3.0)
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 776d930..a5b96e4 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -130,6 +130,10 @@ production: &base
method: 'ssl' # "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
+ mapping:
+ username: 'uid'
+ name: 'cn'
+ email: 'mail'
# If allow_username_or_email_login is enabled, GitLab will ignore everything
# after the first '@' in the LDAP username submitted by the user on login.
#
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 2539097..739de8e 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -223,6 +223,7 @@ Devise.setup do |config|
method: Gitlab.config.ldap['method'],
bind_dn: Gitlab.config.ldap['bind_dn'],
password: Gitlab.config.ldap['password'],
+ mapping: Gitlab.config.ldap['mapping'],
name_proc: email_stripping_proc
end
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb
index 8afd64f..f1f1bea 100644
--- a/lib/gitlab/ldap/user.rb
+++ b/lib/gitlab/ldap/user.rb
@@ -97,6 +97,10 @@ module Gitlab
'ldap'
end
+ def username
+ (auth.info.username || auth.info.nickname).to_s.force_encoding('utf-8')
+ end
+
def raise_error(message)
raise OmniAuth::Error, "(LDAP) " + message
end

View file

@ -1,33 +0,0 @@
--- app/mailers/notify.rb.orig 2014-05-18 18:48:35.150000000 +0200
+++ app/mailers/notify.rb 2014-05-18 18:49:20.480000000 +0200
@@ -16,7 +16,7 @@
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
default from: Gitlab.config.gitlab.email_from
- default reply_to: "noreply@#{Gitlab.config.gitlab.host}"
+ default reply_to: Gitlab.config.gitlab.email_reply_to
# Just send email with 3 seconds delay
def self.delay
--- config/gitlab.yml.example.orig 2014-05-18 18:49:50.880000000 +0200
+++ config/gitlab.yml.example 2014-05-18 18:50:28.350000000 +0200
@@ -37,6 +37,9 @@
# Email address used in the "From" field in mails sent by GitLab
email_from: gitlab@localhost
+ # Email address used in the "Reply-To" field in mails send by GitLab (default: no-reply@<host>)
+ email_reply_to: no-reply@localhost
+
# Email address of your support contact (default: same as email_from)
support_email: support@localhost
--- config/initializers/1_settings.rb.orig 2014-05-18 18:50:52.300000000 +0200
+++ config/initializers/1_settings.rb 2014-05-18 18:51:29.860000000 +0200
@@ -78,6 +78,7 @@
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_reply_to'] ||= "no-reply@#{Settings.gitlab.host}"
Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'

View file

@ -1,89 +0,0 @@
--- Gemfile.orig 2014-05-18 18:41:03.150000000 +0200
+++ Gemfile 2014-05-18 18:41:42.840000000 +0200
@@ -35,7 +35,8 @@
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
# LDAP Auth
-gem 'gitlab_omniauth-ldap', '1.0.4', require: "omniauth-ldap"
+# Patched for attributes mapping customization
+gem 'gitlab_omniauth-ldap', '1.0.4', require: 'omniauth-ldap', git: 'https://github.com/jirutka/omniauth-ldap.git', ref: 'b55852bfc9b46ecf790a2c5526386702350eab89'
# Git Wiki
gem "gitlab-gollum-lib", "~> 1.1.0", require: 'gollum-lib'
--- Gemfile.lock.orig 2014-05-18 18:42:08.100000000 +0200
+++ Gemfile.lock 2014-05-18 18:43:35.330000000 +0200
@@ -5,6 +5,17 @@
specs:
charlock_holmes (0.6.9.4)
+ GIT
+ remote: https://github.com/jirutka/omniauth-ldap.git
+ revision: b55852bfc9b46ecf790a2c5526386702350eab89
+ ref: b55852bfc9b46ecf790a2c5526386702350eab89
+ specs:
+ gitlab_omniauth-ldap (1.0.4)
+ net-ldap (~> 0.3.1)
+ omniauth (~> 1.0)
+ pyu-ruby-sasl (~> 0.0.3.1)
+ rubyntlm (~> 0.1.1)
+
GIT
remote: https://github.com/gitlabhq/markup.git
revision: 61ade389c1e1c159359338f570d18464a44ddbc4
@@ -190,11 +201,6 @@
gitlab-linguist (~> 3.0.0)
rugged (~> 0.19.0)
gitlab_meta (6.0)
- gitlab_omniauth-ldap (1.0.4)
- net-ldap (~> 0.3.1)
- omniauth (~> 1.0)
- pyu-ruby-sasl (~> 0.0.3.1)
- rubyntlm (~> 0.1.1)
gon (5.0.1)
actionpack (>= 2.3.0)
json
@@ -588,7 +594,7 @@
gitlab-linguist (~> 3.0.0)
gitlab_git (~> 5.4.0)
gitlab_meta (= 6.0)
- gitlab_omniauth-ldap (= 1.0.4)
+ gitlab_omniauth-ldap (= 1.0.4)!
gon (~> 5.0.0)
grape (~> 0.6.1)
grape-entity (~> 0.3.0)
--- config/gitlab.yml.example.orig 2014-05-18 18:44:01.500000000 +0200
+++ config/gitlab.yml.example 2014-05-18 18:44:44.250000000 +0200
@@ -127,6 +127,10 @@
method: 'ssl' # "tls" or "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
+ mapping:
+ username: 'uid'
+ name: 'cn'
+ email: 'mail'
# If allow_username_or_email_login is enabled, GitLab will ignore everything
# after the first '@' in the LDAP username submitted by the user on login.
#
--- config/initializers/devise.rb.orig 2014-05-18 18:45:35.080000000 +0200
+++ config/initializers/devise.rb 2014-05-18 18:46:06.530000000 +0200
@@ -223,6 +223,7 @@
method: Gitlab.config.ldap['method'],
bind_dn: Gitlab.config.ldap['bind_dn'],
password: Gitlab.config.ldap['password'],
+ mapping: Gitlab.config.ldap['mapping'],
name_proc: email_stripping_proc
end
--- lib/gitlab/ldap/user.rb.orig 2014-05-18 18:46:48.820000000 +0200
+++ lib/gitlab/ldap/user.rb 2014-05-18 18:47:22.240000000 +0200
@@ -97,6 +97,10 @@
'ldap'
end
+ def username
+ (auth.info.username || auth.info.nickname).to_s.force_encoding('utf-8')
+ end
+
def raise_error(message)
raise OmniAuth::Error, "(LDAP) " + message
end

View file

@ -1,33 +0,0 @@
--- app/mailers/notify.rb.orig 2014-05-19 12:22:50.840000000 +0200
+++ app/mailers/notify.rb 2014-05-19 12:23:35.660000000 +0200
@@ -16,7 +16,7 @@
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
default from: Proc.new { default_sender_address.format }
- default reply_to: "noreply@#{Gitlab.config.gitlab.host}"
+ default reply_to: Gitlab.config.gitlab.email_reply_to
# Just send email with 2 seconds delay
def self.delay
--- config/gitlab.yml.example.orig 2014-05-19 12:23:45.640000000 +0200
+++ config/gitlab.yml.example 2014-05-19 12:24:07.340000000 +0200
@@ -37,6 +37,9 @@
# Email address used in the "From" field in mails sent by GitLab
email_from: gitlab@localhost
+ # Email address used in the "Reply-To" field in mails send by GitLab (default: no-reply@<host>)
+ email_reply_to: no-reply@localhost
+
# Email address of your support contact (default: same as email_from)
support_email: support@localhost
--- config/initializers/1_settings.rb.orig 2014-05-19 12:24:14.520000000 +0200
+++ config/initializers/1_settings.rb 2014-05-19 12:24:44.010000000 +0200
@@ -78,6 +78,7 @@
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_reply_to'] ||= "no-reply@#{Settings.gitlab.host}"
Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'

View file

@ -1,27 +0,0 @@
--- Gemfile.lock.orig 2014-05-23 17:42:33.510000000 +0200
+++ Gemfile.lock 2014-05-23 17:45:31.320000000 +0200
@@ -22,15 +22,15 @@
multi_json (>= 1.3.2)
GIT
- remote: https://github.com/jirutka/omniauth-ldap.git
- revision: b55852bfc9b46ecf790a2c5526386702350eab89
- ref: b55852bfc9b46ecf790a2c5526386702350eab89
- specs:
- gitlab_omniauth-ldap (1.0.4)
- net-ldap (~> 0.3.1)
- omniauth (~> 1.0)
- pyu-ruby-sasl (~> 0.0.3.1)
- rubyntlm (~> 0.1.1)
+ remote: https://github.com/jirutka/omniauth-ldap.git
+ revision: b55852bfc9b46ecf790a2c5526386702350eab89
+ ref: b55852bfc9b46ecf790a2c5526386702350eab89
+ specs:
+ gitlab_omniauth-ldap (1.0.4)
+ net-ldap (~> 0.3.1)
+ omniauth (~> 1.0)
+ pyu-ruby-sasl (~> 0.0.3.1)
+ rubyntlm (~> 0.1.1)
GEM
remote: https://rubygems.org/

View file

@ -1,85 +0,0 @@
--- Gemfile.orig 2014-05-18 18:05:50.320000000 +0200
+++ Gemfile 2014-05-18 18:06:59.040000000 +0200
@@ -133,6 +133,10 @@
# Sanitize user input
gem "sanitize"
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
@@ -142,7 +146,6 @@
gem "sass-rails"
gem "coffee-rails"
gem "uglifier"
-gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
--- Gemfile.lock.orig 2014-05-18 18:07:31.730000000 +0200
+++ Gemfile.lock 2014-05-18 18:25:30.580000000 +0200
@@ -1,4 +1,11 @@
GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
+GIT
remote: https://github.com/gitlabhq/markup.git
revision: 61ade389c1e1c159359338f570d18464a44ddbc4
ref: 61ade389c1e1c159359338f570d18464a44ddbc4
@@ -71,7 +78,6 @@
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.2.2)
code_analyzer (0.4.3)
sexp_processor
@@ -264,7 +270,6 @@
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.3)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -398,7 +403,6 @@
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
mime-types (>= 1.16)
@@ -491,9 +495,6 @@
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -563,6 +564,7 @@
bootstrap-sass (~> 3.0)
capybara
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -648,7 +650,6 @@
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,28 +0,0 @@
--- lib/gitlab/regex.rb.orig 2014-05-19 12:17:42.210000000 +0200
+++ lib/gitlab/regex.rb 2014-05-19 12:18:56.920000000 +0200
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Gitlab
module Regex
extend self
@@ -7,7 +9,7 @@
end
def project_name_regex
- /\A[a-zA-Z0-9_][a-zA-Z0-9_\-\. ]*\z/
+ /\A[\p{Word}_][\p{Word}_\-:\. ]*\z/
end
def name_regex
--- app/models/project.rb.orig 2014-05-19 12:19:44.700000000 +0200
+++ app/models/project.rb 2014-05-19 12:20:16.050000000 +0200
@@ -84,7 +84,7 @@
validates :description, length: { maximum: 2000 }, allow_blank: true
validates :name, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.project_name_regex,
- message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter or digit should be first" }
+ message: "only letters, digits, spaces & '_' '-' '.' ':' allowed. Letter or digit should be first" }
validates :path, presence: true, length: { within: 0..255 },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.path_regex,

View file

@ -1,89 +0,0 @@
--- Gemfile.orig 2014-05-18 18:41:03.150000000 +0200
+++ Gemfile 2014-05-18 18:41:42.840000000 +0200
@@ -35,7 +35,8 @@
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
# LDAP Auth
-gem 'gitlab_omniauth-ldap', '1.0.4', require: "omniauth-ldap"
+# Patched for attributes mapping customization
+gem 'gitlab_omniauth-ldap', '1.0.4', require: 'omniauth-ldap', git: 'https://github.com/jirutka/omniauth-ldap.git', ref: 'b55852bfc9b46ecf790a2c5526386702350eab89'
# Git Wiki
gem "gitlab-gollum-lib", "~> 1.1.0", require: 'gollum-lib'
--- Gemfile.lock.orig 2014-05-23 17:37:14.650000000 +0200
+++ Gemfile.lock 2014-05-23 17:38:48.570000000 +0200
@@ -21,6 +21,17 @@
activesupport
multi_json (>= 1.3.2)
+GIT
+ remote: https://github.com/jirutka/omniauth-ldap.git
+ revision: b55852bfc9b46ecf790a2c5526386702350eab89
+ ref: b55852bfc9b46ecf790a2c5526386702350eab89
+ specs:
+ gitlab_omniauth-ldap (1.0.4)
+ net-ldap (~> 0.3.1)
+ omniauth (~> 1.0)
+ pyu-ruby-sasl (~> 0.0.3.1)
+ rubyntlm (~> 0.1.1)
+
GEM
remote: https://rubygems.org/
specs:
@@ -190,11 +201,6 @@
gitlab-linguist (~> 3.0.0)
rugged (~> 0.19.0)
gitlab_meta (6.0)
- gitlab_omniauth-ldap (1.0.4)
- net-ldap (~> 0.3.1)
- omniauth (~> 1.0)
- pyu-ruby-sasl (~> 0.0.3.1)
- rubyntlm (~> 0.1.1)
gon (5.0.1)
actionpack (>= 2.3.0)
json
@@ -588,7 +594,7 @@
gitlab-linguist (~> 3.0.0)
gitlab_git (~> 5.4.0)
gitlab_meta (= 6.0)
- gitlab_omniauth-ldap (= 1.0.4)
+ gitlab_omniauth-ldap (= 1.0.4)!
gon (~> 5.0.0)
grape (~> 0.6.1)
grape-entity (~> 0.3.0)
--- config/gitlab.yml.example.orig 2014-05-18 18:44:01.500000000 +0200
+++ config/gitlab.yml.example 2014-05-18 18:44:44.250000000 +0200
@@ -127,6 +127,10 @@
method: 'ssl' # "tls" or "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
+ mapping:
+ username: 'uid'
+ name: 'cn'
+ email: 'mail'
# If allow_username_or_email_login is enabled, GitLab will ignore everything
# after the first '@' in the LDAP username submitted by the user on login.
#
--- config/initializers/devise.rb.orig 2014-05-18 18:45:35.080000000 +0200
+++ config/initializers/devise.rb 2014-05-18 18:46:06.530000000 +0200
@@ -223,6 +223,7 @@
method: Gitlab.config.ldap['method'],
bind_dn: Gitlab.config.ldap['bind_dn'],
password: Gitlab.config.ldap['password'],
+ mapping: Gitlab.config.ldap['mapping'],
name_proc: email_stripping_proc
end
--- lib/gitlab/ldap/user.rb.orig 2014-05-18 18:46:48.820000000 +0200
+++ lib/gitlab/ldap/user.rb 2014-05-18 18:47:22.240000000 +0200
@@ -97,6 +97,10 @@
'ldap'
end
+ def username
+ (auth.info.username || auth.info.nickname).to_s.force_encoding('utf-8')
+ end
+
def raise_error(message)
raise OmniAuth::Error, "(LDAP) " + message
end

View file

@ -1,11 +0,0 @@
--- Gemfile.lock.orig 2014-07-20 23:01:25.111641645 +0200
+++ Gemfile.lock 2014-07-20 23:00:43.898976942 +0200
@@ -5,7 +5,7 @@
specs:
charlock_holmes (0.6.9.4)
- GIT
+GIT
remote: https://github.com/jirutka/omniauth-ldap.git
revision: b55852bfc9b46ecf790a2c5526386702350eab89
ref: b55852bfc9b46ecf790a2c5526386702350eab89

View file

@ -1,84 +0,0 @@
--- Gemfile.orig 2014-05-19 13:04:44.700000000 +0200
+++ Gemfile 2014-05-19 13:05:44.400000000 +0200
@@ -142,6 +142,10 @@
# Sanitize user input
gem "sanitize", '~> 2.0'
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
@@ -151,7 +155,6 @@
gem "sass-rails", '~> 4.0.2'
gem "coffee-rails"
gem "uglifier"
-gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
--- Gemfile.lock.orig 2014-05-19 13:06:11.660000000 +0200
+++ Gemfile.lock 2014-05-19 13:08:38.440000000 +0200
@@ -1,3 +1,10 @@
+GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
GEM
remote: https://rubygems.org/
specs:
@@ -60,7 +67,6 @@
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.2.2)
code_analyzer (0.4.3)
sexp_processor
@@ -267,7 +273,6 @@
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.3)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -402,7 +407,6 @@
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
mime-types (>= 1.16)
@@ -496,9 +500,6 @@
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -567,6 +568,7 @@
bootstrap-sass (~> 3.0)
capybara
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -654,7 +656,6 @@
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,76 +0,0 @@
--- Gemfile.orig 2014-05-19 13:15:25.830000000 +0200
+++ Gemfile 2014-05-19 13:16:01.020000000 +0200
@@ -36,7 +36,8 @@
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
# LDAP Auth
-gem 'gitlab_omniauth-ldap', '1.0.4', require: "omniauth-ldap"
+# Patched for attributes mapping customization
+gem 'gitlab_omniauth-ldap', '1.0.4', require: 'omniauth-ldap', git: 'https://github.com/jirutka/omniauth-ldap.git', ref: 'b55852bfc9b46ecf790a2c5526386702350eab89'
# Git Wiki
gem 'gollum-lib', '~> 3.0.0'
--- Gemfile.lock.orig 2014-05-19 13:16:34.160000000 +0200
+++ Gemfile.lock 2014-05-19 13:17:44.500000000 +0200
@@ -5,6 +5,17 @@
specs:
charlock_holmes (0.6.9.4)
+ GIT
+ remote: https://github.com/jirutka/omniauth-ldap.git
+ revision: b55852bfc9b46ecf790a2c5526386702350eab89
+ ref: b55852bfc9b46ecf790a2c5526386702350eab89
+ specs:
+ gitlab_omniauth-ldap (1.0.4)
+ net-ldap (~> 0.3.1)
+ omniauth (~> 1.0)
+ pyu-ruby-sasl (~> 0.0.3.1)
+ rubyntlm (~> 0.1.1)
+
GEM
remote: https://rubygems.org/
specs:
@@ -186,11 +197,6 @@
gitlab-linguist (~> 3.0)
rugged (~> 0.19.0)
gitlab_meta (6.0)
- gitlab_omniauth-ldap (1.0.4)
- net-ldap (~> 0.3.1)
- omniauth (~> 1.0)
- pyu-ruby-sasl (~> 0.0.3.1)
- rubyntlm (~> 0.1.1)
gollum-lib (3.0.0)
github-markup (~> 1.1.0)
gitlab-grit (~> 2.6.5)
@@ -593,7 +599,7 @@
gitlab_emoji (~> 0.0.1.1)
gitlab_git (~> 5.8)
gitlab_meta (= 6.0)
- gitlab_omniauth-ldap (= 1.0.4)
+ gitlab_omniauth-ldap (= 1.0.4)!
gollum-lib (~> 3.0.0)
gon (~> 5.0.0)
grape (~> 0.6.1)
--- config/gitlab.yml.example.orig 2014-05-19 13:18:03.400000000 +0200
+++ config/gitlab.yml.example 2014-05-19 13:18:45.740000000 +0200
@@ -135,6 +135,10 @@
method: 'ssl' # "tls" or "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
+ mapping:
+ username: 'uid'
+ name: 'cn'
+ email: 'mail'
# If allow_username_or_email_login is enabled, GitLab will ignore everything
# after the first '@' in the LDAP username submitted by the user on login.
#
--- config/initializers/devise.rb.orig 2014-05-19 13:19:23.120000000 +0200
+++ config/initializers/devise.rb 2014-05-19 13:19:43.170000000 +0200
@@ -223,6 +223,7 @@
method: Gitlab.config.ldap['method'],
bind_dn: Gitlab.config.ldap['bind_dn'],
password: Gitlab.config.ldap['password'],
+ mapping: Gitlab.config.ldap['mapping'],
name_proc: email_stripping_proc
end

View file

@ -1,39 +0,0 @@
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 84a0da0..9cb359e 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -16,7 +16,7 @@ class Notify < ActionMailer::Base
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
default from: Proc.new { default_sender_address.format }
- default reply_to: "noreply@#{Gitlab.config.gitlab.host}"
+ default reply_to: Gitlab.config.gitlab.email_reply_to
# Just send email with 2 seconds delay
def self.delay
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index b2b8f56..173924c 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -35,6 +35,9 @@ production: &base
# Email address used in the "From" field in mails sent by GitLab
email_from: example@example.com
+ # Email address used in the "Reply-To" field in mails send by GitLab (default: no-reply@<host>)
+ email_reply_to: no-reply@example.com
+
# Email server smtp settings are in [a separate file](initializers/smtp_settings.rb.sample).
## User settings
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index f55e69c..997ff2e 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -79,6 +79,7 @@ Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_reply_to'] ||= "no-reply@#{Settings.gitlab.host}"
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin

View file

@ -1,88 +0,0 @@
diff --git a/Gemfile b/Gemfile
index c642134..de4217b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -150,6 +150,10 @@ gem "underscore-rails", "~> 1.4.4"
# Sanitize user input
gem "sanitize", '~> 2.0'
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
@@ -162,7 +166,6 @@ gem 'semantic-ui-sass', '~> 0.16.1.0'
gem "sass-rails", '~> 4.0.2'
gem "coffee-rails"
gem "uglifier"
-gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
diff --git a/Gemfile.lock b/Gemfile.lock
index 6c27b6e..68c8f41 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,10 @@
+GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
GEM
remote: https://rubygems.org/
specs:
@@ -61,7 +68,6 @@ GEM
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.3.2)
code_analyzer (0.4.3)
sexp_processor
@@ -270,7 +276,6 @@ GEM
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.3)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -411,7 +416,6 @@ GEM
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
mime-types (>= 1.16)
@@ -508,9 +512,6 @@ GEM
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -582,6 +583,7 @@ DEPENDENCIES
bootstrap-sass (~> 3.0)
capybara (~> 2.2.1)
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -674,7 +676,6 @@ DEPENDENCIES
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,84 +0,0 @@
diff --git a/Gemfile b/Gemfile
index de4217b..8723eda 100644
--- a/Gemfile
+++ b/Gemfile
@@ -39,7 +39,8 @@ gem "gitlab_git", '~> 6.0'
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
# LDAP Auth
-gem 'gitlab_omniauth-ldap', '1.0.4', require: "omniauth-ldap"
+# Patched for attributes mapping customization
+gem 'gitlab_omniauth-ldap', '1.0.4', require: 'omniauth-ldap', git: 'https://github.com/jirutka/omniauth-ldap.git', ref: 'b55852bfc9b46ecf790a2c5526386702350eab89'
# Git Wiki
gem 'gollum-lib', '~> 3.0.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 68c8f41..225089f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -5,6 +5,17 @@ GIT
specs:
charlock_holmes (0.6.9.4)
+GIT
+ remote: https://github.com/jirutka/omniauth-ldap.git
+ revision: b55852bfc9b46ecf790a2c5526386702350eab89
+ ref: b55852bfc9b46ecf790a2c5526386702350eab89
+ specs:
+ gitlab_omniauth-ldap (1.0.4)
+ net-ldap (~> 0.3.1)
+ omniauth (~> 1.0)
+ pyu-ruby-sasl (~> 0.0.3.1)
+ rubyntlm (~> 0.1.1)
+
GEM
remote: https://rubygems.org/
specs:
@@ -188,11 +199,6 @@ GEM
gitlab-linguist (~> 3.0)
rugged (~> 0.19.0)
gitlab_meta (7.0)
- gitlab_omniauth-ldap (1.0.4)
- net-ldap (~> 0.3.1)
- omniauth (~> 1.0)
- pyu-ruby-sasl (~> 0.0.3.1)
- rubyntlm (~> 0.1.1)
gollum-lib (3.0.0)
github-markup (~> 1.1.0)
gitlab-grit (~> 2.6.5)
@@ -609,7 +615,7 @@ DEPENDENCIES
gitlab_emoji (~> 0.0.1.1)
gitlab_git (~> 6.0)
gitlab_meta (= 7.0)
- gitlab_omniauth-ldap (= 1.0.4)
+ gitlab_omniauth-ldap (= 1.0.4)!
gollum-lib (~> 3.0.0)
gon (~> 5.0.0)
grape (~> 0.6.1)
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 806984e..b2b8f56 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -132,6 +132,10 @@ production: &base
method: 'ssl' # "tls" or "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
+ mapping:
+ username: 'uid'
+ name: 'cn'
+ email: 'mail'
# If allow_username_or_email_login is enabled, GitLab will ignore everything
# after the first '@' in the LDAP username submitted by the user on login.
#
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 50669ec..881081b 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -223,6 +223,7 @@ Devise.setup do |config|
method: Gitlab.config.ldap['method'],
bind_dn: Gitlab.config.ldap['bind_dn'],
password: Gitlab.config.ldap['password'],
+ mapping: Gitlab.config.ldap['mapping'],
name_proc: email_stripping_proc
end

View file

@ -1,88 +0,0 @@
diff --git a/Gemfile b/Gemfile
index 86f8edb..0f2a83e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -146,6 +146,10 @@ gem "underscore-rails", "~> 1.4.4"
# Sanitize user input
gem "sanitize", '~> 2.0'
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
@@ -158,7 +162,6 @@ gem 'semantic-ui-sass', '~> 0.16.1.0'
gem "sass-rails", '~> 4.0.2'
gem "coffee-rails"
gem "uglifier"
-gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
diff --git a/Gemfile.lock b/Gemfile.lock
index fe85e9e..7b4b1b1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,10 @@
+GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
GEM
remote: https://rubygems.org/
specs:
@@ -61,7 +68,6 @@ GEM
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.3.2)
code_analyzer (0.4.3)
sexp_processor
@@ -271,7 +277,6 @@ GEM
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.3)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -408,7 +413,6 @@ GEM
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
request_store (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
@@ -506,9 +510,6 @@ GEM
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -580,6 +581,7 @@ DEPENDENCIES
bootstrap-sass (~> 3.0)
capybara (~> 2.2.1)
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -671,7 +673,6 @@ DEPENDENCIES
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,24 +0,0 @@
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index 4b80388..30730aa 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Gitlab
module Regex
extend self
@@ -11,11 +13,11 @@ module Gitlab
end
def project_name_regex
- /\A[a-zA-Z0-9_][a-zA-Z0-9_\-\. ]*\z/
+ /\A[\p{Word}_][\p{Word}_\-:\. ]*\z/
end
def project_regex_message
- "can contain only letters, digits, '_', '-' and '.' and space. " \
+ "can contain only letters, digits, '_', '-', ':' and '.' and space. " \
"It must start with letter, digit or '_'."
end

View file

@ -1,97 +0,0 @@
diff --git a/Gemfile b/Gemfile
index ce9b833..c4bd377 100644
--- a/Gemfile
+++ b/Gemfile
@@ -155,6 +155,10 @@ gem "underscore-rails", "~> 1.4.4"
# Sanitize user input
gem "sanitize", '~> 2.0'
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
@@ -170,7 +174,6 @@ gem 'semantic-ui-sass', '~> 0.16.1.0'
gem "sass-rails", '~> 4.0.2'
gem "coffee-rails"
gem "uglifier"
-gem "therubyracer"
gem 'turbolinks'
gem 'jquery-turbolinks'
diff --git a/Gemfile.lock b/Gemfile.lock
index a93935f..98721dc 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,10 @@
+GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
GEM
remote: https://rubygems.org/
specs:
@@ -62,7 +69,6 @@ GEM
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.3.2)
code_analyzer (0.4.3)
sexp_processor
@@ -280,7 +286,6 @@ GEM
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.7)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -426,7 +431,6 @@ GEM
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
request_store (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
@@ -525,9 +529,6 @@ GEM
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -536,7 +537,7 @@ GEM
thread_safe (0.3.4)
tilt (1.4.1)
timers (1.1.0)
- timfel-krb5-auth (0.8)
+ timfel-krb5-auth (0.8.3)
tinder (1.9.3)
eventmachine (~> 1.0)
faraday (~> 0.8)
@@ -606,6 +607,7 @@ DEPENDENCIES
bootstrap-sass (~> 3.0)
capybara (~> 2.2.1)
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -704,7 +706,6 @@ DEPENDENCIES
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,97 +0,0 @@
diff --git a/Gemfile b/Gemfile
index b403e85..03f48ed 100644
--- a/Gemfile
+++ b/Gemfile
@@ -160,6 +160,10 @@ gem "underscore-rails", "~> 1.4.4"
# Sanitize user input
gem "sanitize", '~> 2.0'
+# The newer revision of charlock_holmes that is finally fixed to
+# be compatible with Gentoo
+gem "charlock_holmes", git: "https://github.com/brianmario/charlock_holmes.git", ref: "dde194609b3513b0d2369ce8f916ae52566154b4"
+
# Protect against bruteforcing
gem "rack-attack"
@@ -259,7 +263,6 @@ end
group :production do
gem "gitlab_meta", '7.0'
- gem "therubyracer"
end
gem "newrelic_rpm"
diff --git a/Gemfile.lock b/Gemfile.lock
index c6aa35a..531a483 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,10 @@
+GIT
+ remote: https://github.com/brianmario/charlock_holmes.git
+ revision: dde194609b3513b0d2369ce8f916ae52566154b4
+ ref: dde194609b3513b0d2369ce8f916ae52566154b4
+ specs:
+ charlock_holmes (0.6.9.4)
+
GEM
remote: https://rubygems.org/
specs:
@@ -64,7 +71,6 @@ GEM
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
- charlock_holmes (0.6.9.4)
cliver (0.3.2)
code_analyzer (0.4.3)
sexp_processor
@@ -285,7 +291,6 @@ GEM
addressable (~> 2.3)
letter_opener (1.1.2)
launchy (~> 2.2)
- libv8 (3.16.14.7)
listen (2.3.1)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -439,7 +444,6 @@ GEM
redis-store (~> 1.1.0)
redis-store (1.1.4)
redis (>= 2.2)
- ref (1.0.5)
request_store (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
@@ -541,9 +545,6 @@ GEM
term-ansicolor (1.2.2)
tins (~> 0.8)
test_after_commit (0.2.2)
- therubyracer (0.12.0)
- libv8 (~> 3.16.14.0)
- ref
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
@@ -552,7 +553,7 @@ GEM
thread_safe (0.3.4)
tilt (1.4.1)
timers (1.1.0)
- timfel-krb5-auth (0.8)
+ timfel-krb5-auth (0.8.3)
tinder (1.9.3)
eventmachine (~> 1.0)
faraday (~> 0.8)
@@ -623,6 +624,7 @@ DEPENDENCIES
browser
capybara (~> 2.2.1)
carrierwave
+ charlock_holmes!
coffee-rails
colored
coveralls
@@ -724,7 +726,6 @@ DEPENDENCIES
stamp
state_machine
test_after_commit
- therubyracer
thin
tinder (~> 1.9.2)
turbolinks

View file

@ -1,369 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby19 ruby20"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# 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-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${P}-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-6.5.1-fix-ldap-dn-case.patch"
"${P}-ldap-custom-mapping.patch"
"${P}-email-custom-reply_to.patch"
"${P}-fix-gemfile-lock.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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}
rm -r script/{background_jobs,web}
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} ${temp}/repo_satellites
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}"/
# install logrotate config
dodir /etc/logrotate.d
cat > "${D}/etc/logrotate.d/${MY_NAME}" <<-EOF
${logs}/*.log {
daily
missingok
rotate 90
delaycompress
compress
notifempty
copytruncate
}
EOF
## Install gems via bundler ##
cd "${D}/${dest}"
local without="development test aws"
local flag; for flag in mysql postgres unicorn; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
fperms +x script/{rails,check}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
einfo "You can check the setup of your GitLab installation after starting"
einfo "GitLab and Apache (or nginx) with these commands:"
einfo "$ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production"
einfo "$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production"
einfo "Enjoy!"
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,359 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby19 ruby20"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# 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-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.3
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${PN}-6.7.5-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${P}-ldap-custom-mapping.patch"
"${PN}-6.7.5-email-custom-reply_to.patch"
"${P}-fix-gemfile-lock.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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}
rm -r script/{background_jobs,web}
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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
fperms +x script/{rails,check}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,359 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby19 ruby20"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# 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-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.4
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-6.8.2-fix-gemfile.patch"
"${PN}-6.7.5-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-6.8.2-ldap-custom-mapping.patch"
"${PN}-6.7.5-email-custom-reply_to.patch"
"${PN}-6.8.2-fix-gemfile-lock.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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}
rm -r script/{background_jobs,web}
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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
fperms +x script/{rails,check}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,356 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# 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-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.6
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${PN}-6.7.5-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${P}-ldap-custom-mapping.patch"
"${P}-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,356 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# 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-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.6
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${P}-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-ldap-custom-mapping.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,359 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.7
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-ldap-custom-mapping.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,358 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## Gems dependencies:
# charlock_holmes dev-libs/icu
# grape, capybara dev-libs/libxml2, dev-libs/libxslt
# rugged dev-util/cmake
# 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.7
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-ldap-custom-mapping.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,359 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-1.9.7
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-ldap-custom-mapping.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://github.com/gitlabhq/gitlabhq/blob/v${PV}/script/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,358 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.0
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,358 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.0
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,358 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,359 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,359 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,367 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,367 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.3.1-r1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,367 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.0.1
dev-vcs/git"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.1.1-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,369 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/krb5
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.4.0
dev-vcs/git
!app-crypt/heimdal"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${PN}-7.1.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,369 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/krb5
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.4.1
dev-vcs/git
!app-crypt/heimdal"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${P}-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,369 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/krb5
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.4.2
dev-vcs/git
!app-crypt/heimdal"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${PN}-7.7.1-fix-gemfile.patch"
"${PN}-7.7.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${PN}-7.0.0-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_dounit "${FILESDIR}/gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-6.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}

View file

@ -1,369 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
# 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="ruby20 ruby21"
PYTHON_DEPEND="2:2.7"
inherit eutils python ruby-ng user systemd
DESCRIPTION="GitLab is a free project and repository management application"
HOMEPAGE="https://github.com/gitlabhq/gitlabhq"
SRC_URI="https://github.com/gitlabhq/gitlabhq/archive/v${PV}.tar.gz -> ${P}.tar.gz"
#RUBY_S="${PN}-7.4.0"
RESTRICT="mirror"
LICENSE="MIT"
SLOT="6"
KEYWORDS="~amd64 ~x86"
IUSE="mysql +postgres +unicorn systemd"
## 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-util/cmake
dev-util/ragel
net-libs/nodejs
postgres? ( dev-db/postgresql )
mysql? ( virtual/mysql )
virtual/krb5
virtual/pkgconfig"
DEPEND="${GEMS_DEPEND}
>=dev-vcs/gitlab-shell-2.5.3
dev-vcs/git
!app-crypt/heimdal"
RDEPEND="${DEPEND}
dev-db/redis
virtual/mta
systemd? ( sys-apps/systemd:0= )"
ruby_add_bdepend "
virtual/rubygems
>=dev-ruby/bundler-1.0"
#
# fix-gemfile:
# Remove therubyracer that doesn't compile well on Gentoo (we're using
# nodejs instead that is faster and better). Also replace broken
# charlock_holmes version with fixed one.
#
# fix-project-name-regex:
# Allow project name to contain non-ASCII characters.
#
# fix-sendmail-config:
# Fix default settings to work with ssmtp that doesn't know '-t' argument.
#
RUBY_PATCHES=(
"${P}-fix-gemfile.patch"
"${PN}-7.7.1-fix-project-name-regex.patch"
"${PN}-6.0.2-fix-sendmail-config.patch"
"${P}-email-custom-reply_to.patch"
)
MY_NAME="gitlab"
MY_USER="git" # should be same as in gitlab-shell
DEST_DIR="/opt/${MY_NAME}-${SLOT}"
CONF_DIR="/etc/${MY_NAME}-${SLOT}"
LOGS_DIR="/var/log/${MY_NAME}"
TEMP_DIR="/var/tmp/${MY_NAME}"
# When updating ebuild to newer version, check list of the queues in
# https://gitlab.com/gitlab-org/gitlab-ce/blob/v${PV}/bin/background_jobs
SIDEKIQ_QUEUES="post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default"
all_ruby_prepare() {
# fix paths
local satellites_path="${TEMP_DIR}/repo_satellites"
local repos_path=/var/lib/git/repositories
local shell_path=/usr/share/gitlab-shell
sed -i -E \
-e "/satellites:$/,/\w:$/ s|(\s*path:\s).*|\1${satellites_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*path:\s).*|\1${shell_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*repos_path:\s).*|\1${repos_path}/|" \
-e "/gitlab_shell:$/,/\w:$/ s|(\s*hooks_path:\s).*|\1${shell_path}/hooks/|" \
config/gitlab.yml.example || die "failed to filter gitlab.yml.example"
local run_path=/run/${MY_NAME}
sed -i -E \
-e "s|/home/git/gitlab/tmp/(pids\|sockets)|${run_path}|" \
-e "s|/home/git/gitlab/log|${LOGS_DIR}|" \
-e "s|/home/git/gitlab|${DEST_DIR}|" \
config/unicorn.rb.example || die "failed to filter unicorn.rb.example"
sed -i \
-e "s|/home/git/gitlab/tmp/sockets|${run_path}|" \
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:).*|/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} ${temp}/repo_satellites
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}"/
# 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; do
without+="$(use $flag || echo ' '$flag)"
done
local bundle_args="--deployment ${without:+--without ${without}}"
einfo "Running bundle install ${bundle_args} ..."
${RUBY} /usr/bin/bundle install ${bundle_args} || die "bundler failed"
# clean gems cache
rm -Rf vendor/bundle/ruby/*/cache
# fix permissions
fowners -R ${MY_USER}:${MY_USER} ${dest} ${temp} ${logs}
## RC script ##
if use systemd ; then
ewarn "Beware: systemd support has not been tested, use at your own risk!"
systemd_newunit "${FILESDIR}/gitlab-sidekiq-7.service" "gitlab-sidekiq.service"
systemd_dounit "${FILESDIR}/gitlab-unicorn.service"
systemd_dotmpfilesd "${FILESDIR}/gitlab.conf"
else
local rcscript=gitlab-sidekiq.init
use unicorn && rcscript=gitlab-unicorn-7.init
cp "${FILESDIR}/${rcscript}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@SLOT@|${SLOT}|" \
-e "s|@GITLAB_BASE@|${dest}|" \
-e "s|@LOGS_DIR@|${logs}|" \
-e "s|@QUEUES@|${SIDEKIQ_QUEUES}|" \
"${T}/${rcscript}" \
|| die "failed to filter ${rcscript}"
newinitd "${T}/${rcscript}" "${MY_NAME}-${SLOT}"
fi
}
pkg_postinst() {
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 initlize environment:"
elog " emerge --config \"=${CATEGORY}/${PF}\""
elog " Note: Do not forget to start Redis server first!"
elog
elog "If this is an update from previous version, it's HIGHLY recommended"
elog "to backup your database before running the config phase!"
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."
}
pkg_config() {
local shell_conf='/etc/gitlab-shell.yml'
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
# check gitlab-shell configuration
if [ -r ${shell_conf} ]; then
local shell_repos_path="$(ryaml ${shell_conf} repos_path)"
local gitlab_repos_path="$(ryaml ${CONF_DIR}/gitlab.yml \
production gitlab_shell repos_path)"
if [ ! "${shell_repos_path}" -ef "${gitlab_repos_path}" ]; then
eerror "repos_path in ${CONF_DIR}/gitlab.yml and ${shell_conf}"
eerror "must points to the same location! Fix the repos_path location and"
eerror "run this again."; die
fi
else
ewarn "GitLab Shell checks skipped, could not find config file at"
ewarn "${shell_conf}. Make sure that you have gitlab-shell properly"
ewarn "installed and that repos_path is the same as in GitLab."
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
if [ ! -d "${DEST_DIR}/.git" ]; then
# 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
fi
## Initialize app ##
local RAILS_ENV="production"
local RUBY=${RUBY:-/usr/bin/ruby}
local BUNDLE="${RUBY} /usr/bin/bundle"
local dbname="$(ryaml ${CONF_DIR}/database.yml production database)"
if [ -f "${DEST_DIR}/.secret" ]; then
local update=true
einfo "Migrating database ..."
exec_rake db:migrate
# https://github.com/gitlabhq/gitlabhq/issues/5311#issuecomment-31656496
einfo "Migrating iids ..."
exec_rake migrate_iids
einfo "Cleaning old precompiled assets ..."
exec_rake assets:clean
einfo "Cleaning cache ..."
exec_rake cache:clear
else
local update=false
einfo "Initializing database ..."
exec_rake gitlab:setup
fi
einfo "Precompiling assests ..."
exec_rake assets:precompile
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
}
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}"
echo " ${command}"
su -l ${MY_USER} -c "
export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8
cd ${DEST_DIR}
${command}" \
|| die "failed to run rake $@"
}