diff --git a/README.md b/README.md index f50cfaa2..66dea8c9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ After getting burned by broken FreeNAS updates one too many times, I figured I could do a much better job myself using just a stock Ubuntu install, some clever Ansible config and a bunch of Docker containers. -## What This Sets Up +## What Ansible-NAS Can Set Up * An awesome dashboard to your home server (Heimdall) * Any number of Samba shares or NFS exports for you to store your stuff @@ -23,15 +23,17 @@ Ansible config and a bunch of Docker containers. * SSL secured external access to applications via Traefik * A Docker host with Portainer for image and container management * An automatic dynamic DNS updater if you use Cloudflare to host your domain DNS +* A Personal finance manager ### Docker Containers Used * [Airsonic](https://airsonic.github.io/) - catalog and stream music * [Bitwarden_rs](https://github.com/dani-garcia/bitwarden_rs) - Self-Hosting port of password manager -* [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your dynamic IP address +* [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your IP address * [CouchPotato](https://couchpota.to/) - for downloading and managing movies * [Duplicati](https://www.duplicati.com/) - for backing up your stuff * [Emby](https://emby.media/) - Media streaming and management +* [Firefly III](https://firefly-iii.org/) - Free and open source personal finance manager * [get_iplayer](https://github.com/get-iplayer/get_iplayer) - download programmes from BBC iplayer * [Gitea](https://gitea.io/en-us/) - Self-hosted Github clone * [Glances](https://nicolargo.github.io/glances/) - for seeing the state of your system via a web browser @@ -71,10 +73,9 @@ others could benefit, add it and raise a PR! ## What This Doesn't Do -Ansible NAS doesn't set up your disk partitions, primarily because getting it -wrong can be incredibly destructive. That aside, configuring partitions is -usually a one-time (or very infrequent) event, so there's not much to be gained -by automating it. +Ansible NAS doesn't set up your disk partitions, primarily because getting it wrong can be incredibly destructive. +That aside, configuring partitions is usually a one-time (or very infrequent) event, so there's not much to be +gained by automating it. Check out the [docs](https://davestephens.github.io/ansible-nas) for recommended setups. ## Quick Start @@ -134,7 +135,7 @@ Contributions are welcome, please feel free to raise a PR! `tests/test-vagrant.sh` script to spin up a test VM. Note that Ansible-NAS requires Vagrant version 2.2.2 or later, so for stock Ubuntu 18.04.2, you will have to download and install the newest version from - https://www.vagrantup.com/downloads.html . + https://www.vagrantup.com/downloads.html. * Run `ansible-lint` against the playbook before committing. (There is a VSCode task set up to run the right command for you) * Please know that your efforts are appreciated, thanks! :+1: diff --git a/docs/applications/firefly.md b/docs/applications/firefly.md new file mode 100644 index 00000000..3a8a843e --- /dev/null +++ b/docs/applications/firefly.md @@ -0,0 +1,11 @@ +# Firefly III + +Homepage: [https://firefly-iii.org/](https://firefly-iii.org/) + +Firefly III is a self-hosted financial manager. It can help you keep track of expenses, income, budgets and everything in between. It supports credit cards, shared household accounts and savings accounts. It’s pretty fancy. You should use it to save and organise money. + +## Usage + +Set `firefly_enabled: true` in your `group_vars/all.yml` file. + +The very basic MiniDLNA web interface can be found at http://ansible_nas_host_or_ip:8066. diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index f3f0569a..e47f5009 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -10,6 +10,7 @@ By default, applications can be found on the ports listed below. | Duplicati | 8200 | | | Emby | 8096 | HTTP | | Emby | 8920 | HTTPS | +| Firefly III | 8066 | | | get_iplayer | 8182 | | | Gitea | 3001 | Web | | Gitea | 222 | SSH | diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 000773e9..f873a03c 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -64,6 +64,9 @@ thelounge_enabled: false # Password Management bitwarden_enabled: false +# Finance +firefly_enabled: false + ### ### General ### @@ -525,3 +528,9 @@ bitwarden_admin_token: qwertyuiop1234567890poiuytrewq0987654321 # Once you have created your user, set to "false" and run one more time. # Target just Bitwarden by running: ansible-playbook -i inventory nas.yml -b -K -t bitwarden bitwarden_allow_signups: false + +### +### Firefly +### +firefly_available_externally: "false" +firefly_data_directory: "{{ docker_home }}/firefly" \ No newline at end of file diff --git a/nas.yml b/nas.yml index 428872f7..adbd32fc 100644 --- a/nas.yml +++ b/nas.yml @@ -48,6 +48,10 @@ when: (plex_enabled | default(False)) tags: plex + - import_tasks: tasks/firefly.yml + when: (firefly_enabled | default(False)) + tags: firefly + - import_tasks: tasks/emby.yml when: (emby_enabled | default(False)) tags: emby diff --git a/tasks/firefly.yml b/tasks/firefly.yml new file mode 100644 index 00000000..36bb80bd --- /dev/null +++ b/tasks/firefly.yml @@ -0,0 +1,56 @@ +- name: Create Firefly III Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ firefly_data_directory }}/postgresql" + - "{{ firefly_data_directory }}/mysql" + - "{{ firefly_data_directory }}/upload" + - "{{ firefly_data_directory }}/export" + +- name: Create MySQL container for Firefly + docker_container: + name: firefly-mysql + image: mysql:5.7 + pull: true + volumes: + - "{{ firefly_data_directory }}/mysql:/var/lib/mysql:rw" + env: + MYSQL_DATABASE: firefly + MYSQL_USER: firefly + MYSQL_PASSWORD: firefly + MYSQL_ROOT_PASSWORD: firefly + restart_policy: unless-stopped + memory: 1g + +- name: Wait for MySQL to init + pause: + seconds: 30 + +- name: Create Firefly III container + docker_container: + name: firefly + image: jc5x/firefly-iii:latest + pull: true + volumes: + - "{{ firefly_data_directory }}/export:/var/www/firefly-iii/storage/export:rw" + - "{{ firefly_data_directory }}/upload:/var/www/firefly-iii/storage/upload:rw" + links: + - firefly-mysql:db + ports: + - "8066:80" + env: + FF_APP_ENV: "local" + FF_APP_KEY: "S0m3R@nd0mString0f32Ch@rsEx@ct1y" + FF_DB_HOST: "db" + FF_DB_NAME: "firefly" + FF_DB_USER: "firefly" + FF_DB_PASSWORD: "firefly" + TZ: "{{ ansible_nas_timezone }}" + restart_policy: unless-stopped + memory: 1g + labels: + traefik.backend: "firefly" + traefik.frontend.rule: "Host:firefly.{{ ansible_nas_domain }}" + traefik.enable: "{{ firefly_available_externally }}" + traefik.port: "8080"