Skip to content

Instantly share code, notes, and snippets.

@Engr-AllanG
Last active April 8, 2021 23:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Engr-AllanG/e87f827092e3a6b876b912cd897428ae to your computer and use it in GitHub Desktop.
Save Engr-AllanG/e87f827092e3a6b876b912cd897428ae to your computer and use it in GitHub Desktop.
Firefly-III CSV-Importer Ubuntu 20.04 Proxmox Installation Guide

Here is a link to the firefly-iii website installation instructions. You can install the csv-importer into the same container as firefly, but the only way I know how to get this to work with the single IP address of the container is to either run csv-importer in a sub directory e.g. 192.168.1.128/cs, which isn't necessarily trivial, or run your own local DNS server (which I tried and seemed to work ok).  Instead, I created a seperate container just for the csv-importer. I did this by cloneing the firefly container which already had the LEMP stack installed and everything, and then installed the csv-importer in that container and updated the nginx config to point to the correct root path. To begin, first read through the official documentation so that you hav an idea of whats going on

Container

First, create a 20.04 privileged container with 1 core,  512 mb ram, and default 8GB hard disk space, or clone the firefly container

Installation Instructions

Did I mention to first read through the official documentation?

This requires a LEMP stack and everything, so the easiest thing to do is to clone the FireFly container. I assigned it CT 120 with IP 192.168.1.120. Then, you have to install the CSV-importer app and then edit the nginx config.

If you don't do this, then first start by following the firefly-III installation instructions to get a LEMP stack and other dependicies setup. You could also follow my other guide here, and skip the database setup steps.

CSV-Importer Installation

Here is the online install instructions. Below are the summarized commands

apt install php-bcmath
apt install php-json

Composer should be installed from the container clone. If not then install composer:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Install csv-importer. Change the number at the end to whatever the latest version is

cd /var/www/html
composer create-project firefly-iii/csv-importer --no-dev --prefer-dist csv-importer 2.3.1

chown -R www-data:www-data csv-importer
chmod -R 775 csv-importer/storage
cd /var/www/html/csv-importer
nano .env

Add the firefly url http://192.168.1.128

NGINX

Now update nginx config. Note below the root path is /var/www/html/updated-csv-importer/public. This is because when you update, the method the documentation creates an “updated-csv-importer” folder I think as a backup. I think you could rename it back to csv-importer but if you do, make sure the nginx root file path is correct. 

Note the buffers - I had upstream headers too long to read…errors and its because (I assume) the token returned from firefly is like 800 characters long

server {
       listen       80 default_server;
       listen       [::]:80 default_server;
      # server_name  subdomain.yourdomain.com;
       root         /var/www/html/updated-csv-importer/public;
       index index.html index.htm index.php;
       location / {
               try_files $uri /index.php$is_args$args;
               proxy_buffer_size          128k;
               proxy_buffers              4 256k;
               proxy_busy_buffers_size    256k;
               autoindex on;
               sendfile off;
      }
       location ~ \.php$ {
       fastcgi_pass unix:/run/php/php7.4-fpm.sock;
       fastcgi_index index.php;
       fastcgi_read_timeout 240;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
       fastcgi_split_path_info ^(.+.php)(/.+)$;
       fastcgi_buffers 16 32k;
       fastcgi_buffer_size 64k;
       fastcgi_busy_buffers_size 64k;
       }
   }

Now you can go to the IP address of the csv-importer container. i.e. http://192.168.1.120

Commands

You might need to flush the firefly installation by going to 192.168.1.128/flush. I don't really know what this does but in my debugging this would cause it to work at times

Upgrading

Online documentation here

Just run this command with the correct version number at the end. Update or move the .env file and then update nginx to refer to the new file path 

composer create-project firefly-iii/csv-importer --no-dev --prefer-dist updated-csv-importer 2.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment