This commit is contained in:
Kristo Copani 2024-11-30 20:49:41 +02:00
parent 0815b75209
commit e11a38ed3c
2 changed files with 30 additions and 30 deletions

View File

@ -58,7 +58,7 @@ header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/firefly-iii ]]; then if [[ ! -d /opt/firefly ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
@ -69,25 +69,25 @@ check_container_resources
msg_ok "Stopped Apache2" msg_ok "Stopped Apache2"
msg_info "Updating ${APP} to v${RELEASE}" msg_info "Updating ${APP} to v${RELEASE}"
cp /opt/firefly-iii/.env /opt/.env cp /opt/firefly/.env /opt/.env
cp -r /opt/firefly-iii/storage /opt/storage cp -r /opt/firefly/storage /opt/storage
rm -rf /opt/firefly-iii rm -rf /opt/firefly
cd /opt cd /opt
wget -q "https://github.com/firefly-iii/firefly-iii/releases/download/v${RELEASE}/FireflyIII-v${RELEASE}.tar.gz" wget -q "https://github.com/firefly-iii/firefly-iii/releases/download/v${RELEASE}/FireflyIII-v${RELEASE}.tar.gz"
mkdir -p /opt/firefly-iii mkdir -p /opt/firefly
tar -xzf FireflyIII-v${RELEASE}.tar.gz -C /opt/firefly-iii --exclude='storage' tar -xzf FireflyIII-v${RELEASE}.tar.gz -C /opt/firefly --exclude='storage'
mv /opt/.env /opt/firefly-iii/.env mv /opt/.env /opt/firefly/.env
mv /opt/storage /opt/firefly-iii/storage mv /opt/storage /opt/firefly/storage
chown -R www-data:www-data /opt/firefly-iii chown -R www-data:www-data /opt/firefly
chmod -R 775 /opt/firefly-iii/storage chmod -R 775 /opt/firefly/storage
cd /opt/firefly-iii cd /opt/firefly
composer install --no-dev &>/dev/null composer install --no-dev &>/dev/null
php artisan migrate --seed &>/dev/null php artisan migrate --seed --force &>/dev/null
php artisan firefly-iii:decrypt-all &>/dev/null php artisan firefly:decrypt-all &>/dev/null
php artisan cache:clear &>/dev/null php artisan cache:clear &>/dev/null
php artisan view:clear &>/dev/null php artisan view:clear &>/dev/null
php artisan firefly-iii:upgrade-database &>/dev/null php artisan firefly:upgrade-database &>/dev/null
php artisan firefly-iii:laravel-passport-keys &>/dev/null php artisan firefly:laravel-passport-keys &>/dev/null
echo "${RELEASE}" >"/opt/${APP}_version.txt" &>/dev/null echo "${RELEASE}" >"/opt/${APP}_version.txt" &>/dev/null
msg_ok "Updated ${APP} to v${RELEASE}" msg_ok "Updated ${APP} to v${RELEASE}"

View File

@ -53,31 +53,31 @@ msg_info "Installing Firefly III (Patience)"
RELEASE=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') RELEASE=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
cd /opt cd /opt
wget -q "https://github.com/firefly-iii/firefly-iii/releases/download/v${RELEASE}/FireflyIII-v${RELEASE}.tar.gz" wget -q "https://github.com/firefly-iii/firefly-iii/releases/download/v${RELEASE}/FireflyIII-v${RELEASE}.tar.gz"
mkdir -p /opt/firefly-iii mkdir -p /opt/firefly
tar -xzf FireflyIII-v${RELEASE}.tar.gz -C /opt/firefly-iii tar -xzf FireflyIII-v${RELEASE}.tar.gz -C /opt/firefly
chown -R www-data:www-data /opt/firefly-iii chown -R www-data:www-data /opt/firefly
chmod -R 775 /opt/firefly-iii/storage chmod -R 775 /opt/firefly/storage
cd /opt/firefly-iii cd /opt/firefly
cp .env.example .env cp .env.example .env
sed -i "s/DB_HOST=.*/DB_HOST=localhost/" /opt/firefly-iii/.env sed -i "s/DB_HOST=.*/DB_HOST=localhost/" /opt/firefly/.env
sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=$DB_PASS/" /opt/firefly-iii/.env sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=$DB_PASS/" /opt/firefly/.env
echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc
source ~/.bashrc source ~/.bashrc
$STD composer install --no-dev --no-plugins --no-interaction $STD composer install --no-dev --no-plugins --no-interaction
$STD php artisan firefly-iii:upgrade-database $STD php artisan firefly:upgrade-database
$STD php artisan firefly-iii:correct-database $STD php artisan firefly:correct-database
$STD php artisan firefly-iii:report-integrity $STD php artisan firefly:report-integrity
$STD php artisan firefly-iii:laravel-passport-keys $STD php artisan firefly:laravel-passport-keys
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Firefly III" msg_ok "Installed Firefly III"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/apache2/sites-available/firefly-iii.conf cat <<EOF >/etc/apache2/sites-available/firefly.conf
<VirtualHost *:80> <VirtualHost *:80>
ServerAdmin webmaster@localhost ServerAdmin webmaster@localhost
DocumentRoot /opt/firefly-iii/public/ DocumentRoot /opt/firefly/public/
<Directory /opt/firefly-iii/public> <Directory /opt/firefly/public>
Options FollowSymLinks Options FollowSymLinks
AllowOverride All AllowOverride All
Require all granted Require all granted
@ -90,7 +90,7 @@ cat <<EOF >/etc/apache2/sites-available/firefly-iii.conf
EOF EOF
$STD a2enmod php8.3 $STD a2enmod php8.3
$STD a2enmod rewrite $STD a2enmod rewrite
$STD a2ensite firefly-iii.conf $STD a2ensite firefly.conf
$STD a2dissite 000-default.conf $STD a2dissite 000-default.conf
$STD systemctl reload apache2 $STD systemctl reload apache2
msg_ok "Created Service" msg_ok "Created Service"