Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
4bf7f27
feat: prototype autoclient library
lidel Jul 18, 2025
a72b8e1
feat(config): prototype autoconfig profile
lidel Jul 18, 2025
120bb82
feat: prototype embedded repo migrations
lidel Jul 18, 2025
51a49f9
feat: prototype of `ipfs config` support for `auto`
lidel Jul 24, 2025
a860748
docs: MustGetConfigWithMainnetFallbacks
lidel Jul 24, 2025
302dcdf
chore: lint + cleanup redundant tests
lidel Jul 24, 2025
d23374c
refactor: use const with profile names
lidel Jul 24, 2025
355bc3d
refactor: cfg.BootstrapPeers returns raw Bootstrap
lidel Jul 24, 2025
626a99f
fix: use resolved versions for making decisions
lidel Jul 24, 2025
1d91f11
refactor: Β Bootstrap[Peers]WithAutoConfig
lidel Jul 24, 2025
f629d8b
fix(cli): bootstrap cmd with auto
lidel Jul 24, 2025
0e75e4f
refactor: cleanup
lidel Jul 25, 2025
e711c3c
test: multiple consecutive --expand-auto calls
lidel Jul 25, 2025
d18a1fe
refactor: dry and useful logs
lidel Jul 25, 2025
7088d88
refactor: autoconfig .last-refresh
lidel Jul 25, 2025
e1e4e23
fix: `ipfs bootstrap add auto`
lidel Jul 26, 2025
53a642c
docs: AutoConfig in changelog
lidel Jul 26, 2025
273e18e
chore: update func name
lidel Jul 26, 2025
24d552d
refactor: schema v4
lidel Jul 30, 2025
e2476e9
test: DNSResolver validation
lidel Jul 30, 2025
e9f8ce9
docs: autoconfig changelog
lidel Jul 30, 2025
3d34f41
test: basic ipns publishing work in ci (offline)
lidel Jul 30, 2025
e4eb581
chore: cleanup to use testdata
lidel Jul 30, 2025
2a196dc
test(coreapi): ipns name
lidel Jul 30, 2025
a68d581
fix(docker): copy boxo/autoconfig
lidel Jul 30, 2025
8fa6527
fix(autoconfig): real ipni fallback
lidel Jul 30, 2025
a57df38
fix: restore legacy defaultRepo
lidel Jul 31, 2025
9480b93
test: restore coreiface from master
lidel Jul 31, 2025
85e80d4
chore: restore previous namesys wiring
lidel Jul 31, 2025
7585807
refactor: simplify constructDefaultHTTPRouters
lidel Jul 31, 2025
b3975a2
refactor: cleanup config/autoconfig.go
lidel Jul 31, 2025
00c9d9c
fix: thread-safe cache
lidel Jul 31, 2025
82f2b59
refactor: MustGetConfig fallback handling
lidel Aug 1, 2025
2e22eba
test: ParseAndValidateRoutingURL
lidel Aug 1, 2025
24e6aa4
fix: simpler cache dir
lidel Aug 1, 2025
cf8b596
refactor(config): remove need for passing repoPath
lidel Aug 1, 2025
374ba05
chore: collapse diffs of generated data
lidel Aug 1, 2025
1df21cd
chore: restore master code
lidel Aug 1, 2025
f7c2112
test: error cases for autoconfig.json fetch
lidel Aug 1, 2025
f5fe36f
chore: placeholder
lidel Aug 1, 2025
e52befe
refactor: clenup startAutoConfigUpdater
lidel Aug 1, 2025
03a2a3c
test(autoconfig): ipfs swarm connect
lidel Aug 1, 2025
146ef49
refactor: better names for Must* funcs
lidel Aug 1, 2025
3e4a854
fix(fx): ClearCachedNode
lidel Aug 1, 2025
ef98774
test: TestHTTPCachingBehavior and cleanup
lidel Aug 1, 2025
1a7230c
test: TestAutoConfigIPNS
lidel Aug 1, 2025
814723e
test(autoconfig) Routing.Type=auto|delegated
lidel Aug 2, 2025
36acffe
fix: go vet
lidel Aug 2, 2025
332ab2f
test: migration and autoconfig sharness
lidel Aug 3, 2025
a5f6777
fix: sync.RWMutex
lidel Aug 3, 2025
70dbdc8
test(cli): migration_legacy_15_to_17_test.go
lidel Aug 4, 2025
44dec15
test: testCLIUsesCacheOnlyDaemonUpdatesBackground
lidel Aug 4, 2025
e77f434
fix: t0066-migration.sh
lidel Aug 4, 2025
a6efc94
refactor: autoconfig β†’ autoconf
lidel Aug 4, 2025
35e521d
fix: validate AutoConfSchema 1
lidel Aug 4, 2025
1a73236
docs: highlights and deprecations
lidel Aug 4, 2025
7f3bcea
test: testAutoConfWithHTTPS
lidel Aug 4, 2025
5a6c5ab
docs: boxo/autoconf
lidel Aug 4, 2025
491b1c3
docs: examples in boxo/autoconf/README.md
lidel Aug 5, 2025
c71e9d8
Merge branch 'master' into feat-mainnet-autoconfig
gammazero Aug 11, 2025
6a32e60
remove unused import
gammazero Aug 11, 2025
ea6c3e4
Merge branch 'master' into feat-mainnet-autoconfig
gammazero Aug 11, 2025
285be62
Merge branch 'master' into feat-mainnet-autoconfig
gammazero Aug 11, 2025
13357e3
chore: config β†’ conf
lidel Aug 12, 2025
8fd1829
refactor: boxo/autoconf extraction prep
lidel Aug 13, 2025
ebb948f
refactor: boxo/autoconf cleanup, part 1
lidel Aug 13, 2025
95065fd
Merge branch 'master' into feat-mainnet-autoconfig
lidel Aug 13, 2025
564382f
tests: switch to testify
lidel Aug 13, 2025
d88c0d0
fix: log warn when no cache available
lidel Aug 13, 2025
c2129d7
refactor: improve lock scopes
lidel Aug 13, 2025
a4e0671
chore: move atomicfile
lidel Aug 13, 2025
cfa0bcc
refactor: simplify the path operations
lidel Aug 13, 2025
70860e0
refactor: code simplifications
lidel Aug 13, 2025
0a9a5b7
refactor: reuse buildEndpointURL
lidel Aug 13, 2025
a0bac20
fix: Errorf
lidel Aug 13, 2025
c890bfd
chore: remove FromCache
lidel Aug 13, 2025
c0269f4
fix: panic on nil client
lidel Aug 13, 2025
3a6ec69
chore: preallocate slice
lidel Aug 13, 2025
62f67d6
refactor: slices.Contains
lidel Aug 13, 2025
af51a49
refactor: review feedback cleanup
lidel Aug 13, 2025
54df810
refactor: core/node/libp2p/host.go
lidel Aug 13, 2025
b0cdf44
refactor: move autoclient to boxo#997
lidel Aug 13, 2025
1946d45
fix: restore dockerfile
lidel Aug 13, 2025
5d4275e
chore: gofmt
lidel Aug 13, 2025
66fe0a8
Merge branch 'master' into feat-mainnet-autoconfig
gammazero Aug 14, 2025
2176ae4
merge: origin/master into feat-mainnet-autoconfig
lidel Aug 15, 2025
7f027e4
docs: concise changelog
lidel Aug 15, 2025
9321e46
chore: update to latest boxo#997
lidel Aug 15, 2025
018b73b
chore: update to boxo@main
lidel Aug 15, 2025
e4e08a3
merge: origin/master into feat-mainnet-autoconfig
lidel Aug 18, 2025
f2ca7d9
fix: telemetry bootstrap check for autoconf
lidel Aug 18, 2025
f3b8ed3
feat: autoconf telemetry
lidel Aug 18, 2025
2bb5276
test: telemetry schema regression guard
lidel Aug 18, 2025
f0314d0
test: use atomic.Int32 for cleaner counter handling
lidel Aug 18, 2025
0eb4a02
test: remove emojis from test logs
lidel Aug 18, 2025
dc41fbb
test: clarify bootstrap peer round-trip test
lidel Aug 18, 2025
9ffbf88
test: simplify IPNS error tests
lidel Aug 18, 2025
a7b0b21
refactor: rename --delegated-only to --allow-delegated
lidel Aug 19, 2025
470d4db
refactor: make AutoConf.URL implicit like AutoTLS
lidel Aug 19, 2025
0da54e0
fix: sort profile names in config help output
lidel Aug 19, 2025
8ec830b
test: AutoConf in bootstrap add default test
lidel Aug 19, 2025
ccd2388
fix: allow ipfs repo migrate to run without daemon
lidel Aug 19, 2025
6e75456
refactor: make Migration config optional
lidel Aug 19, 2025
d028a23
Merge branch 'master' into feat-mainnet-autoconfig
lidel Aug 19, 2025
2b32db3
fix(migration): use implicit defaults for AutoConf fields
lidel Aug 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: make AutoConf.URL implicit like AutoTLS
- 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.
  • Loading branch information
