Making a custom registry server

Hi ! I’m trying to create my own self-hosted hand-coded scoped registry server so that I can host my own packages online. I could then add my registry to my projects and the package manager should be able to discover my own packages that I can then add, update, remove from my projects.

But there’s very little information out there about what kind of information Unity is expecting from such a server.

I do receive the unity request: /-/v1/search.text=“myscope”&from=0&size=250.
I then proceed to return it this response (I gathered it from some other response that I found on some registries on the internet):

{
  "objects": [
    {
      "package": {
        "name": "com.me.core",
        "scope": "com.me",
        "version": "0.0.1",
        "unity": "2018.3",
        "displayName": "Me Core",
        "description": "This is the core package for using my tools",
        "author": {
          "name": "me",
          "email": "me@me.com",
          "url": "www.me.com"
        },
        "dependencies": []
      },
      "flags": {
        "insecure": 0
      },
      "score": {
        "final": 1,
        "detail": {
          "quality": 1,
          "popularity": 1,
          "maintenance": 1
        }
      },
      "searchScore": 100000
    }
  ],
  "total": 1,
  "time": "Thu Nov 21 2024 9:25:28 CET"
}

But the package manager then “fails” silently and never show up anything.

Is there a page that I missed where I could find the type of response the package manage is expecting so that I can conform to that and provide valuable information to the package manager ?

At this point I’m stuck so anyhelp is appreciated.

For the people who might think of providing me with some other solutions than the one I’m trying to build => I don’t want to put my packages out publicly. I cannot pay for a private registry. I cannot install software on my web hosting service.

I am trying to build this out of php, and it might be dumb… but where’s the fun if you only ever do sound things ? Plus I figured that it couldn’t be that hard after all…

Thanks for reading :slight_smile:

Perhaps that’s because they utilize a common system: npm. Or at least it’s built to their specs. So you may find more information if you can figure out how to create your own, general npm registry and then try to make that compatible with Unity’s Package Manager (it does not support all npm features).

I get that you’re exploring, otherwise I’d say: why waste time on a registry server just for yourself. You could instead write an editor script that is capable of scanning your git repository for packages (or you maintain a list) and provides the option and GUI to install your packages via the Package Manager API.

Also, you could as well simply try to set up npm rather than trying to program your own registry server - which I suppose is a hundred times more complicated. If you get to run npm you can still decide to try and reprogram it yourself if you’re in it for “fun”. :wink:

Hi ! Thanks for your answer !

I gave me the idea to send requests to openUmp registry via my web browser to see how it responds. Since it is a registry which the unity PackageManager is capable of pulling packages from, the responses I got from it were much closer to what I have to achieve than the one I got from the nmpjs registry.

I corrected the search response and I am now getting some package query ( /com.me.core ) from the PackageManager. I am far from done but this is good progress !

I now must answer the “package query” and then I’ll probably have to answer the actual download of the archive.

Once I’m done, I’ll try to write a recap of what I had to do.

1 Like