Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TRON-US/go-btfs-config
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.12
Choose a base ref
...
head repository: TRON-US/go-btfs-config
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 6 commits
  • 19 files changed
  • 4 contributors

Commits on Feb 22, 2023

  1. Copy the full SHA
    4ceb318 View commit details

Commits on Mar 2, 2023

  1. Merge pull request #76 from Shawn-Huang-Tron/main

    feat: upgrade libp2p to 0.23.4
    laocheng-cheng authored Mar 2, 2023
    Copy the full SHA
    e10f87f View commit details

Commits on Apr 26, 2023

  1. mod: add simple-mode

    turingczz committed Apr 26, 2023
    Copy the full SHA
    7b7fa2e View commit details
  2. Merge pull request #77 from TRON-US/simple_mode

    mod: add simple-mode
    laocheng-cheng authored Apr 26, 2023
    Copy the full SHA
    a4fd759 View commit details

Commits on May 19, 2023

  1. Copy the full SHA
    62ba092 View commit details
  2. Merge pull request #78 from Shawn-Huang-Tron/main

    feat: sync ipfs gateway config
    Yrp authored May 19, 2023
    Copy the full SHA
    f9cba99 View commit details
Showing with 1,037 additions and 154 deletions.
  1. +1 −1 autonat.go
  2. +1 −1 bootstrap_peers.go
  3. +6 −2 config.go
  4. +17 −0 dns.go
  5. +1 −0 experiments.go
  6. +12 −21 gateway.go
  7. +39 −3 go.mod
  8. +118 −43 go.sum
  9. +1 −1 identity.go
  10. +19 −10 init.go
  11. +16 −0 internal.go
  12. +1 −1 migrations.go
  13. +1 −1 peering.go
  14. +10 −6 profile.go
  15. +7 −2 reprovider.go
  16. +175 −2 routing.go
  17. +99 −16 swarm.go
  18. +191 −16 types.go
  19. +322 −28 types_test.go
2 changes: 1 addition & 1 deletion autonat.go
Original file line number Diff line number Diff line change
@@ -77,5 +77,5 @@ type AutoNATThrottleConfig struct {
// global/peer dialback limits.
//
// When unset, this defaults to 1 minute.
Interval Duration `json:",omitempty"`
Interval OptionalDuration `json:",omitempty"`
}
2 changes: 1 addition & 1 deletion bootstrap_peers.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"errors"
"fmt"

peer "github.com/libp2p/go-libp2p-core/peer"
peer "github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
)

8 changes: 6 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
@@ -29,14 +29,18 @@ type Config struct {
AutoNAT AutoNATConfig
Pubsub PubsubConfig
Peering Peering

Services Services // External service domains and info
DNS DNS
Services Services // External service domains and info

Provider Provider
Reprovider Reprovider
Experimental Experiments
UI UI
Plugins Plugins

Internal Internal // experimental/unstable options

SimpleMode bool
}

