Repository navigation
feat(bench): Let the operator trust named private hosts for backup downloads - #660
Open
pramoodsurya wants to merge 1 commit into
Open
pramoodsurya wants to merge 1 commit into
pramoodsurya wants to merge 1 commit into
Conversation
…wnloads The backup URL check refuses any host that resolves to a private address. On a self-hosted Press, the platform's own S3-compatible backup store (Garage, MinIO, Ceph RGW) often sits on the private network, so "New Site from Backup" from it fails with "The URL resolves to an address that is not public." AGENT_TRUSTED_PRIVATE_HOSTS takes exact hostnames, comma-separated. Those hosts may resolve to private addresses; every other host, including each redirect target, is checked as before. Unset, nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Problem
Since #654, the agent refuses to download a backup from any host that resolves to a private address. That is the right default for URLs a customer supplies. On a self-hosted Press, though, the platform's own S3-compatible backup store (Garage, MinIO, Ceph RGW) usually sits on the private network next to the app servers. "New Site from Backup" from that store then fails with:
There is no setting to allow it, so today the only options are to put the backup store on a public address or to patch the agent.
Change
A new environment variable,
AGENT_TRUSTED_PRIVATE_HOSTS, takes exact hostnames, comma-separated (for examples3.internal.example). A host on the list may resolve to private addresses. Nothing else changes:s3.internal.example.attacker.comis not trusted.The list is read at call time, so it is set in the agent's supervisord environment. Operators should list only stores that require signed requests.
Tests
Three new cases in
agent/tests/test_remote_url.py:python -m unittest agent.tests.test_remote_urlpasses on Python 3.8 (12 tests). Two of the new tests fail without the change.ruff checkandruff format --checkare clean.Tried in a lab
I ran Press v0.174.0 on Proxmox VMs, with Garage v2.4.1 as the Backup Bucket store on the private network. With an earlier version of this change and
AGENT_TRUSTED_PRIVATE_HOSTSset on the app server, "New Site from Backup" restored a site from Garage. The restored data was checked against the source site. That version had the same check but read the list once at import.Related: #558 (passing
ENDPOINT_URLto boto3) fixes the upload side of the same setup. I tested an equivalent change in the same lab, and it works.🤖 Generated with Claude Code