You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1318,6 +1319,74 @@ However, on upgrades of Node.js these get lost. If js-controller detects a Node.
1318
1319
1319
1320
In some scenarios, e.g. during development it may be useful to deactivate this feature. You can do so by settings the `IOB_NO_SETCAP` environment variable to `true`.
1320
1321
1322
+
### Vendor Packages Workflow
1323
+
Feature status: New in 7.0.0
1324
+
1325
+
This feature is only of interest for vendors which aim to provide a package which is published to a private package registry (e.g. GitHub Packages).
1326
+
This may be desirable if the adapter is only relevant for a specific customer and/or contains business logic which needs to be kept secret.
1327
+
1328
+
In the following, information is provided how private packages can be installed into the ioBroker ecosystem.
1329
+
The information is tested with GitHub packages. However, it should work in a similar fashion with other registries, like GitLab Packages.
1330
+
1331
+
#### Package Registry
1332
+
You can use e.g. the GitHub package registry. Simply scope your adapter to your organization or personal scope by changing the package name in the `package.json`
1333
+
and configuring the `publishConfig`:
1334
+
1335
+
```json
1336
+
{
1337
+
"name": "@org/vendorAdapter",
1338
+
"publishConfig": {
1339
+
"registry": "https://npm.pkg.github.com"
1340
+
}
1341
+
}
1342
+
```
1343
+
1344
+
Note, that you need to configure `npm` to authenticate via your registry.
1345
+
Find more information in the [documentation](https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#auth-related-configuration).
1346
+
1347
+
Example `.npmrc` file (can be in your project or in the users home directory):
1348
+
1349
+
```
1350
+
//npm.pkg.github.com/:_authToken=<YOUR_TOKEN>
1351
+
@org:registry=https://npm.pkg.github.com
1352
+
```
1353
+
1354
+
Where `YOUR_TOKEN` is an access token which has the permissions to write packages.
1355
+
1356
+
If you then execute `npm publish`, the package will be published to your custom registry instead of the `npm` registry.
1357
+
1358
+
#### Vendor Repository
1359
+
In your vendor-specific repository, each adapter can have a separate field called `packetName`.
1360
+
This represents the real name of the npm packet. E.g.
1361
+
1362
+
```json
1363
+
{
1364
+
"vendorAdapter": {
1365
+
"version": "1.0.0",
1366
+
"name": "vendorAdapter",
1367
+
"packetName": "@org/vendorAdapter"
1368
+
}
1369
+
}
1370
+
```
1371
+
1372
+
The js-controller will alias the package name to the adapter name on installation.
1373
+
This has one drawback, which is normally not relevant for vendor setups. You can not install the adapter via the `npm url` command, meaning no installation from GitHub or local tarballs.
1374
+
1375
+
#### Token setup
1376
+
On the customers ioBroker host, create a `.npmrc` file inside of `/home/iobroker/`.
1377
+
It should look like:
1378
+
1379
+
```
1380
+
//npm.pkg.github.com/:_authToken=<YOUR_TOKEN>
1381
+
@org:registry=https://npm.pkg.github.com
1382
+
```
1383
+
1384
+
Where `YOUR_TOKEN` is an access token which has the permissions to read packages.
1385
+
A best practice working with multiple customers is, to create an organization for each customer instead of using your personal scope.
1386
+
Hence, you can scope them to not have access to packages of other customers or your own.
1387
+
1388
+
Find more information in the [documentation](https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#auth-related-configuration).
1389
+
1321
1390
## Release cycle and Development process overview
1322
1391
The goal is to release an update for the js-controller roughly all 6 months (April/September). The main reasons for this are shorter iterations and fewer changes that can be problematic for the users (and getting fast feedback) and also trying to stay up-to-date with the dependencies.
Copy file name to clipboardExpand all lines: packages/cli/src/lib/setup/setupInstall.ts
+42-86Lines changed: 42 additions & 86 deletions
Original file line number
Diff line number
Diff line change
@@ -148,29 +148,28 @@ export class Install {
148
148
/**
149
149
* Download given packet
150
150
*
151
-
* @paramrepoUrl
152
-
* @param packetName
151
+
* @paramrepoUrlOrRepo repository url or already the repository object
152
+
* @param packetName name of the package to install
153
153
* @param options options.stopDb will stop the db before upgrade ONLY use it for controller upgrade - db is gone afterwards, does not work with stoppedList
154
-
* @param stoppedList
154
+
* @param stoppedList list of stopped instances (as instance objects)
consterrMessage=`Unknown packet name ${packetName}. Please install packages from outside the repository using "${tools.appNameLowerCase} url <url-or-package>"!`;
201
+
console.error(`host.${hostname}${errMessage}`);
202
+
thrownewIoBrokerError({
203
+
code: EXIT_CODES.UNKNOWN_PACKET_NAME,
204
+
message: errMessage,
205
+
});
206
+
}
207
+
208
+
options.packetName=packetName;
209
+
options.unsafePerm=source.unsafePerm;
200
210
201
211
// Check if flag stopBeforeUpdate is true or on windows we stop because of issue #1436
`host.${hostname} Adapter "${packetName}" can be updated only together with ${tools.appName.toLowerCase()}.js-controller`,
269
-
);
270
-
return{ packetName, stoppedList };
271
-
}
272
-
}
273
-
274
-
console.error(
275
-
`host.${hostname} Unknown packet name ${packetName}. Please install packages from outside the repository using "${tools.appNameLowerCase} url <url-or-package>"!`,
276
-
);
277
-
thrownewIoBrokerError({
278
-
code: EXIT_CODES.UNKNOWN_PACKET_NAME,
279
-
message: `Unknown packetName ${packetName}. Please install packages from outside the repository using npm!`,
280
-
});
236
+
return{ packetName, stoppedList };
281
237
}
282
238
283
239
/**
284
240
* Install npm module from url
285
241
*
286
-
* @param npmUrl
287
-
* @param options
242
+
* @param npmUrl parameter passed to `npm install <npmUrl>`
0 commit comments