Path: API › 网站管理

`POST /site`

获取指定网站的目录保护和安全配置状态，包括防跨站攻击、日志开关、Git 同步及密码访问状态。

## Request body

_Required._

- `action243.request_time` (string, required) — Unix 时间戳。
- `action243.request_token` (string, required) — 按 API 概览生成的签名。
- `action243.action` (string, required) — 具体操作名称。
  - one of `"GetDirUserINI"`
- `action243.id` (integer, required) — 网站 ID
- `action243.path` (string, required) — 网站根目录路径，如 `/www/wwwroot/testapi.bt.local`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "GetDirUserINI",
  "id": 0,
  "path": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/site" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=GetDirUserINI" \
  --data-urlencode "id=<id>" \
  --data-urlencode "path=<path>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "sync_git": false,
  "logs": true,
  "userini": true,
  "runPath": {
    "runPath": "/",
    "dirs": [
      "/"
    ]
  },
  "pass": false
}
```

- `action243.response.default.sync_git` (boolean, optional) — 是否开启 Git 同步
- `action243.response.default.logs` (boolean, optional) — 是否开启日志
- `action243.response.default.userini` (boolean, optional) — 是否启用防跨站保护
- `action243.response.default.runPath` (object, optional) — 运行目录信息 `{runPath, dirs}`
- `action243.response.default.pass` (boolean, optional) — 是否启用密码访问保护


## GetDirUserINI

获取指定网站的目录保护和安全配置状态，包括防跨站攻击、日志开关、Git 同步及密码访问状态。

- **路由**：`POST /site`
- **action**：`GetDirUserINI`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `GetDirUserINI` |
| id | 是 | Integer | 网站 ID |
| path | 是 | String | 网站根目录路径，如 `/www/wwwroot/testapi.bt.local` |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| sync_git | Boolean | 是否开启 Git 同步 |
| logs | Boolean | 是否开启日志 |
| userini | Boolean | 是否启用防跨站保护 |
| runPath | Object | 运行目录信息 `{runPath, dirs}` |
| pass | Boolean | 是否启用密码访问保护 |

## 示例

### 请求

```
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetDirUserINI&id=1&path=/www/wwwroot/testapi.bt.local
```

### 响应

```json
{
    "sync_git": false,
    "logs": true,
    "userini": true,
    "runPath": {"runPath": "/", "dirs": ["/"]},
    "pass": false
}
```

