SearXNG: load /etc/searxng/settings.yml
fall back to /etc/searx/setting.yml
This commit is contained in:
		
							parent
							
								
									7f72844ca6
								
							
						
					
					
						commit
						861925c50f
					
				@ -43,8 +43,16 @@ def get_user_settings_path():
 | 
				
			|||||||
    if environ.get('SEARXNG_DISABLE_ETC_SETTINGS', '').lower() in ('1', 'true'):
 | 
					    if environ.get('SEARXNG_DISABLE_ETC_SETTINGS', '').lower() in ('1', 'true'):
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # if not, get it from searx code base or last solution from /etc/searx
 | 
					    # if not, get it from searx code base or last solution from /etc/searxng
 | 
				
			||||||
    return check_settings_yml('/etc/searx/settings.yml')
 | 
					    try:
 | 
				
			||||||
 | 
					        return check_settings_yml('/etc/searxng/settings.yml')
 | 
				
			||||||
 | 
					    except SearxSettingsException as e:
 | 
				
			||||||
 | 
					        # fall back to searx settings
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            return check_settings_yml('/etc/searx/settings.yml')
 | 
				
			||||||
 | 
					        except SearxSettingsException:
 | 
				
			||||||
 | 
					            # if none are found, raise the exception about SearXNG
 | 
				
			||||||
 | 
					            raise e  # pylint: disable=raise-missing-from
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def update_dict(default_dict, user_dict):
 | 
					def update_dict(default_dict, user_dict):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user