Skip to content

Fix bundled aMule EC password synchronization#27

Open
floze-the-genius wants to merge 1 commit into
joecarl:mainfrom
floze-the-genius:fix/issue-20-ec-password-sync
Open

Fix bundled aMule EC password synchronization#27
floze-the-genius wants to merge 1 commit into
joecarl:mainfrom
floze-the-genius:fix/issue-20-ec-password-sync

Conversation

@floze-the-genius

Copy link
Copy Markdown

Summary

  • derive the bundled aMule ECPassword hash from the same AMULE_PASSWORD plaintext used by the backend
  • update persisted amule.conf files on startup so password rotations do not leave the daemon and EC client out of sync
  • keep devcontainer generation and Compose documentation aligned with the runtime behavior
  • add regression coverage for default, custom, and rotated passwords

Verification

  • tests/entrypoint-config.test.sh
  • sh -n entrypoint.sh
  • bash -n .devcontainer/setup-amule.sh
  • docker build -t mularr-batch70-typescript-02:fixed .
  • clean-volume container with AMULE_PASSWORD=custom-secret: /api/media/transfers succeeded and generated ECPassword=ddc33abcbec51fd4de296be5cf1230fe
  • persisted-volume rotation from the old hardcoded hash to custom-secret: /api/media/transfers succeeded with no EC authentication errors

On current main (v0.16.2), the default secret path already authenticates successfully. The remaining reproducible failure was setting AMULE_PASSWORD, which changed the backend credential while generated and persisted bundled configs retained the hardcoded hash for secret.

Fixes #20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes aMule ExternalConnect (EC) authentication mismatches by ensuring the bundled amuled and the backend derive credentials from the same AMULE_PASSWORD plaintext, and by updating persisted amule.conf files on startup so password rotations don’t leave EC client/daemon out of sync.

Changes:

  • Derive ECPassword (MD5 hash) from AMULE_PASSWORD in entrypoint.sh (defaulting to secret) and write it into generated configs.
  • On startup, synchronize ECPassword in an existing persisted amule.conf to match the current AMULE_PASSWORD.
  • Add a shell regression test covering default, custom, and rotated password scenarios; align devcontainer + Compose documentation with runtime behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/entrypoint-config.test.sh Adds regression coverage for default/custom/rotated EC password hashing and persistence behavior.
entrypoint.sh Computes EC password hash from AMULE_PASSWORD and synchronizes persisted amule.conf on startup.
docker-compose.example.yml Updates documentation comments to reflect that AMULE_PASSWORD configures both bundled aMule and Mularr.
.devcontainer/setup-amule.sh Uses the same AMULE_PASSWORD-derived EC password hash when generating dev configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EC auth fails on fresh install (v0.15.4): backend cannot authenticate against hardcoded ECPassword — persistent "invalid password" loop + high CPU

2 participants