# noust site

Manage the nginx and apache virtual hosts on this server.

```bash
noust site [OPTIONS] COMMAND [ARGS]...
```

Subcommands: [`create`](#noust-site-create), [`delete`](#noust-site-delete), [`diff`](#noust-site-diff), [`disable`](#noust-site-disable), [`enable`](#noust-site-enable), [`history`](#noust-site-history), [`list`](#noust-site-list), [`logs`](#noust-site-logs), [`restore`](#noust-site-restore), [`show`](#noust-site-show), [`unknown-hosts`](#noust-site-unknown-hosts)

## noust site create

Create a site and secure it with a certificate.

```bash
noust site create [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `--domain`, `-d` | Domain to serve, such as example.com. |  |
| `--webserver`, `-w` | Web server to configure. | `nginx` |
| `--template`, `-t` | Configuration template to render. | `proxy` |
| `--port`, `-p` | Port the application listens on behind the proxy. | `3000` |
| `--no-ssl` | Serve plain HTTP and request no certificate. |  |
| `--www` | Also serve www.<domain> and cover it with the certificate. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site delete

Delete a site, its configuration and its certificate.

```bash
noust site delete [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--force`, `-f`, `-y` | Delete without asking for confirmation. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site diff

Show what changed between a version of a site's file and the file now.

```bash
noust site diff [OPTIONS] DOMAIN VERSION
```

Arguments: `domain`, `version`

| Option | What it does | Default |
|---|---|---|
| `--against` | Compare with this version instead of the file now. |  |
| `--webserver`, `-w` | The web server. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site disable

Stop serving a site, keeping its configuration.

```bash
noust site disable [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site enable

Start serving a site that is configured but off.

```bash
noust site enable [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site history

List the versions kept of a site's file, newest first, and say if it has drifted.

```bash
noust site history [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--webserver`, `-w` | The web server. |  |
| `--json` | Print the versions as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site list

List the sites configured on this server.

```bash
noust site list [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `--webserver`, `-w` | Only show sites from this web server. | `all` |
| `--team` | Only this team's. |  |
| `--project` | Only what lives in the projects with this name. |  |
| `--env` | Only what lives in the environments with this name. |  |
| `--json` | Print the site list as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site logs

Show the end of what the web server logged for a site.

```bash
noust site logs [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--kind` | The web server's access log or its error log. | `access` |
| `-n`, `--lines` |  | `100` |
| `--contains` | Only lines with this text, whatever its case. |  |
| `--json` | Print the log as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site restore

Put an earlier version of a site's file back.

```bash
noust site restore [OPTIONS] DOMAIN VERSION
```

Arguments: `domain`, `version`

| Option | What it does | Default |
|---|---|---|
| `--reload` | Reload the web server after. |  |
| `--webserver`, `-w` | The web server. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site show

Print the configuration file of a site.

```bash
noust site show [OPTIONS] DOMAIN
```

Arguments: `domain`

| Option | What it does | Default |
|---|---|---|
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site unknown-hosts

What answers a request for a name no site serves: nothing, a 503, or a redirect.

```bash
noust site unknown-hosts [OPTIONS] COMMAND [ARGS]...
```

Subcommands: [`reset`](#noust-site-unknown-hosts-reset), [`set`](#noust-site-unknown-hosts-set), [`show`](#noust-site-unknown-hosts-show)

## noust site unknown-hosts reset

Take the site away: the first site answers an unknown name again.

```bash
noust site unknown-hosts reset [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `--webserver`, `-w` | The web server. |  |
| `--json` | Print the status now in force as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site unknown-hosts set

Answer an unknown name with ACTION: close, refuse (503) or redirect.

```bash
noust site unknown-hosts set [OPTIONS] {close|refuse|redirect}
```

Arguments: `action`

| Option | What it does | Default |
|---|---|---|
| `--redirect-to` | Where a redirect goes (http or https). |  |
| `--switch-off-default-site` | Switch off the web server's own default site if it is in the way (put back on reset). |  |
| `--webserver`, `-w` | The web server. |  |
| `--json` | Print the status now in force as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

## noust site unknown-hosts show

Say what answers an unknown name now, and what else claims to be the default.

```bash
noust site unknown-hosts show [OPTIONS]
```

| Option | What it does | Default |
|---|---|---|
| `--webserver`, `-w` | The web server. |  |
| `--json` | Print the status as JSON. |  |
| `--reason` | Why this change is made (a change reference, a ticket). Recorded with the command in the audit log; required only where a compliance framework asks for it (ENS) or security.change_reasons is on. |  |

