Skip to content

Commit

Permalink
Deprecate local node support and ipfs scheme (#23808)
Browse files Browse the repository at this point in the history
deprecated IPFS local node support and IPFS scheme
brave/brave-browser#37735
---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
Co-authored-by: Nuo Xu <nuoxu.nx@gmail.com>
  • Loading branch information
vadimstruts and nuo-xu committed Jul 9, 2024
1 parent 813a721 commit 43735ef
Show file tree
Hide file tree
Showing 480 changed files with 597 additions and 38,342 deletions.
3 changes: 0 additions & 3 deletions android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# You can obtain one at https://mozilla.org/MPL/2.0/.

import("//brave/components/ai_chat/core/common/buildflags/buildflags.gni")
import("//brave/components/ipfs/buildflags/buildflags.gni")
import("//brave/components/p3a/buildflags.gni")
import("//brave/components/webcompat_reporter/buildflags/buildflags.gni")
import("//build/config/android/rules.gni")
Expand All @@ -17,7 +16,6 @@ java_cpp_enum("brave_android_java_enums_srcjar") {
sources = [
"//brave/chromium_src/chrome/browser/notifications/notification_handler_impl.h",
"//brave/components/decentralized_dns/core/constants.h",
"//brave/components/ipfs/ipfs_constants.h",
]
}

Expand All @@ -26,7 +24,6 @@ java_cpp_template("brave_config_java") {
defines = [
"BRAVE_ANDROID_DEVELOPER_OPTIONS_CODE=\"$brave_android_developer_options_code\"",
"BRAVE_ANDROID_P3A_ENABLED=$brave_p3a_enabled",
"BRAVE_ANDROID_ENABLE_IPFS=$enable_ipfs",
"BRAVE_ANDROID_WEBCOMPAT_REPORT_ENDPOINT=\"$webcompat_report_api_endpoint\"",
"BRAVE_ANDROID_AI_CHAT_ENABLED=$enable_ai_chat",
]
Expand Down
1 change: 0 additions & 1 deletion android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettingsObserver.java",
"../../brave/android/java/org/chromium/chrome/browser/privacy/secure_dns/BraveSecureDnsProviderPreference.java",
"../../brave/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java",
"../../brave/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettingsIPFSUtils.java",
"../../brave/android/java/org/chromium/chrome/browser/profiles/ProfileUtils.java",
"../../brave/android/java/org/chromium/chrome/browser/qrreader/BarcodeTracker.java",
"../../brave/android/java/org/chromium/chrome/browser/qrreader/BarcodeTrackerFactory.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE

private static final String PREF_DE_AMP = "de_amp";
private static final String PREF_DEBOUNCE = "debounce";
private static final String PREF_IPFS_GATEWAY = "ipfs_gateway";
private static final String PREF_BLOCK_COOKIE_CONSENT_NOTICES = "block_cookie_consent_notices";
private static final String PREF_BLOCK_SWITCH_TO_APP_NOTICES = "block_switch_to_app_notices";
private static final String PREF_AD_BLOCK = "ad_block";
Expand Down Expand Up @@ -143,7 +142,6 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
PREF_ENS,
PREF_SNS,
PREF_REQUEST_OTR,
PREF_IPFS_GATEWAY,
PREF_SECURE_DNS,
PREF_BLOCK_COOKIE_CONSENT_NOTICES,
PREF_BLOCK_SWITCH_TO_APP_NOTICES,
Expand Down Expand Up @@ -181,7 +179,6 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
private ChromeSwitchPreference mSendP3A;
private ChromeSwitchPreference mSendCrashReports;
private ChromeSwitchPreference mBraveStatsUsagePing;
private ChromeSwitchPreference mIpfsGatewayPref;
private ChromeSwitchPreference mBlockCookieConsentNoticesPref;
private ChromeSwitchPreference mBlockSwitchToAppNoticesPref;
private PreferenceCategory mSocialBlockingCategory;
Expand Down Expand Up @@ -259,9 +256,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
mUstoppableDomains = (Preference) findPreference(PREF_UNSTOPPABLE_DOMAINS);
mUstoppableDomains.setOnPreferenceChangeListener(this);

mIpfsGatewayPref = (ChromeSwitchPreference) findPreference(PREF_IPFS_GATEWAY);
mIpfsGatewayPref.setOnPreferenceChangeListener(this);

mBlockCookieConsentNoticesPref =
(ChromeSwitchPreference) findPreference(PREF_BLOCK_COOKIE_CONSENT_NOTICES);
mBlockCookieConsentNoticesPref.setOnPreferenceChangeListener(this);
Expand Down Expand Up @@ -442,8 +436,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
} else if (PREF_DEBOUNCE.equals(key)) {
UserPrefs.get(ProfileManager.getLastUsedRegularProfile())
.setBoolean(BravePref.DEBOUNCE_ENABLED, (boolean) newValue);
} else if (PREF_IPFS_GATEWAY.equals(key)) {
BravePrivacySettingsIPFSUtils.setIPFSGatewayPref((boolean) newValue);
} else if (PREF_BLOCK_COOKIE_CONSENT_NOTICES.equals(key)) {
if (mFilterListAndroidHandler != null) {
mFilterListAndroidHandler.enableFilter(
Expand Down Expand Up @@ -611,9 +603,6 @@ private void updateBravePreferences() {
UserPrefs.get(ProfileManager.getLastUsedRegularProfile())
.getBoolean(Pref.HTTPS_ONLY_MODE_ENABLED));

// IPFS Gateway
mIpfsGatewayPref.setChecked(BravePrivacySettingsIPFSUtils.getIPFSGatewayPref());

if (blockAdTrackersPref.equals(BraveShieldsContentSettings.BLOCK_RESOURCE)) {
mAdsTrakersBlockPref.setCheckedIndex(0);
mAdsTrakersBlockPref.setSummary(
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions android/java/res/xml/brave_privacy_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@
app:dialog_subtitle="@string/request_otr_text"
app:dialog_entries="@array/requestOTRTexts"
app:dialog_default_index="1" />
<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
android:key="ipfs_gateway"
android:order="25"
android:title="@string/ipfs_gateway_title"
android:summary="@string/ipfs_gateway_summary"
android:defaultValue="true" />
<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
android:key="block_cookie_consent_notices"
android:order="25"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class BravePrivacySettingsTest {
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
private static final String PREF_PHONE_AS_A_SECURITY_KEY = "phone_as_a_security_key";

private static final int BRAVE_PRIVACY_SETTINGS_NUMBER_OF_ITEMS = 29;
private static final int BRAVE_PRIVACY_SETTINGS_NUMBER_OF_ITEMS = 28;

private int mItemsLeft;

Expand Down
14 changes: 0 additions & 14 deletions app/brave_command_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
#define IDC_SIDEBAR_SHOW_OPTION_ALWAYS 56012
#define IDC_SIDEBAR_SHOW_OPTION_MOUSEOVER 56013
#define IDC_SIDEBAR_SHOW_OPTION_NEVER 56015
#define IDC_CONTENT_CONTEXT_IMPORT_IPFS 56016
#define IDC_CONTENT_CONTEXT_IMPORT_LINK_IPFS 56017
#define IDC_CONTENT_CONTEXT_IMPORT_IPFS_PAGE 56018
#define IDC_CONTENT_CONTEXT_IMPORT_IMAGE_IPFS 56019
#define IDC_CONTENT_CONTEXT_IMPORT_AUDIO_IPFS 56020
#define IDC_CONTENT_CONTEXT_IMPORT_VIDEO_IPFS 56021
#define IDC_CONTENT_CONTEXT_IMPORT_SELECTED_TEXT_IPFS 56022
#define IDC_APP_MENU_IPFS 56023
#define IDC_APP_MENU_IPFS_PUBLISH_LOCAL_FILE 56024
#define IDC_APP_MENU_IPFS_PUBLISH_LOCAL_FOLDER 56025
#define IDC_SHOW_BRAVE_WALLET_PANEL 56026
#define IDC_CLOSE_BRAVE_WALLET_PANEL 56027
#define IDC_SHOW_BRAVE_VPN_PANEL 56028
Expand All @@ -47,10 +37,6 @@
#define IDC_ABOUT_BRAVE_VPN 56032
#define IDC_MANAGE_BRAVE_VPN_PLAN 56033
#define IDC_TOGGLE_BRAVE_VPN 56034
#define IDC_APP_MENU_IPFS_SHARE_LOCAL_FILE 56035
#define IDC_APP_MENU_IPFS_SHARE_LOCAL_FOLDER 56036
#define IDC_APP_MENU_IPFS_OPEN_FILES 56037
#define IDC_APP_MENU_IPFS_UPDATE_IPNS 56038
#define IDC_CONTENT_CONTEXT_FORCE_PASTE 56039
#define IDC_COPY_CLEAN_LINK 56040
#define IDC_TOGGLE_TAB_MUTE 56041
Expand Down
123 changes: 1 addition & 122 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,6 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
Check details
</message>

<!-- IPFS -->
<message name="IDS_LOCATION_BAR_OPEN_USING_IPFS" desc="Button in location bar to open ipfs available site.">
IPFS
</message>
<message name="IDS_EXTENSION_PROMPT_WARNING_IPFS" desc="Permisson string for access to ipfs api.">
Publish and retrieve files from IPFS
</message>
<message name="IDS_EXTENSION_PROMPT_WARNING_IPFS_PRIVATE" desc="Permisson string for access to private ipfs api.">
Read and modify IPFS settings
</message>
<message name="IDS_LOCATION_BAR_ONION_AVAILABLE" desc="Button in location bar to indicate onion available site to open a new tab in tor window.">
.onion
</message>
Expand All @@ -362,37 +352,8 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
<message name="IDS_CONTENT_CONTEXT_FORCE_PASTE" desc="The name of the context menu item to paste without triggering onpaste handlers">
Force Paste
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS" desc="The name of the IPFS context menu item for renderer">
Import to IPFS
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_PAGE" desc="The name of the IPFS context menu item to import current page using IPFS">
This page
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_IMAGE" desc="The name of the IPFS context menu item to import selected image using IPFS">
Selected image
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_VIDEO" desc="The name of the IPFS context menu item to import selected video using IPFS">
Selected video
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_AUDIO" desc="The name of the IPFS context menu item to import selected audio using IPFS">
Selected audio
</message>
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_LINK" desc="The name of the IPFS context menu item to import linked content using IPFS">
Linked content
</message>
<message name="IDS_IMPORT_USING_IPNS_KEYS_TITLE" desc="The name of the IPFS import menu item to publish content using IPNS keys">
Publish with IPNS key
</message>
<message name="IDS_APP_MENU_IPFS" desc="The text label of a menu item to open a new app menu ipfs item.">
IPFS
</message>

<if expr="use_titlecase">
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_SELECTED_TEXT" desc="The name of the IPFS context menu item to import selected text using IPFS">
Import Selected Text to IPFS
</message>
<message name="IDS_IMPORT_WITHOUT_PUBLISHING" desc="The name of the IPFS context menu item to import content without publishing">
Import and Copy Link to IPFS Snapshot
</message>
<message name="IDS_NEW_OFFTHERECORD_WINDOW_TOR" desc="Title case: The text label of a menu item to open a new off-the-record window with Tor.">
New Private Window with Tor
</message>
Expand All @@ -402,41 +363,8 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
<message name="IDS_CONTENT_CONTEXT_OPENLINKTOR_INAPP" desc="Title case: The name of the open a link in private window with Tor command">
Open Link in Brave Private Window with Tor
</message>
<message name="IDS_APP_MENU_IPFS_SHARE_LOCAL_FILE" desc="Title case: The text label of a menu item to share local file using IPFS.">
Import and Share a File
</message>
<message name="IDS_APP_MENU_IPFS_OPEN_FILES" desc="Title case: The text label of a menu item to open IPFS webui files page.">
Open Files
</message>
<message name="IDS_APP_MENU_IPFS_SHARE_LOCAL_FOLDER" desc="Title case: The text label of a menu item to share local fodler using IPFS.">
Import and Share a Directory
</message>
<message name="IDS_APP_MENU_IPFS_PUBLISH_LOCAL_FILE" desc="Title case: The text label of a menu item to publish local file under IPFS key.">
With a File
</message>
<message name="IDS_APP_MENU_IPFS_PUBLISH_LOCAL_FOLDER" desc="Title case: The text label of a menu item to publish local fodler under IPFS key.">
With a Directory
</message>
<message name="IDS_APP_MENU_IPFS_UPDATE_IPNS" desc="Title case: The text label of a menu item to update IPNS.">
Update IPNS
</message>
</if>
<if expr="not use_titlecase">
<message name="IDS_CONTENT_CONTEXT_IMPORT_IPFS_SELECTED_TEXT" desc="The name of the IPFS context menu item to import selected text using IPFS">
Import selected text to IPFS
</message>
<message name="IDS_IMPORT_WITHOUT_PUBLISHING" desc="The name of the IPFS context menu item to import content without publishing">
Import and copy link to IPFS snapshot
</message>
<message name="IDS_APP_MENU_IPFS_SHARE_LOCAL_FILE" desc="The text label of a menu item to share local file using IPFS.">
Import and share a file
</message>
<message name="IDS_APP_MENU_IPFS_OPEN_FILES" desc="Title case: The text label of a menu item to open IPFS webui files page.">
Open files
</message>
<message name="IDS_APP_MENU_IPFS_UPDATE_IPNS" desc="Title case: The text label of a menu item to update IPNS.">
Update IPNS
</message>
<message name="IDS_NEW_OFFTHERECORD_WINDOW_TOR" desc="The text label of a menu item to open a new off-the-record window with Tor.">
New private window with Tor
</message>
Expand All @@ -446,15 +374,6 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
<message name="IDS_CONTENT_CONTEXT_OPENLINKTOR_INAPP" desc="The name of the open a link in private window with Tor command">
Open link in Brave private window with Tor
</message>
<message name="IDS_APP_MENU_IPFS_SHARE_LOCAL_FOLDER" desc="The text label of a menu item to share local folder using IPFS.">
Import and share a directory
</message>
<message name="IDS_APP_MENU_IPFS_PUBLISH_LOCAL_FILE" desc="Title case: The text label of a menu item to publish local file under IPFS key.">
With a File
</message>
<message name="IDS_APP_MENU_IPFS_PUBLISH_LOCAL_FOLDER" desc="Title case: The text label of a menu item to publish local fodler under IPFS key.">
With a Directory
</message>
</if>
<!-- Dev channel deprecation infobar -->
<message name="IDS_DEV_CHANNEL_DEPRECATION_INFOBAR_MESSAGE" desc="The text label of dev channel deprecation announcement.">
Expand Down Expand Up @@ -907,55 +826,15 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
<message name="IDS_BRAVE_CRYPTO_WALLETS_DONT_ASK" desc="Sets provider to none">
Don't ask again
</message>
<!-- IPFS -->
<message name="IDS_BRAVE_WALLET_SETTINGS_SECTION" desc="Open Wallet settings section">
Wallet
</message>
<message name="IDS_BRAVE_IPFS_SETTINGS_SECTION" desc="Open IPFS settings section">
IPFS
</message>
<message name="IDS_BRAVE_WEB3_SETTINGS_SECTION" desc="Open Web3 settings section">
Web3
</message>
<message name="IDS_BRAVE_WEB3_DOMAINS_SETTINGS_SECTION" desc="Open Web3 Domains settings section">
Web3 Domains
</message>
<message name="IDS_BRAVE_IPFS_LEARN_MORE">
Learn more about IPFS and privacy
</message>
<message name="IDS_BRAVE_IPFS_INFOBAR_TEXT" desc="Text that promotes turning on autoredirect to the configured gateway setting">
This page is available on the IPFS network. Would you like to load IPFS pages using Brave's built-in support (via ipfs:// or ipns://)?
</message>
<message name="IDS_BRAVE_IPFS_INFOBAR_APPROVE" desc="Turns on promoted setting">
Always
</message>
<message name="IDS_BRAVE_IPFS_INFOBAR_APPROVE_ONCE" desc="Redirects to the ipfs:// or ipns:// resource for once">
Only This Time
</message>
<message name="IDS_BRAVE_IPFS_INFOBAR_NEVER" desc="Closed infobar and disables it showing">
No Thanks
</message>
<message name="IDS_BRAVE_IPFS_INFOBAR_LINK" desc="Link redirects to the privacy description article">
Learn how this affects my privacy
</message>
<message name="IDS_BRAVE_IPFS_FALLBACK_INFOBAR_TEXT" desc="Prompt, asking the user whether they'd like to load the original URL rather than the resolved one when the page load fails">
There was an error loading the IPFS URL. Would you like to redirect to the original URL?
</message>
<message name="IDS_BRAVE_IPFS_FALLBACK_REDIRECT" desc="Redirect to the original url">
Redirect
</message>
<message name="IDS_BRAVE_IPFS_FALLBACK_INFOBAR_NO" desc="Close infobar without redirection">
No thanks
</message>
<message name="IDS_BRAVE_IPFS_ALWAYS_START_INFOBAR_TEXT" desc="Text that proposes to the user to enable always starting an IPFS node with the browser">
Would you like to always start an IPFS node on browser startup?
</message>
<message name="IDS_BRAVE_IPFS_ALWAYS_START_INFOBAR_OK" desc="Enable IPFS always start mode">
Enable
</message>
<message name="IDS_BRAVE_IPFS_ALWAYS_START_INFOBAR_NO" desc="Ignore proposition">
Cancel
</message>
<!-- Brave Wallet -->
<message name="IDS_UTILITY_PROCESS_WALLET_UTILS_NAME" desc="The utility process running wallet utils">
Brave Wallet Utility Service
Expand Down
Loading

0 comments on commit 43735ef

Please sign in to comment.