forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from anarion80/add_pinchflat
✨ Add Pinchflat
- Loading branch information
Showing
10 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -729,6 +729,10 @@ | |
tags: | ||
- phpmyadmin | ||
|
||
- role: pinchflat | ||
tags: | ||
- pinchflat | ||
|
||
- role: piwigo | ||
tags: | ||
- piwigo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
pinchflat_enabled: false | ||
pinchflat_available_externally: false | ||
|
||
# directories | ||
pinchflat_data_directory: "{{ docker_home }}/pinchflat" | ||
|
||
# network | ||
pinchflat_port: "8175" | ||
pinchflat_hostname: "pinchflat" | ||
|
||
# specs | ||
pinchflat_memory: 1g | ||
|
||
# docker | ||
pinchflat_container_name: pinchflat | ||
pinchflat_image_name: "ghcr.io/kieraneglin/pinchflat" | ||
pinchflat_image_version: latest | ||
pinchflat_user_id: "1000" | ||
pinchflat_group_id: "1000" | ||
|
||
# pinchflat | ||
pinchflat_downloads_directory: "{{ downloads_root }}/pinchflat" | ||
pinchflat_timezone: "{{ ansible_nas_timezone }}" | ||
pinchflat_log_level: "debug" | ||
pinchflat_basic_auth_username: "pinchflat" | ||
pinchflat_basic_auth_password: "pinchflat" | ||
pinchflat_expose_feed_endpoints: "false" | ||
pinchflat_enable_ipv6: "false" | ||
pinchflat_journal_mode: "wal" | ||
pinchflat_tz_data_dir: "/etc/elixir_tzdata_data" | ||
pinchflat_base_route_path: "/" | ||
pinchflat_yt_dlp_worker_concurrency: "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
pinchflat_enabled: true | ||
pinchflat_downloads_directory: "/tmp/downloads" | ||
pinchflat_data_directory: "/tmp" | ||
platforms: | ||
- name: instance | ||
image: geerlingguy/docker-ubuntu2204-ansible:latest | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /tmp:/tmp | ||
cgroupns_mode: host | ||
privileged: true | ||
pre_build_image: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
pinchflat_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 pinchflat container state | ||
community.docker.docker_container: | ||
name: "{{ pinchflat_container_name }}" | ||
register: result | ||
|
||
- name: Check if pinchflat containers are running | ||
ansible.builtin.assert: | ||
that: | ||
- result.container['State']['Status'] == "running" | ||
- result.container['State']['Restarting'] == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 pinchflat | ||
community.docker.docker_container: | ||
name: "{{ pinchflat_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check if pinchflat is stopped | ||
ansible.builtin.assert: | ||
that: | ||
- not result.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../requirements.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
- name: Start Pocket-ID | ||
block: | ||
- name: Create Pocket-ID Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
owner: "{{ pinchflat_user_id }}" | ||
group: "{{ pinchflat_group_id }}" | ||
with_items: | ||
- "{{ pinchflat_data_directory }}" | ||
- "{{ pinchflat_data_directory }}/config" | ||
|
||
- name: Change ownership of downloads directory | ||
ansible.builtin.file: | ||
path: "{{ pinchflat_downloads_directory }}" | ||
state: directory | ||
owner: "{{ pinchflat_user_id }}" | ||
group: "{{ pinchflat_group_id }}" | ||
recurse: yes | ||
|
||
- name: Create Pocket-ID Docker Container | ||
community.docker.docker_container: | ||
container_default_behavior: no_defaults | ||
name: "{{ pinchflat_container_name }}" | ||
image: "{{ pinchflat_image_name }}:{{ pinchflat_image_version }}" | ||
user: "{{ pinchflat_user_id }}:{{ pinchflat_group_id }}" | ||
pull: true | ||
volumes: | ||
- "{{ pinchflat_data_directory }}/config:/config" | ||
- "{{ pinchflat_downloads_directory }}:/downloads:rw" | ||
ports: | ||
- "{{ pinchflat_port }}:8945" | ||
env: | ||
TZ: "{{ pinchflat_timezone }}" | ||
LOG_LEVEL: "{{ pinchflat_log_level }}" | ||
BASIC_AUTH_USERNAME: "{{ pinchflat_basic_auth_username }}" | ||
BASIC_AUTH_PASSWORD: "{{ pinchflat_basic_auth_password }}" | ||
EXPOSE_FEED_ENDPOINTS: "{{ pinchflat_expose_feed_endpoints }}" | ||
ENABLE_IPV6: "{{ pinchflat_enable_ipv6 }}" | ||
JOURNAL_MODE: "{{ pinchflat_journal_mode }}" | ||
TZ_DATA_DIR: "{{ pinchflat_tz_data_dir }}" | ||
BASE_ROUTE_PATH: "{{ pinchflat_base_route_path }}" | ||
YT_DLP_WORKER_CONCURRENCY: "{{ pinchflat_yt_dlp_worker_concurrency }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ pinchflat_memory }}" | ||
tty: true | ||
labels: | ||
traefik.enable: "{{ pinchflat_available_externally | string }}" | ||
traefik.http.routers.pinchflat.rule: "Host(`{{ pinchflat_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.pinchflat.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.pinchflat.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.pinchflat.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.pinchflat.loadbalancer.server.port: "8945" | ||
when: pinchflat_enabled is true | ||
|
||
- name: Stop Pocket-ID | ||
block: | ||
- name: Stop Pocket-ID | ||
community.docker.docker_container: | ||
name: "{{ pinchflat_container_name }}" | ||
state: absent | ||
when: pinchflat_enabled is false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: "Pinchflat" | ||
description: "Your next YouTube media manager" | ||
--- | ||
|
||
Homepage: [https://github.com/kieraneglin/pinchflat](https://github.com/kieraneglin/pinchflat) | ||
|
||
Pinchflat is a self-hosted app for downloading YouTube content built using yt-dlp. It's designed to be lightweight, self-contained, and easy to use. You set up rules for how to download content from YouTube channels or playlists and it'll do the rest, periodically checking for new content. It's perfect for people who want to download content for use in with a media center app (Plex, Jellyfin, Kodi) or for those who want to archive media! | ||
|
||
## Usage | ||
|
||
Set `pinchflat_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
Pinchflat web interface can be found at [http://ansible_nas_host_or_ip:8175](http://ansible_nas_host_or_ip:8175). |