45 lines
1.9 KiB
Markdown
45 lines
1.9 KiB
Markdown
# Capsule
|
||
|
||
Desktop companion for [The Tempus Project](https://TheTempusProject.com). Point it at a TTP site, sign in with a username and password or paste an API token, and work against that install from the desktop.
|
||
|
||
This replaces the old `TempusToolkit` Electron stub. The keepers were the login ? stored-token ? home flow. Hardcoded LAN URLs, `nodeIntegration`, and the leftover WoW-folder picker did not come along.
|
||
|
||
## Run it
|
||
|
||
From this folder (Windows source checkout is fine — Capsule is Node, not PHP):
|
||
|
||
```bash
|
||
npm install
|
||
npm run dev
|
||
```
|
||
|
||
`npm start` previews a production build. There is no local TTP site on the Windows checkout. Login needs a reachable install (typically the Ubuntu host) with `api/apiAccessPersonal` on for user-token calls.
|
||
|
||
## How auth works
|
||
|
||
All HTTP runs in the **main process**. The renderer never sees the token and never talks to the site directly, so TTP’s same-origin CORS policy does not apply.
|
||
|
||
| Action | Endpoint | Notes |
|
||
|--------|----------|-------|
|
||
| Password sign-in | `POST /api/login` | `username` + `password`, `application/x-www-form-urlencoded`. Same limiter as browser login. No CSRF, no Turnstile. |
|
||
| Confirm identity | `GET /api/users/find/{username}` | Bearer token. Returns a user id only. |
|
||
| Existing token | Admin ? Tokens | Personal or app token. Username is optional and only used for that find call. |
|
||
|
||
The token is stored under Electron `userData` (`session.json`). `safeStorage` encrypts it when the OS keychain is available.
|
||
|
||
App-facing pairing notes live with the PHP app: `repos/ttp/docs/capsule.md`.
|
||
|
||
## Layout
|
||
|
||
| Path | Job |
|
||
|------|-----|
|
||
| `src/main/` | Window, session file, TTP HTTP, IPC |
|
||
| `src/preload/` | `window.capsule` bridge |
|
||
| `src/renderer/` | Login view and connected workspace |
|
||
|
||
## Remote
|
||
|
||
This checkout starts with no git remote. When the repo exists on the project host:
|
||
|
||
`ssh://git@git.thetempusproject.com:2222/the-tempus-project/capsule.git`
|