Disable API by default
Add helpful logging and init check
This commit is contained in:
		
							parent
							
								
									a88c323fb3
								
							
						
					
					
						commit
						5047952935
					
				| 
						 | 
				
			
			@ -5,6 +5,6 @@ export default {
 | 
			
		|||
  http_proxy: process.env.RIMGU_HTTP_PROXY || null,
 | 
			
		||||
  https_proxy: process.env.RIMGU_HTTPS_PROXY || null,
 | 
			
		||||
  imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null,
 | 
			
		||||
  use_api: process.env.RIMGU_USE_API !== 'false',
 | 
			
		||||
  use_api: process.env.RIMGU_USE_API && process.env.RIMGU_USE_API !== 'false',
 | 
			
		||||
  page_title: process.env.RIMGU_PAGE_TITLE || 'rimgu',
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,4 +80,11 @@ process.on('unhandledRejection', (err) => {
 | 
			
		|||
  process.exit(1);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
if (!CONFIG.use_api) {
 | 
			
		||||
  console.log('Running without imgur client ID; certain views and functionality missing.');
 | 
			
		||||
} else if (!CONFIG.imgur_client_id) {
 | 
			
		||||
  console.error('imgur_client_id missing. Configure it via RIMGU_IMGUR_CLIENT_ID  or set RIMGU_USE_API=false');
 | 
			
		||||
  process.exit(1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
init();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue