mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-02 20:02:25 -06:00 
			
		
		
		
	[feature] Media cleanup endpoint (#560)
Adds an admin endpoint to trigger a remote media cleanup. Fixed #348 Signed-off-by: Sashanoraa <sasha@noraa.gay>
This commit is contained in:
		
					parent
					
						
							
								545b16ad35
							
						
					
				
			
			
				commit
				
					
						6e947ff266
					
				
			
		
					 8 changed files with 321 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -2574,6 +2574,38 @@ paths:
 | 
			
		|||
      summary: View domain block with the given ID.
 | 
			
		||||
      tags:
 | 
			
		||||
      - admin
 | 
			
		||||
  /api/v1/admin/media_cleanup:
 | 
			
		||||
    post:
 | 
			
		||||
      consumes:
 | 
			
		||||
      - application/json
 | 
			
		||||
      - application/xml
 | 
			
		||||
      - application/x-www-form-urlencoded
 | 
			
		||||
      operationId: mediaCleanup
 | 
			
		||||
      parameters:
 | 
			
		||||
      - description: |-
 | 
			
		||||
          Number of days of remote media to keep. Native values will be treated as 0.
 | 
			
		||||
          If value is not specified, the value of media-remote-cache-days in the server config will be used.
 | 
			
		||||
        format: int64
 | 
			
		||||
        in: query
 | 
			
		||||
        name: remote_cache_days
 | 
			
		||||
        type: integer
 | 
			
		||||
        x-go-name: RemoteCacheDays
 | 
			
		||||
      produces:
 | 
			
		||||
      - application/json
 | 
			
		||||
      responses:
 | 
			
		||||
        "200":
 | 
			
		||||
          description: Echos the number of days requested. The cleanup is performed
 | 
			
		||||
            asynchronously after the request completes.
 | 
			
		||||
        "400":
 | 
			
		||||
          description: bad request
 | 
			
		||||
        "403":
 | 
			
		||||
          description: forbidden
 | 
			
		||||
      security:
 | 
			
		||||
      - OAuth2 Bearer:
 | 
			
		||||
        - admin
 | 
			
		||||
      summary: Clean up remote media older than the specified number of days.
 | 
			
		||||
      tags:
 | 
			
		||||
      - admin
 | 
			
		||||
  /api/v1/apps:
 | 
			
		||||
    post:
 | 
			
		||||
      consumes:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue