From 18aa609716da2c99100577e8bfd9708cac49e106 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Thu, 8 Dec 2022 22:02:24 -0500 Subject: [PATCH] new homepage patches --- README.md | 8 ++-- patches/hide-contact-email.patch | 38 ++++++++++++++++++ patches/hide-server-rules.patch | 66 ++++++++++++++++++++++++++++++++ patches/hide-signup.patch | 19 +++++++++ 4 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 patches/hide-contact-email.patch create mode 100644 patches/hide-server-rules.patch diff --git a/README.md b/README.md index 16ef05c..c25336b 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,17 @@ RAILS_ENV=production bundle exec rails assets:precompile chown -R mastodon:mastodon /home/mastodon/{scripts,live} -systemctl restart mastodon-web +systemctl restart mastodon-* ``` ## Patches -- [`hide-signup.patch`](patches/hide-signup.patch): Hide the "create account" button (for aesthetics, not security!) +- [`hide-contact-email.patch`](patches/hide-contact-email.patch): Hides the `mailto:` link on the About page +- [`hide-server-rules.patch`](patches/hide-server-rules.patch): Applies just to homepage, meant only for single-user instances +- [`hide-signup.patch`](patches/hide-signup.patch): Hide the "create account" button (for aesthetics, **not security!**) - [`favicons.patch`](patches/favicons.patch): Use custom icon images instead of Mastodon logo - [`robots.patch`](patches/robots.patch): Disallow search engines for all of Mastodon -- [`system-font.patch`](patches/favicons.patch): Use the system's default sans-serif font stack instead of Roboto +- [`system-font.patch`](patches/system-font.patch): Use the system's default sans-serif font stack instead of Roboto ## License diff --git a/patches/hide-contact-email.patch b/patches/hide-contact-email.patch new file mode 100644 index 0000000..20e2ef6 --- /dev/null +++ b/patches/hide-contact-email.patch @@ -0,0 +1,38 @@ +diff --git a/app/javascript/flavours/glitch/features/about/index.js b/app/javascript/flavours/glitch/features/about/index.js +index 57f295ea9..0992ba767 100644 +--- a/app/javascript/flavours/glitch/features/about/index.js ++++ b/app/javascript/flavours/glitch/features/about/index.js +@@ -127,14 +127,6 @@ class About extends React.PureComponent { + + + +- +-
+- +-
+-

+- +- {isLoading ? : {server.getIn(['contact', 'email'])}} +-
+ + +
+diff --git a/app/javascript/mastodon/features/about/index.js b/app/javascript/mastodon/features/about/index.js +index e59f73738..0cb11216e 100644 +--- a/app/javascript/mastodon/features/about/index.js ++++ b/app/javascript/mastodon/features/about/index.js +@@ -127,14 +127,6 @@ class About extends React.PureComponent { + + + +- +-
+- +-
+-

+- +- {isLoading ? : {server.getIn(['contact', 'email'])}} +-
+ + +
diff --git a/patches/hide-server-rules.patch b/patches/hide-server-rules.patch new file mode 100644 index 0000000..363b1cc --- /dev/null +++ b/patches/hide-server-rules.patch @@ -0,0 +1,66 @@ +diff --git a/app/javascript/flavours/glitch/features/about/index.js b/app/javascript/flavours/glitch/features/about/index.js +index 57f295ea9..e27a30292 100644 +--- a/app/javascript/flavours/glitch/features/about/index.js ++++ b/app/javascript/flavours/glitch/features/about/index.js +@@ -15,7 +15,6 @@ import Image from 'flavours/glitch/components/image'; + + const messages = defineMessages({ + title: { id: 'column.about', defaultMessage: 'About' }, +- rules: { id: 'about.rules', defaultMessage: 'Server rules' }, + blocks: { id: 'about.blocks', defaultMessage: 'Moderated servers' }, + silenced: { id: 'about.domain_blocks.silenced.title', defaultMessage: 'Limited' }, + silencedExplanation: { id: 'about.domain_blocks.silenced.explanation', defaultMessage: 'You will generally not see profiles and content from this server, unless you explicitly look it up or opt into it by following.' }, +@@ -158,20 +157,6 @@ class About extends React.PureComponent { + ))} +
+ +-
+- {!isLoading && (server.get('rules').isEmpty() ? ( +-

+- ) : ( +-
    +- {server.get('rules').map(rule => ( +-
  1. +- {rule.get('text')} +-
  2. +- ))} +-
+- ))} +-
+- +
+ {domainBlocks.get('isLoading') ? ( + <> +diff --git a/app/javascript/mastodon/features/about/index.js b/app/javascript/mastodon/features/about/index.js +index e59f73738..3468ad19e 100644 +--- a/app/javascript/mastodon/features/about/index.js ++++ b/app/javascript/mastodon/features/about/index.js +@@ -15,7 +15,6 @@ import Image from 'mastodon/components/image'; + + const messages = defineMessages({ + title: { id: 'column.about', defaultMessage: 'About' }, +- rules: { id: 'about.rules', defaultMessage: 'Server rules' }, + blocks: { id: 'about.blocks', defaultMessage: 'Moderated servers' }, + silenced: { id: 'about.domain_blocks.silenced.title', defaultMessage: 'Limited' }, + silencedExplanation: { id: 'about.domain_blocks.silenced.explanation', defaultMessage: 'You will generally not see profiles and content from this server, unless you explicitly look it up or opt into it by following.' }, +@@ -158,20 +157,6 @@ class About extends React.PureComponent { + ))} +
+ +-
+- {!isLoading && (server.get('rules').isEmpty() ? ( +-

+- ) : ( +-
    +- {server.get('rules').map(rule => ( +-
  1. +- {rule.get('text')} +-
  2. +- ))} +-
+- ))} +-
+- +
+ {domainBlocks.get('isLoading') ? ( + <> diff --git a/patches/hide-signup.patch b/patches/hide-signup.patch index 65eb332..0eb2d24 100644 --- a/patches/hide-signup.patch +++ b/patches/hide-signup.patch @@ -70,3 +70,22 @@ index 8bd32edf9..f11ab1893 100644 ); }; +diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml +index f078e2f7e..6e106cd92 100644 +--- a/app/views/auth/shared/_links.html.haml ++++ b/app/views/auth/shared/_links.html.haml +@@ -5,14 +5,8 @@ + - if controller_name != 'sessions' + %li= link_to_login t('auth.login') + +- - if controller_name != 'registrations' +- %li= link_to t('auth.register'), available_sign_up_path +- + - if controller_name != 'passwords' && controller_name != 'registrations' + %li= link_to t('auth.forgot_password'), new_user_password_path + +- - if controller_name != 'confirmations' && (!user_signed_in? || !current_user.confirmed? || current_user.unconfirmed_email.present?) +- %li= link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path +- + - if user_signed_in? && controller_name != 'setup' + %li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }