diff options
Diffstat (limited to 'www-apps')
7 files changed, 134 insertions, 10 deletions
diff --git a/www-apps/phabricator/ChangeLog b/www-apps/phabricator/ChangeLog index 31f8bd7d..e0c65659 100644 --- a/www-apps/phabricator/ChangeLog +++ b/www-apps/phabricator/ChangeLog @@ -1,3 +1,10 @@ + 10 Sep 2013; Bertrand Jacquin <beber@meleeweb.net> +files/hook-01-perms, + +files/hook-02-storage-upgrade, + files/0001-Changed-add_user.php-to-create-users-with-unverified.patch, + files/0002-Make-wiki-visible-to-all.patch, phabricator-9999.ebuild: + www-apps/phabricator: Fix scripts/ permissions via a hook launched by webapp- + config, so add another that backup old database and run storage upgrade + 10 Sep 2013; Bertrand Jacquin <beber@meleeweb.net> +files/0001-Changed-add_user.php-to-create-users-with-unverified.patch, +files/0002-Make-wiki-visible-to-all.patch, +files/aphlictd.confd, diff --git a/www-apps/phabricator/Manifest b/www-apps/phabricator/Manifest index 4dd5d7cf..85f05375 100644 --- a/www-apps/phabricator/Manifest +++ b/www-apps/phabricator/Manifest @@ -1,9 +1,11 @@ -AUX 0001-Changed-add_user.php-to-create-users-with-unverified.patch 1250 SHA256 56a9d7cfc6da64a0d51a1a6e1241df99c455f3e732fe6f421aab7fe1b6d9cf14 WHIRLPOOL 1ee30c2502072d82edc08417d32646b3739f0d28ec0373c3a60db935ff69449780028313d6f937d061cf49455d8edf8c103ddc5bf5a42df5c919c3967a4a610d -AUX 0002-Make-wiki-visible-to-all.patch 911 SHA256 2d6532cd05f8951efac9e8baffa84916f74ea34f397c6236c93a8019627efc0e WHIRLPOOL 7a0141c83b34b6539c914e3fa87a7dde7bc653e34b2b20e838261f331c1c55126522d40b1dab80effcd1a43a7f4d9cebfd6d9ac756743c132194df14353d8efb +AUX 0001-Changed-add_user.php-to-create-users-with-unverified.patch 1250 SHA256 7b6ee57533ec28b8d661bda1cd39a1395c8c1fdc9eb7c09786e208b1a8374e44 WHIRLPOOL 68d2606c25e521e8e4014ba19a9f90f17fd468e79008339e104ef9edc01fb765855c5bb4f6c9495a9b6f41b96e3451bbd51560ba81c6e75fb0b1c972f3d6122e +AUX 0002-Make-wiki-visible-to-all.patch 911 SHA256 59a838916a123057df5da6a3149a4bdc4fed67c915088ac9f7b2df14262d27db WHIRLPOOL e34120ffd119ab35f4b6ce8fa1ef5113b697bebce04942ff98358ec740561e15ab275f1b88ca61b6ca90a02a850ba253347da664421450b32a8ea8171692705a AUX aphlictd.confd 163 SHA256 553f18f54bcf75eada649e564fea7c4c610fd01ec93708bd246263405e7d5246 WHIRLPOOL 027e41cff147fbf7544ba72575fa21e12a66da7b5cd1bdf53a98b929b7c6127c25a997118e9cfea0e00379a7937eb52b051deb4256abb5bb5d6796a9d16138ad AUX aphlictd.initd 1036 SHA256 e0a547d4592955beef3886781d152cd0d48cdd1a547234d6cf7d2cc3e74ee07a WHIRLPOOL d7a8da8395dddaca01e4adaea03200121191cf313d202b5bee6bc9823a6117c0e220dcedc03f30c3022d5b7f6b716b78fe8aedb7ab2cd8d17e3649dcd0f8bd2e +AUX hook-01-perms 647 SHA256 557ccec2af3003f7d4d1bce8104f0619de1657743a3c453021ed4643db368278 WHIRLPOOL 19f8de21e0d3a5cd754e4ede5c4462112d8c0233efcd07b1ffa360fdc78c0527d74abd84a3713d736fa1ed4b889ed61cd747a1f1b2731549d0315834deeed0c6 +AUX hook-02-storage-upgrade 2179 SHA256 ab053bacb55ab34f8e832abb9b6b7254367ceed9f422955046e2930ac17af6f6 WHIRLPOOL 70a1355254cfbde014d825768f814db41a780014966fb931513d2547e6cbe9413c83e6f37699ba00385735831512e5cc2732f562c05df1425874175640f6250a AUX phd.confd 215 SHA256 80ddbf586f38cc600d06e524f7e85c3258bd563696fa2e41e1ea19268da8079b WHIRLPOOL 0f1a587c755994c410b62da6b897ca8684d584b9f01956359e078429fc7ec7642561dc3e3c306bbb24753e3a68ef5f088a5709706143b6154aa085ac2dfa52ad AUX phd.initd 1334 SHA256 38059b41841f1d571280c35eebb20759e4f917937650891426edc985d15dc762 WHIRLPOOL 01a7d56b81d0282dcb2c8d5826059f2c9cf941ba8257eed1fbc27d620e205d06e69fe6dc8dafab2874c27f99d4f056f0fe2ea9f8b4a3a2b2e6d9d99e8ca55b4d -EBUILD phabricator-9999.ebuild 3964 SHA256 1e15bec58b1f9aa3cecb5d68322a38eb18a50c2105896124e1a5426554f8e3b0 WHIRLPOOL 87a18bb05051b310466a52b8ab57b5aa0a81fd37b348b0b0b4ebeb86fd8fe3bd8626fb20a7af96f4e4dad15fbd98e71a3f2c605dccc1891d0fe1a95c2bbc6722 -MISC ChangeLog 2453 SHA256 c39f97e4f5147fcb0b1ec255ceebecbc8ee1630d4fa4f81ae0d55ee61e11e101 WHIRLPOOL 942afbdec65daba9cae336910eaa065831ad452b134334aec9793e9547a69e10b926091502a1eb0025bdc8e2b17dbf11d879a5fac4caa6f7b828157cdf865d40 +EBUILD phabricator-9999.ebuild 3980 SHA256 83a7f92c609f0761bd858d6e9aff6646699b4d214b65a459512780f74396ac2b WHIRLPOOL b67f5d1335048a1ff9f9d79e7cb83bcb9de1c4b563021c692d33a6920db80cb592a16e2da190f1696903e6d88e4071f20276ddbd52bcf69571b45a2ddfcfbb4c +MISC ChangeLog 2860 SHA256 05bc75ab1e3ce06c9a75c90c2927c8829d2a3b970042af2b515674a5f2a04b3d WHIRLPOOL 1cd007017eb24cb81b6a1213a16d567fc5fe8198b6919decc1e0f7af1372221c4420d9e4e98adae0cbcefed22cdf0e1499c0f9c24fc82009b6bfe4e1e7a2f13d MISC metadata.xml 653 SHA256 744c67bfd3b874f305b08a5b68c5e2213c3cdc1c47b381fe130ebfc2005a964b WHIRLPOOL 5efd225c032e0704862510f166c94327460caf27527b473fe8f35ea6117b2b16862e362aff0b7bdb47b38349dbcf8710fff4040f11d50e07865f983dacc93d99 diff --git a/www-apps/phabricator/files/0001-Changed-add_user.php-to-create-users-with-unverified.patch b/www-apps/phabricator/files/0001-Changed-add_user.php-to-create-users-with-unverified.patch index 271ef158..0ff4f2c1 100644 --- a/www-apps/phabricator/files/0001-Changed-add_user.php-to-create-users-with-unverified.patch +++ b/www-apps/phabricator/files/0001-Changed-add_user.php-to-create-users-with-unverified.patch @@ -1,7 +1,7 @@ From fc9e297d124790a337dd6c69b50bd72cbdc0067c Mon Sep 17 00:00:00 2001 From: Enlightenment <no-reply@enlightenment.org> Date: Fri, 25 Jan 2013 06:00:11 -0800 -Subject: [PATCH 1/6] Changed add_user.php to create users with unverified +Subject: [PATCH 1/2] Changed add_user.php to create users with unverified emails. Different error codes for different errors. diff --git a/www-apps/phabricator/files/0002-Make-wiki-visible-to-all.patch b/www-apps/phabricator/files/0002-Make-wiki-visible-to-all.patch index 9085fa0a..d6554388 100644 --- a/www-apps/phabricator/files/0002-Make-wiki-visible-to-all.patch +++ b/www-apps/phabricator/files/0002-Make-wiki-visible-to-all.patch @@ -1,7 +1,7 @@ From 8f7c3736b99b5497620df020381373525b9531bf Mon Sep 17 00:00:00 2001 From: Enlightenment <no-reply@enlightenment.org> Date: Tue, 26 Mar 2013 06:11:16 -0700 -Subject: [PATCH 6/6] Make wiki visible to all. +Subject: [PATCH 2/2] Make wiki visible to all. --- src/applications/phriction/controller/PhrictionDocumentController.php | 4 ++++ diff --git a/www-apps/phabricator/files/hook-01-perms b/www-apps/phabricator/files/hook-01-perms new file mode 100755 index 00000000..fd9fcfa4 --- /dev/null +++ b/www-apps/phabricator/files/hook-01-perms @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +export PATH="$PATH:/usr/lib/portage/bin/ebuild-helpers" +source /usr/lib/portage/bin/isolated-functions.sh + +function do_install () { + einfo "Make executable all shebanged files" + find "${VHOST_ROOT}" -type f \ + | xargs -n 1 --no-run-if-empty -- \ + awk 'NR == 1 && /^#!/ {print FILENAME}' \ + | xargs --no-run-if-empty -- \ + fperms 755 + eend $? + + return 0 +} + +[[ $# -ne 1 ]] && exit 1 + +einfo +einfo "$0 $@" +einfo + +if ! declare -f "do_$1" > /dev/null 2>&1 ; then + ewarn "action "$1" not handled" + exit 0 +fi + +do_$1 diff --git a/www-apps/phabricator/files/hook-02-storage-upgrade b/www-apps/phabricator/files/hook-02-storage-upgrade new file mode 100755 index 00000000..fa086433 --- /dev/null +++ b/www-apps/phabricator/files/hook-02-storage-upgrade @@ -0,0 +1,82 @@ +#!/bin/bash +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +export PATH="$PATH:/usr/lib/portage/bin/ebuild-helpers" +source /usr/lib/portage/bin/isolated-functions.sh + +function rc_status () { + [[ $# -ne 1 ]] && return 1 + + local _svc="$1" + + "/etc/init.d/${_svc}" -sCq status 2> /dev/null +} + +function do_install () { + local _date="$(date +'%F-%T')" + + local _has_aphlictd=no + local _has_phd=no + local _has_server=no + + # Do not upgrade anything if we can't connect to databases + if ! "${VHOST_ROOT}/bin/storage" status > /dev/null ; then + ewarn "Aborting, connection to database unsuccessfull" + ewarn "You need to manually run" + ewarn " ${VHOST_ROOT}/bin/storage upgrade" + ewarn + + return 1 + fi + + # Save service status + rc_status aphlictd && _has_aphlictd=yes + rc_status phd && _has_phd=yes + rc_status "${VHOST_SERVER}" && _has_server=yes + + # Only stop started services + [[ "${_has_aphlictd:-no}" == "yes" ]] && /etc/init.d/aphlictd stop + [[ "${_has_phd:-no}" == "yes" ]] && /etc/init.d/phd stop + [[ "${_has_server:-no}" == "yes" ]] && /etc/init.d/"${VHOST_SERVER}" stop + + einfo "Backing up database to ${VHOST_ROOT}/backup-${_date}.sql.xz" + [[ ! -d "${VHOST_ROOT}/backup" ]] \ + && mkdir "${VHOST_ROOT}/backup" + + einfo " ${VHOST_ROOT}/bin/storage dump" + "${VHOST_ROOT}/bin/storage" dump \ + | xz -v > "${VHOST_ROOT}/backup-${_date}.sql.xz" + eend $? + + einfo "Upgrading storage" + einfo " ${VHOST_ROOT}/bin/storage upgrade" + "${VHOST_ROOT}/bin/storage" upgrade \ + || eerror "failed, you should analyze it and rerun manually" + eend $? + + # Only start services that was previously started + [[ "${_has_server:-no}" == "yes" ]] && /etc/init.d/"${VHOST_SERVER}" start + [[ "${_has_phd:-no}" == "yes" ]] && /etc/init.d/phd start + [[ "${_has_aphlictd:-no}" == "yes" ]] && /etc/init.d/aphlictd start + + return 0 +} + +[[ $# -ne 1 ]] && exit 1 + +einfo +einfo "$0 $@" +einfo + +if ! declare -f "do_$1" > /dev/null 2>&1 ; then + ewarn "action "$1" not handled" + exit 0 +fi + +case "${VHOST_SERVER}" in + apache) VHOST_SERVER="apache2" ;; +esac + +do_$1 diff --git a/www-apps/phabricator/phabricator-9999.ebuild b/www-apps/phabricator/phabricator-9999.ebuild index db39681e..aa95a7d5 100644 --- a/www-apps/phabricator/phabricator-9999.ebuild +++ b/www-apps/phabricator/phabricator-9999.ebuild @@ -113,6 +113,10 @@ src_install() { fperms 755 webapp_configfile "${MY_HOSTROOTDIR}"/conf/{default,development,production}.conf.php + + webapp_hook_script "${FILESDIR}/hook-01-perms" + webapp_hook_script "${FILESDIR}/hook-02-storage-upgrade" + webapp_src_install newinitd "${FILESDIR}/phd.initd" phd @@ -128,9 +132,6 @@ pkg_postinst() { webapp_pkg_postinst elog - elog "After an upgrade, you should run" - elog " ${MY_APPDIR}/bin/storage upgrade" - elog - elog "For more info about how to configure it, see" + elog "For more info about how to configure, see" elog " http://www.phabricator.com/docs/phabricator/article/Configuration_Guide.html" } |