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 fusion #180

Merged
merged 4 commits into from
Aug 26, 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 @@ -72,6 +72,7 @@ If you have a spare domain name you can configure applications to be accessible
* [FormIO](https://github.com/formio/formio) - SA Form and Data Management Platform for Progressive Web Applications
* [Fresh RSS](https://freshrss.org/) - Self-hosted RSS feed aggregator like Leed or Kriss Feed
* [Frigate](https://frigate.video/) - Frigate is an open source NVR built around real-time AI object detection
* [Fusion](https://github.com/0x2E/fusion) - A lightweight, self-hosted friendly RSS aggregator and reader
* [Gaps](https://github.com/JasonHHouse/gaps) - Find the missing movies in your Plex Server
* [get_iplayer](https://github.com/get-iplayer/get_iplayer) - download programmes from BBC iplayer
* [Ghost](https://ghost.org/) - Turn your audience into a business. Publishing, memberships, subscriptions and newsletters
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@
tags:
- frigate

- role: fusion
tags:
- fusion

- role: gaps
tags:
- gaps
Expand Down
48 changes: 48 additions & 0 deletions roles/fusion/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
fusion_enabled: false
fusion_available_externally: false

# directories
fusion_data_directory: "{{ docker_home }}/fusion"

# network
fusion_port: "8170"
fusion_hostname: "fusion"

# specs
fusion_memory: 1g

# docker
fusion_container_name: fusion
fusion_image_name: "rook1e404/fusion"
fusion_image_version: latest
fusion_user_id: "1000"
fusion_group_id: "1000"

# fusion
fusion_host: "0.0.0.0"
fusion_port_internal: "8080"
fusion_password: "super_secure"
fusion_db: "fusion.db"
fusion_secure_cookie: "false"
fusion_tls_cert: ""
fusion_tls_key: ""

fusion_env:
HOST: "{{ fusion_host }}"
PORT: "{{ fusion_port_internal }}"

# WebUI password
PASSWORD: "{{ fusion_password }}"

# Path to store sqlite DB file
DB: "{{ fusion_db }}"

# Enable Secure Cookie
# It is automatically set to true when TLS_* is not empty.
SECURE_COOKIE: "{{ fusion_secure_cookie }}"

# Path to TLS cert and key files
# If you are using a reverse proxy like Nginx to handle HTTPS, please leave these empty.
TLS_CERT: "{{ fusion_tls_cert }}"
TLS_KEY: "{{ fusion_tls_key }}"
7 changes: 7 additions & 0 deletions roles/fusion/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
provisioner:
inventory:
group_vars:
all:
fusion_enabled: true
fusion_data_directory: /tmp/fusion
10 changes: 10 additions & 0 deletions roles/fusion/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:
fusion_enabled: false
20 changes: 20 additions & 0 deletions roles/fusion/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get fusion container state
community.docker.docker_container:
name: "{{ fusion_container_name }}"
env: "{{ fusion_env }}"
register: result

- name: Check if fusion containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
19 changes: 19 additions & 0 deletions roles/fusion/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 fusion
community.docker.docker_container:
name: "{{ fusion_container_name }}"
state: absent
register: result

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

- name: Create Fusion Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ fusion_container_name }}"
image: "{{ fusion_image_name }}:{{ fusion_image_version }}"
pull: true
volumes:
- "{{ fusion_data_directory }}/data:/data:rw"
ports:
- "{{ fusion_port }}:8080"
env: "{{ fusion_env }}"
restart_policy: unless-stopped
memory: "{{ fusion_memory }}"
labels:
traefik.enable: "{{ fusion_available_externally | string }}"
traefik.http.routers.fusion.rule: "Host(`{{ fusion_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.fusion.tls.certresolver: "letsencrypt"
traefik.http.routers.fusion.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.fusion.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.fusion.loadbalancer.server.port: "8080"
when: fusion_enabled is true

- name: Stop Fusion
block:
- name: Stop Fusion
community.docker.docker_container:
name: "{{ fusion_container_name }}"
state: absent
when: fusion_enabled is false
14 changes: 14 additions & 0 deletions website/docs/applications/news/fusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Fusion"
description: "Lightweight, self-hosted friendly RSS aggregator and reader"
---

Homepage: [https://github.com/0x2E/fusion](https://github.com/0x2E/fusion)

A lightweight RSS feed aggregator and reader.

## Usage

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

Fusion web interface can be found at [http://ansible_nas_host_or_ip:8170](http://ansible_nas_host_or_ip:8170).