-
-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ansible-nas-flaresolverr' of https://github.com/darshit…
- Loading branch information
Showing
9 changed files
with
129 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 |
---|---|---|
|
@@ -133,6 +133,10 @@ | |
tags: | ||
- firefly | ||
|
||
- role: flaresolverr | ||
tags: | ||
- flaresolverr | ||
|
||
- role: freshrss | ||
tags: | ||
- freshrss | ||
|
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 @@ | ||
--- | ||
flaresolverr_enabled: false | ||
flaresolverr_available_externally: false | ||
|
||
# directories | ||
flaresolverr_config_directory: "{{ docker_home }}/flaresolverr/config" | ||
|
||
# uid / gid | ||
flaresolverr_user_id: "0" | ||
flaresolverr_group_id: "0" | ||
|
||
# network | ||
flaresolverr_port: "8191" | ||
|
||
# specs | ||
flaresolverr_memory: 200m | ||
|
||
# docker | ||
flaresolverr_container_name: flaresolverr |
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,11 @@ | ||
# FlareSolverr | ||
|
||
Homepage: <https://github.com/FlareSolverr/FlareSolverr> | ||
|
||
FlareSolverr is a proxy server to bypass Cloudflare and DDoS-GUARD protection. Some Jackett indexers require it. | ||
|
||
## Usage | ||
|
||
Set `flaresolverr_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. | ||
|
||
The FlareSolverr API can be accessed from <http://ansible_nas_host_or_ip:8191>. |
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,6 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
flaresolverr_enabled: 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: | ||
flaresolverr_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,18 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get container state | ||
community.docker.docker_container_info: | ||
name: "{{ flaresolverr_container_name }}" | ||
register: result | ||
|
||
- name: Check FlareSolverr is 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,18 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Try and stop and remove FlareSolverr | ||
community.docker.docker_container: | ||
name: "{{ flaresolverr_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check FlareSolverr 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,42 @@ | ||
--- | ||
- name: Start FlareSolverr | ||
block: | ||
- name: Create FlareSolverr Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
# mode: 0755 | ||
with_items: | ||
- "{{ docker_home }}/flaresolverr/config" | ||
|
||
- name: FlareSolverr Docker Container | ||
community.docker.docker_container: | ||
name: "{{ flaresolverr_container_name }}" | ||
image: flaresolverr/flaresolverr | ||
pull: true | ||
volumes: | ||
- "{{ flaresolverr_config_directory }}:/config:rw" | ||
ports: | ||
- "{{ flaresolverr_port }}:5050" | ||
env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
PUID: "{{ flaresolverr_user_id }}" | ||
PGID: "{{ flaresolverr_group_id }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ flaresolverr_memory }}" | ||
labels: | ||
traefik.enable: "{{ flaresolverr_available_externally | string }}" | ||
traefik.http.routers.flaresolverr.rule: "Host(`flaresolverr.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.flaresolverr.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.flaresolverr.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.flaresolverr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.flaresolverr.loadbalancer.server.port: "8191" | ||
when: flaresolverr_enabled is true | ||
|
||
- name: Stop FlareSolverr | ||
block: | ||
- name: Stop FlareSolverr | ||
community.docker.docker_container: | ||
name: "{{ flaresolverr_container_name }}" | ||
state: absent | ||
when: flaresolverr_enabled is false |