git ssb

3+

cel / ssb-npm-registry



After installing ssb-git I now want to use ssb-npm.

%aGao3JS86LqAcLkZ6b8J+l675QqObfmctdXAnHeyP0k=.sha256
ClosedMarcos opened this issue on 1/7/2020, 10:16:12 AM

After installing ssb-git I now want to use ssb-npm. For that I added the package ssb-npm-registry and ssb-links to the patchwork configuration. After trying to use it without success I explored the request I was making. It turns out that it does not add the port in this.baseUrl (http://localhost:7718/%25pFqjcdVKHqsrtOjVEAVZeCF0iY4s%2B3Hr0vA3EFCq5UM%3D.sha256/blob/aaa1df0018178db95a6bc4d24a4db3ec9f8975bc/index.js#L548)

A quick fix was to add this code and then everything worked fine.

  if (this.baseUrl) {
    var port = req.headers.host.split(':')[1] || 8043
    this.baseUrl = this.baseUrl.replace(/\/+$/, '') + ':' + port
  }
%55E7J6ETvA/srqVACsCCLmaOKhf+SkXaNtgPzZLzZmM=.sha256 cel · 1/7/2020, 3:21:40 PM

@gmarcos87 Are you adding that code after the existing if (this.baseUrl) {…} else {…}, or replacing part of it? It is easiest to see if you show a diff. Also, do you have any {"npm":{"baseUrl": …}} set in your ~/.ssb/config?

%fExYlSVbTluhZdsk8xtn3tyzWamiQMESkKh9TSv4xa4=.sha256 Marcos · 1/7/2020, 3:32:13 PM

The code block was replacing the existing if, but you are right, in the .ssb/config file I have http://localhost as baseUrl.

%RbhTkIxDEinyuYU35TP+FZQDjI8aTvyUdoXwOcYIdbU=.sha256 Marcos closed this issue · 1/7/2020, 3:43:41 PM

Built with git-ssb-web