Skip to content

Add configurable file size limits to the NPM package repository

Problem

There is currently no limit to the size of file a user can upload when publishing an NPM package to the GitLab package registry.

Solution

An admin user can set a maximum file size for NPM package files for the instance in the admin package settings section.

The default setting should be 50MB.

Technical notes

Create a plan_limits column named npm_max_file_size to manage this setting

NPM does not use workhorse authentication, so it cannot use the same helpers being used by the other package managers to limit the file size.

References

Investigation of package limits

Edited by Steve Abrams