Skip to main content

Owner-scoped plan/apply/adopt controller for Nginx Proxy Manager resources.

Project description

npmctl

npmctl is the Python package and console script for owner-scoped Nginx Proxy Manager automation. It validates desired-state YAML, computes safe plans, applies clean changes, and adopts unmanaged resources only when explicitly requested.

Install

Use pipx for an isolated CLI install:

pipx install npmctl
npmctl --version

Use uv if you manage tools with uv:

uv tool install npmctl
npmctl --help

Use pip inside an existing virtual environment:

python -m venv .venv
. .venv/bin/activate
python -m pip install npmctl
npmctl --help

PowerShell activation:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install npmctl
npmctl --help

Configure NPM

Set Nginx Proxy Manager API credentials as environment variables:

export NPM_BASE_URL=http://127.0.0.1:81/api
export NPM_IDENTITY=admin@example.com
export NPM_SECRET=changeme

Or pass them directly:

npmctl --base-url http://127.0.0.1:81/api --identity admin@example.com --secret changeme health

Desired State

Every managed resource needs npmctl ownership metadata:

apiVersion: npmctl.com/v1
schemaVersion: 2
proxy_hosts:
  - domain_names: [app.example.com]
    forward_scheme: http
    forward_host: app
    forward_port: 3000
    meta:
      managed_by: npmctl
      owner: workload-a
      resource_id: proxy.app

References use resource_id values:

apiVersion: npmctl.com/v1
schemaVersion: 2
certificates:
  - name: wildcard-example
    domain_names: ["*.example.com", example.com]
    certificate_type: letsencrypt
    api_payload:
      provider: letsencrypt
    meta:
      managed_by: npmctl
      owner: workload-a
      resource_id: cert.wildcard-example
access_lists:
  - name: private-admins
    api_payload:
      satisfy_any: 0
      items: []
      clients: []
    meta:
      managed_by: npmctl
      owner: workload-a
      resource_id: acl.private-admins
proxy_hosts:
  - domain_names: [app.example.com]
    forward_host: app
    forward_port: 3000
    certificate_ref: cert.wildcard-example
    access_list_ref: acl.private-admins
    ssl_forced: 1
    allow_websocket_upgrade: 1
    caching_enabled: 1
    block_exploits: 1
    meta:
      managed_by: npmctl
      owner: workload-a
      resource_id: proxy.app

Commands

Validate files without calling the NPM API:

npmctl validate ./desired-state
npmctl --output json validate ./desired-state

Check or write desired-state schema migrations:

npmctl migrate ./desired-state --check
npmctl migrate ./desired-state --write

Check the target NPM API:

npmctl health
npmctl schema fetch --write npm-openapi.json
npmctl schema capabilities
npmctl schema check

Plan and apply by owner:

npmctl plan ./desired-state --owner workload-a
npmctl apply ./desired-state --owner workload-a

Preview apply without mutation:

npmctl apply ./desired-state --owner workload-a --dry-run

Prune owned resources absent from desired state:

npmctl apply ./desired-state --owner workload-a --prune-owned

Adopt unmanaged matching resources:

npmctl adopt ./desired-state --owner workload-a
npmctl adopt ./desired-state --owner workload-a --allow-field-drift

Exit Codes

  • 0: success
  • 1: plan conflict
  • 2: usage, validation, or migration error
  • 3: API error
  • 4: endpoint capability error

More Documentation

The source repository includes detailed docs and examples:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npmctl-0.3.2.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npmctl-0.3.2-py3-none-any.whl (43.6 kB view details)

Uploaded Python 3

File details

Details for the file npmctl-0.3.2.tar.gz.

File metadata

  • Download URL: npmctl-0.3.2.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for npmctl-0.3.2.tar.gz
Algorithm Hash digest
SHA256 4913e53a109fbaa600cbd1809cb5d55dfe932fee272c67592d5dae720f203a80
MD5 66bb830ac381e0db13837de203555e37
BLAKE2b-256 46d880123ccf48f077c8b53151abe5085f3bbde2eb6c4e746af8ffaec434dc0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for npmctl-0.3.2.tar.gz:

Publisher: release.yml on groupsum/npmctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file npmctl-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: npmctl-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for npmctl-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b26a5fbf4bccc3be93f244d2f1b4527f0a9a9ac0f681d67a780e6e1851fad26
MD5 64ff482a93964ccb19d0524845eae1c3
BLAKE2b-256 08af8190dded01104869d1ea235c666a5b37ec3fe8d90cb9e5ad2a5ea9b26252

See more details on using hashes here.

Provenance

The following attestation bundles were made for npmctl-0.3.2-py3-none-any.whl:

Publisher: release.yml on groupsum/npmctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page