// 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": { "/agents": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a list of all agents currently connected via Collector (log streaming)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agents" ], "summary": "Get connected agents", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/internal_handlers.AgentInfo" } } } } } }, "/agents/deploy": { "post": { "security": [ { "Bearer": [] } ], "description": "Deploy HellreigN agents to multiple servers using Ansible playbooks. Supports Docker and Binary deployment types.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agents" ], "summary": "Deploy agents to multiple servers via Ansible", "parameters": [ { "description": "Deployment configuration for servers", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployAgentsRequest" } } ], "responses": { "200": { "description": "Deployment results with tokens for each server", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal server error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/agents/register": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agents" ], "summary": "Register agent", "parameters": [ { "description": "CSR + token", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.RegisterRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_handlers.RegisterResponse" } } } } }, "/agents/register-token": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agents" ], "summary": "Create registration token", "parameters": [ { "description": "Label", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.RegistrationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/login": { "post": { "description": "Authenticate with login and password, returns a token and permissions", "consumes": [ "application/json" ], "tags": [ "auth" ], "summary": "Login", "parameters": [ { "description": "Login credentials", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "403": { "description": "Forbidden", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/register": { "post": { "description": "Registers a new user with login, password, name, last name. All permissions are set to false.", "consumes": [ "application/json" ], "tags": [ "auth" ], "summary": "Register user", "parameters": [ { "description": "Registration data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.UserRegister" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "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" } } } } } }, "/auth/token": { "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new user with permissions", "consumes": [ "application/json" ], "tags": [ "auth" ], "summary": "Create user", "parameters": [ { "description": "User data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenCreate" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes the current authenticated user", "tags": [ "auth" ], "summary": "Delete my account", "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/tokens": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns list of all users with their permissions", "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "List users", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/tokens/:login": { "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a user by their login", "tags": [ "auth" ], "summary": "Delete user", "parameters": [ { "type": "string", "description": "Login of the user to delete", "name": "login", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/users/:login": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a user by their login (admin only)", "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Get user by login", "parameters": [ { "type": "string", "description": "Login of the user", "name": "login", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens" } }, "400": { "description": "Bad Request", "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": { "security": [ { "Bearer": [] } ], "description": "Updates a user's name and last name (admin only)", "consumes": [ "application/json" ], "tags": [ "auth" ], "summary": "Update user", "parameters": [ { "type": "string", "description": "Login of the user", "name": "login", "in": "path", "required": true }, { "description": "User data to update", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "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" } } } } } }, "/auth/users/:login/activate": { "post": { "security": [ { "Bearer": [] } ], "description": "Activates a user account by login (admin only)", "tags": [ "auth" ], "summary": "Activate user", "parameters": [ { "type": "string", "description": "Login of the user to activate", "name": "login", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "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" } } } } } }, "/auth/users/:login/deactivate": { "post": { "security": [ { "Bearer": [] } ], "description": "Deactivates a user account by login (admin only)", "tags": [ "auth" ], "summary": "Deactivate user", "parameters": [ { "type": "string", "description": "Login of the user to deactivate", "name": "login", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "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" } } } } } }, "/auth/users/:login/password": { "put": { "security": [ { "Bearer": [] } ], "description": "Resets a user's password to a new value (admin only)", "consumes": [ "application/json" ], "tags": [ "auth" ], "summary": "Reset user password", "parameters": [ { "type": "string", "description": "Login of the user", "name": "login", "in": "path", "required": true }, { "description": "New password", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenPasswordReset" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "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" } } } } } }, "/auth/users/:login/permissions": { "put": { "security": [ { "Bearer": [] } ], "description": "Updates a user's permissions and activation status (admin only)", "consumes": [ "application/json" ], "tags": [ "auth" ], "summary": "Update user permissions", "parameters": [ { "type": "string", "description": "Login of the user", "name": "login", "in": "path", "required": true }, { "description": "Permissions to update", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdatePermissions" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "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" } } } } } }, "/auth/users/inactive": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns list of all users waiting for activation", "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "List inactive users", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/auth/validate": { "get": { "security": [ { "Bearer": [] } ], "description": "Check if the provided Bearer token is valid and return its permissions", "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Validate token", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens" } }, "401": { "description": "Unauthorized", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/jobs": { "post": { "description": "Sends a command to the specified agent and returns a URL to wait for the result", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "jobs" ], "summary": "Submit a job to an agent", "parameters": [ { "description": "Job request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.AddJobIn" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/internal_handlers.AddJobOut" } } } } }, "/jobs/check_cmd": { "post": { "description": "Validates that a command binary exists on the system", "consumes": [ "application/json" ], "tags": [ "jobs" ], "summary": "Check command path", "parameters": [ { "description": "Command to check", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.CheckCmdIn" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_handlers.CheckCmdOut" } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/jobs/metrics": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns total, successful, failed, and pending job counts over the given period", "produces": [ "application/json" ], "tags": [ "jobs" ], "summary": "Get job metrics", "parameters": [ { "type": "string", "default": "24h", "description": "Time period (e.g. 1h, 24h, 7d)", "name": "period", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_handlers.JobMetricsOut" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/jobs/{id}/wait": { "post": { "description": "Long-polls for a job result. Returns immediately if the job is already finished.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "jobs" ], "summary": "Wait for job result", "parameters": [ { "type": "integer", "description": "Job ID", "name": "id", "in": "path", "required": true }, { "description": "Agent reference", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.WaitJobIn" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/internal_handlers.JobResult" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/logs": { "get": { "security": [ { "Bearer": [] } ], "description": "Searches logs with various filters", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Search logs", "parameters": [ { "type": "string", "description": "Log level (INFO, WARNING, ERROR, FATAL)", "name": "level", "in": "query" }, { "type": "string", "description": "Service name", "name": "service", "in": "query" }, { "type": "string", "description": "Agent name", "name": "agent", "in": "query" }, { "type": "string", "description": "Date from (RFC3339)", "name": "date_from", "in": "query" }, { "type": "string", "description": "Date to (RFC3339)", "name": "date_to", "in": "query" }, { "type": "integer", "default": 100, "description": "Limit results", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset results", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry" } } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Inserts a single log entry into ClickHouse", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Insert log entry", "parameters": [ { "description": "Log entry", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.InsertLogRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/logs/agents": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns list of all unique agent names in logs", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get distinct agents", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/logs/batch": { "post": { "security": [ { "Bearer": [] } ], "description": "Inserts multiple log entries into ClickHouse", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Insert log entries (batch)", "parameters": [ { "description": "Log entries", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.InsertLogsRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/logs/levels": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns list of all unique log levels in logs", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get distinct log levels", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/logs/mock": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns 100 mock log entries for frontend development (no ClickHouse required)", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get mock logs", "parameters": [ { "type": "string", "description": "Filter by level", "name": "level", "in": "query" }, { "type": "string", "description": "Filter by service", "name": "service", "in": "query" }, { "type": "string", "description": "Filter by agent", "name": "agent", "in": "query" }, { "type": "integer", "default": 100, "description": "Limit results", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset results", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry" } } } } } }, "/logs/services": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns list of all unique service names in logs", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get distinct services", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/scripts": { "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new script with path, content, and interpreter binding", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Create script", "parameters": [ { "description": "Script data", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptCreate" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script" } } } } }, "/scripts/:id": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a script by its ID", "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Get script", "parameters": [ { "type": "integer", "description": "Script ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates a script's path, content, or interpreter", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Update script", "parameters": [ { "type": "integer", "description": "Script ID", "name": "id", "in": "path", "required": true }, { "description": "Script data", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a script by its ID", "tags": [ "scripts" ], "summary": "Delete script", "parameters": [ { "type": "integer", "description": "Script ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/scripts/:id/run": { "post": { "security": [ { "Bearer": [] } ], "description": "Loads a script from storage, resolves interpreter command, and submits it to the agent", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Run script by ID", "parameters": [ { "type": "integer", "description": "Script ID", "name": "id", "in": "path", "required": true }, { "description": "Agent ID and optional stdin", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.RunStoredScriptIn" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/internal_handlers.AddJobOut" } }, "400": { "description": "Bad Request", "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" } } } } } }, "/scripts/by-path": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a script by its full path (e.g. 'deploy/nginx/restart.sh')", "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Get script by path", "parameters": [ { "type": "string", "description": "Script path", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/scripts/folder": { "post": { "security": [ { "Bearer": [] } ], "description": "Creates a virtual folder by creating a placeholder script with the folder path", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Create folder", "parameters": [ { "description": "Folder path", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.CreateFolderRequest" } } ], "responses": { "201": { "description": "Folder created", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes all scripts that start with the given folder path", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Delete folder", "parameters": [ { "description": "Folder path", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.DeleteFolderRequest" } } ], "responses": { "200": { "description": "Folder deleted with count of deleted scripts", "schema": { "type": "object", "additionalProperties": true } } } } }, "/scripts/interpreters": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns all script interpreters available in the system", "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "List interpreters", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter" } } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Registers a new script interpreter with name, label, and argv", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Create interpreter", "parameters": [ { "description": "Interpreter definition", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterCreate" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter" } } } } }, "/scripts/interpreters/:id": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a script interpreter by ID", "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Get interpreter", "parameters": [ { "type": "integer", "description": "Interpreter ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates fields of a script interpreter", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Update interpreter", "parameters": [ { "type": "integer", "description": "Interpreter ID", "name": "id", "in": "path", "required": true }, { "description": "Interpreter fields", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Removes a script interpreter by ID", "tags": [ "scripts" ], "summary": "Delete interpreter", "parameters": [ { "type": "integer", "description": "Interpreter ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/scripts/rename": { "post": { "security": [ { "Bearer": [] } ], "description": "Renames a single script or all scripts under a folder prefix", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Rename script or folder", "parameters": [ { "description": "Rename request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.RenameRequest" } } ], "responses": { "200": { "description": "Rename result with count of renamed scripts", "schema": { "type": "object", "additionalProperties": true } }, "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" } } } } } }, "/scripts/run": { "post": { "security": [ { "Bearer": [] } ], "description": "Resolves interpreter argv[] and sends the full command to the agent", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Run a script on an agent", "parameters": [ { "description": "Script request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/internal_handlers.RunScriptIn" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/internal_handlers.AddJobOut" } } } } }, "/scripts/tree": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a hierarchical tree of all scripts organized by their paths", "produces": [ "application/json" ], "tags": [ "scripts" ], "summary": "Get script directory tree", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptTreeNode" } } } } } } }, "definitions": { "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AgentDeployConfig": { "description": "Configuration for deploying HellreigN agent to a single server", "type": "object", "required": [ "agentLabel", "authMethod", "deployType", "ip", "user" ], "properties": { "agentLabel": { "type": "string", "example": "production-server-1" }, "authMethod": { "allOf": [ { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AuthMethod" } ], "example": "key" }, "deployType": { "allOf": [ { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployType" } ], "example": "docker" }, "ip": { "type": "string", "example": "192.168.1.100" }, "password": { "type": "string", "example": "secret" }, "port": { "type": "integer", "example": 22 }, "sshKey": { "type": "string", "example": "-----BEGIN OPENSSH PRIVATE KEY-----" }, "user": { "type": "string", "example": "admin" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AuthMethod": { "description": "SSH authentication method: key or password", "type": "string", "enum": [ "key", "password" ], "x-enum-varnames": [ "AuthMethodKey", "AuthMethodPassword" ] }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployAgentsRequest": { "description": "Request to deploy HellreigN agents to multiple servers", "type": "object", "required": [ "servers" ], "properties": { "servers": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.AgentDeployConfig" } } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResponse": { "description": "Response containing deployment results and registration tokens", "type": "object", "properties": { "message": { "type": "string", "example": "Deployment completed" }, "results": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResult" } } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployResult": { "description": "Result of deploying to a single server", "type": "object", "properties": { "agent_label": { "type": "string", "example": "production-server-1" }, "error": { "type": "string", "example": "" }, "ip": { "type": "string", "example": "192.168.1.100" }, "success": { "type": "boolean", "example": true }, "token": { "type": "string", "example": "abc123..." } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.DeployType": { "description": "Type of deployment: docker or binary", "type": "string", "enum": [ "docker", "binary" ], "x-enum-varnames": [ "DeployTypeDocker", "DeployTypeBinary" ] }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginRequest": { "type": "object", "required": [ "login", "password" ], "properties": { "login": { "type": "string" }, "password": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.LoginResponse": { "type": "object", "properties": { "is_active": { "type": "boolean" }, "last_name": { "type": "string" }, "login": { "type": "string" }, "name": { "type": "string" }, "permission_admin": { "type": "boolean" }, "permission_manage_agent": { "type": "boolean" }, "permission_view": { "type": "boolean" }, "token": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.RegistrationRequest": { "type": "object", "required": [ "label" ], "properties": { "label": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Script": { "type": "object", "properties": { "content": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "interpreter_id": { "type": "integer" }, "path": { "type": "string" }, "updated_at": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptCreate": { "type": "object", "required": [ "interpreter_id", "path" ], "properties": { "content": { "type": "string" }, "interpreter_id": { "type": "integer" }, "path": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreter": { "type": "object", "properties": { "argv": { "type": "array", "items": { "type": "string" } }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "label": { "type": "string" }, "name": { "type": "string" }, "updated_at": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterCreate": { "type": "object", "required": [ "argv", "label", "name" ], "properties": { "argv": { "type": "array", "items": { "type": "string" } }, "label": { "type": "string" }, "name": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptInterpreterUpdate": { "type": "object", "properties": { "argv": { "type": "array", "items": { "type": "string" } }, "label": { "type": "string" }, "name": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptTreeNode": { "type": "object", "properties": { "children": { "type": "array", "items": { "$ref": "#/definitions/gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptTreeNode" } }, "content": { "type": "string" }, "id": { "type": "integer" }, "interpreter_id": { "type": "integer" }, "name": { "type": "string" }, "type": { "description": "\"folder\" or \"file\"", "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.ScriptUpdate": { "type": "object", "properties": { "content": { "type": "string" }, "interpreter_id": { "type": "integer" }, "path": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenCreate": { "type": "object", "required": [ "last_name", "login", "name", "password" ], "properties": { "is_active": { "type": "boolean" }, "last_name": { "type": "string" }, "login": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string" }, "permission_admin": { "type": "boolean" }, "permission_manage_agent": { "type": "boolean" }, "permission_view": { "type": "boolean" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenPasswordReset": { "type": "object", "required": [ "new_password" ], "properties": { "new_password": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdate": { "type": "object", "properties": { "last_name": { "type": "string" }, "name": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.TokenUpdatePermissions": { "type": "object", "properties": { "is_active": { "type": "boolean" }, "permission_admin": { "type": "boolean" }, "permission_manage_agent": { "type": "boolean" }, "permission_view": { "type": "boolean" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.Tokens": { "type": "object", "properties": { "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "last_name": { "type": "string" }, "login": { "type": "string" }, "name": { "type": "string" }, "permission_admin": { "type": "boolean" }, "permission_manage_agent": { "type": "boolean" }, "permission_view": { "type": "boolean" }, "token": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_repository.UserRegister": { "type": "object", "required": [ "last_name", "login", "name", "password" ], "properties": { "last_name": { "type": "string" }, "login": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string" } } }, "gitea_d3m0k1d_ru_d3m0k1d_HellreigN_backend_internal_storage.LogEntry": { "type": "object", "properties": { "agent": { "type": "string" }, "level": { "type": "string" }, "message": { "type": "string" }, "service": { "type": "string" }, "timestamp": { "type": "string" } } }, "internal_handlers.AddJobIn": { "type": "object", "required": [ "agent_id", "command" ], "properties": { "agent_id": { "type": "string" }, "command": { "type": "string" }, "interpreter_id": { "type": "integer" }, "stdin": { "type": "string" } } }, "internal_handlers.AddJobOut": { "type": "object", "properties": { "command": { "type": "array", "items": { "type": "string" } }, "id": { "type": "integer" }, "wait_url": { "type": "string" } } }, "internal_handlers.AgentInfo": { "type": "object", "properties": { "connected_at": { "description": "Time when agent connected (RFC3339-like)", "type": "string", "example": "2026-04-04 10:30:00" }, "label": { "description": "Human-readable label", "type": "string", "example": "web-server-1" }, "services": { "description": "List of services with status (format: \"name:status\")", "type": "array", "items": { "type": "string" }, "example": [ "nginx:running", "redis:up" ] }, "token": { "description": "Unique agent identifier", "type": "string", "example": "agent-001" } } }, "internal_handlers.CheckCmdIn": { "type": "object", "required": [ "command" ], "properties": { "command": { "type": "string", "example": "bash" } } }, "internal_handlers.CheckCmdOut": { "type": "object", "properties": { "exists": { "type": "boolean" } } }, "internal_handlers.CreateFolderRequest": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string", "example": "deploy/nginx" } } }, "internal_handlers.DeleteFolderRequest": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string", "example": "deploy/nginx" } } }, "internal_handlers.InsertLogRequest": { "type": "object", "required": [ "agent", "level", "message", "service" ], "properties": { "agent": { "type": "string" }, "level": { "type": "string" }, "message": { "type": "string" }, "service": { "type": "string" }, "timestamp": { "type": "string" } } }, "internal_handlers.InsertLogsRequest": { "type": "object", "required": [ "logs" ], "properties": { "logs": { "type": "array", "items": { "$ref": "#/definitions/internal_handlers.InsertLogRequest" } } } }, "internal_handlers.JobMetricsOut": { "type": "object", "properties": { "failed": { "type": "integer" }, "pending": { "type": "integer" }, "period": { "type": "string" }, "success": { "type": "integer" }, "total": { "type": "integer" } } }, "internal_handlers.JobResult": { "type": "object", "properties": { "command": { "type": "array", "items": { "type": "string" } }, "id": { "type": "integer" }, "status": { "type": "integer" }, "stderr": { "type": "string" }, "stdin": { "type": "string" }, "stdout": { "type": "string" } } }, "internal_handlers.RegisterRequest": { "type": "object", "required": [ "csr", "token" ], "properties": { "csr": { "type": "string" }, "token": { "type": "string" } } }, "internal_handlers.RegisterResponse": { "type": "object", "properties": { "ca_cert": { "type": "string" }, "client_cert": { "type": "string" } } }, "internal_handlers.RenameRequest": { "type": "object", "required": [ "new_path", "old_path" ], "properties": { "new_path": { "type": "string", "example": "deploy/nginx-v2" }, "old_path": { "type": "string", "example": "deploy/nginx" } } }, "internal_handlers.RunScriptIn": { "type": "object", "required": [ "agent_id", "interpreter_id", "script_text" ], "properties": { "agent_id": { "type": "string" }, "interpreter_id": { "type": "integer" }, "script_text": { "type": "string" }, "stdin": { "type": "string" } } }, "internal_handlers.RunStoredScriptIn": { "type": "object", "required": [ "token" ], "properties": { "stdin": { "type": "string" }, "token": { "type": "string" } } }, "internal_handlers.WaitJobIn": { "type": "object", "required": [ "agent_id" ], "properties": { "agent_id": { "type": "string" } } } }, "securityDefinitions": { "Bearer": { "description": "Type \"Bearer\" followed by a space and the JWT token.", "type": "apiKey", "name": "Authorization", "in": "header" } } }` // 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: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }