Skip to content

Commit e6c2181

Browse files
authored
Firefly: Add Data Importer to LXC (#5159)
* Add Data Importer to Firefly LXC * Remove useless var
1 parent 142fea2 commit e6c2181

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

ct/firefly.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
33
# Copyright (c) 2021-2025 community-scripts ORG
4-
# Author: quantumryuu
4+
# Author: quantumryuu | Co-Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://firefly-iii.org/
77

frontend/public/json/firefly.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"password": null
3333
},
3434
"notes": [
35+
{
36+
"text": "Data Importer is at `http://<LXC_IP>/dataimporter/`",
37+
"type": "info"
38+
},
3539
{
3640
"text": "Database credentials: `cat ~/firefly.creds`",
3741
"type": "info"

install/firefly-install.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Copyright (c) 2021-2025 community-scripts ORG
4-
# Author: quantumryuu
4+
# Author: quantumryuu | Co-Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://firefly-iii.org/
77

@@ -30,7 +30,6 @@ msg_info "Setting up database"
3030
DB_NAME=firefly
3131
DB_USER=firefly
3232
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
33-
MYSQL_VERSION=$(mariadb --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
3433
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
3534
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
3635
mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
@@ -43,6 +42,7 @@ mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRI
4342
msg_ok "Set up database"
4443

4544
msg_info "Installing Firefly III (Patience)"
45+
LOCAL_IP=$(hostname -I | awk '{print $1}')
4646
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)}')
4747
cd /opt
4848
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 +61,14 @@ $STD php artisan firefly:upgrade-database
6161
$STD php artisan firefly:correct-database
6262
$STD php artisan firefly:report-integrity
6363
$STD php artisan firefly:laravel-passport-keys
64+
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)}')
65+
mkdir -p /opt/firefly/dataimporter
66+
cd /opt
67+
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"
68+
tar -xzf "DataImporter-v${IMPORTER_RELEASE}.tar.gz" -C /opt/firefly/dataimporter
69+
cp /opt/firefly/dataimporter/.env.example /opt/firefly/dataimporter/.env
70+
sed -i "s#FIREFLY_III_URL=#FIREFLY_III_URL=http://${LOCAL_IP}#g" /opt/firefly/dataimporter/.env
71+
chown -R www-data:www-data /opt/firefly
6472
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
6573
msg_ok "Installed Firefly III"
6674

@@ -75,7 +83,18 @@ cat <<EOF >/etc/apache2/sites-available/firefly.conf
7583
AllowOverride All
7684
Require all granted
7785
</Directory>
78-
86+
87+
Alias /dataimporter/ /opt/firefly/dataimporter/public/
88+
89+
<Directory /opt/firefly/dataimporter/public/>
90+
Options Indexes FollowSymLinks
91+
AllowOverride All
92+
Require all granted
93+
</Directory>
94+
<FilesMatch \.php$>
95+
SetHandler application/x-httpd-php
96+
</FilesMatch>
97+
7998
ErrorLog /var/log/apache2/error.log
8099
CustomLog /var/log/apache2/access.log combined
81100
@@ -93,7 +112,8 @@ motd_ssh
93112
customize
94113

95114
msg_info "Cleaning up"
96-
rm -rf /opt/FireflyIII-v${RELEASE}.tar.gz
115+
rm -rf "/opt/FireflyIII-v${RELEASE}.tar.gz"
116+
rm -rf "/opt/DataImporter-v${IMPORTER_RELEASE}.tar.gz"
97117
$STD apt-get -y autoremove
98118
$STD apt-get -y autoclean
99119
msg_ok "Cleaned"

0 commit comments

Comments
 (0)