Files
filebrowser/backend/swagger/docs/docs.go
T
2025-06-30 13:07:16 -05:00

2755 lines
100 KiB
Go

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/auth/logout": {
"post": {
"description": "Returns a logout URL for the frontend to redirect to.",
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User Logout",
"responses": {
"200": {
"description": "{\"logoutUrl\": \"http://...\"}",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/oidc/callback": {
"get": {
"description": "Handles OIDC login callback.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OIDC"
],
"summary": "OIDC callback",
"parameters": [
{
"type": "string",
"description": "OIDC code",
"name": "code",
"in": "query"
},
{
"type": "string",
"description": "OIDC state",
"name": "state",
"in": "query"
}
],
"responses": {
"200": {
"description": "OIDC callback result",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/oidc/login": {
"get": {
"description": "Initiates OIDC login flow.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OIDC"
],
"summary": "OIDC login",
"responses": {
"302": {
"description": "Redirect to OIDC provider",
"schema": {
"type": "string"
}
}
}
}
},
"/api/auth/otp/generate": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Generates a new TOTP secret and QR code for the authenticated user.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OTP"
],
"summary": "Generate OTP",
"responses": {
"200": {
"description": "OTP secret generated successfully.",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/otp/verify": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Verifies the provided TOTP code for the authenticated user.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OTP"
],
"summary": "Verify OTP",
"parameters": [
{
"type": "string",
"description": "TOTP code to verify",
"name": "code",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OTP token is valid.",
"schema": {
"$ref": "#/definitions/http.HttpResponse"
}
},
"401": {
"description": "Unauthorized - invalid TOTP token",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/token": {
"put": {
"description": "Create an API key with specified name, duration, and permissions.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API Keys"
],
"summary": "Create API key",
"parameters": [
{
"type": "string",
"description": "Name of the API key",
"name": "name",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Duration of the API key in days",
"name": "days",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Permissions for the API key (comma-separated)",
"name": "permissions",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Token created successfully, response contains json object with token key",
"schema": {
"$ref": "#/definitions/http.HttpResponse"
}
},
"400": {
"description": "Bad request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "Delete an API key with specified name.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API Keys"
],
"summary": "Delete API key",
"parameters": [
{
"type": "string",
"description": "Name of the API key to delete",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "API key deleted successfully",
"schema": {
"$ref": "#/definitions/http.HttpResponse"
}
},
"404": {
"description": "Not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/tokens": {
"get": {
"description": "List all API keys or retrieve details for a specific key.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API Keys"
],
"summary": "List API keys",
"parameters": [
{
"type": "string",
"description": "Name of the API to retrieve details",
"name": "name",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of API keys or specific key details",
"schema": {
"$ref": "#/definitions/http.AuthTokenMin"
}
},
"404": {
"description": "Not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/jobs/{action}/{target}": {
"get": {
"description": "Returns job info for the user.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "Get jobs info",
"parameters": [
{
"type": "string",
"description": "Job action",
"name": "action",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Job target",
"name": "target",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Job info",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/indexing.ReducedIndex"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/login": {
"post": {
"description": "Authenticate a user with a username and password.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User login",
"responses": {
"200": {
"description": "JWT token for authentication",
"schema": {
"type": "string"
}
},
"403": {
"description": "Forbidden - authentication failed",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/preview": {
"get": {
"description": "Returns a preview image based on the requested path and size.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Get image preview",
"parameters": [
{
"type": "string",
"description": "source hash",
"name": "hash",
"in": "query",
"required": true
},
{
"type": "string",
"description": "File path of the image to preview",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Preview size ('small' or 'large'). Default is based on server config.",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "Preview image content",
"schema": {
"type": "file"
}
},
"202": {
"description": "Download permissions required",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Invalid request path",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "File not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"415": {
"description": "Unsupported file type for preview",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/raw": {
"get": {
"description": "Returns the raw content of a file, multiple files, or a directory. Supports downloading files as archives in various formats.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Get raw content of a file, multiple files, or directory",
"parameters": [
{
"type": "string",
"description": "a list of files in the following format 'source::filename' and separated by '||' with additional items in the list. (required)",
"name": "files",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "If true, sets 'Content-Disposition' to 'inline'. Otherwise, defaults to 'attachment'.",
"name": "inline",
"in": "query"
},
{
"type": "string",
"description": "Compression algorithm for archiving multiple files or directories. Options: 'zip' and 'tar.gz'. Default is 'zip'.",
"name": "algo",
"in": "query"
}
],
"responses": {
"200": {
"description": "Raw file or directory content, or archive for multiple files",
"schema": {
"type": "file"
}
},
"202": {
"description": "Modify permissions required",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Invalid request path",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "File or directory not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/renew": {
"post": {
"description": "Refresh the authentication token for a logged-in user.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Renew authentication token",
"responses": {
"200": {
"description": "New JWT token generated",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized - invalid token",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/resources": {
"get": {
"description": "Returns metadata and optionally file contents for a specified resource path.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Get resource information",
"parameters": [
{
"type": "string",
"description": "Path to the resource",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Source name for the desired source, default is used if not provided",
"name": "source",
"in": "query"
},
{
"type": "string",
"description": "Include file content if true",
"name": "content",
"in": "query"
},
{
"type": "string",
"description": "Optional checksum validation",
"name": "checksum",
"in": "query"
}
],
"responses": {
"200": {
"description": "Resource metadata",
"schema": {
"$ref": "#/definitions/iteminfo.FileInfo"
}
},
"404": {
"description": "Resource not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"description": "Updates an existing file at the specified path.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Update a file resource",
"parameters": [
{
"type": "string",
"description": "Destination path where to place the files inside the destination source",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Source name for the desired source, default is used if not provided",
"name": "source",
"in": "query"
}
],
"responses": {
"200": {
"description": "Resource updated successfully"
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Resource not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"405": {
"description": "Method not allowed",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"description": "Creates a new resource or uploads a file at the specified path. Supports file uploads and directory creation.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Create or upload a resource",
"parameters": [
{
"type": "string",
"description": "url encoded destination path where to place the files inside the destination source, a directory must end in / to create a directory",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Name for the desired filebrowser destination source name, default is used if not provided",
"name": "source",
"in": "query"
},
{
"type": "boolean",
"description": "Override existing file if true",
"name": "override",
"in": "query"
}
],
"responses": {
"200": {
"description": "Resource created successfully"
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Resource not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict - Resource already exists",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "Deletes a resource located at the specified path.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Delete a resource",
"parameters": [
{
"type": "string",
"description": "Path to the resource",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Source name for the desired source, default is used if not provided",
"name": "source",
"in": "query"
}
],
"responses": {
"200": {
"description": "Resource deleted successfully"
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Resource not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"patch": {
"description": "Moves or renames a resource to a new destination.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Patch resource (move/rename)",
"parameters": [
{
"type": "string",
"description": "Path from resource in \u003csource_name\u003e::\u003cindex_path\u003e format",
"name": "from",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Destination path for the resource",
"name": "destination",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Action to perform (copy, rename)",
"name": "action",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Overwrite if destination exists",
"name": "overwrite",
"in": "query"
},
{
"type": "boolean",
"description": "Rename if destination exists",
"name": "rename",
"in": "query"
}
],
"responses": {
"200": {
"description": "Resource moved/renamed successfully"
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Resource not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict - Destination exists",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/search": {
"get": {
"description": "Searches for files matching the provided query. Returns file paths and metadata based on the user's session and scope.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Search"
],
"summary": "Search Files",
"parameters": [
{
"type": "string",
"description": "Search query",
"name": "query",
"in": "query",
"required": true
},
{
"type": "string",
"description": "path within user scope to search, for example '/first/second' to search within the second directory only",
"name": "scope",
"in": "query"
},
{
"type": "string",
"description": "User session ID, add unique value to prevent collisions",
"name": "SessionId",
"in": "header"
}
],
"responses": {
"200": {
"description": "List of search results",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/indexing.SearchResult"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/settings": {
"get": {
"description": "Returns the current configuration settings for signup, user directories, rules, frontend.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Settings"
],
"summary": "Get system settings",
"parameters": [
{
"type": "string",
"description": "Property to retrieve: ` + "`" + `userDefaults` + "`" + `, ` + "`" + `frontend` + "`" + `, ` + "`" + `auth` + "`" + `, ` + "`" + `server` + "`" + `, ` + "`" + `sources` + "`" + `",
"name": "property",
"in": "query"
}
],
"responses": {
"200": {
"description": "System settings data",
"schema": {
"$ref": "#/definitions/settings.Settings"
}
}
}
}
},
"/api/share": {
"get": {
"description": "Retrieves all share links associated with a specific resource path for the current user.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Shares"
],
"summary": "Get share links by path",
"parameters": [
{
"type": "string",
"description": "Resource path for which to retrieve share links",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Source name for share links",
"name": "source",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "List of share links for the specified path",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/share.Link"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/shares": {
"get": {
"description": "Returns a list of share links for the current user, or all links if the user is an admin.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Shares"
],
"summary": "List share links",
"responses": {
"200": {
"description": "List of share links",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/share.Link"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"description": "Creates a new share link with an optional expiration time and password protection.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Shares"
],
"summary": "Create a share link",
"parameters": [
{
"type": "string",
"description": "Source Path of the files to share",
"name": "path",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Source name of the files to share",
"name": "source",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Created share link",
"schema": {
"$ref": "#/definitions/share.Link"
}
},
"400": {
"description": "Bad request - failed to decode body",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "Deletes a share link specified by its hash.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Shares"
],
"summary": "Delete a share link",
"parameters": [
{
"type": "string",
"description": "Hash of the share link to delete",
"name": "hash",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Share link deleted successfully"
},
"400": {
"description": "Bad request - missing or invalid hash",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/signup": {
"post": {
"description": "Register a new user account with a username and password.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User signup",
"parameters": [
{
"description": "User signup details",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/http.signupBody"
}
}
],
"responses": {
"201": {
"description": "User created successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request - invalid input",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"405": {
"description": "Method not allowed - signup is disabled",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"409": {
"description": "Conflict - user already exists",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/users": {
"get": {
"description": "Returns a user's details based on their ID, or all users if no id is provided.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Retrieve a user by ID",
"parameters": [
{
"type": "string",
"description": "User ID or 'self'",
"name": "id",
"in": "query"
}
],
"responses": {
"200": {
"description": "User details or list of users",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"description": "Updates the details of a user identified by ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Update a user's details",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "query",
"required": true
},
{
"description": "User data to update",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/users.User"
}
}
],
"responses": {
"200": {
"description": "Updated user details",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"post": {
"description": "Adds a new user to the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Create a new user",
"parameters": [
{
"description": "User data to create a new user",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/users.User"
}
}
],
"responses": {
"201": {
"description": "Created user",
"schema": {
"$ref": "#/definitions/users.User"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"description": "Deletes a user identified by their ID.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Delete a user by ID",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "User deleted successfully"
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/health": {
"get": {
"description": "Returns the health status of the API.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Health"
],
"summary": "Health Check",
"responses": {
"200": {
"description": "successful health check response",
"schema": {
"$ref": "#/definitions/http.HttpResponse"
}
}
}
}
},
"/public/dl": {
"get": {
"description": "Returns the raw content of a file, multiple files, or a directory. Supports downloading files as archives in various formats.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Resources"
],
"summary": "Get raw content of a file, multiple files, or directory",
"parameters": [
{
"type": "string",
"description": "a list of files in the following format 'filename' and separated by '||' with additional items in the list. (required)",
"name": "files",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "If true, sets 'Content-Disposition' to 'inline'. Otherwise, defaults to 'attachment'.",
"name": "inline",
"in": "query"
},
{
"type": "string",
"description": "Compression algorithm for archiving multiple files or directories. Options: 'zip' and 'tar.gz'. Default is 'zip'.",
"name": "algo",
"in": "query"
}
],
"responses": {
"200": {
"description": "Raw file or directory content, or archive for multiple files",
"schema": {
"type": "file"
}
},
"202": {
"description": "Modify permissions required",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Invalid request path",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"404": {
"description": "File or directory not found",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"http.AuthTokenMin": {
"type": "object",
"properties": {
"Permissions": {
"$ref": "#/definitions/users.Permissions"
},
"created": {
"type": "integer"
},
"expires": {
"type": "integer"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"http.HttpResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "integer"
},
"token": {
"type": "string"
}
}
},
"http.signupBody": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"indexing.IndexStatus": {
"type": "string",
"enum": [
"ready",
"indexing",
"unavailable"
],
"x-enum-varnames": [
"READY",
"INDEXING",
"UNAVAILABLE"
]
},
"indexing.ReducedIndex": {
"type": "object",
"properties": {
"assessment": {
"type": "string"
},
"fullScanDurationSeconds": {
"type": "integer"
},
"lastIndexedUnixTime": {
"type": "integer"
},
"name": {
"type": "string"
},
"numDeleted": {
"type": "integer"
},
"numDirs": {
"type": "integer"
},
"numFiles": {
"type": "integer"
},
"quickScanDurationSeconds": {
"type": "integer"
},
"status": {
"$ref": "#/definitions/indexing.IndexStatus"
},
"total": {
"type": "integer"
},
"used": {
"type": "integer"
}
}
},
"indexing.SearchResult": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"size": {
"type": "integer"
},
"type": {
"type": "string"
}
}
},
"iteminfo.FileInfo": {
"type": "object",
"properties": {
"files": {
"description": "files in the directory",
"type": "array",
"items": {
"$ref": "#/definitions/iteminfo.ItemInfo"
}
},
"folders": {
"description": "folders in the directory",
"type": "array",
"items": {
"$ref": "#/definitions/iteminfo.ItemInfo"
}
},
"hidden": {
"description": "whether the file is hidden",
"type": "boolean"
},
"modified": {
"description": "modification time",
"type": "string"
},
"name": {
"description": "name of the file",
"type": "string"
},
"path": {
"description": "path scoped to the associated index",
"type": "string"
},
"size": {
"description": "length in bytes for regular files",
"type": "integer"
},
"type": {
"description": "type of the file, either \"directory\" or a file mimetype",
"type": "string"
}
}
},
"iteminfo.ItemInfo": {
"type": "object",
"properties": {
"hidden": {
"description": "whether the file is hidden",
"type": "boolean"
},
"modified": {
"description": "modification time",
"type": "string"
},
"name": {
"description": "name of the file",
"type": "string"
},
"size": {
"description": "length in bytes for regular files",
"type": "integer"
},
"type": {
"description": "type of the file, either \"directory\" or a file mimetype",
"type": "string"
}
}
},
"settings.Auth": {
"type": "object",
"properties": {
"adminPassword": {
"description": "the password of the admin user. If not set, the default is \"admin\".",
"type": "string"
},
"adminUsername": {
"description": "the username of the admin user. If not set, the default is \"admin\".",
"type": "string"
},
"key": {
"description": "the key used to sign the JWT tokens. If not set, a random key will be generated.",
"type": "string"
},
"methods": {
"$ref": "#/definitions/settings.LoginMethods"
},
"tokenExpirationHours": {
"description": "the number of hours until the token expires. Default is 2 hours.",
"type": "integer"
},
"totpSecret": {
"description": "secret used to encrypt TOTP secrets",
"type": "string"
}
}
},
"settings.ExcludeIndexFilter": {
"type": "object",
"properties": {
"fileEndsWith": {
"description": "(global) exclude files that end with these suffixes. Eg. \".jpg\" or \".txt\"",
"type": "array",
"items": {
"type": "string"
}
},
"fileNames": {
"description": "(global) list of file names to include/exclude. Eg. \"a.jpg\"",
"type": "array",
"items": {
"type": "string"
}
},
"filePaths": {
"description": "list of filepaths Eg. \"folder1\" or \"file1.txt\" or \"folder1/file1.txt\" (without source path prefix)",
"type": "array",
"items": {
"type": "string"
}
},
"folderEndsWith": {
"description": "(global) exclude folders that end with these suffixes. Eg. \".thumbnails\" or \".git\"",
"type": "array",
"items": {
"type": "string"
}
},
"folderNames": {
"description": "(global) list of folder names to include/exclude. Eg. \"@eadir\" or \".thumbnails\"",
"type": "array",
"items": {
"type": "string"
}
},
"folderPaths": {
"description": "(filepath) list of folder names to include/exclude. Eg. \"folder1\" or \"folder1/subfolder\" (do not include source path, just the subpaths from the source path)",
"type": "array",
"items": {
"type": "string"
}
},
"hidden": {
"description": "exclude hidden files and folders.",
"type": "boolean"
},
"ignoreZeroSizeFolders": {
"description": "ignore folders with 0 size",
"type": "boolean"
}
}
},
"settings.ExternalLink": {
"type": "object",
"required": [
"text",
"url"
],
"properties": {
"text": {
"description": "the text to display on the link",
"type": "string"
},
"title": {
"description": "the title to display on hover",
"type": "string"
},
"url": {
"description": "the url to link to",
"type": "string"
}
}
},
"settings.Frontend": {
"type": "object",
"properties": {
"disableDefaultLinks": {
"description": "disable default links in the sidebar",
"type": "boolean"
},
"disableUsedPercentage": {
"description": "disable used percentage for the sources in the sidebar",
"type": "boolean"
},
"externalLinks": {
"type": "array",
"items": {
"$ref": "#/definitions/settings.ExternalLink"
}
},
"name": {
"description": "display name",
"type": "string"
}
}
},
"settings.IncludeIndexFilter": {
"type": "object",
"properties": {
"rootFiles": {
"description": "list of root files to include, relative to the source path (eg. \"file1.txt\")",
"type": "array",
"items": {
"type": "string"
}
},
"rootFolders": {
"description": "list of root folders to include, relative to the source path (eg. \"folder1\")",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"settings.Integrations": {
"type": "object",
"properties": {
"media": {
"$ref": "#/definitions/settings.Media"
},
"office": {
"$ref": "#/definitions/settings.OnlyOffice"
}
}
},
"settings.LogConfig": {
"type": "object",
"properties": {
"apiLevels": {
"description": "separated list of log levels to enable for the API. (eg. \"info|warning|error\")",
"type": "string"
},
"json": {
"description": "output in json format, currently not supported",
"type": "boolean"
},
"levels": {
"description": "separated list of log levels to enable. (eg. \"info|warning|error|debug\")",
"type": "string"
},
"noColors": {
"description": "disable colors in the output",
"type": "boolean"
},
"output": {
"description": "output location. (eg. \"stdout\" or \"path/to/file.log\")",
"type": "string"
},
"utc": {
"description": "use UTC time in the output instead of local time",
"type": "boolean"
}
}
},
"settings.LoginMethods": {
"type": "object",
"properties": {
"noauth": {
"description": "if set to true, overrides all other auth methods and disables authentication",
"type": "boolean"
},
"oidc": {
"$ref": "#/definitions/settings.OidcConfig"
},
"password": {
"$ref": "#/definitions/settings.PasswordAuthConfig"
},
"proxy": {
"$ref": "#/definitions/settings.ProxyAuthConfig"
}
}
},
"settings.Media": {
"type": "object",
"properties": {
"ffmpegPath": {
"description": "path to ffmpeg directory with ffmpeg and ffprobe (eg. /usr/local/bin)",
"type": "string"
}
}
},
"settings.OidcConfig": {
"type": "object",
"properties": {
"adminGroup": {
"description": "if set, users in this group will be granted admin privileges.",
"type": "string"
},
"clientId": {
"description": "client id of the OIDC application",
"type": "string"
},
"clientSecret": {
"description": "client secret of the OIDC application",
"type": "string"
},
"createUser": {
"description": "create user if not exists",
"type": "boolean"
},
"disableVerifyTLS": {
"description": "disable TLS verification for the OIDC provider. This is insecure and should only be used for testing.",
"type": "boolean"
},
"enabled": {
"description": "whether to enable OIDC authentication",
"type": "boolean"
},
"issuerUrl": {
"description": "authorization URL of the OIDC provider",
"type": "string"
},
"logoutRedirectUrl": {
"description": "if provider logout url is provided, filebrowser will also redirect to logout url. Custom logout query params are respected.",
"type": "string"
},
"scopes": {
"description": "scopes to request from the OIDC provider",
"type": "string"
},
"userIdentifier": {
"description": "the field value to use as the username. Default is \"preferred_username\", can also be \"email\" or \"username\", or \"phone\"",
"type": "string"
}
}
},
"settings.OnlyOffice": {
"type": "object",
"required": [
"secret",
"url"
],
"properties": {
"internalUrl": {
"description": "An optional internal address that the filebrowser server can use to communicate with the OnlyOffice Document Server, could be useful to bypass proxy.",
"type": "string"
},
"secret": {
"type": "string"
},
"url": {
"description": "The URL to the OnlyOffice Document Server, needs to be accessible to the user.",
"type": "string"
}
}
},
"settings.PasswordAuthConfig": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"enforcedOtp": {
"description": "if set to true, TOTP is enforced for all password users users. Otherwise, users can choose to enable TOTP.",
"type": "boolean"
},
"minLength": {
"description": "minimum pasword length required.",
"type": "integer",
"minimum": 5
},
"recaptcha": {
"description": "recaptcha config, only used if signup is enabled",
"allOf": [
{
"$ref": "#/definitions/settings.Recaptcha"
}
]
},
"signup": {
"description": "allow signups on login page if enabled -- not secure.",
"type": "boolean"
}
}
},
"settings.ProxyAuthConfig": {
"type": "object",
"properties": {
"createUser": {
"description": "create user if not exists",
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"header": {
"description": "required header to use for authentication. Security Warning: FileBrowser blindly accepts the header value as username.",
"type": "string"
},
"logoutRedirectUrl": {
"description": "if provider logout url is provided, filebrowser will also redirect to logout url. Custom logout query params are respected.",
"type": "string"
}
}
},
"settings.Recaptcha": {
"type": "object",
"required": [
"host",
"key",
"secret"
],
"properties": {
"host": {
"type": "string"
},
"key": {
"type": "string"
},
"secret": {
"type": "string"
}
}
},
"settings.Server": {
"type": "object",
"required": [
"sources"
],
"properties": {
"baseURL": {
"description": "base URL for the server, the subpath that the server is running on.",
"type": "string"
},
"cacheDir": {
"description": "path to the cache directory, used for thumbnails and other cached files",
"type": "string"
},
"database": {
"description": "path to the database file",
"type": "string"
},
"debugMedia": {
"description": "output ffmpeg stdout for media integration -- careful can produces lots of output!",
"type": "boolean"
},
"disablePreviewResize": {
"description": "disable resizing of previews for faster loading over slow connections",
"type": "boolean"
},
"disablePreviews": {
"description": "disable all previews thumbnails, simple icons will be used",
"type": "boolean"
},
"disableTypeDetectionByHeader": {
"description": "disable type detection by header, useful if filesystem is slow.",
"type": "boolean"
},
"externalUrl": {
"description": "used by share links if set",
"type": "string"
},
"internalUrl": {
"description": "used by integrations if set, this is the url that an integration service will use to communicate with filebrowser",
"type": "string"
},
"logging": {
"type": "array",
"items": {
"$ref": "#/definitions/settings.LogConfig"
}
},
"maxArchiveSize": {
"description": "max pre-archive combined size of files/folder that are allowed to be archived (in GB)",
"type": "integer"
},
"numImageProcessors": {
"description": "number of concurrent image processing jobs used to create previews, default is number of cpu cores available.",
"type": "integer"
},
"port": {
"description": "port to listen on",
"type": "integer"
},
"socket": {
"description": "socket to listen on",
"type": "string"
},
"sources": {
"type": "array",
"items": {
"$ref": "#/definitions/settings.Source"
}
},
"tlsCert": {
"description": "path to TLS cert",
"type": "string"
},
"tlsKey": {
"description": "path to TLS key",
"type": "string"
}
}
},
"settings.Settings": {
"type": "object",
"properties": {
"auth": {
"$ref": "#/definitions/settings.Auth"
},
"frontend": {
"$ref": "#/definitions/settings.Frontend"
},
"integrations": {
"$ref": "#/definitions/settings.Integrations"
},
"server": {
"$ref": "#/definitions/settings.Server"
},
"userDefaults": {
"$ref": "#/definitions/settings.UserDefaults"
}
}
},
"settings.Source": {
"type": "object",
"required": [
"path"
],
"properties": {
"config": {
"$ref": "#/definitions/settings.SourceConfig"
},
"name": {
"description": "display name",
"type": "string"
},
"path": {
"description": "file system path. (Can be relative)",
"type": "string"
}
}
},
"settings.SourceConfig": {
"type": "object",
"properties": {
"createUserDir": {
"description": "create a user directory for each user",
"type": "boolean"
},
"defaultEnabled": {
"description": "should be added as a default source for new users?",
"type": "boolean"
},
"defaultUserScope": {
"description": "default \"/\" should match folders under path",
"type": "string"
},
"disableIndexing": {
"description": "disable the indexing of this source",
"type": "boolean"
},
"exclude": {
"description": "exclude files and folders from indexing, if include is not set",
"allOf": [
{
"$ref": "#/definitions/settings.ExcludeIndexFilter"
}
]
},
"include": {
"description": "include files and folders from indexing, if exclude is not set",
"allOf": [
{
"$ref": "#/definitions/settings.IncludeIndexFilter"
}
]
},
"indexingIntervalMinutes": {
"description": "optional manual overide interval in seconds to re-index the source",
"type": "integer"
},
"maxWatchers": {
"description": "number of concurrent watchers to use for this source, currently not supported",
"type": "integer"
},
"neverWatchPaths": {
"description": "paths that get initially once. Useful for folders that rarely change contents (without source path prefix)",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"settings.UserDefaults": {
"type": "object",
"properties": {
"darkMode": {
"description": "should dark mode be enabled",
"type": "boolean"
},
"dateFormat": {
"description": "when false, the date is relative, when true, the date is an exact timestamp",
"type": "boolean"
},
"disableOfficePreviewExt": {
"description": "comma separated list of file extensions to disable office preview for",
"type": "string"
},
"disableOnlyOfficeExt": {
"description": "comma separated list of file extensions to disable onlyoffice preview for",
"type": "string"
},
"disableSettings": {
"description": "disable the user from viewing the settings page",
"type": "boolean"
},
"disableUpdateNotifications": {
"description": "disable update notifications banner for admin users",
"type": "boolean"
},
"gallerySize": {
"description": "0-9 - the size of the gallery thumbnails",
"type": "integer"
},
"locale": {
"description": "language to use: eg. de, en, or fr",
"type": "string"
},
"lockPassword": {
"description": "disable the user from changing their password",
"type": "boolean"
},
"loginMethod": {
"description": "login method to use: eg. password, proxy, oidc",
"type": "string"
},
"permissions": {
"$ref": "#/definitions/users.Permissions"
},
"preview": {
"$ref": "#/definitions/users.Preview"
},
"quickDownload": {
"description": "show icon to download in one click",
"type": "boolean"
},
"showHidden": {
"description": "show hidden files in the UI. On windows this includes files starting with a dot and windows hidden files",
"type": "boolean"
},
"singleClick": {
"description": "open directory on single click, also enables middle click to open in new tab",
"type": "boolean"
},
"stickySidebar": {
"description": "keep sidebar open when navigating",
"type": "boolean"
},
"themeColor": {
"description": "theme color to use: eg. #ff0000, or var(--red), var(--purple), etc",
"type": "string"
},
"viewMode": {
"description": "view mode to use: eg. normal, list, grid, or compact",
"type": "string"
}
}
},
"share.Link": {
"type": "object",
"properties": {
"expire": {
"type": "integer"
},
"hash": {
"type": "string"
},
"password_hash": {
"type": "string"
},
"path": {
"type": "string"
},
"source": {
"type": "string"
},
"token": {
"description": "Token is a random value that will only be set when PasswordHash is set. It is\nURL-Safe and is used to download links in password-protected shares via a\nquery arg.",
"type": "string"
},
"userID": {
"type": "integer"
}
}
},
"users.AuthToken": {
"type": "object",
"properties": {
"Permissions": {
"$ref": "#/definitions/users.Permissions"
},
"belongsTo": {
"type": "integer"
},
"createdAt": {
"type": "integer"
},
"expiresAt": {
"type": "integer"
},
"key": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"users.LoginMethod": {
"type": "string",
"enum": [
"password",
"proxy",
"oidc"
],
"x-enum-varnames": [
"LoginMethodPassword",
"LoginMethodProxy",
"LoginMethodOidc"
]
},
"users.Permissions": {
"type": "object",
"properties": {
"admin": {
"type": "boolean"
},
"api": {
"type": "boolean"
},
"modify": {
"type": "boolean"
},
"realtime": {
"type": "boolean"
},
"share": {
"type": "boolean"
}
}
},
"users.Preview": {
"type": "object",
"properties": {
"autoplayMedia": {
"description": "autoplay media files in preview",
"type": "boolean"
},
"disableHideSidebar": {
"description": "disable the hide sidebar preview for previews and editors",
"type": "boolean"
},
"highQuality": {
"description": "generate high quality preview images",
"type": "boolean"
},
"image": {
"description": "show real image as icon instead of generic photo icon",
"type": "boolean"
},
"motionVideoPreview": {
"description": "show multiple frames for videos in preview when hovering",
"type": "boolean"
},
"office": {
"description": "show preview image for office files",
"type": "boolean"
},
"popup": {
"description": "show larger popup preview when hovering",
"type": "boolean"
},
"video": {
"description": "show preview image for video files",
"type": "boolean"
}
}
},
"users.Sorting": {
"type": "object",
"properties": {
"asc": {
"type": "boolean"
},
"by": {
"type": "string"
}
}
},
"users.SourceScope": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"scope": {
"type": "string"
}
}
},
"users.User": {
"type": "object",
"properties": {
"apiKeys": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/users.AuthToken"
}
},
"darkMode": {
"description": "should dark mode be enabled",
"type": "boolean"
},
"dateFormat": {
"description": "when false, the date is relative, when true, the date is an exact timestamp",
"type": "boolean"
},
"disableOfficePreviewExt": {
"description": "comma separated list of file extensions to disable office preview for",
"type": "string"
},
"disableOnlyOfficeExt": {
"description": "comma separated list of file extensions to disable onlyoffice preview for",
"type": "string"
},
"disableSettings": {
"type": "boolean"
},
"disableUpdateNotifications": {
"description": "disable update notifications",
"type": "boolean"
},
"gallerySize": {
"description": "0-9 - the size of the gallery thumbnails",
"type": "integer"
},
"id": {
"type": "integer"
},
"locale": {
"description": "language to use: eg. de, en, or fr",
"type": "string"
},
"lockPassword": {
"type": "boolean"
},
"loginMethod": {
"$ref": "#/definitions/users.LoginMethod"
},
"otpEnabled": {
"description": "true if TOTP is enabled, false otherwise",
"type": "boolean"
},
"password": {
"type": "string"
},
"perm": {
"description": "legacy for migration purposes... og filebrowser has perm attribute",
"allOf": [
{
"$ref": "#/definitions/users.Permissions"
}
]
},
"permissions": {
"$ref": "#/definitions/users.Permissions"
},
"preview": {
"$ref": "#/definitions/users.Preview"
},
"quickDownload": {
"description": "show icon to download in one click",
"type": "boolean"
},
"scope": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"$ref": "#/definitions/users.SourceScope"
}
},
"showHidden": {
"description": "show hidden files in the UI. On windows this includes files starting with a dot and windows hidden files",
"type": "boolean"
},
"singleClick": {
"description": "open directory on single click, also enables middle click to open in new tab",
"type": "boolean"
},
"sorting": {
"$ref": "#/definitions/users.Sorting"
},
"stickySidebar": {
"description": "keep sidebar open when navigating",
"type": "boolean"
},
"themeColor": {
"description": "theme color to use: eg. #ff0000, or var(--red), var(--purple), etc",
"type": "string"
},
"totpNonce": {
"type": "string"
},
"totpSecret": {
"type": "string"
},
"username": {
"type": "string"
},
"viewMode": {
"description": "view mode to use: eg. normal, list, grid, or compact",
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}