Repository navigation
feat: add SOLR_PASSWORD, generate the security.json hash on start - #81
Merged
Merged
Conversation
## Short Summary (TL;DR)
Users can change the Solr admin password with one `ddev dotenv set` command, instead of editing two files and generating a hash by hand.
## The Issue
To change the password, users had to remove `#ddev-generated` from `docker-compose.solr.yaml` and `security.json`, edit the password in two places, and generate the `security.json` hash with an external tool. After that, the add-on no longer updated those files.
## How This PR Solves The Issue
The password is set with `ddev dotenv set .ddev/.env.solr --solr-password=...` and applied with `ddev restart -s solr`. It is used by the Solr Admin UI login form, `SOLR_AUTHENTICATION_OPTS` and `security.json`, where `${SOLR_PASSWORD_HASH}` is replaced on every start. The username stays `solr`, because the Solr image already defines `SOLR_USER`.
The README uses `ddev utility delete-volume solr` for Solr downgrades, so the add-on requires DDEV v1.25.5 for `ddev restart -s`.
## Manual Testing Instructions
```bash
ddev add-on get ddev/ddev-solr --pr 81
ddev restart
ddev dotenv set .ddev/.env.solr --solr-password=SolrRocksSolrRocks
ddev restart -s solr
ddev exec "curl -sS -u solr:SolrRocksSolrRocks http://solr:8983/solr/admin/info/system"
# Expect JSON with "solr_home"; with solr:SolrRocks expect a 401
ddev describe
# Expect "Pass: SolrRocksSolrRocks" for the solr service
```
## Automated Testing Overview
`health_checks` now checks authenticated admin access, a 401 without credentials, and the prefilled login form. The new test `install from directory with custom password` changes the password in a running project and runs `health_checks` with it.
`tests/test.bats` sets `CI=true`, as `ddev utility addon-update-checker` requires.
## Release/Deployment Notes
Projects that removed `#ddev-generated` to change the password keep their customized files and password. To use `SOLR_PASSWORD`, delete `.ddev/docker-compose.solr.yaml` and `.ddev/solr/security.json`, then run `ddev add-on get ddev/ddev-solr`.
🤖 Developed with assistance from [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stasadev
force-pushed
the
20261028_stasadev_solr_password
branch
from
October 28, 2026 15:32
5967abe to
9eef99e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Summary (TL;DR)
Users can change the Solr admin password with one
ddev dotenv setcommand, instead of editing two files and generating a hash by hand.The Issue
To change the password, users had to remove
#ddev-generatedfromdocker-compose.solr.yamlandsecurity.json, edit the password in two places, and generate thesecurity.jsonhash with an external tool. After that, the add-on no longer updated those files.How This PR Solves The Issue
The password is set with
ddev dotenv set .ddev/.env.solr --solr-password=...and applied withddev restart -s solr. It is used by the Solr Admin UI login form,SOLR_AUTHENTICATION_OPTSandsecurity.json, where${SOLR_PASSWORD_HASH}is replaced on every start. The username stayssolr, because the Solr image already definesSOLR_USER.The README uses
ddev utility delete-volume solrfor Solr downgrades, so the add-on requires DDEV v1.25.5 forddev restart -s.Manual Testing Instructions
https://github.com/ddev/ddev-solr/tree/20261028_stasadev_solr_password#solr-admin-credentials
Automated Testing Overview
health_checksnow checks authenticated admin access, a 401 without credentials, and the prefilled login form. The new testinstall from directory with custom passwordchanges the password in a running project and runshealth_checkswith it.tests/test.batssetsCI=true, asddev utility addon-update-checkerrequires.Release/Deployment Notes
Projects that removed
#ddev-generatedto change the password keep their customized files and password. To useSOLR_PASSWORD, delete.ddev/docker-compose.solr.yamland.ddev/solr/security.json, then runddev add-on get ddev/ddev-solr.🤖 Developed with assistance from Claude Code