In this chapter we will make an organization, publish our application under it, and link a second server so it can install the package too. By the end, exampleco-hello will install on that server, and on no one else's.
A package we publish as a developer installs only on our own license. An organization's packages install on the licenses of its members and of the servers linked to it.
Make an organization
From the shell in the nextweb-tour folder:
pkg org create examplecoCreated organization exampleco; you are its owner.
Build for it with "owner": "exampleco" in .nextwebrc; its packages are named exampleco-<name>.An organization's handle comes from the same pool as developer handles, so it has to differ from ours.
Build for it
Add an owner line at the top of hello/.nextwebrc:
{
"owner": "exampleco",
"type": "application",Then open the shell from the hello folder again, and build and publish under the organization's name:
pkg create exampleco-hello 0.1.0Building exampleco-hello 0.1.0 for exampleco (internal)...
Built and registered dist/exampleco-hello_0.1.0_all.zip.enc
owner exampleco (organization, you are owner)
files 1; source not encrypted
package key akek-47e612454fee
sha256 c96f81d411d5f4edbe862e984bc58441714b1f164f257a4ac61a0de59ee089f2
size 1453 bytes
Next: pkg validate, then pkg publish.pkg publishnote: no VM check report for this file (optional: pkg validate --vm)
Publishing exampleco-hello-0.1.0-all to https://cdn.nextwebjs.com...
Published: exampleco-hello-0.1.0-all (1453 bytes, sha256 c96f81d411d5f4edbe862e984bc58441714b1f164f257a4ac61a0de59ee089f2)
It installs on the licenses of exampleco's members and its linked servers: pkg install exampleco-helloThe package key is the organization's now, not ours. The last line names who can install it.
Invite a server
A server joins with a one-time token. We make one here:
pkg org license invite examplecoA one-time token for exampleco, valid until 2026-10-20 (shown once):
nwj_jNNDFug0agb-NXavQHx3owvrs0jQeNjC
On the server to link, run: pkg org join <token> -yCopy the token now: it is shown once, and it works once.
Join from the other server
On the second server, Nextweb is installed and started as in Open Nextweb, with a license of its own. Before it joins, our package doesn't install there:
pkg install exampleco-hello...
Installing exampleco-hello...
Installation failed: exampleco-hello 0.1.0 cannot be installed on this license: key release refused (NOT_AUTHORIZED): This package is internal to exampleco: it installs only on licenses of its members and linked servers.Joining is a command from the packaging tools, so the server installs them first:
pkg install nextweb-dev...
nextweb-dev 0.1.3 installed successfullyThen it joins with the token:
pkg org join nwj_jNNDFug0agb-NXavQHx3owvrs0jQeNjCJoining links this server's license to the organization: its internal packages will install
here, and they run as the user Nextweb runs as (often root under systemd).
Run again with -y to join.Read that before saying yes: a linked server runs whatever the organization publishes for it, with the same rights as Nextweb itself.
pkg org join nwj_jNNDFug0agb-NXavQHx3owvrs0jQeNjC -yThis license (98dd7737de88) is linked to exampleco; its internal packages install here.pkg install exampleco-helloResolving dependencies...
Architecture: x64 (auto-detected)
Installation order: exampleco-hello
Installing 1 package(s)...
Installing exampleco-hello...
exampleco-hello 0.1.0 installed successfullyFrom here, the server deploys it exactly as we did in Deploy your application.
Unlink it
When a server should stop receiving the organization's packages, its owner unlinks it by the fingerprint the join printed. Back in the nextweb-tour shell:
pkg org license remove exampleco 98dd7737de88Unlinked 98dd7737de88 from exampleco. Its cached keys run out within 7 days; nothing new installs there.What the server already installed stays there. Nothing of the organization's installs there from now on.
What we have now
An organization that owns our package, and a way to let a server install it and to take that back. People join an organization the same way, with pkg org invite, each as an owner, a publisher, or a member.