From daf01287943c0de92b8cbaf66358b44a7c92d640 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 3 Oct 2021 21:40:58 +0200 Subject: [PATCH] Add config option to display source code URL in footer --- assets/css/default.css | 5 +++ config/config.example.yml | 9 +++++ locales/en-US.json | 7 +++- src/invidious/helpers/helpers.cr | 4 +++ src/invidious/views/template.ecr | 59 ++++++++++++++++++-------------- 5 files changed, 58 insertions(+), 26 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index ce6c30c9..9e283fb6 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -314,6 +314,11 @@ footer a { text-decoration: underline; } +footer span { + margin: 4px 0; + display: block; +} + /* keyframes */ @keyframes spin { diff --git a/config/config.example.yml b/config/config.example.yml index d2346719..12560528 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -432,6 +432,15 @@ feed_threads: 1 ## #cache_annotations: false +## +## Source code URL. If your instance is running a modfied source +## code, you MUST publish it somewhere and set this option. +## +## Accepted values: a string +## Default: +## +#source_code_url: "" + ######################################### diff --git a/locales/en-US.json b/locales/en-US.json index a1e39777..cc590e9e 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -423,5 +423,10 @@ "Current version: ": "Current version: ", "next_steps_error_message": "After which you should try to: ", "next_steps_error_message_refresh": "Refresh", - "next_steps_error_message_go_to_youtube": "Go to YouTube" + "next_steps_error_message_go_to_youtube": "Go to YouTube", + "footer_donate": "Donate: ", + "footer_documentation": "Documentation", + "footer_source_code": "Source code", + "footer_original_source_code": "Original source code", + "footer_modfied_source_code": "Modified Source code" } diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index fb33df1c..a4f3ad9c 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -97,6 +97,10 @@ class Config property hsts : Bool? = true # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely property disable_proxy : Bool? | Array(String)? = false # Disable proxying server-wide: options: 'dash', 'livestreams', 'downloads', 'local' + # URL to the modified source code to be easily AGPL compliant + # Will display in the footer, next to the main source code link + property source_code_url : String? = nil + @[YAML::Field(converter: Preferences::FamilyConverter)] property force_resolve : Socket::Family = Socket::Family::UNSPEC # Connect to YouTube over 'ipv6', 'ipv4'. Will sometimes resolve fix issues with rate-limiting (see https://github.com/ytdl-org/youtube-dl/issues/21729) property port : Int32 = 3000 # Port to listen for connections (overrided by command line argument) diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 7be95959..12381cf7 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -117,38 +117,47 @@ +