Another pixelfed attempt

This commit is contained in:
Bob Mottram 2018-06-11 13:18:35 +01:00
parent fe70b27555
commit 514cd6140b
3 changed files with 29 additions and 4 deletions

View File

@ -30,7 +30,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
VARIANTS='full'
VARIANTS='full full-vim'
IN_DEFAULT_INSTALL=0
SHOW_ON_ABOUT=1

View File

@ -29,7 +29,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
VARIANTS=''
VARIANTS='full full-vim'
IN_DEFAULT_INSTALL=0
SHOW_ON_ABOUT=1
@ -293,6 +293,7 @@ function install_pixelfed {
apt-get -yq install php-gettext php-curl php-gd php-mysql git curl
apt-get -yq install memcached php-memcached php-intl exiftool libfcgi0ldbl
apt-get -yq install redis-server php-redis autoconf imagemagick imagemagick-dev libtool
apt-get -yq install jpegoptim
if [ ! "$PIXELFED_DOMAIN_NAME" ]; then
echo $'No domain name was given'
@ -320,7 +321,16 @@ function install_pixelfed {
git checkout "$PIXELFED_COMMIT" -b "$PIXELFED_COMMIT"
set_completion_param "pixelfed commit" "$PIXELFED_COMMIT"
install_composer
install_composer --no-dev
if [ ! -f "/var/www/$PIXELFED_DOMAIN_NAME/htdocs/.env.example" ]; then
echo $"Can't find .env.example"
exit 346826285
fi
cp "/var/www/$PIXELFED_DOMAIN_NAME/htdocs/.env.example" "/var/www/$PIXELFED_DOMAIN_NAME/htdocs/.env"
php artisan key:generate
php artisan storage:link
chmod g+w "/var/www/$PIXELFED_DOMAIN_NAME/htdocs"
chown -R www-data:www-data "/var/www/$PIXELFED_DOMAIN_NAME/htdocs"
@ -419,6 +429,19 @@ function install_pixelfed {
create_site_certificate "$PIXELFED_DOMAIN_NAME" 'yes'
cd "/var/www/$PIXELFED_DOMAIN_NAME/htdocs" || exit 365845635
# hack: within vendor/laravel/framework/src/Illuminate/database/Schema/Blueprint.php
# change return $this->addColumn('json', $column);
# to return $this->addColumn('text', $column);
if [ -f vendor/laravel/framework/src/Illuminate/database/Schema/Blueprint.php ]; then
sed -i "s|\$this->addColumn('json', \$column);|\$this->addColumn('text', \$column);|g" vendor/laravel/framework/src/Illuminate/database/Schema/Blueprint.php
else
find . -name Blueprint.php
fi
php artisan migrate:fresh
nginx_ensite "$PIXELFED_DOMAIN_NAME"
systemctl restart mariadb

View File

@ -1074,6 +1074,8 @@ function create_default_web_site {
}
function install_composer {
composer_options="$1"
# curl -sS https://getcomposer.org/installer | php
if [ -f "${HOME}/${PROJECT_NAME}/image_build/composer_install" ]; then
php < "${HOME}/${PROJECT_NAME}/image_build/composer_install"
@ -1085,7 +1087,7 @@ function install_composer {
if [ -f composer.phar ]; then
cp composer.phar composer
fi
if ! php composer.phar install; then
if ! php composer.phar install "$composer_options"; then
echo $'Unable to run composer install'
exit 7252198
fi