2017-04-16 17:22:30 +02:00
|
|
|
PRIVATEBIN_VERSION="1.1"
|
2016-08-24 19:33:06 +02:00
|
|
|
PRIVATEBIN_SOURCE_URL="https://github.com/PrivateBin/PrivateBin/archive/${PRIVATEBIN_VERSION}.tar.gz"
|
2017-04-16 17:22:30 +02:00
|
|
|
PRIVATEBIN_SOURCE_SHA256="61d18753c792d83f54ad9e414d1d32198ab873054907081e732effd5ccbe96ef"
|
2016-08-24 19:33:06 +02:00
|
|
|
|
|
|
|
extract_source() {
|
|
|
|
local DESTDIR=$1
|
|
|
|
|
|
|
|
# retrieve and extract Roundcube tarball
|
|
|
|
rc_tarball="${DESTDIR}/privatebin.tar.gz"
|
|
|
|
sudo wget -q -O "$rc_tarball" "$PRIVATEBIN_SOURCE_URL" \
|
|
|
|
|| ynh_die "Unable to download source tarball"
|
|
|
|
echo "$PRIVATEBIN_SOURCE_SHA256 $rc_tarball" | sha256sum -c >/dev/null \
|
|
|
|
|| ynh_die "Invalid checksum of downloaded tarball"
|
|
|
|
sudo tar xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \
|
|
|
|
|| ynh_die "Unable to extract source tarball"
|
|
|
|
sudo rm "$rc_tarball"
|
|
|
|
}
|
2017-04-16 22:17:13 +02:00
|
|
|
|
2017-04-16 23:57:23 +02:00
|
|
|
ynh_pool_fpm () { # Create the php-fpm pool configuration file and configure it.
|
|
|
|
sed -i "s@__NAMETOCHANGE__@$app@g" ../conf/php-fpm.conf
|
|
|
|
sed -i "s@__FINALPATH__@$final_path@g" ../conf/php-fpm.conf
|
|
|
|
finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
|
|
|
sudo cp ../conf/php-fpm.conf $finalphpconf
|
|
|
|
sudo chown root: $finalphpconf
|
|
|
|
finalphpini=/etc/php5/fpm/conf.d/20-$app.ini
|
|
|
|
sudo cp ../conf/php-fpm.ini $finalphpini
|
|
|
|
sudo chown root: $finalphpini
|
|
|
|
sudo systemctl reload php5-fpm
|
|
|
|
}
|
|
|
|
|
|
|
|
ynh_remove_fpm () { # Delete pool php-fpm configuration
|
|
|
|
if [ -e "/etc/php5/fpm/pool.d/$app.conf" ]; then # Delete fpm config
|
|
|
|
echo "Delete fpm config"
|
|
|
|
sudo rm "/etc/php5/fpm/pool.d/$app.conf"
|
|
|
|
fi
|
|
|
|
if [ -e "/etc/php5/fpm/conf.d/20-$app.ini" ]; then # Delete php config
|
|
|
|
echo "Delete php config"
|
|
|
|
sudo rm "/etc/php5/fpm/conf.d/20-$app.ini"
|
|
|
|
fi
|
|
|
|
sudo systemctl reload php5-fpm
|
|
|
|
}
|
|
|
|
|
2017-04-16 22:17:13 +02:00
|
|
|
ynh_secure_rm () {
|
|
|
|
[[ "/var/www /opt /home/yunohost.app" =~ $1 ]] \
|
|
|
|
|| (test -n "$1" && sudo rm -Rf $1 )
|
|
|
|
}
|