Skip to content

Commit

Permalink
✨ Add n.eko (#127)
Browse files Browse the repository at this point in the history
* ✨ Add n.eko
  • Loading branch information
anarion80 authored May 8, 2024
1 parent 803ccb3 commit 5c7f5a2
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ If you have a spare domain name you can configure applications to be accessible
* [MySql](https://www.mysql.com/) - The world's most popular open source database
* [n8n](https://n8n.io/) - Nodemation, a node based workflow and automation service like IFTTT.
* [navidrome](https://www.navidrome.org/) - Modern Music Server and Streamer compatible with Subsonic/Airsonic
* [n.eko](https://github.com/m1k1o/neko/) - A self hosted virtual browser that runs in docker and uses WebRTC.
* [netboot.xyz](https://netboot.xyz/) - a PXE boot server
* [Netbox](https://netbox.dev/) - The premiere source of truth powering network automation
* [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@
tags:
- navidrome

- role: neko
tags:
- neko

- role: netbootxyz
tags:
- netbootxyz
Expand Down
37 changes: 37 additions & 0 deletions roles/neko/defaults/main.yml
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'] }}"
11 changes: 11 additions & 0 deletions roles/neko/docs/neko.md
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).
6 changes: 6 additions & 0 deletions roles/neko/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
neko_enabled: true
10 changes: 10 additions & 0 deletions roles/neko/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:
neko_enabled: false
19 changes: 19 additions & 0 deletions roles/neko/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 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
19 changes: 19 additions & 0 deletions roles/neko/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 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
1 change: 1 addition & 0 deletions roles/neko/requirements.yml
59 changes: 59 additions & 0 deletions roles/neko/tasks/main.yml
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
14 changes: 14 additions & 0 deletions website/docs/applications/other/neko.md
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).

0 comments on commit 5c7f5a2

Please sign in to comment.