Skip to content

Commit

Permalink
✨ Add scribble.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
anarion80 committed Oct 23, 2024
1 parent 4ef328c commit 46cddf8
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,10 @@
tags:
- searxng

- role: scribblers
tags:
- scribblers

- role: shaarli
tags:
- shaarli
Expand Down
53 changes: 53 additions & 0 deletions roles/scribblers/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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) }}"
7 changes: 7 additions & 0 deletions roles/scribblers/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
provisioner:
inventory:
group_vars:
all:
scribblers_enabled: true
scribblers_data_directory: "/tmp/scribblers"
10 changes: 10 additions & 0 deletions roles/scribblers/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:
scribblers_enabled: false
19 changes: 19 additions & 0 deletions roles/scribblers/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 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
19 changes: 19 additions & 0 deletions roles/scribblers/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 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
1 change: 1 addition & 0 deletions roles/scribblers/requirements.yml
36 changes: 36 additions & 0 deletions roles/scribblers/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions website/docs/applications/gaming/scribblers.md
Original file line number Diff line number Diff line change
@@ -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/<your_inventory>/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).

0 comments on commit 46cddf8

Please sign in to comment.