basePath: /api definitions: acme.DNSParam: properties: access_key: type: string api_key: type: string email: type: string id: type: string secret_key: type: string token: type: string type: object acme.Resolve: properties: err: type: string key: type: string value: type: string type: object commonrequests.Paginate: properties: limit: type: integer page: type: integer type: object controllers.ErrorResponse: properties: code: type: integer message: type: string type: object controllers.SuccessResponse: properties: code: type: integer data: {} message: type: string type: object models.Cert: properties: auto_renew: description: 自动续签 type: boolean cert: description: 证书内容 type: string cert_url: description: 证书 URL (续签时使用) type: string created_at: type: string dns: $ref: '#/definitions/models.CertDNS' dns_id: description: 关联的 DNS ID type: integer domains: items: type: string type: array id: type: integer key: description: 私钥内容 type: string type: description: 证书类型 (P256, P384, 2048, 4096) type: string updated_at: type: string user: $ref: '#/definitions/models.CertUser' user_id: description: 关联的 ACME 用户 ID type: integer website: $ref: '#/definitions/models.Website' website_id: description: 关联的网站 ID type: integer type: object models.CertDNS: properties: created_at: type: string dns_param: $ref: '#/definitions/acme.DNSParam' id: type: integer name: description: 备注名称 type: string type: description: DNS 提供商 (dnspod, aliyun, cloudflare) type: string updated_at: type: string type: object models.CertUser: properties: ca: description: CA 提供商 (letsencrypt, zerossl, sslcom, google, buypass) type: string created_at: type: string email: type: string hmac_encoded: type: string id: type: integer key_type: type: string kid: type: string private_key: type: string updated_at: type: string type: object models.Website: properties: cert: $ref: '#/definitions/models.Cert' created_at: type: string id: type: integer name: type: string path: type: string php: type: integer remark: type: string ssl: type: boolean status: type: boolean updated_at: type: string type: object requests.Add: properties: db: type: boolean db_name: type: string db_password: type: string db_type: type: string db_user: type: string domains: items: type: string type: array name: type: string php: type: integer ports: items: type: string type: array type: object requests.CertStore: properties: auto_renew: type: boolean dns_id: type: integer domains: items: type: string type: array type: type: string user_id: type: integer website_id: type: integer type: object requests.CertUpdate: properties: auto_renew: type: boolean dns_id: type: integer domains: items: type: string type: array id: type: integer type: type: string user_id: type: integer website_id: type: integer type: object requests.DNSStore: properties: data: $ref: '#/definitions/acme.DNSParam' name: type: string type: type: string type: object requests.DNSUpdate: properties: data: $ref: '#/definitions/acme.DNSParam' id: type: integer name: type: string type: type: string type: object requests.DeleteBackup: properties: name: type: string type: object requests.ID: properties: id: type: integer type: object requests.Login: properties: password: type: string username: type: string type: object requests.Obtain: properties: id: type: integer type: object requests.Renew: properties: id: type: integer type: object requests.RestoreBackup: properties: id: type: integer name: type: string type: object requests.SaveConfig: properties: domains: items: type: string type: array hsts: type: boolean http_redirect: type: boolean id: type: integer index: type: string open_basedir: type: boolean path: type: string php: type: integer ports: items: type: string type: array raw: type: string rewrite: type: string root: type: string ssl: type: boolean ssl_certificate: type: string ssl_certificate_key: type: string waf: type: boolean waf_cache: type: string waf_cc_deny: type: string waf_mode: type: string type: object requests.Update: properties: backup_path: type: string email: type: string entrance: type: string name: type: string password: type: string port: type: integer username: type: string website_path: type: string type: object requests.UserStore: properties: ca: type: string email: type: string hmac_encoded: type: string key_type: type: string kid: type: string type: object requests.UserUpdate: properties: ca: type: string email: type: string hmac_encoded: type: string id: type: integer key_type: type: string kid: type: string type: object responses.CertList: properties: items: items: $ref: '#/definitions/models.Cert' type: array total: type: integer type: object responses.DNSList: properties: items: items: $ref: '#/definitions/models.CertDNS' type: array total: type: integer type: object responses.Info: properties: email: type: string id: type: integer role: items: type: string type: array username: type: string type: object responses.List: properties: items: items: $ref: '#/definitions/models.Website' type: array total: type: integer type: object responses.Settings: properties: backup_path: type: string email: type: string entrance: type: string name: type: string password: type: string port: type: string username: type: string website_path: type: string type: object services.BackupFile: properties: name: type: string size: type: string type: object services.PanelWebsite: properties: db: type: boolean db_name: type: string db_password: type: string db_type: type: string db_user: type: string domains: items: type: string type: array name: type: string path: type: string php: type: integer ports: items: type: string type: array remark: type: string ssl: type: boolean status: type: boolean type: object info: contact: email: i@haozi.net name: 耗子科技 description: 耗子 Linux 面板的 API 信息 license: name: GNU Affero General Public License v3 title: 耗子 Linux 面板 API version: "2" paths: /panel/cert/algorithms: get: description: 获取面板证书管理支持的算法列表 produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 获取算法列表 tags: - 证书管理 /panel/cert/caProviders: get: description: 获取面板证书管理支持的 CA 提供商 produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 获取 CA 提供商 tags: - 证书管理 /panel/cert/certs: get: description: 获取面板证书管理的证书列表 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/commonrequests.Paginate' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/responses.CertList' type: object security: - BearerToken: [] summary: 获取证书列表 tags: - 证书管理 post: consumes: - application/json description: 添加证书到面板证书管理 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.CertStore' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 添加证书 tags: - 证书管理 /panel/cert/certs/{id}: delete: consumes: - application/json description: 删除面板证书管理的证书 parameters: - description: 证书 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 删除证书 tags: - 证书管理 get: description: 获取面板证书管理的证书 parameters: - description: 证书 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/models.Cert' type: object security: - BearerToken: [] summary: 获取证书 tags: - 证书管理 put: consumes: - application/json description: 更新面板证书管理的证书 parameters: - description: 证书 ID in: path name: id required: true type: integer - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.CertUpdate' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 更新证书 tags: - 证书管理 /panel/cert/dns: get: description: 获取面板证书管理的 DNS 接口列表 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/commonrequests.Paginate' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/responses.DNSList' type: object security: - BearerToken: [] summary: 获取 DNS 接口列表 tags: - 证书管理 post: consumes: - application/json description: 添加 DNS 接口到面板证书管理 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.DNSStore' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 添加 DNS 接口 tags: - 证书管理 /panel/cert/dns/{id}: delete: consumes: - application/json description: 删除面板证书管理的 DNS 接口 parameters: - description: DNS 接口 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 删除 DNS 接口 tags: - 证书管理 get: description: 获取面板证书管理的 DNS 接口 parameters: - description: DNS 接口 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/models.CertDNS' type: object security: - BearerToken: [] summary: 获取 DNS 接口 tags: - 证书管理 put: consumes: - application/json description: 更新面板证书管理的 DNS 接口 parameters: - description: DNS 接口 ID in: path name: id required: true type: integer - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.DNSUpdate' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 更新 DNS 接口 tags: - 证书管理 /panel/cert/dnsProviders: get: description: 获取面板证书管理支持的 DNS 提供商 produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 获取 DNS 提供商 tags: - 证书管理 /panel/cert/manualDNS: post: consumes: - application/json description: 获取签发证书所需的 DNS 记录 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.Obtain' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: additionalProperties: $ref: '#/definitions/acme.Resolve' type: object type: object security: - BearerToken: [] summary: 获取手动 DNS 记录 tags: - 证书管理 /panel/cert/obtain: post: consumes: - application/json description: 签发面板证书管理的证书 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.Obtain' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 签发证书 tags: - 证书管理 /panel/cert/renew: post: consumes: - application/json description: 续签面板证书管理的证书 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.Renew' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 续签证书 tags: - 证书管理 /panel/cert/users: get: description: 获取面板证书管理的 ACME 用户列表 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/commonrequests.Paginate' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/responses.CertList' type: object security: - BearerToken: [] summary: 获取用户列表 tags: - 证书管理 post: consumes: - application/json description: 添加 ACME 用户到面板证书管理 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.UserStore' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 添加 ACME 用户 tags: - 证书管理 /panel/cert/users/{id}: delete: consumes: - application/json description: 删除面板证书管理的 ACME 用户 parameters: - description: 用户 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 删除 ACME 用户 tags: - 证书管理 get: description: 获取面板证书管理的 ACME 用户 parameters: - description: 用户 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/models.CertUser' type: object security: - BearerToken: [] summary: 获取 ACME 用户 tags: - 证书管理 put: consumes: - application/json description: 更新面板证书管理的 ACME 用户 parameters: - description: 用户 ID in: path name: id required: true type: integer - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.UserUpdate' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 更新 ACME 用户 tags: - 证书管理 /panel/setting/list: get: description: 获取面板设置列表 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/responses.Settings' type: object security: - BearerToken: [] summary: 设置列表 tags: - 面板设置 /panel/setting/update: post: consumes: - application/json description: 更新面板设置 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.Update' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 更新设置 tags: - 面板设置 /panel/user/info: get: description: 获取当前登录用户信息 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/responses.Info' type: object security: - BearerToken: [] summary: 用户信息 tags: - 用户鉴权 /panel/user/login: post: consumes: - application/json description: 通过用户名和密码获取访问令牌 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.Login' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' "403": description: 用户名或密码错误 schema: $ref: '#/definitions/controllers.ErrorResponse' "500": description: 系统内部错误 schema: $ref: '#/definitions/controllers.ErrorResponse' summary: 登录 tags: - 用户鉴权 /panel/website: get: description: 获取网站管理的网站列表 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/commonrequests.Paginate' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/responses.List' type: object security: - BearerToken: [] summary: 获取网站列表 tags: - 网站管理 post: consumes: - application/json description: 添加网站到网站管理 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.Add' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 添加网站 tags: - 网站管理 /panel/website/{id}: delete: consumes: - application/json description: 删除网站管理的网站 parameters: - description: 网站 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 删除网站 tags: - 网站管理 /panel/website/backupList: get: description: 获取网站的备份列表 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: items: $ref: '#/definitions/services.BackupFile' type: array type: object security: - BearerToken: [] summary: 获取备份列表 tags: - 网站管理 /panel/website/config/{id}: get: consumes: - application/json description: 获取网站的配置 parameters: - description: 网站 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: $ref: '#/definitions/services.PanelWebsite' type: object security: - BearerToken: [] summary: 获取配置 tags: - 网站管理 post: consumes: - application/json description: 保存网站的配置 parameters: - description: 网站 ID in: path name: id required: true type: integer - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.SaveConfig' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 保存配置 tags: - 网站管理 /panel/website/createBackup: post: consumes: - application/json description: 创建网站的备份 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.ID' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 创建备份 tags: - 网站管理 /panel/website/defaultConfig: get: description: 获取默认首页和停止页配置 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/controllers.SuccessResponse' - properties: data: additionalProperties: type: string type: object type: object security: - BearerToken: [] summary: 获取默认配置 tags: - 网站管理 post: consumes: - application/json description: 保存默认首页和停止页配置 parameters: - description: request in: body name: data required: true schema: additionalProperties: type: string type: object produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 保存默认配置 tags: - 网站管理 /panel/website/deleteBackup: delete: consumes: - application/json description: 删除网站的备份 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.DeleteBackup' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 删除备份 tags: - 网站管理 /panel/website/log/{id}: delete: consumes: - application/json description: 清空网站的日志 parameters: - description: 网站 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 清空日志 tags: - 网站管理 /panel/website/resetConfig: post: consumes: - application/json description: 重置网站的配置 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.ID' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 重置配置 tags: - 网站管理 /panel/website/restoreBackup: post: consumes: - application/json description: 还原网站的备份 parameters: - description: request in: body name: data required: true schema: $ref: '#/definitions/requests.RestoreBackup' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 还原备份 tags: - 网站管理 /panel/website/status/{id}: post: consumes: - application/json description: 启用或停用网站 parameters: - description: 网站 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 状态 tags: - 网站管理 /panel/website/updateRemark/{id}: post: consumes: - application/json description: 更新网站的备注 parameters: - description: 网站 ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 更新备注 tags: - 网站管理 /panel/website/uploadBackup: post: consumes: - application/json description: 上传网站的备份 parameters: - description: 备份文件 in: formData name: file required: true type: file produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/controllers.SuccessResponse' security: - BearerToken: [] summary: 上传备份 tags: - 网站管理 /swagger: get: description: Swagger UI responses: "200": description: OK "500": description: Internal Server Error summary: Swagger UI tags: - Swagger securityDefinitions: BearerToken: in: header name: Authorization type: apiKey swagger: "2.0"