Proxy Remote Package Repositories
Space Packages lets you proxy remote repositories using the pull-through cache approach:
You create a remote repository mirror in Space Packages.
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
Navigate to the project where you want to create a mirror.
On the project sidebar, choose Packages.
On the Packages page, click New repository.
In the New Package Repository window, specify repository settings like Type and Name.
Choose Mirror Remote Repository.
In the mirror properties, specify the URL of the remote repository and the Authentication type.
Depending on the Authentication type, specify required authentication settings.
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.*
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
Open the Packages page for a required project.
Open the required mirror and click Settings.
Switch to the Remote Repositories tab.
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
Click Create.
Disable package caching for a remote repository
Open the Packages page for a required project.
Open the required mirror and click Settings.
Switch to the Remote Repositories tab.
Click next to the required repository and choose Edit.
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
Open the Packages page for a required project.
Open the required mirror and click Settings.
Switch to the Remote Repositories tab.
Click next to the required repository and choose Edit.
Clear the Prevent dependency hijacking checkbox and click Save.
To change a remote repository used for package updates
Click Versions.
Choose a new remote repository in the Look for new versions in list.
After this, Space will look for new package versions only in the newly specified repository.