JetBrains Space Help

Proxy Remote Package Repositories

Space Packages lets you proxy remote repositories using the pull-through cache approach:

  1. You create a remote repository mirror in Space Packages.

  2. When a user references a package from the repository mirror, Space checks if the package is available locally. If the package is not available, Space will download it from the associated remote repository and save it locally in the mirror.

Note that you cannot publish packages to pull-through cache mirrors: You will receive the 405 status code from the server: Method Not Allowed.

Benefits of pull-through cache mirrors

  • Simplify referencing packages from remote repositories: One local mirror repository can mirror multiple remote repositories. Note that a remote repository doesn't necessarily represent an external repository. This could also be a local repository hosted in Space. For example, you can create a mirror that aggregates data from Maven Central and a local repository with private artifacts.

  • Optimize network traffic: For example, a mirror can speed up Space Automation builds as all external packages will be available locally.

Supported repository types

  • Cargo (Rust)

  • Container

  • Dart

  • Maven

  • npm

  • Python Package Index

Create a pull-through cache mirror

  1. Navigate to the project where you want to create a mirror.

  2. On the project sidebar, choose Packages.

  3. On the Packages page, click New repository.

  4. In the New Package Repository window, specify repository settings like Type and Name.

  5. Choose Mirror Remote Repository.

  6. In the mirror properties, specify the URL of the remote repository and the Authentication type.

  7. Depending on the Authentication type, specify required authentication settings.

  8. The Package name filters option lets you specify which packages from the remote repository will be available in the mirror. Specify the required exclude or include patterns with + or - correspondingly. The asterisk * wildcard is allowed. For example, to include only packages related to Kotlin: +com.jetbrains.kotlin.*

  9. After you create the mirror, click the Get Started button to see the command-line snippets that will help you get started: connect to the repository and get images. Here you can also Generate personal token for accessing the mirror.

Associate a mirror with additional remote repositories

  1. Open the Packages page for a required project.

  2. Open the required mirror and click Settings.

  3. Switch to the Remote Repositories tab.

  4. Click New remote repository and specify repository settings:

    • Type: Choose a repository type.

      • Remote: a repository that is external to Space.

      • Space: a local repository hosted in Space Packages.

    • For a Remote repository, specify its URL and authentication credentials.

    • For a repository hosted in Space, specify the project the repository belongs to and the repository itself.

    • Prevent dependency hijacking: Enable/disable protection from dependency hijacking. Learn more

  5. Click Create.

Disable package caching for a remote repository

  1. Open the Packages page for a required project.

  2. Open the required mirror and click Settings.

  3. Switch to the Remote Repositories tab.

  4. Click Menu next to the required repository and choose Edit.

  5. Clear the Enable package downloading checkbox and click Save.

Prevent dependency hijacking

Mirrors in Packages provide built-in protection from dependency hijacking. By default, if a mirror downloads a package from a remote repository once, it will use only this remote repository for all further package updates. If you disable Prevent dependency hijacking for this repository, Space will look for the updates in all associated remote repositories.

To disable protection from hijacking for a remote repository

  1. Open the Packages page for a required project.

  2. Open the required mirror and click Settings.

  3. Switch to the Remote Repositories tab.

  4. Click Menu next to the required repository and choose Edit.

  5. Clear the Prevent dependency hijacking checkbox and click Save.

To change a remote repository used for package updates

  1. Find the required package.

  2. Click Versions.

  3. Choose a new remote repository in the Look for new versions in list.

    Protection from dependency hijacking

    After this, Space will look for new package versions only in the newly specified repository.

Last modified: 08 April 2024