initial commit for test

This commit is contained in:
Kristo Copani 2024-11-30 17:36:51 +02:00
parent c81e47349b
commit 50d6b1128e
3 changed files with 114 additions and 33 deletions

View File

@ -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"

View File

@ -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 <<EOF >/etc/inspircd/inspircd.conf
<define name="networkDomain" value="helper-scripts.com">
<define name="networkName" value="Proxmox VE Helper-Scripts">
<server
name="irc.&networkDomain;"
description="&networkName; IRC server"
network="&networkName;">
<admin
name="Admin"
description="Supreme Overlord"
email="irc@&networkDomain;">
<bind address="" port="6667" type="clients">
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 <<EOF >/etc/apache2/sites-available/firefly-iii.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/firefly-iii/public/
<Directory /opt/firefly-iii/public>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
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"

34
json/firefly.json Normal file
View File

@ -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": []
}