forked from open-webui/open-webui
		
	feat: add ALLOW_ADMIN_EXPORT to disable exporting of chats and the db
This commit is contained in:
		
							parent
							
								
									1e76dbc9a0
								
							
						
					
					
						commit
						190b934ab5
					
				
					 6 changed files with 44 additions and 25 deletions
				
			
		| 
						 | 
				
			
			@ -91,7 +91,11 @@ async def download_chat_as_pdf(
 | 
			
		|||
 | 
			
		||||
@router.get("/db/download")
 | 
			
		||||
async def download_db(user=Depends(get_admin_user)):
 | 
			
		||||
 | 
			
		||||
    if not ALLOW_ADMIN_EXPORT:
 | 
			
		||||
        raise HTTPException(
 | 
			
		||||
            status_code=status.HTTP_401_UNAUTHORIZED,
 | 
			
		||||
            detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
 | 
			
		||||
        )
 | 
			
		||||
    return FileResponse(
 | 
			
		||||
        f"{DATA_DIR}/webui.db",
 | 
			
		||||
        media_type="application/octet-stream",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue