Skip to content

Commit

Permalink
hm
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jun 29, 2024
1 parent 6b0109f commit 36e1516
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/timelines/public_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def require_auth?
if Setting.timeline_preview false
if truthy_param?(:local)
!Setting.timeline_preview_local
elsif truthy_param?(:remote)
elsif truthy_param?(:remote) or truthy_param?(:allow_local_only)

Check failure on line 20 in app/controllers/api/v1/timelines/public_controller.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Style/AndOr: Use || instead of or. (https://rubystyle.guide#no-and-or-or)
!Setting.timeline_preview_remote
end
else
Expand Down
8 changes: 8 additions & 0 deletions app/helpers/admin/settings/discovery_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ def discovery_hint_text
def discovery_recommended_value
authorized_fetch_overridden? ? :overridden : nil
end

def public_feed_auth
Setting.timeline_preview
end

def public_timelines_warning_hint_text
public_feed_auth? ? t('admin.settings.security.public_timelines_warning_hint') : nil
end
end
8 changes: 2 additions & 6 deletions app/views/admin/settings/discovery/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@
.fields-group
= f.input :timeline_preview, as: :boolean, wrapper: :with_label

%h4= t('admin.settings.discovery.public_timelines_local')

.fields-group
= f.input :timeline_preview_local, as: :boolean, wrapper: :with_label

%h4= t('admin.settings.discovery.public_timelines_remote')
= f.input :timeline_preview_local, as: :boolean, wrapper: :with_label, warning_hint: public_timelines_warning_hint_text, disabled: public_feed_auth?

.fields-group
= f.input :timeline_preview_remote, as: :boolean, wrapper: :with_label
= f.input :timeline_preview_remote, as: :boolean, wrapper: :with_label, warning_hint: public_timelines_warning_hint_text, disabled: public_feed_auth?

.fields-group
= f.input :noindex, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_noindex.title'), hint: t('admin.settings.default_noindex.desc_html')
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ en:
authorized_fetch_hint: Requiring authentication from federated servers enables stricter enforcement of both user-level and server-level blocks. However, this comes at the cost of a performance penalty, reduces the reach of your replies, and may introduce compatibility issues with some federated services. In addition, this will not prevent dedicated actors from fetching your public posts and accounts.
authorized_fetch_overridden_hint: You are currently unable to change this setting because it is overridden by an environment variable.
federation_authentication: Federation authentication enforcement
public_timelines_warning_hint: Overridden by the general toggle
title: Server settings
site_uploads:
delete: Delete uploaded file
Expand Down
4 changes: 2 additions & 2 deletions config/locales/simple_form.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ en:
theme: Default theme
thumbnail: Server thumbnail
timeline_preview: Allow unauthenticated access to public timelines
timeline_preview: Allow unauthenticated access to local timeline
timeline_preview: Allow unauthenticated access to remote timeline
timeline_preview_local: Allow unauthenticated access to local timeline
timeline_preview_remote: Allow unauthenticated access to remote timeline
trendable_by_default: Allow trends without prior review
trends: Enable trends
trends_as_landing_page: Use trends as the landing page
Expand Down
4 changes: 2 additions & 2 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ defaults: &defaults
profile_directory: true
closed_registrations_message: ''
timeline_preview: false
timeline_preview_local: false
timeline_preview_remote: false
timeline_preview_local: true
timeline_preview_remote: true
show_staff_badge: true
preview_sensitive_media: false
noindex: false
Expand Down

0 comments on commit 36e1516

Please sign in to comment.