Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Actual #156

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ If you have a spare domain name you can configure applications to be accessible
## Available Applications

* [Activepieces](https://www.activepieces.com/) - an open source all-in-one automation tool
* [Actual](https://github.com/actualbudget/actual-server) - A local-first personal finance app
* [Admidio](https://www.admidio.org/) - a free online membership management
* [Affine](https://github.com/toeverything/AFFiNE) - a next-gen knowledge base that brings planning, sorting and creating all together
* [Airsonic](https://airsonic.github.io/) - catalog and stream music
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
tags:
- activepieces

- role: actual
tags:
- actual

- role: admidio
tags:
- admidio
Expand Down
25 changes: 25 additions & 0 deletions roles/actual/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
actual_enabled: false
actual_available_externally: false

# directories
actual_data_directory: "{{ docker_home }}/actual"

# network
actual_port: "5008"
actual_hostname: "actual"

# specs
actual_memory: 1g

# docker
actual_container_name: actual
actual_image_name: "docker.io/actualbudget/actual-server"
actual_image_version: latest
actual_user_id: "1000"
actual_group_id: "1000"

# actual
actual_upload_file_sync_size_limit_mb: "20"
actual_upload_sync_encrypted_file_sync_size_limit_mb: "50"
actual_upload_file_size_limit_mb: "20"
11 changes: 11 additions & 0 deletions roles/actual/docs/actual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Actual

Homepage: [https://github.com/actualbudget/actual-server](https://github.com/actualbudget/actual-server)

A local-first personal finance app

## Usage

Set `actual_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

actual web interface can be found at [http://ansible_nas_host_or_ip:5008](http://ansible_nas_host_or_ip:5008).
6 changes: 6 additions & 0 deletions roles/actual/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
actual_enabled: true
10 changes: 10 additions & 0 deletions roles/actual/molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
actual_enabled: false
19 changes: 19 additions & 0 deletions roles/actual/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get actual container state
community.docker.docker_container:
name: "{{ actual_container_name }}"
register: result

- name: Check if actual containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
19 changes: 19 additions & 0 deletions roles/actual/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove actual
community.docker.docker_container:
name: "{{ actual_container_name }}"
state: absent
register: result

- name: Check if actual is stopped
ansible.builtin.assert:
that:
- not result.changed
1 change: 1 addition & 0 deletions roles/actual/requirements.yml
43 changes: 43 additions & 0 deletions roles/actual/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
- name: Start Actual
block:
- name: Create Actual Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ actual_data_directory }}"
- "{{ actual_data_directory }}/data"

- name: Create Actual Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ actual_container_name }}"
image: "{{ actual_image_name }}:{{ actual_image_version }}"
pull: true
volumes:
- "{{ actual_data_directory }}/data:/data:rw"
ports:
- "{{ actual_port }}:5006"
env:
ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB: "{{ actual_upload_file_sync_size_limit_mb }}"
ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB: "{{ actual_upload_sync_encrypted_file_sync_size_limit_mb }}"
ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB: "{{ actual_upload_file_size_limit_mb }}"
restart_policy: unless-stopped
memory: "{{ actual_memory }}"
labels:
traefik.enable: "{{ actual_available_externally | string }}"
traefik.http.routers.actual.rule: "Host(`{{ actual_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.actual.tls.certresolver: "letsencrypt"
traefik.http.routers.actual.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.actual.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.actual.loadbalancer.server.port: "5006"
when: actual_enabled is true

- name: Stop Actual
block:
- name: Stop Actual
community.docker.docker_container:
name: "{{ actual_container_name }}"
state: absent
when: actual_enabled is false
14 changes: 14 additions & 0 deletions website/docs/applications/other/actual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Actual"
description: "A local-first personal finance app"
---

Homepage: [https://github.com/actualbudget/actual-server](https://github.com/actualbudget/actual-server)

A local-first personal finance app

## Usage

Set `actual_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

actual web interface can be found at [http://ansible_nas_host_or_ip:5008](http://ansible_nas_host_or_ip:5008).