mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Check / lint (push) Waiting to run
Docker Check / build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
* refactor: consolidate Provider/Reprovider into unified Provide config - merge Provider and Reprovider configs into single Provide section - add fs-repo-17-to-18 migration for config consolidation - improve migration ergonomics with common package utilities - convert deprecated "flat" strategy to "all" during migration - improve Provide docs * docs: add total_provide_count metric guidance - document how to monitor provide success rates via prometheus metrics - add performance comparison section to changelog - explain how to evaluate sweep vs legacy provider effectiveness * fix: add OpenTelemetry meter provider for metrics - set up meter provider with Prometheus exporter in daemon - enables metrics from external libs like go-libp2p-kad-dht - fixes missing total_provide_count_total when SweepEnabled=true - update docs to reflect actual metric names --------- Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com> Co-authored-by: guillaumemichel <guillaume@michel.id> Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com> Co-authored-by: Hector Sanjuan <code@hector.link>
64 lines
1.8 KiB
Go
64 lines
1.8 KiB
Go
// Package main implements fs-repo-16-to-17 migration for IPFS repositories.
|
|
//
|
|
// This migration transitions repositories from version 16 to 17, introducing
|
|
// the AutoConf system that replaces hardcoded network defaults with dynamic
|
|
// configuration fetched from autoconf.json.
|
|
//
|
|
// Changes made:
|
|
// - Enables AutoConf system with default settings
|
|
// - Migrates default bootstrap peers to "auto" sentinel value
|
|
// - Sets DNS.Resolvers["."] to "auto" for dynamic DNS resolver configuration
|
|
// - Migrates Routing.DelegatedRouters to ["auto"]
|
|
// - Migrates Ipns.DelegatedPublishers to ["auto"]
|
|
// - Preserves user customizations (custom bootstrap peers, DNS resolvers)
|
|
//
|
|
// The migration is reversible and creates config.16-to-17.bak for rollback.
|
|
//
|
|
// Usage:
|
|
//
|
|
// fs-repo-16-to-17 -path /path/to/ipfs/repo [-verbose] [-revert]
|
|
//
|
|
// This migration is embedded in Kubo starting from version 0.37 and runs
|
|
// automatically during daemon startup. This standalone binary is provided
|
|
// for manual migration scenarios.
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/ipfs/kubo/repo/fsrepo/migrations/common"
|
|
mg16 "github.com/ipfs/kubo/repo/fsrepo/migrations/fs-repo-16-to-17/migration"
|
|
)
|
|
|
|
func main() {
|
|
var path = flag.String("path", "", "Path to IPFS repository")
|
|
var verbose = flag.Bool("verbose", false, "Enable verbose output")
|
|
var revert = flag.Bool("revert", false, "Revert migration")
|
|
flag.Parse()
|
|
|
|
if *path == "" {
|
|
fmt.Fprintf(os.Stderr, "Error: -path flag is required\n")
|
|
flag.Usage()
|
|
os.Exit(1)
|
|
}
|
|
|
|
opts := common.Options{
|
|
Path: *path,
|
|
Verbose: *verbose,
|
|
}
|
|
|
|
var err error
|
|
if *revert {
|
|
err = mg16.Migration.Revert(opts)
|
|
} else {
|
|
err = mg16.Migration.Apply(opts)
|
|
}
|
|
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Migration failed: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|