Add role for TiddlyWiki

Signed-off-by: Webster Mudge <wmudge@gmail.com>
This commit is contained in:
Webster Mudge 2022-06-18 15:41:25 -04:00
parent 89ccd77185
commit 3ede0c17ef
No known key found for this signature in database
GPG key ID: DDD99B2BBDAE708C
6 changed files with 95 additions and 0 deletions

View file

@ -80,6 +80,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Tautulli](http://tautulli.com/) - Monitor Your Plex Media Server
* [Telegraf](https://github.com/influxdata/telegraf) - Metrics collection agent
* [The Lounge](https://thelounge.chat) - Web based always-on IRC client
* [TiddlyWiki](https://tiddlywiki.com) - A unique non-linear notebook/wiki for capturing, organizing, and sharing complex information
* [TimeMachine](https://github.com/awlx/samba-timemachine) - Samba-based mac backup server
* [Traefik](https://traefik.io/) - Web proxy and SSL certificate manager
* [Transmission](https://transmissionbt.com/) - BitTorrent client (with OpenVPN if you have a supported VPN provider)

View file

@ -0,0 +1,34 @@
# TiddlyWiki
Homepage: [https://www.tiddlywiki.com/](https://www.tiddlywiki.com/)
TiddlyWiki is a unique non-linear notebook for capturing, organizing, and sharing complex information. Use it to keep your to-do list, to plan an essay or novel, or to organise your wedding. Record every thought that crosses your brain, or build a flexible and responsive website. Unlike conventional online services, TiddlyWiki lets you choose where to keep your data, guaranteeing that in the decades to come you will still be able to use the notes you take today.
## Usage
Set `tiddlywiki_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
If you want to access TiddlyWiki externally, set `tiddlywiki_available_externally: "true"` in your `inventories/<your_inventory>/nas.yml` file.
The TiddlyWiki web interface can be found at http://ansible_nas_host_or_ip:8092.
## Specific Configuration
The TiddlyWiki role has several configuration parameters. All parameters are optional.
### Data and Networking
| Parameter | Description |
|---------------------------|-------------------------------|
| tiddlywiki_data_directory | Host location to store data |
| tiddlywiki_port | Host port for internal access |
| tiddlywiki_hostname | Subdomain for external access |
### Server Configuration
| Parameter | Description |
|------------------------|--------------------------|
| tiddlywiki_username | Basic Auth username |
| tiddlywiki_password | Basic Auth password |
| tiddlywiki_node_memory | NodeJS memory allocation |
| tiddlywiki_debug_level | Service debugging |

View file

@ -86,6 +86,7 @@ By default, applications can be found on the ports listed below.
| Syncthing P2P | 22000 | Host | |
| Tautulli | 8185 | Bridge | HTTP |
| The Lounge | 9000 | Bridge | HTTP |
| TiddlyWiki | 8092 | Bridge | HTTP |
| Time Machine | 10445 | Bridge | SMB |
| Traefik | 8083 | Host | HTTP Admin |
| Transmission | 9091 | Bridge | HTTP w/VPN |

View file

@ -313,6 +313,11 @@
- tautulli
when: (tautulli_enabled | default(False))
- role: tiddlywiki
tags:
- tiddlywiki
when: (tiddlywiki_enabled | default(False))
- role: transmission
tags:
- transmission

View file

@ -0,0 +1,24 @@
---
tiddlywiki_enabled: false
tiddlywiki_available_externally: "false"
# Data directory for config file
tiddlywiki_data_directory: "{{ docker_home }}/tiddlywiki"
# Basic auth
# tiddlywiki_username:
# tiddlywiki_password:
# Node low memory
# tiddlywiki_node_memory:
# Server debugging
# tiddlywiki_debug_level: none # full
# Networking
tiddlywiki_port: 8092
tiddlywiki_hostname: tiddlywiki
# Container
tiddlywiki_memory: 512MB

View file

@ -0,0 +1,30 @@
---
- name: Create Tiddlywiki Directory
file:
path: "{{ tiddlywiki_data_directory }}"
state: directory
- name: Create Tiddlywiki Container
docker_container:
name: tiddlywiki
image: wmudge/tiddlywiki:latest
ports:
- "{{ tiddlywiki_port }}:8080"
volumes:
- "{{ tiddlywiki_data_directory }}:/var/lib/tiddlywiki"
env:
NODE_MEM: "{{ tiddlywiki_node_memory | default(omit) }}"
USERNAME: "{{ tiddlywiki_username | default(omit) }}"
PASSWORD: "{{ tiddlywiki_password | default(omit) }}"
DEBUG: "{{ tiddlywiki_debug_level | default(omit) }}"
pull: true
restart_policy: unless-stopped
memory: "{{ tiddlywiki_memory }}"
labels:
traefik.enable: "{{ tiddlywiki_available_externally }}"
traefik.http.routers.tiddlywiki.rule: "Host(`{{ tiddlywiki_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.tiddlywiki.tls.certresolver: "letsencrypt"
traefik.http.routers.tiddlywiki.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.tiddlywiki.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.tiddlywiki.loadbalancer.server.port: "8080"