> ## Documentation Index
> Fetch the complete documentation index at: https://frp.xdr.ooo/llms.txt
> Use this file to discover all available pages before exploring further.

# Lifecycle Semantics

> Understand disable, revoke, release, uninstall, purge, and update before changing client or port state.

# Lifecycle Semantics

FRP Auto Deploy deliberately separates **temporary publication**, **management identity**, and **public-port reservation**. These are different state machines.

```text theme={null}
disable   != release
revoke    != release
uninstall != release
update    != re-enrollment
```

## Service lifecycle

```mermaid theme={null}
stateDiagram-v2
    [*] --> Published
    Published --> Disabled: disable service
    Disabled --> Published: enable service
    Published --> Published: edit + apply
    Published --> Released: release service
    Disabled --> Released: release service
    Released --> [*]
```

| Action          | Effect                       | Public port            |
| --------------- | ---------------------------- | ---------------------- |
| Disable service | stop publication temporarily | **kept**               |
| Enable service  | resume publication           | **same port reused**   |
| Edit + apply    | change target/name/config    | **kept when possible** |
| Release service | remove reservation           | **returned to pool**   |

## Client management lifecycle

```mermaid theme={null}
flowchart LR
    E[Enrolled client] -->|revoke client| R[Management identity blocked]
    E -->|release client| X[Server record + service reservations released]
    E -->|local uninstall| L[Client software/state removed locally]
    L -. does not automatically .-> X
```

* `revoke client` blocks the client's management identity but does not mean "free all public ports".
* `release client` is the server-side operation that removes the client record and returns its service reservations.
* client uninstall is local-only and does not automatically contact the server to release reservations.

There is intentionally no ambiguous `delete client` command.

## Enrollment credential lifecycle — stable v2.1.2

```mermaid theme={null}
stateDiagram-v2
    [*] --> Pending
    Pending --> Bound
    Pending --> Revoked: revoke enrollment
    Bound --> Completed
    Bound --> Revoked: revoke enrollment
    Pending --> Expired
    Completed --> [*]
    Revoked --> [*]
    Expired --> [*]
```

`show enrollments` does not expose the secret itself. Stable v2.1.2 supports revoking active enrollment credentials with:

```bash theme={null}
sudo frpctl revoke enrollment <ID>
```

<Note>
  The 2.1.3 development tree adds explicit terminal enrollment purge/retention controls. Those should not be assumed on stable v2.1.2.
</Note>

## Which command do I actually want?

```mermaid theme={null}
flowchart TD
    A[What is your goal?] --> B{Stop one service temporarily?}
    B -->|Yes| D[disable service]
    B -->|No| C{Permanently return its public port?}
    C -->|Yes| R[release service]
    C -->|No| M{Block a client's management identity?}
    M -->|Yes| V[revoke client]
    M -->|No| X{Decommission client and free all reservations?}
    X -->|Yes| RC[release client\nthen uninstall local client as needed]
```

## Update

A supported normal project update is not a re-enrollment operation. Identity, CA, token, registry, and persistent public ports are designed to remain intact.

<Warning>
  Do not use `release` as a generic cleanup command unless you actually intend to return the public-port reservation to the pool.
</Warning>
