From 1988c7d14a0ef1f37a0caee545fc863daa51c248 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Fri, 10 Apr 2020 22:30:13 +0200 Subject: [PATCH] Add CONFIG.child_friendly switch And it controls things like: * presence of "Watch on YT" link * presence of likes/stats * presence of BTC/liberapay (ask their parents for this!) :) --- config/config.yml | 1 + docker-compose.yml | 1 + src/invidious/helpers/helpers.cr | 1 + src/invidious/views/template.ecr | 28 ++++++++++++++++------------ src/invidious/views/watch.ecr | 19 ++++++++++++------- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/config/config.yml b/config/config.yml index e83a7515..de91bc26 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,5 +1,6 @@ channel_threads: 1 feed_threads: 1 +child_friendly: false db: user: kemal password: kemal diff --git a/docker-compose.yml b/docker-compose.yml index d7b3fa91..5dbf5b6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ services: INVIDIOUS_CONFIG: | channel_threads: 1 feed_threads: 1 + child_friendly: false db: user: kemal password: kemal diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 96d14737..c83b77c2 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -233,6 +233,7 @@ struct Config YAML.mapping({ channel_threads: Int32, # Number of threads to use for crawling videos from channels (for updating subscriptions) feed_threads: Int32, # Number of threads to use for updating feeds + child_friendly: Bool, # Prevent 13- kids getting to YouTube db: DBConfig, # Database configuration full_refresh: Bool, # Used for crawling channels: threads should check all videos uploaded by a channel https_only: Bool?, # Used to tell Invidious it is behind a proxy, so links to resources should be https:// diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 3a8d47dd..6bece30c 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -115,18 +115,22 @@ <%= translate(locale, "Released under the AGPLv3 by Omar Roth.") %> -
- - BTC: 356DpZyMXu6rYd55Yqzjs29n79kGKWcYrY -
-
- - BCH: qq4ptclkzej5eza6a50et5ggc58hxsq5aylqut2npk -
-
- - Liberapay -
+ + <% if !CONFIG.child_friendly %> +
+ + BTC: 356DpZyMXu6rYd55Yqzjs29n79kGKWcYrY +
+
+ + BCH: qq4ptclkzej5eza6a50et5ggc58hxsq5aylqut2npk +
+
+ + Liberapay +
+ <% end %> +
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index e43282cb..54cbaad0 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -86,9 +86,11 @@