Activate a paid licence
din activate turns a paid licence key into the signed entitlement file that the field, the console and the plugin read. The free build needs none of this: with no entitlement file an install runs as the free tier.
DIN is prelaunch and no paid plan is on sale yet, so there are no licence keys to activate today. This page documents the command as it ships in release 1.0.31.
Online
din activate <LICENSE_KEY>
din activate - # the key read from stdin, so it stays out of your shell history
din activate # re-activate with the key already saved in license.key
This needs curl. din activate checks the key in with the issuer (by default https://api.dinctrl.com, changed with --url <BASE> or DIN_BILLING_URL) and receives a signed entitlement in reply. The key is handed to curl on stdin, never on its command line, so it does not show in a process listing.
Offline
din activate --file <PATH>
No network and no curl. The file is either the saved reply of a check-in (the JSON that POST /api/license/verify answered) or a bare signed envelope. On a machine that does have a network, the check-in din activate makes is:
printf '{"key":"%s"}' '<LICENSE_KEY>' | curl -sS -X POST -H 'content-type: application/json' --data-binary @- https://api.dinctrl.com/api/license/verify > reply.json
Carry reply.json to the offline box and pass it to --file. Where the bytes travelled does not matter: the signature is what is checked.
Nothing is written unless it verifies
Whatever arrives, from the network or from a file, is verified on your machine first, against the public key built into the program. It must verify, be in term, and say it is valid and entitled. Anything else is refused and nothing is written, so a bad activation never replaces a good file.
What it writes
<prefix>/.din/entitlement.json(by default~/din/.din/entitlement.json), whichdin licensereads and whichdin field startanddin consolehand to the programs they start.- The same bytes to
~/.din/entitlement.json(or$DIN_HOME/entitlement.json), the default a field or console started any other way, and the plugin, read. - If
DIN_ENTITLEMENT(orDASH_ENTITLEMENT) names a file, that one file only. - After an online activation with a new key, the key is saved to
<prefix>/.din/license.key, so a laterdin activateon its own re-activates.
Each file is written mode 600, through a temporary file and a rename, so a reader never sees half a file.
When it takes effect
The field re-reads the entitlement on its rescan tick (every 5 seconds by default), so the paid features switch on within seconds without a restart. A din console that is already running picks it up too: reload the page. It then shows your plan, what it includes, your agents and when the plan renews. din license shows the tier, and who decided it, at any time, and din status shows your plan, when it renews and your agents.
Renewing
A paid plan is billed by period, and each entitlement runs a few days past its period's billing date, so a renewal that lands a day late does not drop you to free. Your subscription gets a new key each period. While it is live and paid, the licensing service answers the key you saved with the current period's entitlement and the current key; din activate checks that key on your machine and saves it in place of the old one, so the next renewal presents a key from this period.
din activate --renew # check the saved key in again; prints nothing when it works
--renew uses the saved key only (give it no key and no --file). When it cannot renew it prints one line saying why, writes nothing, and the entitlement you have stays in place.
To have it done for you, run din autostart on (per user, no admin). On a paid install the login entry also runs din activate --renew: with systemd, two minutes after login and then daily; on Windows at logon and in a daily task named "DIN renew"; with a plain XDG autostart entry, at each login. If autostart was already on before you activated, din activate adds the renewal to it and says so. din autostart off removes it all.
Without autostart, nothing on your machine checks in on its own, on a timer or at start-up; the programs only check the signature locally. din license and din status show when the entitlement expires, and in its last week din status says how to renew. Run din activate --renew, or din activate with the new key from your account page, or --file with a saved reply, offline. If the entitlement has expired, activation says so ("renew, then activate again").
A hand-edited entitlement, another key's signature, or a lapsed term is read as the free tier. Nothing in your records is deleted on a lapse.