vela 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -5
- package/dist/bin.js +3427 -3176
- package/dist/bin.js.map +4 -4
- package/package.json +2 -2
- package/templates/minimal/_env.example +7 -0
- package/templates/server/apply.sh +37 -3
- package/templates/server/lib.sh +20 -3
- package/templates/server/systemd/vela-pb@.service +8 -0
- package/templates/server/systemd/vela-web@.service +8 -0
- package/templates/static/_env.example +2 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ That's a running app with a database behind it. No separate PocketBase install,
|
|
|
19
19
|
- **CRUD you didn't write.** `vela generate scaffold post title:text body:editor` gives you the model, schema, forms, and pages.
|
|
20
20
|
- **Describe it instead.** Pass `--ai "a blog post with tags and a cover image"` and review the collection it designs before anything is written.
|
|
21
21
|
- **shadcn-svelte components** on tap, and fixtures and seeds for realistic data while you work.
|
|
22
|
-
- **The app's name in code.** Every project keeps its name and public URL in `src/lib/site.ts`; canonical links, Open Graph images and feeds are built from it, and `vela dev` / `vela deploy`
|
|
22
|
+
- **The app's name in code.** Every project keeps its name and public URL in `src/lib/site.ts`; canonical links, Open Graph images and feeds are built from it, and `vela dev` / `vela deploy` hand the name to PocketBase as `APP_NAME` for the emails it sends. Nothing is written into its settings behind the admin panel's back.
|
|
23
23
|
- **Themed templates.** `vela create --template broadsheet` pulls a finished blog design from the template registry; `--template` lists what is available, grouped by category.
|
|
24
24
|
- **Linked from the start.** Logged in to velastack.dev, `vela create` links the new project there (`.vela/project.json`), so `vela deploy` reports to it and a CMS-ready template such as `hearth` reads from the project's free hosted CMS right away. `vela login` first if you are not; `vela link` does the same for a project you already have.
|
|
25
25
|
|
|
@@ -74,7 +74,7 @@ machine again. Every command takes the same selector — `-t local`, `-t product
|
|
|
74
74
|
|
|
75
75
|
```sh
|
|
76
76
|
vela targets # what exists, and where
|
|
77
|
-
vela env
|
|
77
|
+
vela env set STRIPE_SECRET_KEY -t production
|
|
78
78
|
vela admin create -t production # a login for the admin panel
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ Each deploy uploads an immutable release, runs migrations, restarts the app and
|
|
|
82
82
|
|
|
83
83
|
One deploy runs per target at a time. A second one started from another machine — CI and a laptop, say — waits for the first to finish (up to `--lock-wait` seconds, 300 by default; `0` gives up at once), and a release that is older than the one already live is dropped rather than put back in front of it. Release ids are stamped from the server's clock so every machine agrees on which is newer.
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
The build sees exactly what the target will run with: once a target has a database, the build renders against it over the same SSH connection (`--no-remote-db` to use a throwaway local one instead), and it runs with the target's environment rather than your `.env`. A key set only in `.env` is blanked for the build, and a `$env/static` import of one fails the deploy before anything is uploaded.
|
|
86
86
|
|
|
87
87
|
```sh
|
|
88
88
|
vela status # what is running, on which release
|
|
@@ -92,8 +92,37 @@ vela rollback # previous release, with its down migrations
|
|
|
92
92
|
|
|
93
93
|
`vela destroy deployment -t staging` removes a copy from its server. Its database and uploads stay behind unless you pass `--purge`, which snapshots them into `/var/lib/vela/trash` on the server (kept two weeks) before deleting. Removing production, or purging anything but a preview, asks you to type the app's name; from a script, pass `--confirm <app-name>` — `--yes` alone is not accepted for either.
|
|
94
94
|
|
|
95
|
-
These default to `production`; `vela
|
|
96
|
-
|
|
95
|
+
These default to `production`; `vela admin` defaults to `local`, because that is
|
|
96
|
+
the copy you are usually standing in. `vela env` has no default — see below.
|
|
97
|
+
|
|
98
|
+
## Environment
|
|
99
|
+
|
|
100
|
+
Everything that differs between environments is an environment variable, for the
|
|
101
|
+
app and for PocketBase alike. Locally that is `.env`, with `.env.example`
|
|
102
|
+
documenting what the app reads. On a server a target's environment is three
|
|
103
|
+
layers, lowest to highest, and a key in a higher layer wins:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
vela env set VELASTACK_API_KEY -t all # every target, on every server the app is deployed to
|
|
107
|
+
vela env set WHATSAPP_MODE -t preview # every preview
|
|
108
|
+
vela env set STRIPE_SECRET_KEY -t production # one target (or -t staging, -t preview:<branch>)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
A value is secret by default: written, never read back, shown as `••••`. Pass
|
|
112
|
+
`--public` for one that should read back (`vela env get`, values in `vela env
|
|
113
|
+
list`); `PUBLIC_*` keys are public without asking, since SvelteKit ships them to
|
|
114
|
+
the browser anyway. Setting a key again with or without `--public` moves it.
|
|
115
|
+
Values are always prompted for, never taken as an argument, so none lands in
|
|
116
|
+
shell history; a secret is typed without echo, a public value with. Without `-t`
|
|
117
|
+
the command asks which environment; `vela env list` with no `-t` shows every
|
|
118
|
+
scope at once.
|
|
119
|
+
|
|
120
|
+
PocketBase reads its own settings from the same environment — `APP_NAME` (from
|
|
121
|
+
`src/lib/site.ts`), `APP_URL` (the deploy's origin unless you say otherwise),
|
|
122
|
+
`PB_SMTP_*`, `PB_S3_*`, `PB_BACKUPS_S3_*`, and the WhatsApp plugin's
|
|
123
|
+
`WHATSAPP_*` / `VELASTACK_*` — and shows them locked in the admin panel. Nothing
|
|
124
|
+
in the repo carries environment but `.env.example`, and there is no project
|
|
125
|
+
config file.
|
|
97
126
|
|
|
98
127
|
Same thing from CI with [`velastack/action`](https://github.com/velastack/action).
|
|
99
128
|
|