199 lines
4.8 KiB
JSON
199 lines
4.8 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "yet-another-nginx-proxy-manager",
|
|
"description": "",
|
|
"license": {
|
|
"name": ""
|
|
},
|
|
"version": "0.1.0"
|
|
},
|
|
"paths": {
|
|
"/api/auth/init_admin": {
|
|
"post": {
|
|
"tags": [
|
|
"Authentication"
|
|
],
|
|
"summary": "Initializes the admin user",
|
|
"description": "Initializes the admin user if no admin user exists and the correct setup secret is provided.",
|
|
"operationId": "init_admin",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AdminInitRequest"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Admin user initialized successfully"
|
|
},
|
|
"400": {
|
|
"description": "Invalid request payload"
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized: Admin user already exists or invalid setup secret"
|
|
},
|
|
"500": {
|
|
"description": "Internal server error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/auth/login": {
|
|
"post": {
|
|
"tags": [
|
|
"Authentication"
|
|
],
|
|
"summary": "Login endpoint",
|
|
"description": "Authenticates a user and returns a JWT in an HttpOnly cookie.",
|
|
"operationId": "login",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/LoginRequest"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "User authenticated successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"default": null
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Authentication failed"
|
|
},
|
|
"500": {
|
|
"description": "Internal server error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/health/info": {
|
|
"get": {
|
|
"tags": [
|
|
"Health"
|
|
],
|
|
"summary": "Health check endpoint",
|
|
"description": "Returns the health status, version, uptime, and any errors if unhealthy.",
|
|
"operationId": "get_health_info",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Health information retrieved successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HealthInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Health information not found"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"AdminInitRequest": {
|
|
"type": "object",
|
|
"description": "Login request payload",
|
|
"required": [
|
|
"username",
|
|
"password",
|
|
"setup_secret"
|
|
],
|
|
"properties": {
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"setup_secret": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"HealthInfo": {
|
|
"type": "object",
|
|
"description": "System health information",
|
|
"required": [
|
|
"status",
|
|
"version",
|
|
"up_since",
|
|
"is_initialized"
|
|
],
|
|
"properties": {
|
|
"errors": {
|
|
"type": [
|
|
"array",
|
|
"null"
|
|
],
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "List of error messages if unhealthy"
|
|
},
|
|
"is_initialized": {
|
|
"type": "boolean",
|
|
"description": "Is initialized"
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"description": "Health status: \"healthy\" or \"unhealthy\""
|
|
},
|
|
"up_since": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "RFC 3339 formatted timestamp"
|
|
},
|
|
"version": {
|
|
"type": "string",
|
|
"description": "Application version"
|
|
}
|
|
}
|
|
},
|
|
"LoginRequest": {
|
|
"type": "object",
|
|
"description": "Login request payload",
|
|
"required": [
|
|
"username",
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Health",
|
|
"description": "Health information API"
|
|
},
|
|
{
|
|
"name": "Authentication",
|
|
"description": "Authentication API"
|
|
}
|
|
]
|
|
} |