diff --git a/ct/firefly.sh b/ct/firefly.sh index 955a2845..78c2330f 100644 --- a/ct/firefly.sh +++ b/ct/firefly.sh @@ -9,21 +9,21 @@ source <(curl -s https://raw.githubusercontent.com/quantumryuu/ProxmoxVE/build/m function header_info { clear cat <<"EOF" - ____ ________ ______ __ - / _/___ _________ / _/ __ \/ ____/___/ / - / // __ \/ ___/ __ \ / // /_/ / / / __ / - _/ // / / (__ ) /_/ // // _, _/ /___/ /_/ / -/___/_/ /_/____/ .___/___/_/ |_|\____/\__,_/ - /_/ - + _______ ______ ____________ + / ____(_)_______ / __/ /_ __ / _/ _/ _/ + / /_ / / ___/ _ \/ /_/ / / / / / / / / / / + / __/ / / / / __/ __/ / /_/ / _/ /_/ /_/ / +/_/ /_/_/ \___/_/ /_/\__, / /___/___/___/ + /____/ + EOF } header_info echo -e "Loading..." -APP="InspIRCd" +APP="Firefly III" var_disk="2" var_cpu="1" -var_ram="512" +var_ram="1024" var_os="debian" var_version="12" variables @@ -95,4 +95,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${APP} should be reachable by going to the following URL. - ${BL}http://${IP}:3000${CL} \n" + ${BL}http://${IP}{CL} \n" \ No newline at end of file diff --git a/install/firefly-install.sh b/install/firefly-install.sh index dede9390..7d477a29 100644 --- a/install/firefly-install.sh +++ b/install/firefly-install.sh @@ -17,38 +17,85 @@ msg_info "Installing Dependencies" $STD apt-get install -y \ curl \ mc \ - sudo + sudo \ + apache2 \ + php8.3 \ + php8.3-cli \ + libapache2-mod-php8.3 \ + php8.3-{bcmath,intl,curl,zip,gd,xml,mbstring,mysql} \ + mariadb-server \ + composer msg_ok "Installed Dependencies" +msg_info "Setting up database" +DB_NAME=firefly +DB_USER=firefly +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +MYSQL_VERSION=$(mysql --version | grep -oP 'Distrib \K[0-9]+\.[0-9]+\.[0-9]+') +mysql -u root -e "CREATE DATABASE $DB_NAME;" +mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" +mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +{ + echo "Firefly-Credentials" + echo "Firefly Database User: $DB_USER" + echo "Firefly Database Password: $DB_PASS" + echo "Firefly Database Name: $DB_NAME" +} >> ~/firefly.creds +msg_ok "Set up database" -msg_info "Installing InspIRCd" -RELEASE=$(curl -s https://api.github.com/repos/REPO/REPO/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + + +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, 2, length($2)-3) }') cd /opt -wget -q https://github.com/REPO/REPO/releases/download/v${RELEASE}/inspircd_${RELEASE}.deb12u1_amd64.deb -$STD apt-get install "./inspircd_${RELEASE}.deb12u1_amd64.deb" -y &>/dev/null -cat </etc/inspircd/inspircd.conf - - - - - - -EOF - +wget -q "https://github.com/firefly-iii/firefly-iii/releases/download/${RELEASE}/FireflyIII-${RELEASE}.tar.gz" +mkdir -p /opt/firefly-iii +tar -xzf FireflyIII-${RELEASE}.tar.gz -C /opt/firefly-iii +chown -R www-data:www-data /opt/firefly-iii +chmod -R 775 /opt/firefly-iii/storage +cd /opt/firefly-iii +cp .env.example .env +sed -i "s/DB_HOST=.*/DB_HOST=localhost/" /opt/firefly-iii/.env +sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=$DB_PASS/" /opt/firefly-iii/.env +echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc +source ~/.bashrc +composer install --no-dev --no-plugins --no-interaction +php artisan firefly-iii:upgrade-database +php artisan firefly-iii:correct-database +php artisan firefly-iii:report-integrity +php artisan firefly-iii:laravel-passport-keys echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" -msg_ok "Installed InspIRCd" +msg_ok "Installed Firefly III" + +msg_info "Creating Service" +cat </etc/apache2/sites-available/firefly-iii.conf + + ServerAdmin webmaster@localhost + DocumentRoot /opt/firefly-iii/public/ + + + Options FollowSymLinks + AllowOverride All + Require all granted + + + ErrorLog /var/log/apache2/error.log + CustomLog /var/log/apache2/access.log combined + + +EOF +$STD a2enmod php8.3 +$STD a2enmod rewrite +$STD a2ensite firefly-iii.conf +$STD a2dissite 000-default.conf +$STD systemctl reload apache2 +msg_ok "Created Service" motd_ssh customize msg_info "Cleaning up" -rm -rf /opt/inspircd_${RELEASE}.deb12u1_amd64.deb +rm -rf /opt/FireflyIII-${RELEASE}.tar.gz $STD apt-get -y autoremove $STD apt-get -y autoclean -msg_ok "Cleaned" +msg_ok "Cleaned" \ No newline at end of file diff --git a/json/firefly.json b/json/firefly.json new file mode 100644 index 00000000..81a28b43 --- /dev/null +++ b/json/firefly.json @@ -0,0 +1,34 @@ +{ + "name": "Firefly III", + "slug": "firefly-iii", + "categories": [ + 0 + ], + "date_created": "2024-11-30", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 80, + "documentation": "https://docs.firefly-iii.org/", + "website": "https://firefly-iii.org/", + "logo": "https://raw.githubusercontent.com/firefly-iii/firefly-iii/develop/.github/assets/img/logo-small.png", + "description": "A free and open source personal finance manager", + "install_methods": [ + { + "type": "default", + "script": "/ct/firefly-iii.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 2, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] + } \ No newline at end of file