Skip to content
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

remove ipfs #216

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 0 additions & 21 deletions extension/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,26 +318,5 @@ var OfferedExtensions = Extensions{
Title: "Brave Tor Client Updater (Mac)",
URL: "",
Blacklisted: false,
}, {
ID: "nljcddpbnaianmglkpkneakjaapinabi",
Version: "1.0.1",
SHA256: "1bfdea8bd9fcac4a7109e85cbfe76670f9cb1f716fb36d36e2d5f1bbaafb734a",
Title: "Brave Ipfs Daemon Updater (Mac)",
URL: "",
Blacklisted: false,
}, {
ID: "lnbclahgobmjphilkalbhebakmblnbij",
Version: "1.0.1",
SHA256: "efc1b8a1ade508e2028c918c5b3451a568ec3ecce1703f01c09659403bc91526",
Title: "Brave Ipfs Daemon Updater (Windows)",
URL: "",
Blacklisted: false,
}, {
ID: "oecghfpdmkjlhnfpmmjegjacfimiafjp",
Version: "1.0.1",
SHA256: "6641042f9f75f16066d28741cd699fc3a04df3e414629a7cda33d8df2b15c717",
Title: "Brave Ipfs Daemon Updater (Linux)",
URL: "",
Blacklisted: false,
},
}
9 changes: 0 additions & 9 deletions extension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ func TestS3BucketForExtension(t *testing.T) {
torExtensionLinux, ok := allExtensionsMap.Load("biahpgbdmdkfgndcmfiipgcebobojjkp")
assert.True(t, ok)
assert.Equal(t, GetS3ExtensionBucketHost(torExtensionLinux.ID), "tor.bravesoftware.com")
ipfsExtensionMac, ok := allExtensionsMap.Load("nljcddpbnaianmglkpkneakjaapinabi")
assert.True(t, ok)
assert.Equal(t, GetS3ExtensionBucketHost(ipfsExtensionMac.ID), "ipfs.bravesoftware.com")
ipfsExtensionWin, ok := allExtensionsMap.Load("lnbclahgobmjphilkalbhebakmblnbij")
assert.True(t, ok)
assert.Equal(t, GetS3ExtensionBucketHost(ipfsExtensionWin.ID), "ipfs.bravesoftware.com")
ipfsExtensionLinux, ok := allExtensionsMap.Load("oecghfpdmkjlhnfpmmjegjacfimiafjp")
assert.True(t, ok)
assert.Equal(t, GetS3ExtensionBucketHost(ipfsExtensionLinux.ID), "ipfs.bravesoftware.com")
lightThemeExtension, ok := allExtensionsMap.Load("ldimlcelhnjgpjjemdjokpgeeikdinbm")
assert.True(t, ok)
assert.Equal(t, GetS3ExtensionBucketHost(lightThemeExtension.ID), "brave-core-ext.s3.brave.com")
Expand Down
29 changes: 0 additions & 29 deletions extension/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ var torPluggableTransportsLinuxExtensionID = "apfggiafobakjahnkchiecbomjgigkkn"
var TorClientExtensionIDs = []string{torClientMacExtensionID, torClientWindowsExtensionID, torClientLinuxExtensionID, torClientLinuxArm64ExtensionID}
var TorPluggableTransportsExtensionIDs = []string{torPluggableTransportsMacExtensionID, torPluggableTransportsWindowsExtensionID, torPluggableTransportsLinuxExtensionID}

var ipfsClientMacExtensionID = "nljcddpbnaianmglkpkneakjaapinabi"
var ipfsClientWindowsExtensionID = "lnbclahgobmjphilkalbhebakmblnbij"
var ipfsClientLinuxExtensionID = "oecghfpdmkjlhnfpmmjegjacfimiafjp"
var ipfsClientMacArm64ExtensionID = "lejaflgbgglfaomemffoaappaihfligf"
var ipfsClientLinuxArm64ExtensionID = "fmmldihckdnognaabhligdpckkeancng"
var ipfsClientWindowsArm64ExtensionID = "nbhgdecjnlofkpafjpcjfajdceeppaih"

// ipfsClientExtensionIDs is used to add an exception to return the dedicated
// proxy url for downloading the ipfs crx
var ipfsClientExtensionIDs = []string{ipfsClientMacExtensionID, ipfsClientWindowsExtensionID, ipfsClientLinuxExtensionID, ipfsClientMacArm64ExtensionID, ipfsClientLinuxArm64ExtensionID, ipfsClientWindowsArm64ExtensionID}

func isTorExtension(id string) bool {
for _, torID := range TorClientExtensionIDs {
if torID == id {
Expand All @@ -43,15 +32,6 @@ func isTorExtension(id string) bool {
return false
}

func isIPFSExtension(id string) bool {
for _, ipfsID := range ipfsClientExtensionIDs {
if ipfsID == id {
return true
}
}
return false
}

func lookupEnvFallback(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
Expand All @@ -65,10 +45,6 @@ func GetS3ExtensionBucketHost(id string) string {
return GetS3TorExtensionBucketHost()
}

if isIPFSExtension(id) {
return GetS3IPFSExtensionBucketHost()
}

return lookupEnvFallback("S3_EXTENSIONS_BUCKET_HOST", "brave-core-ext.s3.brave.com")
}

Expand All @@ -77,11 +53,6 @@ func GetS3TorExtensionBucketHost() string {
return lookupEnvFallback("S3_EXTENSIONS_BUCKET_HOST_TOR", "tor.bravesoftware.com")
}

// GetS3IPFSExtensionBucketHost returns the url to use for accessing go-ipfs client crx
func GetS3IPFSExtensionBucketHost() string {
return lookupEnvFallback("S3_EXTENSIONS_BUCKET_HOST_IPFS", "ipfs.bravesoftware.com")
}

// GetUpdateStatus returns the status of an update response for an extension
func GetUpdateStatus(extension Extension) string {
if extension.Status == "" {
Expand Down