const (
17 changes: 17 additions & 0 deletions dns.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package config

// DNS specifies DNS resolution rules using custom resolvers
type DNS struct {
// Resolvers is a map of FQDNs to URLs for custom DNS resolution.
// URLs starting with `https://` indicate DoH endpoints.
// Support for other resolver types can be added in the future.
// https://en.wikipedia.org/wiki/Fully_qualified_domain_name
// https://en.wikipedia.org/wiki/DNS_over_HTTPS
//
// Example:
// - Custom resolver for ENS: `eth.` → `https://dns.eth.limo/dns-query`
// - Override the default OS resolver: `.` → `https://doh.applied-privacy.net/query`
Resolvers map[string]string
// MaxCacheTTL is the maximum duration DNS entries are valid in the cache.
MaxCacheTTL *OptionalDuration `json:",omitempty"`
}
1 change: 1 addition & 0 deletions experiments.go
Original file line number Diff line number Diff line change
@@ -20,4 +20,5 @@ type Experiments struct {
HostChallengeEnabled bool
ReportOnline bool
ReportStatusContract bool
AcceleratedDHTClient bool
}
33 changes: 12 additions & 21 deletions gateway.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package config

const DefaultInlineDNSLink = false

type GatewaySpec struct {
// Paths is explicit list of path prefixes that should be handled by
// this gateway. Example: `["/ipfs", "/ipns", "/api"]`
@@ -8,7 +10,7 @@ type GatewaySpec struct {
// UseSubdomains indicates whether or not this gateway uses subdomains
// for IPFS resources instead of paths. That is: http://CID.ipfs.GATEWAY/...
//
// If this flag is set, any /ipns/$id and/or /ipfs/$id paths in PathPrefixes
// If this flag is set, any /ipns/$id and/or /ipfs/$id paths in Paths
// will be permanently redirected to http://$id.[ipns|ipfs].$gateway/.
//
// We do not support using both paths and subdomains for a single domain
@@ -18,6 +20,11 @@ type GatewaySpec struct {
// NoDNSLink configures this gateway to _not_ resolve DNSLink for the FQDN
// provided in `Host` HTTP header.
NoDNSLink bool

// InlineDNSLink configures this gateway to always inline DNSLink names
// (FQDN) into a single DNS label in order to interop with wildcard TLS certs
// and Origin per CID isolation provided by rules like https://publicsuffix.org
InlineDNSLink Flag
}

// Gateway contains options for the HTTP gateway server.
@@ -31,29 +38,13 @@ type Gateway struct {
// should be redirected.
RootRedirect string

// Writable enables PUT/POST request handling by this gateway. Usually,
// writing is done through the API, not the gateway.
// REMOVED: modern replacement tracked in https://github.com/ipfs/specs/issues/375
Writable bool

// PathPrefixes is an array of acceptable url paths that a client can
// specify in X-Ipfs-Path-Prefix header.
//
// The X-Ipfs-Path-Prefix header is used to specify a base path to prepend
// to links in directory listings and for trailing-slash redirects. It is
// intended to be set by a frontend http proxy like nginx.
//
// Example: To mount blog.ipfs.io (a DNSLink site) at ipfs.io/blog
// set PathPrefixes to ["/blog"] and nginx config to translate paths
// and pass Host header (for DNSLink):
// location /blog/ {
// rewrite "^/blog(/.*)$" $1 break;
// proxy_set_header Host blog.ipfs.io;
// proxy_set_header X-Ipfs-Gateway-Prefix /blog;
// proxy_pass http://127.0.0.1:8080;
// }
// PathPrefixes was removed: https://github.com/ipfs/go-ipfs/issues/7702
PathPrefixes []string

// FIXME: Not yet implemented
// FIXME: Not yet implemented: https://github.com/ipfs/kubo/issues/8059
APICommands []string

// NoFetch configures the gateway to _not_ fetch blocks in response to
@@ -62,7 +53,7 @@ type Gateway struct {

// NoDNSLink configures the gateway to _not_ perform DNS TXT record
// lookups in response to requests with values in `Host` HTTP header.
// This flag can be overriden per FQDN in PublicGateways.
// This flag can be overridden per FQDN in PublicGateways.
NoDNSLink bool

// PublicGateways configures behavior of known public gateways.
42 changes: 39 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -2,10 +2,46 @@ module github.com/TRON-US/go-btfs-config

require (
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5
github.com/libp2p/go-libp2p-core v0.5.6
github.com/libp2p/go-libp2p v0.23.4
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr v0.2.2
github.com/multiformats/go-multiaddr v0.7.0
github.com/tron-us/go-btfs-common v0.2.11
)

go 1.14
require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/ipfs/go-cid v0.3.2 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.6.0 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/tron-us/protobuf v1.3.4 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
google.golang.org/grpc v1.25.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)

go 1.18
Loading