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.
* ✨ Add n.eko
- Loading branch information
Showing
11 changed files
with
181 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 |
---|---|---|
|
@@ -478,6 +478,10 @@ | |
tags: | ||
- navidrome | ||
|
||
- role: neko | ||
tags: | ||
- neko | ||
|
||
- role: netbootxyz | ||
tags: | ||
- netbootxyz | ||
|
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,37 @@ | ||
--- | ||
neko_enabled: false | ||
neko_available_externally: false | ||
|
||
# directories | ||
neko_data_directory: "{{ docker_home }}/neko" | ||
|
||
# network | ||
neko_port: "8137" | ||
neko_port_epr: "52000-52100" | ||
neko_hostname: "neko" | ||
|
||
# specs | ||
neko_memory: 1g | ||
neko_shm_size: 2G | ||
|
||
# docker | ||
neko_container_name: neko | ||
neko_image_name: "m1k1o/neko" | ||
neko_image_version: chromium | ||
neko_user_id: "1000" | ||
neko_group_id: "1000" | ||
|
||
# neko | ||
neko_screen: "1920x1080@30" | ||
neko_password: neko | ||
neko_password_admin: admin | ||
neko_epr: "52000-52100" | ||
neko_icelite: "true" | ||
neko_file_transfer_enabled: "true" | ||
neko_control_protection: "false" | ||
neko_implicit_control: "false" | ||
neko_locks: "control" | ||
neko_video_codec: "vp8" | ||
neko_audio_codec: "opus" | ||
neko_broadcast_pipeline: "" | ||
neko_nat1to1: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" |
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 @@ | ||
# n.eko | ||
|
||
Homepage: [https://github.com/m1k1o/neko/](https://github.com/m1k1o/neko/) | ||
|
||
A self hosted virtual browser that runs in docker and uses WebRTC. | ||
|
||
## Usage | ||
|
||
Set `neko_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
neko web interface can be found at [http://ansible_nas_host_or_ip:8137](http://ansible_nas_host_or_ip:8137). |
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: | ||
neko_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: | ||
neko_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 neko container state | ||
community.docker.docker_container: | ||
name: "{{ neko_container_name }}" | ||
register: result | ||
|
||
- name: Check if neko 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 neko | ||
community.docker.docker_container: | ||
name: "{{ neko_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check if neko 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,59 @@ | ||
--- | ||
- name: Start neko | ||
block: | ||
- name: Create neko Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
with_items: | ||
- "{{ neko_data_directory }}" | ||
|
||
- name: Create neko Docker Container | ||
community.docker.docker_container: | ||
container_default_behavior: no_defaults | ||
name: "{{ neko_container_name }}" | ||
image: "{{ neko_image_name }}:{{ neko_image_version }}" | ||
pull: true | ||
capabilities: SYS_ADMIN | ||
volumes: | ||
- "{{ neko_data_directory }}/data:/home/neko/Downloads" | ||
- "{{ neko_data_directory }}/media:/media" | ||
ports: | ||
- "{{ neko_port }}:8080" | ||
- "{{ neko_port_epr }}:52000-52100/udp" | ||
env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
UID: "{{ neko_user_id | quote }}" | ||
GID: "{{ neko_group_id | quote }}" | ||
NEKO_SCREEN: "{{ neko_screen }}" | ||
NEKO_PASSWORD: "{{ neko_password }}" | ||
NEKO_PASSWORD_ADMIN: "{{ neko_password_admin }}" | ||
NEKO_EPR: "{{ neko_epr }}" | ||
NEKO_ICELITE: "{{ neko_icelite }}" | ||
NEKO_FILE_TRANSFER_ENABLED: "{{ neko_file_transfer_enabled }}" | ||
NEKO_CONTROL_PROTECTION: "{{ neko_control_protection }}" | ||
NEKO_IMPLICIT_CONTROL: "{{ neko_implicit_control }}" | ||
NEKO_LOCKS: "{{ neko_locks }}" | ||
NEKO_VIDEO_CODEC: "{{ neko_video_codec }}" | ||
NEKO_AUDIO_CODEC: "{{ neko_audio_codec }}" | ||
NEKO_BROADCAST_PIPELINE: "{{ neko_broadcast_pipeline }}" | ||
NEKO_NAT1TO1: "{{ neko_nat1to1 }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ neko_memory }}" | ||
shm_size: "{{ neko_shm_size }}" | ||
labels: | ||
traefik.enable: "{{ neko_available_externally | string }}" | ||
traefik.http.routers.neko.rule: "Host(`{{ neko_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.neko.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.neko.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.neko.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.neko.loadbalancer.server.port: "8080" | ||
when: neko_enabled is true | ||
|
||
- name: Stop neko | ||
block: | ||
- name: Stop neko | ||
community.docker.docker_container: | ||
name: "{{ neko_container_name }}" | ||
state: absent | ||
when: neko_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: "n.eko" | ||
description: "A self hosted virtual browser that runs in docker and uses WebRTC." | ||
--- | ||
|
||
Homepage: [https://github.com/m1k1o/neko/](https://github.com/m1k1o/neko/) | ||
|
||
A self hosted virtual browser that runs in docker and uses WebRTC. | ||
|
||
## Usage | ||
|
||
Set `neko_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
neko web interface can be found at [http://ansible_nas_host_or_ip:8137](http://ansible_nas_host_or_ip:8137). |