Access, licenses and personal account

Everything lives on https://pulse.avacloude.ru - this is the same server that distributes updates and receives error reports (cloud/, Fastify + SQLite).

What does a person see

Page Why
/ Showcase: what is Pulse, installers for macOS, Windows and Ubuntu
/signup Get access using a code from the owner: email, name, password → license immediately
/account Personal account: license key, plan, term, remaining days; Login by email and password
/admin Owner page: issue code, view and revoke licenses

How to grant access

  1. Open https://pulse.avacloude.ru/admin, enter ADMIN_TOKEN server (located in cloud/.deploy/admin.env, on the server - in /opt/pulse-cloud/.env). The token is stored only in the browser tab and is not sent anywhere other than the request header.
  2. Fill in “to”, license term in days (empty - unlimited) and number of uses.
  3. The button displays a code that looks like XXXX-XXXX and a ready link https://pulse.avacloude.ru/signup?code=XXXX-XXXX - and send it to the person.

A person opens the link, enters their email and password, receives a license and downloads the installer. A confirmation email is not needed: the access code already proves that you allowed it, so the account is immediately considered confirmed. This is important because the server has not yet configured SMTP and the letter simply would not go through.

The same without the page, with the command:

# access code for 365 days, one use
curl -X POST https://pulse.avacloude.ru/admin/invites \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \
  -d '{"note":"Ivan","licenseDays":365,"maxUses":1}'

# license directly to your email, no code
curl -X POST https://pulse.avacloude.ru/admin/licenses \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \
  -d '{"email":"ivan@example.com","days":365,"note":"by agreement"}'

What is a license

Row in table licenses: key PULSE-XXXXX-XXXXX-XXXXX, plan, deadline and review mark. The license belongs to the account, not the machine: a person logs in with the same email and password on any of his computers, and the license works everywhere. There is no limit on the number of devices yet - field seats exists in the table, but is not checked, although the machine registry already exists: table machines (migration 0006_machines) and routes /machines (list, renaming, review), see Mobile remote control.

States: active, expired (deadline expired) revoked (revoked by owner). Feedback is more important than deadline.

What happens without a license

Application blocked: Pulse refuses to create tasks, launch sessions and make turns, but on the screen explains what happened and leads to your personal account.

The decision is made not based on the server response or the settings file, but based on signatures. The server signs the rights impression with the key Ed25519 (the private part is only on the server, /opt/pulse-cloud/license-key.pem), the application verifies it with a hardwired public key (src/main/cloud/licenseToken.ts). Therefore:

  • You cannot set up your server and issue yourself a license - the signature will not match;
  • edit pulse-settings.json it makes no sense - the same signed cast is there;
  • the real border is in main (guardLicense in src/main/ipc.ts), and not in the window.

States and what a person sees:

Condition When What's on offer
no license logged in, but access was not granted activate the code in your account
the deadline has expired the license has expired extend
cast is outdated more than 30 days without connection to the server connect to the network and click “Check”
the signature didn't match the settings file has been changed or the server is foreign login again

Offline allowed for the duration of the impression - by default 30 days (LICENSE_TOKEN_DAYS). It is impossible to work longer without communication: otherwise it would be enough to turn off the network forever. Change clocks back does not help: the server time since the last connection serves as a lower bound.

Run from source (npm run dev, live runs) does not require a license - otherwise development would have stopped. The assembled application always has a check; You can force enable it in development using a variable PULSE_ENFORCE_LICENSE=1.

Switch on the server. LICENSE_REQUIRED=false in /opt/pulse-cloud/.env returns beta mode, where anyone registered gets a plan. This is insurance in case of disaster: it works immediately after the service is restarted, there is no need to update the application.

Login and security

  • Access code - 8 characters from the alphabet without similar characters (no O, 0, I, 1), plus a limitation: 10 activation attempts from one address in 10 minutes.
  • A one-time code cannot be redeemed twice; the usage counter is incremented in the same transaction.
  • The code cannot intercept busy mail: if the address already has a password, activation is rejected. Otherwise, the access code could be used to change the password of a stranger.
  • The account keeps tokens in the browser (localStorage) and renews the rancid one through /auth/refresh. Values entered by a person enter the page only through textContent — the markings cannot be assembled from them.

What's left

  • SMTP. So far there are no letters at all: password recovery and logging in using the code from the letter do not work. Need mailbox details in /opt/pulse-cloud/.env (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM) and NODE_ENV=production.
  • Payment. Now access is granted manually; There is no payment gateway. Decisions on tariffs, provider and testing in test mode are recorded payment acceptance protocol.
  • Check seats according to the device register. The machine registry itself is implemented (migration 0006_machines, routes /machines: list, rename, review); All that remains is to apply it to the license - the limit on the number of machines has not yet been checked.

Third Party Kits in Pulse Code

What License Where How to update
Lucide (UI icon shapes - grammar, not a copy of the set) ISC src/renderer/src/components/ui/icons.tsx hands according to the DS guide
Material Icon Theme 5.39.0 (file icon theme “Material”) MIT, Material Extensions src/renderer/src/assets/file-icons/material/ (SVG, map, LICENSE) node scripts/vendor-material-icons.mjs <version>