npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iswesolutions/plugin-dhis2-backend

v0.1.2

Published

Backend for [`@iswesolutions/plugin-dhis2`](../dhis2). It runs the DHIS2 lifecycle on a Proxmox VE cluster: provisioning, cloning, editing, upgrading, backups, restores, database moves and decommissioning. Each change runs as a background job whose saniti

Readme

@iswesolutions/plugin-dhis2-backend

Backend for @iswesolutions/plugin-dhis2. It runs the DHIS2 lifecycle on a Proxmox VE cluster: provisioning, cloning, editing, upgrading, backups, restores, database moves and decommissioning. Each change runs as a background job whose sanitised log the page streams. Instances are recorded in the plugin's database.

How provisioning works

Backstage backend ──► orchestrator host (local exec, or SSH when remote)
                      scripts/create-instance.sh
                        └─ ansible-playbook site.yml
                             pve_lxc        create + start the LXC (Proxmox REST API)
                             lxc_bootstrap  python, sudo, `ansible` user, SSH key
                             postgres       per-instance or shared PostgreSQL
                             dhis2          Java, Tomcat, DHIS2 WAR, dhis.conf
                        └─ scripts/configure-proxy.sh
                             central nginx vhost + Let's Encrypt certificate

The scripts and playbooks are not part of this npm package. They live in plugins/dhis2/scripts and plugins/dhis2/ansible in the GitHub repository. Check them out on the orchestrator host and point dhis2.orchestrator.scriptPath at create-instance.sh.

The orchestrator host needs:

  • ansible-core 2.13 or later, plus the collections in ansible/requirements.yml: ansible-galaxy collection install -r ansible/requirements.yml
  • Python proxmoxer 2.x and requests
  • An SSH key pair; the public half is installed in each new container

Installation

yarn --cwd packages/backend add @iswesolutions/plugin-dhis2-backend
// packages/backend/src/index.ts
backend.add(import('@iswesolutions/plugin-dhis2-backend'));

Configuration

dhis2:
  orchestrator:
    # 'localhost' runs create-instance.sh on the backend host; any other
    # host is reached over SSH.
    host: localhost
    port: 22
    user: ${DHIS2_ORCHESTRATOR_USER}
    privateKeyFile: ${DHIS2_ORCHESTRATOR_KEY}
    # passphrase: ${DHIS2_ORCHESTRATOR_KEY_PASSPHRASE}
    scriptPath: /opt/backstage-plugins/plugins/dhis2/scripts/create-instance.sh
    # Proxmox node that hosts the central nginx (used by configure-proxy.sh)
    pveHost: pve1
    skipCertbot: false
    # Proxmox REST API used to create and manage containers. The token's
    # user needs PVEVMAdmin (or equivalent) on /.
    apiUrl: ${PROXMOX_API_URL}
    apiUser: ${PROXMOX_USER} # e.g. root@pam
    apiTokenId: ${PROXMOX_TOKEN_ID} # the part after the !
    apiTokenSecret: ${PROXMOX_TOKEN_SECRET}
    validateApiCerts: false
    # Where uploaded database dumps are staged before a restore
    # (default: a directory under the system temp dir)
    restoreStagingDir: /var/lib/backstage/dhis2/restore-staging

  # Optional: give new and cloned containers a static IP from
  # @iswesolutions/plugin-ipam-backend (ipam.allocation must be configured)
  ipamAllocation:
    enabled: true

With host: localhost, anything left out of user, privateKeyFile and scriptPath falls back to the current user, the first key in ~/.ssh, and common checkout locations of create-instance.sh. A remote orchestrator needs all three.

API

Routes are under /api/dhis2 and need a signed-in user. Changes also need a permission from @iswesolutions/plugin-dhis2-common:

| Route | Permission | | ---------------------------------------------------------------------------------- | ------------------------ | | GET /instances, GET /instances/reconcile, GET /instances/jobs/:id | — | | POST /instances/:id/logs, GET /databases/transfers/:id | — | | POST /instances/provision, /instances/next-vmid, /restore/upload | dhis2.instance.create | | POST /databases/test, /databases/list, /databases/check-compatibility | dhis2.instance.create | | POST /instances/:id/clone | dhis2.instance.clone | | POST /instances/:id/edit, /instances/:id/upgrade | dhis2.instance.update | | POST /instances/:id/lifecycle, /instances/:id/backup, …/reconcile-live | dhis2.instance.operate | | POST /instances/:id/restore, /instances/:id/transfer-database | dhis2.instance.restore | | POST /instances/:id/decommission | dhis2.instance.delete | | POST /instances/:id/proxy-files/read, …/proxy-files/write, …/proxy-logs/tail | dhis2.proxy.manage |

Database credentials sent to these routes are used for the job and are never written to job logs.