Connect an existing DDEV Drupal project to a Lifna-hosted environment.
This add-on installs a native DDEV provider named lifna, so existing projects can use:
ddev pull lifna
ddev push lifna
ddev lifna status
ddev lifna spinup
ddev lifna pauseCode remains Git-first. The provider only syncs the database and Drupal public files, matching DDEV hosting-provider conventions.
Requires DDEV v1.24.0+ and an existing DDEV Drupal project.
From a DDEV project root:
ddev add-on get Lifnaio/ddev-lifna
ddev restartTo test a local checkout while developing this add-on, use the same command with a local path, for example ddev add-on get /path/to/ddev-lifna.
Repeat the install command to update to the latest release:
ddev add-on get Lifnaio/ddev-lifna
ddev restartCheck the installed version with ddev add-on list --installed.
In Lifna, open the site, choose Download for DDEV / local development, then use the DDEV access token card. The direct URL is:
https://app.lifna.io/sites/<site-slug>/export
Choose Account-wide token to reuse one token across every Lifna site you can access, or choose a specific environment for a narrower token. Select the allowed actions, click Create DDEV token, and copy the one-time token.
Then run:
ddev lifna connect \
--site=my-site \
--environment=mainPaste the token when prompted.
For local Lifna platform development only, set LIFNA_DEV_MODE=1 or pass --dev with --base-url when connecting to a local HTTPS or localhost URL.
The command writes:
.lifna/environment.jsonwith the Lifna site/environment link..ddev/lifna/.envwith the local token.
Both are ignored locally by generated .gitignore files.
ddev lifna status
ddev pull lifna
ddev push lifna
ddev lifna pause
ddev lifna spinup
ddev lifna openddev pull lifna downloads the Lifna database and public files into the DDEV project.
ddev push lifna uploads the local database and public files back to the scoped Lifna environment. Pushes to protected environments such as main, live, prod, or production require a typed confirmation.
Automated tests cover:
- Add-on installation into a disposable DDEV Drupal project.
- Generated DDEV provider and host command files.
- Scoped token storage without command-line token input.
- Production base URL protection and explicit local development mode.
- Token-safe diagnostics.
- Protected environment push confirmation.
- Files archive traversal protection before extraction.
- Database and public files are synced; code stays Git-first.
- Lifna API endpoints and token generation must be available in the Lifna app before pull, push, and lifecycle commands can complete.
- Local development URLs require explicit
--devorLIFNA_DEV_MODE=1.
The add-on uses a Lifna local access token created in the Lifna UI. Tokens can be account-wide or scoped to one site/environment, and always carry limited actions plus an expiry date. Lifna still checks your account permissions for the requested site on every API call.
Tokens are read from the secure prompt during ddev lifna connect or from LIFNA_TOKEN. Do not pass tokens as command-line arguments and do not commit .ddev/lifna/.env.
Production connections default to https://app.lifna.io unless explicit dev mode is enabled.
The test suite is written with Bats and includes shell-level security tests plus a DDEV install smoke test.
bash -n commands/host/lifna lifna/client.sh
shellcheck commands/host/lifna lifna/client.sh
yamllint .
bats testsGitHub Actions runs the same lint checks and uses DDEV's add-on test action to install the add-on into a disposable DDEV project.
The recommended GitHub repo name is ddev-lifna, with the ddev-get topic added for DDEV add-on discovery.