-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(config): AutoConf with "auto" placeholders #10883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
tdb, we may extract this later for use outside of Kubo
this needs more testing and work, but we will do that after autoconfig is wired in future commits
- tests need manual inspection / being more DRY / reusable for future migrations - need to see if all CI tests pass
lidel
commented
Jul 24, 2025
cfg.BootstrapPeersWithAutoConfig for resolved "auto"
for consistency with old code
identified some test gaps - will fix in future commit
ensuring we do only one http get per AutoConfig.RefreshInterval
use file and dont depend on filesystem timestamps (less problematic across platforms and deployments, some people mount filesystems without atime or mtime for performance)
+ backward compatibility for `ipfs bootstrap add default`
This was referenced Jul 28, 2025
changes autoconfig.json format to one from ipshipyard/conf.ipfs-mainnet.org#4 at v4
- follows existing --allow-* convention for degraded modes - clarifies --allow-offline behavior in docs - improves test clarity and removes duplication - adds test to verify PUT payload matches routing get
9e06f4d
to
a7b0b21
Compare
Things to agree before merge:
|
- change AutoConf.URL to *OptionalString with omitempty - use WithDefault(DefaultAutoConfURL) for implicit defaults - update migration to omit URL field for cleaner config - remove explicit empty field validation this makes AutoConf work like AutoTLS where defaults are implicit unless explicitly overridden by the user.
use slices.Sorted(maps.Keys()) for consistent alphabetical ordering
the test profile explicitly disables AutoConf, so we need to enable it for the 'bootstrap add default' test to work correctly
c84f145
to
8ec830b
Compare
- add SetDoesNotUseRepo(true) to repoMigrateCmd to enable direct filesystem access - migrations need filesystem access without daemon API connection - manual lock checking at lines 427-433 still protects against concurrent access - fix t0066-migration.sh test by removing explicit AutoConf.Enabled=false The test profile disables AutoConf by default, which prevents the daemon from starting after v16-to-17 migration adds 'auto' values. Since sharness tests use the test profile by default, we need to remove the explicit AutoConf.Enabled=false to allow implicit defaults that work with 'auto' values.
- remove Migration initialization from config/init.go (no longer in new configs) - add omitempty to Migration.DownloadSources and Migration.Keep fields - these fields now only appear in JSON when explicitly set - update docs to clarify Migration is deprecated (only for repos <v16) - emphasize that only HTTPS is supported for legacy migrations
0d89566
to
d028a23
Compare
All green, merging to master. We will cut 0.37 RC1 on Thursday. |
migration now creates empty AutoConf{} section instead of setting explicit values. fields use implicit defaults via WithDefault(): - Enabled defaults to true - RefreshInterval defaults to 24h - TLSInsecureSkipVerify defaults to false
7447d93
to
2b32db3
Compare
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.
Note
🔍 REVIEW HIGHLIGHT: this PR looks scary (>10k of lines) but its mostly very very comprehensive tests :)
This PR contains three distinct components:
boxo/autoconf/
library is in feat: autoconf client library boxo#997config.AutoConf.URL
integration - Kubo integration usinghttps://config.ipfs-mainnet.org/autoconf.json
by default with explicit"auto"
placeholders (no implicit defaults), plus--expand-auto
CLI flag for viewing resolved valuesipfs init
Directory Tree & Review Focus
Problem
Hardcoded defaults accumulated over time make it difficult to:
Solution
Replace implicit hardcoded values with explicit
"auto"
placeholders resolved from remoteautoconf.json
manifest.New
ipfs init
behaviorImplementation Highlights
CLI Usage
Migration 16→17
"auto"
while preserving user-set valuesipfs repo migrate
now supports target version:ipfs repo migrate --to=17
Documentation
See
AutoConf
section indocs/config.md
References
Routing.Type=delegated
to only useRouting.DelegatedRouters
#10824