diff --git a/README.md b/README.md index 2f96fb9b8..4ccdb8dee 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,7 @@ If you have a spare domain name you can configure applications to be accessible * [Sabnzbd](https://sabnzbd.org/) - A powerful usenet downloader that FreeNAS provides * [Seafile](https://www.seafile.com/en/home/) - High performance file syncing and sharing * [SearxNG](https://github.com/searxng/searxng) - Free internet metasearch engine +* [Scribble.rs](https://github.com/scribble-rs/scribble.rs) - A skribbl.io alternative * [Servas](https://github.com/beromir/Servas) - A self-hosted bookmark management tool * [Shaarli](https://github.com/shaarli/Shaarli) - Personal, minimalist, super-fast, database free, bookmarking service * [Shiori](https://github.com/go-shiori/shiori) - Simple bookmark manager built with Go diff --git a/nas.yml b/nas.yml index 681586f6c..7a60b82a5 100644 --- a/nas.yml +++ b/nas.yml @@ -849,6 +849,10 @@ tags: - searxng + - role: scribblers + tags: + - scribblers + - role: shaarli tags: - shaarli diff --git a/roles/scribblers/defaults/main.yml b/roles/scribblers/defaults/main.yml new file mode 100644 index 000000000..165e55d41 --- /dev/null +++ b/roles/scribblers/defaults/main.yml @@ -0,0 +1,53 @@ +--- +scribblers_enabled: false +scribblers_available_externally: false + +# directories +scribblers_data_directory: "{{ docker_home }}/scribblers" + +# network +scribblers_port: "8183" +scribblers_hostname: "scribblers" + +# specs +scribblers_memory: 1g + +# docker +scribblers_container_name: scribblers +scribblers_image_name: biosmarcel/scribble.rs +scribblers_image_version: latest + +scribblers_env_port: "8080" +scribblers_public: "false" +scribblers_drawing_time: "120" +scribblers_rounds: "4" +scribblers_max_players: "12" +scribblers_custom_words: "" +scribblers_custom_words_per_turn: "3" +scribblers_clients_per_ip_limit: "4" +scribblers_language: "english" +scribblers_allowed_origins: "*" +scribblers_allow_credentials: "false" +scribblers_interval: "90s" +scribblers_player_inactivity_threshold: "75s" +scribblers_network_address: "" +scribblers_root_path: "/" +scribblers_cpu_profile_path: "" + +scribblers_env: + PORT: "{{ scribblers_env_port | default(omit) }}" + PUBLIC: "{{ scribblers_public | default(omit) }}" + DRAWING_TIME: "{{ scribblers_drawing_time | default(omit) }}" + ROUNDS: "{{ scribblers_rounds | default(omit) }}" + MAX_PLAYERS: "{{ scribblers_max_players | default(omit) }}" + CUSTOM_WORDS: "{{ scribblers_custom_words | default(omit) }}" + CUSTOM_WORDS_PER_TURN: "{{ scribblers_custom_words_per_turn | default(omit) }}" + CLIENTS_PER_IP_LIMIT: "{{ scribblers_clients_per_ip_limit | default(omit) }}" + LANGUAGE: "{{ scribblers_language | default(omit) }}" + ALLOWED_ORIGINS: "{{ scribblers_allowed_origins | default(omit) }}" + ALLOW_CREDENTIALS: "{{ scribblers_allow_credentials | default(omit) }}" + INTERVAL: "{{ scribblers_interval | default(omit) }}" + PLAYER_INACTIVITY_THRESHOLD: "{{ scribblers_player_inactivity_threshold | default(omit) }}" + NETWORK_ADDRESS: "{{ scribblers_network_address | default(omit) }}" + ROOT_PATH: "{{ scribblers_root_path | default(omit) }}" + CPU_PROFILE_PATH: "{{ scribblers_cpu_profile_path | default(omit) }}" diff --git a/roles/scribblers/molecule/default/molecule.yml b/roles/scribblers/molecule/default/molecule.yml new file mode 100644 index 000000000..ede5f4cde --- /dev/null +++ b/roles/scribblers/molecule/default/molecule.yml @@ -0,0 +1,7 @@ +--- +provisioner: + inventory: + group_vars: + all: + scribblers_enabled: true + scribblers_data_directory: "/tmp/scribblers" diff --git a/roles/scribblers/molecule/default/side_effect.yml b/roles/scribblers/molecule/default/side_effect.yml new file mode 100644 index 000000000..25fb4cb62 --- /dev/null +++ b/roles/scribblers/molecule/default/side_effect.yml @@ -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: + scribblers_enabled: false diff --git a/roles/scribblers/molecule/default/verify.yml b/roles/scribblers/molecule/default/verify.yml new file mode 100644 index 000000000..4c6349979 --- /dev/null +++ b/roles/scribblers/molecule/default/verify.yml @@ -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 container state + community.docker.docker_container_info: + name: "{{ scribblers_container_name }}" + register: result + + - name: Check scribblers is running + ansible.builtin.assert: + that: + - result.container['State']['Status'] == "running" + - result.container['State']['Restarting'] == false diff --git a/roles/scribblers/molecule/default/verify_stopped.yml b/roles/scribblers/molecule/default/verify_stopped.yml new file mode 100644 index 000000000..c164aea3b --- /dev/null +++ b/roles/scribblers/molecule/default/verify_stopped.yml @@ -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 scribblers + community.docker.docker_container: + name: "{{ scribblers_container_name }}" + state: absent + register: result + + - name: Check scribblers is stopped + ansible.builtin.assert: + that: + - not result.changed diff --git a/roles/scribblers/requirements.yml b/roles/scribblers/requirements.yml new file mode 120000 index 000000000..9a736435a --- /dev/null +++ b/roles/scribblers/requirements.yml @@ -0,0 +1 @@ +../../requirements.yml \ No newline at end of file diff --git a/roles/scribblers/tasks/main.yml b/roles/scribblers/tasks/main.yml new file mode 100644 index 000000000..969c03a45 --- /dev/null +++ b/roles/scribblers/tasks/main.yml @@ -0,0 +1,36 @@ +--- +- name: Start Scribble.rs + block: + - name: Create Scribble.rs Directory + ansible.builtin.file: + path: "{{ item }}" + state: directory + with_items: + - "{{ scribblers_data_directory }}" + + - name: Scribble.rs Docker Container + community.docker.docker_container: + name: "{{ scribblers_container_name }}" + image: "{{ scribblers_image_name }}:{{ scribblers_image_version }}" + pull: true + ports: + - "{{ scribblers_port }}:{{ scribblers_env_port }}" + restart_policy: unless-stopped + memory: "{{ scribblers_memory }}" + env: "{{ scribblers_optional_env | default({}) | combine(scribblers_env) }}" + labels: + traefik.enable: "{{ scribblers_available_externally | string }}" + traefik.http.routers.scribblers.rule: "Host(`{{ scribblers_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.scribblers.tls.certresolver: "letsencrypt" + traefik.http.routers.scribblers.tls.domains[0].main: "{{ ansible_nas_domain }}" + traefik.http.routers.scribblers.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" + traefik.http.services.scribblers.loadbalancer.server.port: "8080" + when: scribblers_enabled is true + +- name: Stop Scribble.rs + block: + - name: Stop Scribble.rs + community.docker.docker_container: + name: "{{ scribblers_container_name }}" + state: absent + when: scribblers_enabled is false diff --git a/website/docs/applications/gaming/scribblers.md b/website/docs/applications/gaming/scribblers.md new file mode 100644 index 000000000..78276779c --- /dev/null +++ b/website/docs/applications/gaming/scribblers.md @@ -0,0 +1,14 @@ +--- +title: "Scribble.rs" +description: "A skribbl.io alternative" +--- + +Homepage: [https://github.com/scribble-rs/scribble.rs](https://github.com/scribble-rs/scribble.rs) + +Scribble.rs is an alternative to the web-based drawing game skribbl.io. My main problems with skribbl.io were the ads and the fact that a disconnect would cause you to lose your points. On top of that, the automatic word choice was quite annoying and caused some frustration. + +## Usage + +Set `scribblers_enabled: true` in your `inventories//group_vars/nas.yml` file. + +Scribble.rs web interface can be found at [http://ansible_nas_host_or_ip:8140](http://ansible_nas_host_or_ip:8183).