From 4d11c324b07be10dcf2aac19b215576b3cb94206 Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 13 Mar 2024 14:38:18 -0700 Subject: [PATCH] Add "Instance" section to footer --- config/config.example.yml | 32 ++++++++++++++++-- locales/en-US.json | 10 +++--- src/invidious/config.cr | 21 +++++++----- src/invidious/views/template.ecr | 56 ++++++++++++++++++++++++++++---- 4 files changed, 99 insertions(+), 20 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index 118ac0c0..afd9773f 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -427,12 +427,40 @@ jobs: ## ## Email to contact the instance maintainer; used in a mailto: link within the footer. -## -## Accepted values: Email +## +## Accepted values: string ## Default: ## # instance_maintainer_email: +## +## Link to the terms of service of the instance (if any) +## +## Displayed within the instance section of the footer +## +## Accepted values: String (link) +## Default: +## +# footer_instance_tos_link: + +## +## Link to the privacy-policy of the instance (if any) +## +## Displayed within the instance section of the footer +## +## Accepted values: String (link) +## Default: +## +# footer_instance_privacy_policy_link: + +## +## Custom fields to be displayed within the footer's instance section +## +## Accepted values: A nested array mapping field name and links together. +## IE: [ ["field1", "https://example.com/1"], ["field2", "https://example.com/2"] ] +## Default: +## +# footer_instance_section_custom_fields: [] # ----------------------------- # Miscellaneous diff --git a/locales/en-US.json b/locales/en-US.json index 202b43d2..a49f8dc8 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -461,7 +461,6 @@ "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", - "default_invidious_footer_text": "A free and open source frontend for Youtube that that respects your privacy! Now you can watch videos (ad-free), subscribe to channels, create playlist and much more all without the prying eyes of Google!", "footer_navigation_section_header": "Navigation", "footer_home_link": "Home", @@ -473,13 +472,16 @@ "footer_donate_link": "Donate", "footer_matrix_link": "Matrix", "footer_support_section_header": "Support", - "footer_contact_link": "Contact instance maintainer", + "footer_contact_link": "Contact Instance Maintainer", "footer_report_bug_link": "Report a bug", "footer_faq_link": "FAQ", - "footer_legal_section_header": "Legal", + "footer_instance_section_header": "Instance", + "footer_instance_section_header_modified_source": "Instance (Modified)", + "footer_instance_section_modified_source_code": "Instance Source Code", + "footer_instance_section_tos": "Terms of Service", + "footer_instance_section_privacy_policy": "Privacy Policy", "footer_licences_link": "Licences", "footer_privacy_policy_link": "Privacy", - "adminprefs_modified_source_code_url_label": "URL to modified source code repository", "none": "none", "videoinfo_started_streaming_x_ago": "Started streaming `x` ago", diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 7f820018..f4a753f2 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -104,10 +104,6 @@ class Config property check_tables : Bool = false # Cache annotations requested from IA, will not cache empty annotations or annotations that only contain cards property cache_annotations : Bool = false - # Optional banner to be displayed along top of page for announcements, etc. - property banner : String? = nil - # Optional footer text to be displayed within Invidious' footer. Can be used for maintainer contact info, etc. - property footer : String? = nil # Enables 'Strict-Transport-Security'. Ensure that `domain` and all subdomains are served securely property hsts : Bool? = true # Disable proxying server-wide: options: 'dash', 'livestreams', 'downloads', 'local' @@ -115,9 +111,21 @@ class Config # Enable the user notifications for all users property enable_user_notifications : Bool = true + # Optional banner to be displayed along top of page for announcements, etc. + property banner : String? = nil + # Optional footer text to be displayed within Invidious' footer. Can be used for maintainer contact info, etc. + property footer : String? = nil + # Email to contact the instance maintainer. This is used within the footer as an mailto link. + property instance_maintainer_email : String? = nil # URL to the modified source code to be easily AGPL compliant - # Will display in the footer, next to the main source code link + # Will display in the footer property modified_source_code_url : String? = nil + # Link to the terms of service of the instance (if any). Will be displayed in the footer. + property footer_instance_tos_link : String? = nil + # Link to the privacy policy of the instance (if any). Will be displayed in the footer. + property footer_instance_privacy_policy_link : String? = nil + # Custom fields to be displayed within the footer's instance section + property footer_instance_section_custom_fields : Array(Array(String)) = [] of Array(String) # Connect to YouTube over 'ipv6', 'ipv4'. Will sometimes resolve fix issues with rate-limiting (see https://github.com/ytdl-org/youtube-dl/issues/21729) @[YAML::Field(converter: Preferences::FamilyConverter)] @@ -139,9 +147,6 @@ class Config # Playlist length limit property playlist_length_limit : Int32 = 500 - # Email to contact the instance maintainer. This is used within the footer as an mailto link. - property instance_maintainer_email : String? = nil - def disabled?(option) case disabled = CONFIG.disable_proxy when Bool diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index b55f7040..04cb7915 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -233,15 +233,59 @@ + <% if CONFIG.instance_maintainer_email || CONFIG.modified_source_code_url || CONFIG.footer_instance_tos_link || CONFIG.footer_instance_privacy_policy_link %> + + <% end %> +