diff --git a/idea/customization/base/resources/intellij.idea.customization.base.xml b/idea/customization/base/resources/intellij.idea.customization.base.xml index fa45d99c1451..e350e3ac1de8 100644 --- a/idea/customization/base/resources/intellij.idea.customization.base.xml +++ b/idea/customization/base/resources/intellij.idea.customization.base.xml @@ -2,7 +2,7 @@ diff --git a/idea/customization/base/src/OpenIdeExternalResourceUrls.kt b/idea/customization/base/src/OpenIdeExternalResourceUrls.kt new file mode 100644 index 000000000000..68688d048892 --- /dev/null +++ b/idea/customization/base/src/OpenIdeExternalResourceUrls.kt @@ -0,0 +1,31 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.idea.customization.base + +import com.intellij.openapi.util.BuildNumber +import com.intellij.platform.ide.customization.ExternalProductResourceUrls +import com.intellij.util.Url +import com.intellij.util.Urls + +// TODO [OpenIDE]: replaces urls +class OpenIdeExternalResourceUrls : ExternalProductResourceUrls { + + override val helpPageUrl: ((topicId: String) -> Url)? = null + + override val gettingStartedPageUrl = null + + override val youTubeChannelUrl = null + + override val updateMetadataUrl = Urls.newFromEncoded("https://www.openide.com") + + override fun computePatchUrl(from: BuildNumber, to: BuildNumber): Url = Urls.newFromEncoded("https://www.openide.com") + + override val bugReportUrl: ((String) -> Url)? = null + + override val technicalSupportUrl: ((description: String) -> Url) ? = null + + override val feedbackReporter = null + + override val downloadPageUrl = null + + override val whatIsNewPageUrl = null +} \ No newline at end of file diff --git a/java/execution/impl/src/com/intellij/execution/testDiscovery/IntellijTestDiscoveryProducer.java b/java/execution/impl/src/com/intellij/execution/testDiscovery/IntellijTestDiscoveryProducer.java index 3942a877f279..a76f873cf825 100644 --- a/java/execution/impl/src/com/intellij/execution/testDiscovery/IntellijTestDiscoveryProducer.java +++ b/java/execution/impl/src/com/intellij/execution/testDiscovery/IntellijTestDiscoveryProducer.java @@ -33,7 +33,7 @@ import java.util.stream.Collectors; @InternalIgnoreDependencyViolation public final class IntellijTestDiscoveryProducer implements TestDiscoveryProducer { - private static final String INTELLIJ_TEST_DISCOVERY_HOST = "https://intellij-test-discovery.labs.intellij.net"; + private static final String INTELLIJ_TEST_DISCOVERY_HOST = ""; private static final NotNullLazyValue JSON_READER = NotNullLazyValue.createValue(() -> new ObjectMapper().readerFor(TestsSearchResult.class)); diff --git a/java/java-impl/resources/META-INF/JavaPlugin.xml b/java/java-impl/resources/META-INF/JavaPlugin.xml index 8cf138d1d965..bdb09ed8a498 100644 --- a/java/java-impl/resources/META-INF/JavaPlugin.xml +++ b/java/java-impl/resources/META-INF/JavaPlugin.xml @@ -1962,7 +1962,7 @@ implementationClass="com.intellij.codeInspection.streamToLoop.StreamToLoopInspection" key="inspection.stream.to.loop.display.name" bundle="messages.JavaBundle"/> @@ -2745,7 +2745,7 @@ diff --git a/platform/feedback/src/com/intellij/platform/feedback/impl/GeneralFeedbackSubmit.kt b/platform/feedback/src/com/intellij/platform/feedback/impl/GeneralFeedbackSubmit.kt index 653cd6f5b610..f07ee0ce3290 100644 --- a/platform/feedback/src/com/intellij/platform/feedback/impl/GeneralFeedbackSubmit.kt +++ b/platform/feedback/src/com/intellij/platform/feedback/impl/GeneralFeedbackSubmit.kt @@ -106,17 +106,17 @@ fun submitFeedback(feedbackData: FeedbackRequestDataHolder, onDone: () -> Unit, onError: () -> Unit, feedbackRequestType: FeedbackRequestType = FeedbackRequestType.TEST_REQUEST) { - ApplicationManager.getApplication().executeOnPooledThread { - val feedbackUrl = when (feedbackRequestType) { - FeedbackRequestType.NO_REQUEST -> return@executeOnPooledThread - FeedbackRequestType.TEST_REQUEST -> TEST_FEEDBACK_URL - FeedbackRequestType.PRODUCTION_REQUEST -> PRODUCTION_FEEDBACK_URL - } - - val regionalFeedbackUrl = RegionUrlMapper.tryMapUrlBlocking(feedbackUrl) - LOG.info("Feedback sent to $regionalFeedbackUrl") - sendFeedback(regionalFeedbackUrl, feedbackData, onDone, onError) - } + //ApplicationManager.getApplication().executeOnPooledThread { + // val feedbackUrl = when (feedbackRequestType) { + // FeedbackRequestType.NO_REQUEST -> return@executeOnPooledThread + // FeedbackRequestType.TEST_REQUEST -> TEST_FEEDBACK_URL + // FeedbackRequestType.PRODUCTION_REQUEST -> PRODUCTION_FEEDBACK_URL + // } + // + // val regionalFeedbackUrl = RegionUrlMapper.tryMapUrlBlocking(feedbackUrl) + // LOG.info("Feedback sent to $regionalFeedbackUrl") + // sendFeedback(regionalFeedbackUrl, feedbackData, onDone, onError) + //} } private fun sendFeedback(feedbackUrl: String, diff --git a/platform/ide-core/src/com/intellij/facet/frameworks/LibrariesDownloadConnectionService.java b/platform/ide-core/src/com/intellij/facet/frameworks/LibrariesDownloadConnectionService.java index 7ba96b90bdbd..ea9dd6ace6ec 100644 --- a/platform/ide-core/src/com/intellij/facet/frameworks/LibrariesDownloadConnectionService.java +++ b/platform/ide-core/src/com/intellij/facet/frameworks/LibrariesDownloadConnectionService.java @@ -3,8 +3,8 @@ package com.intellij.facet.frameworks; public final class LibrariesDownloadConnectionService extends SettingsConnectionService { - private static final String SETTINGS_URL = "https://www.jetbrains.com/idea/download-assistant.xml"; - private static final String SERVICE_URL = "https://frameworks.jetbrains.com"; + private static final String SETTINGS_URL = null; + private static final String SERVICE_URL = null; private static final LibrariesDownloadConnectionService ourInstance = new LibrariesDownloadConnectionService(); diff --git a/platform/ide-core/src/com/intellij/util/io/HttpRequests.java b/platform/ide-core/src/com/intellij/util/io/HttpRequests.java index a00ce908aa8a..2fc445052b71 100644 --- a/platform/ide-core/src/com/intellij/util/io/HttpRequests.java +++ b/platform/ide-core/src/com/intellij/util/io/HttpRequests.java @@ -564,6 +564,12 @@ public final class HttpRequests { request.myUrl = "https:" + request.myUrl.substring(5); } + if (!WhiteListUrls.isAvailableUrl(request.myUrl)) { + LOG.info("Not available url: " + request.myUrl); + URL url = new URL(request.myUrl); + return new StubUrlConnection(url); + } + for (int i = 0; i < builder.myRedirectLimit; i++) { final String url = request.myUrl; diff --git a/platform/ide-core/src/com/intellij/util/io/WhiteListUrls.kt b/platform/ide-core/src/com/intellij/util/io/WhiteListUrls.kt new file mode 100644 index 000000000000..c02943384bc3 --- /dev/null +++ b/platform/ide-core/src/com/intellij/util/io/WhiteListUrls.kt @@ -0,0 +1,34 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.util.io + +import java.net.URL +import java.net.URLConnection + +object WhiteListUrls { + private val urls = listOf( + "https://github.com", + "https://search.maven.org", + "https://repo.jfrog.org", + "https://oss.sonatype.org", + "https://repository.jboss.org", + "https://repo.maven.apache.org", + "https://plugins.gradle.org/plugin/org.jetbrains.intellij", + "https://api.github.com/repos", + "https://pypi.python.org", + "http://localhost", + "https://services.gradle.org", + "https://plugins.jetbrains.com", // TODO [OpenIDE]: replace url + "https://downloads.marketplace.jetbrains.com/files", // TODO [OpenIDE]: replace url + "https://repo1.maven.org/maven2/net/sourceforge/plantuml/plantuml/1.2023.10/plantuml-1.2023.10.jar", + ) + + @JvmStatic + fun isAvailableUrl(url: String): Boolean { + return urls.any { url.startsWith(it, true) } + } +} + +class StubUrlConnection(url: URL): URLConnection(url) { + override fun connect() { + } +} \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkList.kt b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkList.kt index 9a4214054933..635a159f579a 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkList.kt +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkList.kt @@ -510,7 +510,7 @@ class JdkListDownloader : JdkListDownloaderBase() { return registry } } - return "https://download.jetbrains.com/jdk/feed/v1/jdks.json.xz" + return "" // TODO [OpenIDE]: replace url } } diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/RuntimeChooserJbr.kt b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/RuntimeChooserJbr.kt index 42b7475ecd99..5b58afd48ec8 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/RuntimeChooserJbr.kt +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/RuntimeChooserJbr.kt @@ -40,7 +40,8 @@ private class RuntimeChooserJbrListDownloader : JdkListDownloaderBase() { val majorVersion = runCatching { Registry.get("runtime.chooser.pretend.major").asInteger() }.getOrNull() ?: ApplicationInfo.getInstance().build.components.firstOrNull() - return "https://download.jetbrains.com/jdk/feed/v1/jbr-choose-runtime-${majorVersion}.json.xz" + return ""; // TODO [OpenIDE]: replace url + //return "https://download.jetbrains.com/jdk/feed/v1/jbr-choose-runtime-${majorVersion}.json.xz" } } diff --git a/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.kt b/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.kt index afa8eb13a19e..bbc88d68b8cd 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.kt +++ b/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.kt @@ -39,7 +39,7 @@ internal val NOTIFY_SUCCESS_EACH_REPORT = AtomicBoolean(true) // dirty hack, rep @InternalIgnoreDependencyViolation open class ITNReporter internal constructor(private val postUrl: String) : ErrorReportSubmitter() { @ApiStatus.Internal - constructor() : this("https://ea-report.jetbrains.com/trackerRpc/idea/createScr") + constructor() : this("") override fun getReportActionText(): String = DiagnosticBundle.message("error.report.to.jetbrains.action") diff --git a/platform/platform-impl/src/com/intellij/ide/RegionUrlMapper.java b/platform/platform-impl/src/com/intellij/ide/RegionUrlMapper.java index b99424a8291f..57e14f3e582f 100644 --- a/platform/platform-impl/src/com/intellij/ide/RegionUrlMapper.java +++ b/platform/platform-impl/src/com/intellij/ide/RegionUrlMapper.java @@ -11,9 +11,13 @@ import com.intellij.util.SmartList; import com.intellij.util.SystemProperties; import com.intellij.util.concurrency.annotations.RequiresBackgroundThread; import com.intellij.util.concurrency.annotations.RequiresReadLockAbsence; +import com.intellij.util.io.HttpRequests; import com.intellij.util.net.PlatformHttpClient; +import kotlinx.coroutines.Dispatchers; +import kotlinx.coroutines.ExecutorsKt; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.jetbrains.io.JsonReaderEx; import org.jetbrains.io.JsonUtil; @@ -154,8 +158,7 @@ public final class RegionUrlMapper { } private static @NotNull String getConfigUrl(@NotNull Region reg) { - String overridden = OVERRIDE_CONFIG_URL_TABLE.get(reg); - return overridden != null ? overridden : CONFIG_URL_TABLE.getOrDefault(reg, CONFIG_URL_DEFAULT); + return ""; } /* diff --git a/plugins/git4idea/resources/intellij.vcs.git.xml b/plugins/git4idea/resources/intellij.vcs.git.xml index cfde9bdeeafb..b0856b17d4cf 100644 --- a/plugins/git4idea/resources/intellij.vcs.git.xml +++ b/plugins/git4idea/resources/intellij.vcs.git.xml @@ -859,7 +859,8 @@ restartRequired="true" description="Amount of time in minutes to check new Git version after IDE inactivity.\n -1 to disable check."/> - + + diff --git a/plugins/gradle/plugin-resources/META-INF/plugin.xml b/plugins/gradle/plugin-resources/META-INF/plugin.xml index 27fce5d1a303..3c5a726ad93d 100644 --- a/plugins/gradle/plugin-resources/META-INF/plugin.xml +++ b/plugins/gradle/plugin-resources/META-INF/plugin.xml @@ -218,7 +218,7 @@ description="Enable the phased Gradle sync execution"/> - { - DownloadableFileService service = DownloadableFileService.getInstance(); - var description = service.createFileDescription("https://cache-redirector.jetbrains.com/" + - "intellij-dependencies/org/jetbrains/intellij/deps/scenebuilderkit/" + - SceneBuilderUtil.SCENE_BUILDER_VERSION + "/" + SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME, SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME); - FileDownloader downloader = service.createDownloader(Collections.singletonList(description), "Scene Builder Kit"); - try { - Path tempDir = Files.createTempDirectory(""); - - final var list = downloader.downloadWithProgress(tempDir.toString(), myProject, myErrorPanel); - if (list == null || list.isEmpty()) { - myErrorNotification.clear(); - myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.download.kit.error")); - return; - } - - FileUtil.copy(VfsUtilCore.virtualToIoFile(list.get(0).first), SceneBuilderUtil.getSceneBuilder11Path().toFile()); - FileUtil.delete(tempDir.toFile()); - - SceneBuilderUtil.updateLoader(); - updateState(); - } - catch (IOException e2) { - LOG.warn("Can't download SceneBuilderKit", e2); - } - } - ); + // TODO [OpenIDE]: https://git.haulmont.com/platform/open-ide/idea/-/issues/29 + //myErrorNotification.createActionLabel( + // JavaFXBundle.message("javafx.scene.builder.editor.download.scene.builder.kit"), + // () -> { + // DownloadableFileService service = DownloadableFileService.getInstance(); + // var description = service.createFileDescription("https://cache-redirector.jetbrains.com/" + + // "intellij-dependencies/org/jetbrains/intellij/deps/scenebuilderkit/" + + // SceneBuilderUtil.SCENE_BUILDER_VERSION + "/" + SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME, SceneBuilderUtil.SCENE_BUILDER_KIT_FULL_NAME); + // FileDownloader downloader = service.createDownloader(Collections.singletonList(description), "Scene Builder Kit"); + // try { + // Path tempDir = Files.createTempDirectory(""); + // + // final var list = downloader.downloadWithProgress(tempDir.toString(), myProject, myErrorPanel); + // if (list == null || list.isEmpty()) { + // myErrorNotification.clear(); + // myErrorNotification.setText(JavaFXBundle.message("javafx.scene.builder.editor.failed.to.download.kit.error")); + // return; + // } + // + // FileUtil.copy(VfsUtilCore.virtualToIoFile(list.get(0).first), SceneBuilderUtil.getSceneBuilder11Path().toFile()); + // FileUtil.delete(tempDir.toFile()); + // + // SceneBuilderUtil.updateLoader(); + // updateState(); + // } + // catch (IOException e2) { + // LOG.warn("Can't download SceneBuilderKit", e2); + // } + // } + //); myLayout.show(myPanel, ERROR_CARD); return; } diff --git a/plugins/markdown/core/resources/META-INF/plugin.xml b/plugins/markdown/core/resources/META-INF/plugin.xml index 674de242b40c..6bd8326438b7 100644 --- a/plugins/markdown/core/resources/META-INF/plugin.xml +++ b/plugins/markdown/core/resources/META-INF/plugin.xml @@ -325,7 +325,7 @@ defaultValue="600000" description="Interval in milliseconds defining how often Markdown plugin caches (e.g. PlantUML diagrams) should be cleared"/>