lidel committed Aug 19, 2025
commit 470d4db40cc49d5ac63f05758266a2dbb90bba6c
4 changes: 0 additions & 4 deletions cmd/ipfs/kubo/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment

// Start background AutoConf updater if enabled
if cfg.AutoConf.Enabled.WithDefault(config.DefaultAutoConfEnabled) {
autoConfURL := cfg.AutoConf.URL
if autoConfURL == "" {
return fmt.Errorf("AutoConf is enabled but AutoConf.URL is empty - please provide a URL")
}
// Start autoconf client for background updates
client, err := config.GetAutoConfClient(cfg)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion config/autoconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var log = logging.Logger("config")
type AutoConf struct {
// URL is the HTTP(S) URL to fetch the autoconf.json from
// Default: see boxo/autoconf.MainnetAutoConfURL
URL string
URL *OptionalString `json:",omitempty"`

// Enabled determines whether to use autoconf
// Default: true
Expand Down
13 changes: 3 additions & 10 deletions config/autoconf_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ func newAutoConfClient(cfg *Config) (*autoconf.Client, error) {
}

// Use default URL if not specified
url := cfg.AutoConf.URL
if url == "" {
url = DefaultAutoConfURL
}
url := cfg.AutoConf.URL.WithDefault(DefaultAutoConfURL)

// Build client options
options := []autoconf.Option{
Expand All @@ -69,13 +66,9 @@ func ValidateAutoConfWithRepo(cfg *Config, swarmKeyExists bool) error {
return validateAutoConfDisabled(cfg)
}

// AutoConf is enabled - validate URL is provided
if cfg.AutoConf.URL == "" {
return fmt.Errorf("AutoConf is enabled but AutoConf.URL is empty - please provide a URL")
}

// Check for private network with default mainnet URL
if swarmKeyExists && cfg.AutoConf.URL == DefaultAutoConfURL {
url := cfg.AutoConf.URL.WithDefault(DefaultAutoConfURL)
if swarmKeyExists && url == DefaultAutoConfURL {
return fmt.Errorf("AutoConf cannot use the default mainnet URL (%s) on a private network (swarm.key or LIBP2P_FORCE_PNET detected). Either disable AutoConf by setting AutoConf.Enabled=false, or configure AutoConf.URL to point to a configuration service specific to your private swarm", DefaultAutoConfURL)
}

Expand Down
8 changes: 4 additions & 4 deletions config/autoconf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ func TestAutoConfDefaults(t *testing.T) {
// Test that AutoConf has the correct default values
cfg := &Config{
AutoConf: AutoConf{
URL: DefaultAutoConfURL,
URL: NewOptionalString(DefaultAutoConfURL),
Enabled: True,
},
}

assert.Equal(t, DefaultAutoConfURL, cfg.AutoConf.URL)
assert.Equal(t, DefaultAutoConfURL, cfg.AutoConf.URL.WithDefault(DefaultAutoConfURL))
assert.True(t, cfg.AutoConf.Enabled.WithDefault(DefaultAutoConfEnabled))

// Test default refresh interval
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestAutoConfProfile(t *testing.T) {
assert.True(t, cfg.AutoConf.Enabled.WithDefault(DefaultAutoConfEnabled))

// Check that URL was set
assert.Equal(t, DefaultAutoConfURL, cfg.AutoConf.URL)
assert.Equal(t, DefaultAutoConfURL, cfg.AutoConf.URL.WithDefault(DefaultAutoConfURL))
}

func TestInitWithAutoValues(t *testing.T) {
Expand All @@ -88,5 +88,5 @@ func TestInitWithAutoValues(t *testing.T) {

// Check that AutoConf is enabled with correct URL
assert.True(t, cfg.AutoConf.Enabled.WithDefault(DefaultAutoConfEnabled))
assert.Equal(t, DefaultAutoConfURL, cfg.AutoConf.URL)
assert.Equal(t, DefaultAutoConfURL, cfg.AutoConf.URL.WithDefault(DefaultAutoConfURL))
}
4 changes: 0 additions & 4 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ func InitWithIdentity(identity Identity) (*Config, error) {
DownloadSources: []string{},
Keep: "",
},
AutoConf: AutoConf{
URL: DefaultAutoConfURL,
Enabled: True,
},
Routing: Routing{
DelegatedRouters: []string{AutoPlaceholder},
},
Expand Down
2 changes: 1 addition & 1 deletion config/ipns.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ type Ipns struct {
UsePubsub Flag `json:",omitempty"`

// Simplified configuration for delegated IPNS publishers
DelegatedPublishers []string `json:",omitempty"`
DelegatedPublishers []string
}
16 changes: 10 additions & 6 deletions config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ is useful when using the daemon in test environments.`,
c.Bootstrap = []string{}
c.Discovery.MDNS.Enabled = false
c.AutoTLS.Enabled = False
c.AutoConf.Enabled = False

// Explicitly set autoconf-controlled fields to empty when autoconf is disabled
c.DNS.Resolvers = map[string]string{}
c.Routing.DelegatedRouters = []string{}
c.Ipns.DelegatedPublishers = []string{}
return nil
},
},
Expand All @@ -99,10 +105,8 @@ Inverse profile of the test profile.`,

// Use AutoConf system for bootstrap peers
c.Bootstrap = []string{AutoPlaceholder}
c.AutoConf.Enabled = True
if c.AutoConf.URL == "" {
c.AutoConf.URL = DefaultAutoConfURL
}
c.AutoConf.Enabled = Default
c.AutoConf.URL = nil // Clear URL to use implicit default

c.Swarm.DisableNatPortMap = false
c.Discovery.MDNS.Enabled = true
Expand Down Expand Up @@ -363,8 +367,8 @@ This profile requires AutoConf to be enabled and configured.`,
c.Routing.DelegatedRouters = []string{AutoPlaceholder}
c.Ipns.DelegatedPublishers = []string{AutoPlaceholder}
c.AutoConf.Enabled = True
if c.AutoConf.URL == "" {
c.AutoConf.URL = DefaultAutoConfURL
if c.AutoConf.URL == nil {
c.AutoConf.URL = NewOptionalString(DefaultAutoConfURL)
}
return nil
},
Expand Down
2 changes: 1 addition & 1 deletion config/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Routing struct {
IgnoreProviders []string `json:",omitempty"`

// Simplified configuration used by default when Routing.Type=auto|autoclient
DelegatedRouters []string `json:",omitempty"`
DelegatedRouters []string

// Advanced configuration used when Routing.Type=custom
Routers Routers `json:",omitempty"`
Expand Down
4 changes: 3 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,14 @@ Specifies the HTTP(S) URL from which to fetch the autoconf JSON. The endpoint sh

The URL must serve a JSON document matching the AutoConf schema. Kubo validates all multiaddr and URL values before caching to ensure they are properly formatted.

When not specified in the configuration, the default mainnet URL is used automatically.

<a href="https://ipshipyard.com/"><img align="right" src="https://github.com/user-attachments/assets/39ed3504-bb71-47f6-9bf8-cb9a1698f272" /></a>

> [!NOTE]
> Public good autoconf manifest at `conf.ipfs-mainnet.org` is provided by the team at [Shipyard](https://ipshipyard.com).

Default: `"https://example.com/autoconf.json"`
Default: `"https://conf.ipfs-mainnet.org/autoconf.json"` (when not specified)

Type: `optionalString`

Expand Down
2 changes: 1 addition & 1 deletion plugin/plugins/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (p *telemetryPlugin) collectAutoTLSInfo() {

func (p *telemetryPlugin) collectAutoConfInfo() {
p.event.AutoConf = p.config.AutoConf.Enabled.WithDefault(config.DefaultAutoConfEnabled)
p.event.AutoConfCustom = p.config.AutoConf.URL != config.DefaultAutoConfURL
p.event.AutoConfCustom = p.config.AutoConf.URL.WithDefault(config.DefaultAutoConfURL) != config.DefaultAutoConfURL
}

func (p *telemetryPlugin) collectDiscoveryInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ func enableAutoConf(confMap map[string]any) error {
return nil
}

// Add AutoConf section
// Add AutoConf section (URL omitted to use implicit default)
confMap["AutoConf"] = map[string]any{
"URL": config.DefaultAutoConfURL,
"Enabled": true,
"Interval": "24h",
"TLSInsecureSkipVerify": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"path/filepath"
"testing"

"github.com/ipfs/kubo/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -164,7 +163,9 @@ func TestMigration(t *testing.T) {
autoConf, exists := updatedConfig["AutoConf"]
assert.True(t, exists, "AutoConf section not added")
autoConfMap := autoConf.(map[string]interface{})
assert.Equal(t, config.DefaultAutoConfURL, autoConfMap["URL"], "Expected AutoConf URL")
// URL is not set explicitly in migration (uses implicit default)
_, hasURL := autoConfMap["URL"]
assert.False(t, hasURL, "AutoConf URL should not be explicitly set in migration")

// Check Bootstrap was updated
bootstrap := updatedConfig["Bootstrap"].([]interface{})
Expand Down
2 changes: 1 addition & 1 deletion test/cli/autoconf/extensibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestAutoConfExtensibility_NewSystem(t *testing.T) {

// Update config to use mock autoconf server
node.UpdateConfig(func(cfg *config.Config) {
cfg.AutoConf.URL = mockServer.URL
cfg.AutoConf.URL = config.NewOptionalString(mockServer.URL)
cfg.AutoConf.Enabled = config.True
cfg.AutoConf.RefreshInterval = config.NewOptionalDuration(1 * time.Second)
cfg.Routing.Type = config.NewOptionalString("auto") // Should enable native AminoDHT + delegated others
Expand Down
1 change: 0 additions & 1 deletion test/cli/migrations/migration_16_to_17_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ func (h *MigrationTestHelper) RequireFieldAbsent(path string) *MigrationTestHelp
func (h *MigrationTestHelper) RequireAutoConfDefaults() *MigrationTestHelper {
return h.RequireFieldExists("AutoConf").
RequireFieldEquals("AutoConf.Enabled", true).
RequireFieldExists("AutoConf.URL").
RequireFieldEquals("AutoConf.Interval", "24h").
RequireFieldEquals("AutoConf.TLSInsecureSkipVerify", false)
}
Expand Down
Loading