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.3.tar.gz (36.3 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.3-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: npmctl-0.3.3.tar.gz
  • Upload date:
  • Size: 36.3 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.3.tar.gz
Algorithm Hash digest
SHA256 81e3a4c9b693b54917446a3c0411a00f08896d740022ba3ff116ef6b9bf10c2b
MD5 7d30b28db8b42d53e711ae95ae6dd4e0
BLAKE2b-256 0f72440a71a7b84ca03b6296a625b2573a4b78e71e50ec244f92d2bad8786592

See more details on using hashes here.

Provenance

The following attestation bundles were made for npmctl-0.3.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: npmctl-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 47.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a69fd64f90d8f607803b008bad6146d2b6d08a5bad697b7e38acb39e1b6ecbe3
MD5 eaed6296522b0b1a035e16de42c4546f
BLAKE2b-256 d03003a47c4bd25dd6dafab8d52ff9c7c2ffc07dd9fe4a5dd634d40f7165bc03

See more details on using hashes here.

Provenance

The following attestation bundles were made for npmctl-0.3.3-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