From f5a78828993148805d7d4521f56b43e222b22315 Mon Sep 17 00:00:00 2001 From: Michael Zufelt Date: Thu, 8 Apr 2021 09:35:33 -0400 Subject: [PATCH 1/4] Partial update to README --- README.md | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bbc342c..f3281e6 100644 --- a/README.md +++ b/README.md @@ -47,18 +47,52 @@ Community instances: See ```CHANGELOG.md``` ## Installation -### Docker - -Using [Docker and `docker-compose`](https://github.com/docker/compose): +### Docker-compose method ```console +wget https://codeberg.org/teddit/teddit/raw/branch/main/docker-compose.yml docker-compose build docker-compose up ``` Teddit should now be running at . -Docker image is available at [https://hub.docker.com/r/teddit/teddit](https://hub.docker.com/r/teddit/teddit) +Docker image is available at [https://hub.docker.com/r/teddit/teddit](https://hub.docker.com/r/teddit/teddit). + +#### Environment Variables + +The following variables may be set to customize your deployment at runtime. + +| Variable | Description | +|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| domain | Defines URL for Teddit to use (i.e. teddit.domain.com). Defaults to **127.0.0.1** | +| use_reddit_oauth | *Boolean* If true, "reddit_app_id" must be set with your own Reddit app ID. If false, Teddit uses Reddit's public API. Defaults to **false** | +| cert_dir | Defines location of certificates if using HTTPS (i.e. /home/teddit/le/live/teddit.net). No trailing slash. | +| theme | Automatically theme the user's browser experience. Options are *auto*, *dark*, *sepia*, or you can set *white* by setting the variable to empty ( '' ). Defaults to **auto** | +| flairs_enabled | Enables the rendering of user and link flairs on Teddit. Defaults to **true** | +| highlight_controversial | Enables controversial comments to be indicated by a typographical dagger (†). Defaults to **true** | +| api_enabled | Teddit API feature. Might increase loads significantly on your instance. Defaults to **true** | +| video_enabled | Enables video playback within Teddit. Defaults to **true** | +| redis_enabled | Enables Redis caching. If disabled, does not allow for any caching of Reddit API calls. Defaults to **true** | +| redis_db | Sets the redis DB name, if required | +| redis_host | Sets the redis host location, if required. Defaults to **127.0.0.1** | +| redis_password | Sets the redis password, if required | +| redis_port | Sets the redis port, if required. Defaults to **6379** | +| ssl_port | Sets the SSL port Teddit listens on. Defaults to **8088** | +| nonssl_port | Sets the non-SSL port Teddit listens on. Defaults to **8080** | +| listen_address | Sets the address Teddit listens for requests on. Defaults to **0.0.0.0** | +| https_enabled | *Boolean* Sets whether or not to enable HTTPS for Teddit. Defaults to **false** | +| redirect_http_to_https | *Boolean* Sets whether to force redirection from HTTP to HTTPS. Defaults to **false** | +| redirect_www | | +| use_compression | | +| use_view_cache | | +| use_helmet | | +| use_helmet_hsts | | +| trust_proxy | | +| trust_proxy_address | | +| nsfw_enabled | | +| post_comments_sort | | +| reddit_app_id | | ### Manual From 611361ef479c0d2292ede43a879d7ef4734690f1 Mon Sep 17 00:00:00 2001 From: Michael Zufelt Date: Thu, 8 Apr 2021 10:14:52 -0400 Subject: [PATCH 2/4] Full env variable table built --- README.md | 60 +++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index f3281e6..dbea54e 100644 --- a/README.md +++ b/README.md @@ -63,36 +63,36 @@ Docker image is available at [https://hub.docker.com/r/teddit/teddit](https://hu The following variables may be set to customize your deployment at runtime. -| Variable | Description | -|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| domain | Defines URL for Teddit to use (i.e. teddit.domain.com). Defaults to **127.0.0.1** | -| use_reddit_oauth | *Boolean* If true, "reddit_app_id" must be set with your own Reddit app ID. If false, Teddit uses Reddit's public API. Defaults to **false** | -| cert_dir | Defines location of certificates if using HTTPS (i.e. /home/teddit/le/live/teddit.net). No trailing slash. | -| theme | Automatically theme the user's browser experience. Options are *auto*, *dark*, *sepia*, or you can set *white* by setting the variable to empty ( '' ). Defaults to **auto** | -| flairs_enabled | Enables the rendering of user and link flairs on Teddit. Defaults to **true** | -| highlight_controversial | Enables controversial comments to be indicated by a typographical dagger (†). Defaults to **true** | -| api_enabled | Teddit API feature. Might increase loads significantly on your instance. Defaults to **true** | -| video_enabled | Enables video playback within Teddit. Defaults to **true** | -| redis_enabled | Enables Redis caching. If disabled, does not allow for any caching of Reddit API calls. Defaults to **true** | -| redis_db | Sets the redis DB name, if required | -| redis_host | Sets the redis host location, if required. Defaults to **127.0.0.1** | -| redis_password | Sets the redis password, if required | -| redis_port | Sets the redis port, if required. Defaults to **6379** | -| ssl_port | Sets the SSL port Teddit listens on. Defaults to **8088** | -| nonssl_port | Sets the non-SSL port Teddit listens on. Defaults to **8080** | -| listen_address | Sets the address Teddit listens for requests on. Defaults to **0.0.0.0** | -| https_enabled | *Boolean* Sets whether or not to enable HTTPS for Teddit. Defaults to **false** | -| redirect_http_to_https | *Boolean* Sets whether to force redirection from HTTP to HTTPS. Defaults to **false** | -| redirect_www | | -| use_compression | | -| use_view_cache | | -| use_helmet | | -| use_helmet_hsts | | -| trust_proxy | | -| trust_proxy_address | | -| nsfw_enabled | | -| post_comments_sort | | -| reddit_app_id | | +| Variable | Description | +|-|-| +| domain | Defines URL for Teddit to use (i.e. teddit.domain.com). Defaults to **127.0.0.1** | +| use_reddit_oauth | *Boolean* If true, "reddit_app_id" must be set with your own Reddit app ID. If false, Teddit uses Reddit's public API. Defaults to **false** | +| cert_dir | Defines location of certificates if using HTTPS (i.e. /home/teddit/le/live/teddit.net). No trailing slash. | +| theme | Automatically theme the user's browser experience. Options are *auto*, *dark*, *sepia*, or you can set *white* by setting the variable to empty ( '' ). Defaults to **auto** | +| flairs_enabled | Enables the rendering of user and link flairs on Teddit. Defaults to **true** | +| highlight_controversial | Enables controversial comments to be indicated by a typographical dagger (†). Defaults to **true** | +| api_enabled | Teddit API feature. Might increase loads significantly on your instance. Defaults to **true** | +| video_enabled | Enables video playback within Teddit. Defaults to **true** | +| redis_enabled | Enables Redis caching. If disabled, does not allow for any caching of Reddit API calls. Defaults to **true** | +| redis_db | Sets the redis DB name, if required | +| redis_host | Sets the redis host location, if required. Defaults to **127.0.0.1** | +| redis_password | Sets the redis password, if required | +| redis_port | Sets the redis port, if required. Defaults to **6379** | +| ssl_port | Sets the SSL port Teddit listens on. Defaults to **8088** | +| nonssl_port | Sets the non-SSL port Teddit listens on. Defaults to **8080** | +| listen_address | Sets the address Teddit listens for requests on. Defaults to **0.0.0.0** | +| https_enabled | *Boolean* Sets whether or not to enable HTTPS for Teddit. Defaults to **false** | +| redirect_http_to_https | *Boolean* Sets whether to force redirection from HTTP to HTTPS. Defaults to **false** | +| redirect_www | *Boolean* Defaults to **false** | +| use_compression | *Boolean* Defaults to **true** | +| use_view_cache | *Boolean* Defaults to **false** | +| use_helmet | *Boolean* Recommended to be true when using https. Defaults to **false** | +| use_helmet_hsts | *Boolean* Recommended to be true when using https. Defaults to **false** | +| trust_proxy | *Boolean* Enable trust_proxy if you are using a reverse proxy like nginx or traefik. Defaults to **false** | +| trust_proxy_address | Location of trust_proxy. Defaults to **127.0.0.1** | +| nsfw_enabled | *Boolean* Enable NSFW (over 18) content. If false, a warning is shown to the user before opening any NSFW post. When the NFSW content is disabled, NSFW posts are hidden from subreddits and from user page feeds. Note: Users can set this to true or false from their preferences. Defaults to **true** | +| post_comments_sort | Defines default sort preference. Options are *confidence* (default sorting option in Reddit), *top*, *new*, *controversal*, *old*, *random*, *qa*, *live*. Defaults to **confidence** | +| reddit_app_id | If "use_reddit_oauth" config key is set to true, you have to obtain your Reddit app ID. For testing purposes it's okay to use this project's default app ID. Create your Reddit app here: https://old.reddit.com/prefs/apps/. Make sure to create an "installed app" type of app. Default is **ABfYqdDc9qPh1w** | ### Manual From 4f12806953ae8714ba01b1644c06fec681470bfe Mon Sep 17 00:00:00 2001 From: Michael Zufelt Date: Fri, 9 Apr 2021 16:23:49 -0400 Subject: [PATCH 3/4] Removed TODO and Roadmap --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index dbea54e..7d9d1cd 100644 --- a/README.md +++ b/README.md @@ -31,17 +31,6 @@ Community instances: * [ibarajztopxnuhabfu7f...onion](http://ibarajztopxnuhabfu7fg6gbudynxofbnmvis3ltj6lfx47b6fhrd5qd.onion) * [xugoqcf2pftm76vbznx4...i2p](http://xugoqcf2pftm76vbznx4xuhrzyb5b6zwpizpnw2hysexjdn5l2tq.b32.i2p) -## TODO - -* User trophies -* "other discussions" feature -* "Open on reddit" links -* ... and lot of other small stuff - -## Roadmap - -* HLS video streaming? (Would require browser JavaScript) -* User login, so people can use their Reddit account through teddit to comment and up/downvote posts etc. ## Changelog See ```CHANGELOG.md``` From 369bf95539dc998e763e32bc80c9c841ed608be6 Mon Sep 17 00:00:00 2001 From: Michael Zufelt Date: Fri, 9 Apr 2021 16:29:20 -0400 Subject: [PATCH 4/4] Additional env variable descriptions --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7d9d1cd..1db7738 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,9 @@ The following variables may be set to customize your deployment at runtime. | listen_address | Sets the address Teddit listens for requests on. Defaults to **0.0.0.0** | | https_enabled | *Boolean* Sets whether or not to enable HTTPS for Teddit. Defaults to **false** | | redirect_http_to_https | *Boolean* Sets whether to force redirection from HTTP to HTTPS. Defaults to **false** | -| redirect_www | *Boolean* Defaults to **false** | -| use_compression | *Boolean* Defaults to **true** | -| use_view_cache | *Boolean* Defaults to **false** | +| redirect_www | *Boolean* Redirects from www to non-www URL. For example, if true, Teddit will redirect https://www.teddit.com to https://teddit.com. Defaults to **false** | +| use_compression | *Boolean* If set to true, Teddit will use the [https://github.com/expressjs/compression](Node.js compression middleware) to compress HTTP requests with deflate/gzip. Defaults to **true** | +| use_view_cache | *Boolean* If this is set to true, view template compilation caching is enabled. Defaults to **false** | | use_helmet | *Boolean* Recommended to be true when using https. Defaults to **false** | | use_helmet_hsts | *Boolean* Recommended to be true when using https. Defaults to **false** | | trust_proxy | *Boolean* Enable trust_proxy if you are using a reverse proxy like nginx or traefik. Defaults to **false** |