2019-11-26 21:47:40 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
# just check if we execute apache or php-fpm
|
2021-09-11 21:43:13 +02:00
|
|
|
if (expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]) && [ "${FRIENDICA_DISABLE_UPGRADE:-false}" = "false" ]; then
|
2021-09-11 20:26:16 +02:00
|
|
|
echo "Download sources for ${FRIENDICA_VERSION} (Addon: ${FRIENDICA_ADDONS})"
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
# Removing the whole directory first
|
|
|
|
rm -fr /usr/src/friendica
|
|
|
|
export GNUPGHOME="$(mktemp -d)"
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 21:43:13 +02:00
|
|
|
gpg --batch --logger-fd=1 --no-tty --quiet --keyserver keyserver.ubuntu.com --recv-keys 08656443618E6567A39524083EE197EF3F9E4287
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
curl -fsSL -o friendica-full-${FRIENDICA_VERSION}.tar.gz "https://files.friendi.ca/friendica-full-${FRIENDICA_VERSION}.tar.gz"
|
|
|
|
curl -fsSL -o friendica-full-${FRIENDICA_VERSION}.tar.gz.asc "https://files.friendi.ca/friendica-full-${FRIENDICA_VERSION}.tar.gz.asc";
|
2021-09-11 21:43:13 +02:00
|
|
|
gpg --batch --logger-fd=1 --no-tty --quiet --verify friendica-full-${FRIENDICA_VERSION}.tar.gz.asc friendica-full-${FRIENDICA_VERSION}.tar.gz
|
2021-09-11 20:26:16 +02:00
|
|
|
echo "Core sources (${FRIENDICA_VERSION}) verified"
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 21:43:13 +02:00
|
|
|
tar -xzf friendica-full-${FRIENDICA_VERSION}.tar.gz -C /usr/src/
|
2021-09-11 20:26:16 +02:00
|
|
|
rm friendica-full-${FRIENDICA_VERSION}.tar.gz friendica-full-${FRIENDICA_VERSION}.tar.gz.asc
|
|
|
|
mv -f /usr/src/friendica-full-${FRIENDICA_VERSION}/ /usr/src/friendica
|
|
|
|
echo "Core sources (${FRIENDICA_VERSION}) extracted"
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
chmod 777 /usr/src/friendica/view/smarty3
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
curl -fsSL -o friendica-addons-${FRIENDICA_ADDONS}.tar.gz "https://files.friendi.ca/friendica-addons-${FRIENDICA_ADDONS}.tar.gz"
|
|
|
|
curl -fsSL -o friendica-addons-${FRIENDICA_ADDONS}.tar.gz.asc "https://files.friendi.ca/friendica-addons-${FRIENDICA_ADDONS}.tar.gz.asc"
|
2021-09-11 21:43:13 +02:00
|
|
|
gpg --batch --logger-fd=1 --no-tty --quiet --verify friendica-addons-${FRIENDICA_ADDONS}.tar.gz.asc friendica-addons-${FRIENDICA_ADDONS}.tar.gz
|
|
|
|
echo "Addon sources (${FRIENDICA_ADDONS}) verified"
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
mkdir -p /usr/src/friendica/addon
|
2021-09-11 21:43:13 +02:00
|
|
|
tar -xzf friendica-addons-${FRIENDICA_ADDONS}.tar.gz -C /usr/src/friendica/addon --strip-components=1
|
2021-09-11 20:26:16 +02:00
|
|
|
rm friendica-addons-${FRIENDICA_ADDONS}.tar.gz friendica-addons-${FRIENDICA_ADDONS}.tar.gz.asc
|
|
|
|
echo "Addon sources (${FRIENDICA_ADDONS}) extracted"
|
2019-11-26 21:47:40 +01:00
|
|
|
|
2021-09-11 20:26:16 +02:00
|
|
|
gpgconf --kill all
|
|
|
|
rm -rf "$GNUPGHOME"
|
2019-11-26 21:47:40 +01:00
|
|
|
fi
|
|
|
|
|
2020-01-03 19:20:20 +01:00
|
|
|
exec /entrypoint.sh "$@"
|