diff options
author | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-02-20 20:28:11 -0500 |
---|---|---|
committer | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-02-20 20:28:11 -0500 |
commit | 23b96f0f63a6e5b6389d588268e76b71660678a8 (patch) | |
tree | adab92f48dd3e63a89463fd6be1adbb1c3c5b625 /roles | |
parent | 57df3b2ea3304b0a1b1091a2f8757b469b9d8f51 (diff) | |
download | selfhosted-23b96f0f63a6e5b6389d588268e76b71660678a8.tar.gz selfhosted-23b96f0f63a6e5b6389d588268e76b71660678a8.zip |
teddit: add docs
Diffstat (limited to 'roles')
-rw-r--r-- | roles/teddit/README.md | 66 | ||||
-rw-r--r-- | roles/teddit/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/teddit/templates/opt/teddit/teddit/config.js.j2 | 4 | ||||
-rw-r--r-- | roles/teddit/vars/main.yml | 1 |
4 files changed, 69 insertions, 3 deletions
diff --git a/roles/teddit/README.md b/roles/teddit/README.md new file mode 100644 index 0000000..a77780c --- /dev/null +++ b/roles/teddit/README.md @@ -0,0 +1,66 @@ +Teddit +====== + +Description +----------- + +The `teddit` role installs and configures [Teddit](https://codeberg.org/teddit/teddit), +an open source frontend for Reddit. + +This role configures the NodeJS application only; it does not configure a reverse +proxy. + + +Variables +--------- + +This role **accepts** the following variables: + +Variable | Default | Description +---------------------------------|----------------------|------------ +`teddit_version` | `main` | Git version to install +`teddit_port` | 8080 | Local listening port +`teddit_server_name` | `{{ ansible_fqdn }}` | Canonical HTTP hostname +`teddit_update_on_calendar` | `weekly` | Systemd [calendar interval](https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events) for updating teddit +`teddit_use_reddit_oauth` | no | Use OAuth for Reddit API +`teddit_reddit_app_id` | | Reddit app ID for OAuth +`teddit_theme` | `auto` | Either `dark`, `sepia`, or `auto` +`teddit_clean_homepage` | yes | Use clean homepage +`teddit_flairs_enabled` | no | Show Reddit flairs +`teddit_highlight_controversial` | yes | Highlight controversial comments +`teddit_videos_muted` | yes | Automatically mute videos +`teddit_comments_sort` | `confidence` | Either `confidence`, `top`, `new`, `controversial`, `old`, `random` +`teddit_show_upvotes` | yes | Show upvote counts +`teddit_show_upvote_percentage` | yes | Show upvote percentages +`teddit_suggested_subreddits` | `['All', 'Saved']` | List of suggested subreddits +`teddit_redis_port` | 6379 | Local Redis port +`teddit_cache_control_interval` | 24 | How often to purge static file cache (hours) + + +This role **exports** the following variables: + +Variable | Description +-----------------------|------------ +`teddit_apache_config` | Apache config block to configure a reverse proxy + + +Usage +----- + +Example playbook: + +````yaml +- name: configure teddit + hosts: privbrowse_servers + roles: + - role: teddit + vars: + teddit_server_name: teddit.ipa.example.com + teddit_use_reddit_oauth: no + + - role: apache_vhost + vars: + apache_server_name: '{{ teddit_server_name }}' + apache_server_aliases: [] + apache_config: '{{ teddit_apache_config }}' +```` diff --git a/roles/teddit/defaults/main.yml b/roles/teddit/defaults/main.yml index 35557ef..92f18be 100644 --- a/roles/teddit/defaults/main.yml +++ b/roles/teddit/defaults/main.yml @@ -1,5 +1,4 @@ teddit_version: main -teddit_user: teddit teddit_port: 8080 teddit_server_name: '{{ ansible_fqdn }}' diff --git a/roles/teddit/templates/opt/teddit/teddit/config.js.j2 b/roles/teddit/templates/opt/teddit/teddit/config.js.j2 index 1f56f92..33f39dc 100644 --- a/roles/teddit/templates/opt/teddit/teddit/config.js.j2 +++ b/roles/teddit/templates/opt/teddit/teddit/config.js.j2 @@ -11,8 +11,8 @@ const config = { video_enabled: true, redis_enabled: true, redis_db: 0, - redis_host: {{ teddit_redis_host | to_json }}, - redis_password: {{ teddit_redis_password | to_json }}, + redis_host: "127.0.0.1", + redis_password: "", redis_port: {{ teddit_redis_port | to_json }}, ssl_port: 0, nonssl_port: {{ teddit_port }}, diff --git a/roles/teddit/vars/main.yml b/roles/teddit/vars/main.yml index c294dfa..4604676 100644 --- a/roles/teddit/vars/main.yml +++ b/roles/teddit/vars/main.yml @@ -4,6 +4,7 @@ teddit_packages: - git teddit_git_repo: https://codeberg.org/teddit/teddit +teddit_user: teddit teddit_home: /opt/teddit teddit_install_dir: '{{ teddit_home }}/teddit' |