git ssb

3+

cel / ssb-npm-registry



Commit a17b7e21e8c33ec08d467af96942fb4e3d801ef7

scuttlebot -> ssb-server

cel committed on 5/17/2020, 11:51:20 PM
Parent: d5f4acee1403676fc69209710977d0bc98c2e71d

Files changed

README.mdchanged
index.jschanged
README.mdView
@@ -3,9 +3,9 @@
33 Serve an npm registry server backed by SSB.
44
55 ## Install
66
7-Requirement: scuttlebot running from the command line (`sbot server` / `ssb-server start`).
7 +Requirement: ssb-server running from the command line (`sbot server` / `ssb-server start`).
88
99 ```
1010 BLOB_ID="$(sbot links2.read --query '[{"$filter":{"rel":["mentions",{"$prefix":"npm:ssb-npm-registry:"}]}}]'|grep -o '&.*sha256'|tail -n 1)"
1111 cd ~/.ssb && mkdir -p node_modules && cd node_modules
@@ -20,14 +20,14 @@
2020 ## Develop
2121
2222 ### Install with git-ssb:
2323
24-As a scuttlebot plugin:
24 +As a ssb-server plugin:
2525 ```
2626 git clone ssb://%pFqjcdVKHqsrtOjVEAVZeCF0iY4s+3Hr0vA3EFCq5UM=.sha256 ~/.ssb/node_modules/ssb-npm-registry
2727 cd ~/.ssb/node_modules/ssb-npm-registry
2828 ./enable.js
29-# restart sbot
29 +# restart ssb-server
3030 ```
3131
3232 To set ssb-npm-registry as your default registry server:
3333 ```
@@ -59,9 +59,9 @@
5959 - `config.npm.needShasum`: whether to fetch always calculate and send package shasums. Default is `false` but will always calculate the shasum in response to a request from `npm < v5`
6060 - `config.npm.baseUrl`: URL of this ssb-npm-registry instance, such as in case it is being served behind a proxy. Default is to try to detect it for each HTTP request from the Host header or local socket address.
6161 - `config.npm.defaultPkgs`: Array of names (or `name@version` strings) of
6262 ssb-npm packages for the bootstrap snippet to install globally with `npm`.
63- These are resolved to message ids when the snippet is served. Default: `["scuttlebot", "ssb-npm", "git-ssb"]`
63 + These are resolved to message ids when the snippet is served. Default: `["ssb-server", "ssb-npm", "git-ssb"]`
6464 - `config.npm.postInstallCmd`: Command string for the bootstrap snippet to run
6565 after installing packages, if any. Default: `"sbot server"`
6666
6767 ### Environmental variables
@@ -105,9 +105,9 @@
105105 `respond` method) serve the following additional routes:
106106
107107 ### `/-/bootstrap` - Bootstrap shell snippet
108108
109-Serves a shell script to for installing `ssb-npm-registry` and using it to install other `ssb-npm` packages by running in a bootstrap mode where it does not require running `scuttlebot`.
109 +Serves a shell script to for installing `ssb-npm-registry` and using it to install other `ssb-npm` packages by running in a bootstrap mode where it does not require running `ssb-server`.
110110
111111 ### `/-/blobs/get/:id` - Blobs
112112
113113 Fetch a SSB blob by its id.
@@ -136,15 +136,15 @@
136136 ### Message scope
137137
138138 Requests to the registry server can be scoped to one or more messages by prefixing the request pathname with a directory part with url-encoded message ids. You can make such requests by including that prefix in the registry URL. i.e. `npm --registry=http://localhost:8043/<MsgIdEnc>[,<MsgIdEnc>...]/ ...`
139139
140-If a request is scoped to a message, the registry server will answer the request using information contained in that message or messages that it links to (recursively), instead of by using `sbot`'s ssb-links indexes. Fetching messages for a message-scoped request will be done using [`ssb-ooo`][] if that sbot plugin is available.
140 +If a request is scoped to a message, the registry server will answer the request using information contained in that message or messages that it links to (recursively), instead of by using `ssb-server`'s ssb-links indexes. Fetching messages for a message-scoped request will be done using [`ssb-ooo`][] if that sbot plugin is available.
141141
142142 A message-scoped request allows you to install a package without having to replicate the feeds of the authors of the package or its dependencies, since the information needed to install the package is referenced by message id.
143143
144-If you prefix the message id with a caret (`^` or `%5E`), the results will include packages from both the message scope and sbot's ssb-links indexes.
144 +If you prefix the message id with a caret (`^` or `%5E`), the results will include packages from both the message scope and ssb-server's ssb-links indexes.
145145
146-If `sbot` does not have the `ssb-links` scuttlebot plugin, requests to the registry must use message scope and not the caret, since `ssb-links` is required otherwise.
146 +If `ssb-server` does not have the `ssb-links` ssb-server plugin, requests to the registry must use message scope and not the caret, since `ssb-links` is required otherwise.
147147
148148 When running the `ssb-npm` command or a ssb-npm bootstrap server
149149 (`ssb-npm-bootstrap` or `ssb-npm-registry/bootstrap/bin.js`), the `--branch`
150150 option is equivalent to adding a message id to the scope.
@@ -154,14 +154,14 @@
154154 ## Bootstrapping
155155
156156 Since the ssb-npm and ssb-npm-registry packages are distributed on ssb-npm,
157157 there is a problem of how to get them securely if you do not already have
158-scuttlebot installed - especially if you also want to install scuttlebot via
158 +ssb-server installed - especially if you also want to install ssb-server via
159159 ssb-npm. ssb-npm's bootstrap feature aims to solve this. ssb-npm-registry
160160 includes a route that serves a snippet of shell script code. Executing this
161161 bootstrap snippet fetches the ssb-npm-registry package identified by a blob id,
162162 uses that to run a bootstrap ssb-npm-registry server, and uses that to install
163-further packages from ssb-npm (e.g. the ssb-npm command, scuttlebot, git-ssb)
163 +further packages from ssb-npm (e.g. the ssb-npm command, ssb-server, git-ssb)
164164 identified by message ids. The bootstrap snippet fetches from the network only
165165 hash-identified data (SSB blobs and messages), so the package contents cannot
166166 be modified by the server or in transit. By default, the snippet fetches
167167 content from the server that served the snippet, but it can be changed to fetch
index.jsView
@@ -276,9 +276,9 @@
276276
277277 // For each dependency that is not a bundledDependency, get message ids for
278278 // that dependency name + version.
279279 function publishSingleMention(sbot, mention, cb) {
280- if (!sbot.links2) return cb(new Error('ssb-links scuttlebot plugin is required to publish ssb-npm packages'))
280 + if (!sbot.links2) return cb(new Error('ssb-links plugin is required to publish ssb-npm packages'))
281281 // Calculate dependencyBranch and versionBranch message ids.
282282 var value = {
283283 type: 'npm-packages',
284284 mentions: [mention]
@@ -693,9 +693,9 @@
693693 }
694694
695695 Req.prototype.serveBootstrap = function () {
696696 var self = this
697- var pkgs = self.server.npmConfig.defaultPkgs || ['scuttlebot', 'ssb-npm', 'git-ssb']
697 + var pkgs = self.server.npmConfig.defaultPkgs || ['ssb-server', 'ssb-npm', 'git-ssb']
698698 var postInstallCmd = self.server.npmConfig.postInstallCmd
699699 if (postInstallCmd == null) postInstallCmd = 'sbot server'
700700 var ssbNpmRegistryName = require('./package.json').name
701701 var ssbNpmRegistryVersion = require('./package.json').version
@@ -833,10 +833,10 @@
833833 var useMsgMentions = this.headMsgIds
834834 var useServerMentions = !this.headMsgIds || this.headMsgPlus
835835 if (useServerMentions && !this.server.sbot.links2) {
836836 return this.headMsgPlus
837- ? pull.error(new Error('ssb-links scuttlebot plugin is needed for ^msgid queries'))
838- : pull.error(new Error('ssb-links scuttlebot plugin is needed for non-msgid queries'))
837 + ? pull.error(new Error('ssb-links plugin is needed for ^msgid queries'))
838 + : pull.error(new Error('ssb-links plugin is needed for non-msgid queries'))
839839 }
840840 return cat([
841841 useMsgMentions ? this.getMsgMentions(name) : pull.empty(),
842842 useServerMentions ? this.server.getMentions(name) : pull.empty()

Built with git-ssb-web