Adopting protected HTTPS with the CLI without a restart

Complete TLS, password and Symfony checks, a separate journal and a write-free replay. Existing-state adoption versus first installation.

A woman with a clipboard inspects server racks behind glass doors.

Installed HTTPS needs its own record

The educational E-01 already has a separate protected HTTPS vhost: an Origin CA certificate, authentication before static content and PHP, and denials for foreign names and private paths. The separate https-successor-inspect command successfully completed 8 HTTP checks with an explicit reference to the confirmed package state. This establishes the result of reading the existing configuration, but does not create an adoption journal.

The next step is narrow: accept this verified installed role into its own journal. Doing so does not require rewriting the configuration. The distinction matters between “this state has been checked” and “the operation has saved an immutable confirmation of this state.”

Accept what is there

Adoption works only with protected HTTPS that is already installed. It has no hidden fallback that creates a missing vhost or repairs different files. A mismatch must stop the operation and remain visible.

The plan binds the original private application confirmations, the package successor and the exact observed HTTPS state. Inspection covers the certificate and matching key, active TLS peer, authentication, denials, Host and SNI, redirects, application response body and noindex/no-store headers. The original https-inspect retains its strict parent/packages refusal: the new operation uses the successor explicitly.

Plan, apply and an independent reading

The Bash example below uses placeholder paths. Prepare every profile and reference for your own server; the command does not invent them. Planning writes a new local file. Review it and explicitly supply its exact SHA256 before applying. Verification uses the same plan and checksum, but does not accept the privilege approval flag.

set -euo pipefail

# Bash: replace these example paths with prepared private input files.
ADMIN_ENV_FILE=/private/example/administrator.env
REQUEST_FILE=/private/example/current-request.json
FPM_FILE=/private/example/original-fpm.json
KEY_FILE=/private/example/archive-keyring.gpg
ACTIVATION_FILE=/private/example/activation-reference.json
ENABLE_FILE=/private/example/enable-reference.json
MINIMAL_FILE=/private/example/minimal-reference.json
APPLICATION_FILE=/private/example/application-profile.json
APPLICATION_REFERENCE=/private/example/application-reference.json
SUCCESSOR_FILE=/private/example/replacement-profile.json
PLAN_FILE=/private/e01/https-adoption-plan.json
HTTPS_FILE=/private/example/https-profile.json
SUCCESSOR_REFERENCE=/private/example/committed-successor-reference.json
: "${ARCHIVE_KEY_SHA256:?Set the previously verified keyring SHA256}"

common=(
  --env-file "$ADMIN_ENV_FILE"
  --request-file "$REQUEST_FILE"
  --fpm-file "$FPM_FILE"
  --key-file "$KEY_FILE" --key-sha256 "$ARCHIVE_KEY_SHA256"
  --activation-file "$ACTIVATION_FILE"
  --enable-file "$ENABLE_FILE"
  --minimal-file "$MINIMAL_FILE"
  --application-file "$APPLICATION_FILE"
  --application-reference "$APPLICATION_REFERENCE"
)

# All inputs refer to an already installed and inspected HTTPS role.
https_inputs=(
  "${common[@]}"
  --successor-file "$SUCCESSOR_FILE"
  --successor-reference "$SUCCESSOR_REFERENCE"
  --https-file "$HTTPS_FILE"
)

# Plan publication is exclusive: choose a new PLAN_FILE.
deploy-cli host application https-adopt-plan "${https_inputs[@]}" \
  --plan-file "$PLAN_FILE"

# Review the saved plan and set its exact SHA256 before approval.
: "${HTTPS_PLAN_SHA256:?Set the reviewed HTTPS adoption plan SHA256}"
deploy-cli host application https-adopt-apply "${https_inputs[@]}" \
  --plan-file "$PLAN_FILE" --plan-sha256 "$HTTPS_PLAN_SHA256" \
  --approve-privileges

deploy-cli host application https-adopt-verify "${https_inputs[@]}" \
  --plan-file "$PLAN_FILE" --plan-sha256 "$HTTPS_PLAN_SHA256"

This shows how to invoke the private CLI, not its implementation. Private input files are not publication material. Password and private key values do not belong in command arguments; neither key content nor the server auth file is transferred to create the journal.

What application may write

The write boundary is narrow: a separate root-owned /var/lib/deploy-cli-protected-https directory with mode 0700, an owner marker and root-owned transaction files with mode 0600. Nginx configuration, certificate, key and password file must remain unchanged. The operation must not reload services, install packages or change the network.

Application reads the state again. If a file or another bound input changes after planning, the plan does not authorize accepting those new bytes. An incomplete record likewise cannot count as completed adoption. Replaying the same committed operation must check the existing journal without another durable write.

Actual adoption on E-01

The CLI completed a new plan with 8 HTTP checks, 5 file-role images and 2 services. Application created only the new adoption journal. Built-in fresh verification, a separate verify and an exact application replay also succeeded; the last two passes performed no durable writes. The confirmed state checksum matched across every result.

Each full observation found the certificate, key, auth file and Nginx configuration bytes unchanged. There were no service actions, configuration writes or changes to the original journals. The fields below summarize selected saved actual results for readability; this is not the raw response of a single command.

{
  "plan": "passed",
  "http_checks": 8,
  "file_role_images": 5,
  "units": 2,
  "apply": "passed",
  "fresh_verification": "passed",
  "separate_verification_write_performed": false,
  "exact_replay_write_performed": false,
  "service_actions": 0,
  "configuration_writes": 0,
  "historical_journals_written": 0
}

A journal does not open the site

Completed adoption records an existing role. Installing TLS on a clean server remains separate work. Cloudflare access, external networking and DNS do not follow from creating a local journal either: they need their own actions and checks.

A real terminal frame summarising selected fields from saved E01 results. Apply created only a new journal; verify and replay performed no writes. This is neither a rerun nor the complete raw output.
  1. Operations & Security HTTPS and a password for E-01: Nginx, Origin CA and Symfony
  2. Platform Engineering Private Symfony on E-01: the Nginx → FPM → application path
  3. Operations & Security A package changed: accepting the new E-01 state
  4. Operations & Security Origin CA: a certificate between Cloudflare and the educational server
  5. Operations & Security First HTTPS installation through CLI: verification and rollback