Use mastodon config namespace to load software update default value via config_for (#30534)
				
					
				
			This commit is contained in:
		@@ -105,6 +105,7 @@ module Mastodon
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    config.x.captcha = config_for(:captcha)
 | 
			
		||||
    config.x.mastodon = config_for(:mastodon)
 | 
			
		||||
    config.x.translation = config_for(:translation)
 | 
			
		||||
 | 
			
		||||
    config.to_prepare do
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								config/mastodon.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								config/mastodon.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
---
 | 
			
		||||
shared:
 | 
			
		||||
  software_update_url: <%= ENV.fetch('UPDATE_CHECK_URL', 'https://api.joinmastodon.org/update-check') %>
 | 
			
		||||
@@ -6,7 +6,11 @@ SimpleNavigation::Configuration.run do |navigation|
 | 
			
		||||
  navigation.items do |n|
 | 
			
		||||
    n.item :web, safe_join([material_symbol('chevron_left'), t('settings.back')]), root_path
 | 
			
		||||
 | 
			
		||||
    n.item :software_updates, safe_join([material_symbol('report'), t('admin.critical_update_pending')]), admin_software_updates_path, if: -> { ENV['UPDATE_CHECK_URL'] != '' && current_user.can?(:view_devops) && SoftwareUpdate.urgent_pending? }, html: { class: 'warning' }
 | 
			
		||||
    n.item :software_updates,
 | 
			
		||||
           safe_join([material_symbol('report'), t('admin.critical_update_pending')]),
 | 
			
		||||
           admin_software_updates_path,
 | 
			
		||||
           if: -> { Rails.configuration.x.mastodon.software_update_url.present? && current_user.can?(:view_devops) && SoftwareUpdate.urgent_pending? },
 | 
			
		||||
           html: { class: 'warning' }
 | 
			
		||||
 | 
			
		||||
    n.item :profile, safe_join([material_symbol('person'), t('settings.profile')]), settings_profile_path, if: -> { current_user.functional? && !self_destruct }, highlights_on: %r{/settings/profile|/settings/featured_tags|/settings/verification|/settings/privacy}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user