diff --git a/install/firefly-install.sh b/install/firefly-install.sh index c10e9ca8..3c8ec598 100644 --- a/install/firefly-install.sh +++ b/install/firefly-install.sh @@ -43,6 +43,7 @@ mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRI msg_ok "Set up database" msg_info "Installing Firefly III (Patience)" +LOCAL_IP=$(hostname -I | awk '{print $1}') RELEASE=$(curl -fsSL https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') cd /opt curl -fsSL "https://github.com/firefly-iii/firefly-iii/releases/download/v${RELEASE}/FireflyIII-v${RELEASE}.tar.gz" -o "FireflyIII-v${RELEASE}.tar.gz" @@ -61,6 +62,14 @@ $STD php artisan firefly:upgrade-database $STD php artisan firefly:correct-database $STD php artisan firefly:report-integrity $STD php artisan firefly:laravel-passport-keys +IMPORTER_RELEASE=$(curl -fsSL https://api.github.com/repos/firefly-iii/data-importer/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') +mkdir -p /opt/firefly/dataimporter +cd /opt +curl -fsSL "https://github.com/firefly-iii/data-importer/releases/download/v${IMPORTER_RELEASE}/DataImporter-v${IMPORTER_RELEASE}.tar.gz" -o "DataImporter-v${IMPORTER_RELEASE}.tar.gz" +tar -xzf "DataImporter-v${IMPORTER_RELEASE}.tar.gz" -C /opt/firefly/dataimporter +cp /opt/firefly/dataimporter/.env.example /opt/firefly/dataimporter/.env +sed -i "s#FIREFLY_III_URL=#FIREFLY_III_URL=http://${LOCAL_IP}#g" /opt/firefly/dataimporter/.env +chown -R www-data:www-data /opt/firefly echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Firefly III" @@ -75,7 +84,18 @@ cat </etc/apache2/sites-available/firefly.conf AllowOverride All Require all granted - + + Alias /dataimporter/ /opt/firefly/dataimporter/public/ + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + + SetHandler application/x-httpd-php + + ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined @@ -93,7 +113,8 @@ motd_ssh customize msg_info "Cleaning up" -rm -rf /opt/FireflyIII-v${RELEASE}.tar.gz +rm -rf "/opt/FireflyIII-v${RELEASE}.tar.gz" +rm -rf "/opt/DataImporter-v${IMPORTER_RELEASE}.tar.gz" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"