Fixes from the third Supermarket run: coreapp mail, route wait, skill edges
coreapp mail shows what the Core's mail server did with the app's mail (from its log: accepted, delivered, deferred or bounced). Deploy waits until traefik routes the public address, so it doesn't answer 404 just after "Updated". The skill's settings rules no longer contradict, the lowest role means read-only, the Core's admin gets no local password or reset, and SQLite may need allowing in an app's multi-user edition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+32
-13
@@ -127,7 +127,10 @@ using it runs, so deploy, `coreapp check` and a sign-in can all pass.
|
||||
|
||||
What's inside the image is the app's own: its language runtime, SQLite and
|
||||
other libraries are whatever the Dockerfile installs, not the Core's.
|
||||
SQLite in `/data` is a fine database for an app that supports it.
|
||||
SQLite in `/data` is a fine database for an app that supports it. An
|
||||
app's SQLite mode is often its single-user mode, though: if its multi-user
|
||||
edition insists on PostgreSQL or MySQL, allow SQLite there when it runs on
|
||||
a Core (`CORE_DOMAIN` set), rather than using the single-user edition.
|
||||
|
||||
## Needs
|
||||
|
||||
@@ -142,8 +145,8 @@ The Core makes a PostgreSQL user and database just for this app, and adds:
|
||||
| `DB_NAME`, `DB_USER` | `coreapp_<name>` with `-` as `_` (e.g. `coreapp_my_app`) |
|
||||
| `DB_PASSWORD` | random |
|
||||
|
||||
The server is PostgreSQL 17 (17.6 today; `coreapp status` shows the Core's
|
||||
version), shared with the Core's other apps; the app owns its database and
|
||||
The server is PostgreSQL 17 (17.6 today; `coreapp core` shows the Core's
|
||||
version, and `coreapp status` once the app needs it), shared with the Core's other apps; the app owns its database and
|
||||
nothing else. Check what version the app needs before choosing this (its
|
||||
docs, its own compose file's `postgres:` image, its migrations): features
|
||||
of a newer PostgreSQL fail only when the code that uses them runs, so a
|
||||
@@ -236,14 +239,18 @@ may log; it should retry).
|
||||
link), skip it on a Core: the Core's admin is the owner. If the app can't
|
||||
run without an owner (its pages say "not set up" until there is one),
|
||||
make `CORE_ADMIN_EMAIL` the owner at startup, without a password; it
|
||||
signs in with the Core. The example app
|
||||
signs in with the Core. That account signs in only with the Core: turn
|
||||
off the app's password sign-in and password reset for it, or its
|
||||
forgot-password page could give it a local password. The example app
|
||||
(`coreapp new --sso`) shows the check in `oidc.py`. `coreapp signin`
|
||||
signs in as the test account, not the admin, so ask the user to sign in
|
||||
once as `admin@<domain>` in a browser and check it gets the admin pages.
|
||||
- **Everyone else gets the lowest role.** Any other Core account (a person
|
||||
at the company) may sign in, with no invitation, and gets the app's
|
||||
lowest role (viewer, or whatever can do least). The app's admins raise
|
||||
people from there in the app. Don't hand out more by default, and don't
|
||||
lowest role that can still look around: read-only, seeing what the app
|
||||
shows its members but changing nothing (a viewer). Not "nothing until an
|
||||
admin grants access": they should find the app useful to look at. The
|
||||
app's admins raise people from there in the app. Don't hand out more by default, and don't
|
||||
require invitations for Core accounts. `coreapp signin` checks this: the
|
||||
test account should land with that role.
|
||||
- Discovery: `$OIDC_ISSUER/.well-known/openid-configuration`. The Core
|
||||
@@ -280,9 +287,13 @@ isn't delivered anywhere (the account has no mailbox), so set a reply-to
|
||||
if people should be able to answer. The account can't sign in to anything
|
||||
else on the Core. `coreapp new --email` adds the need (there's no example
|
||||
app for it). There's no inbox to check that a test message arrived: send
|
||||
one the app's usual way (e.g. a password reset for `coreapp.test@<domain>`)
|
||||
and check `coreapp logs` for mail errors; ask the user to confirm delivery
|
||||
to a real address.
|
||||
one the app's usual way (e.g. a password reset for `coreapp.test@<domain>`),
|
||||
then `coreapp mail`: what the Core's mail server did with each message from
|
||||
the app's account in the last day (accepted, then delivered, deferred or
|
||||
bounced, with the reason). Mail to `coreapp.test@<domain>` is accepted and
|
||||
then deferred ("451 ... Temporary internal error"), because the test
|
||||
account has no mailbox; that's expected and shows the app's sending
|
||||
works. Ask the user to confirm delivery to a real address.
|
||||
|
||||
### Not available yet
|
||||
|
||||
@@ -350,9 +361,12 @@ and make the Dockerfile fit the Core:
|
||||
them too, not only the server started by the entrypoint.
|
||||
- **Read settings from the environment**, mapping the Core's names to the
|
||||
app's in an entrypoint script or config file if they differ
|
||||
(`SECRET_KEY="$APP_SECRET"`, `DATABASE_URL=...`). Set the app's own
|
||||
variables outright rather than "only if unset": upstream images often set
|
||||
defaults in `ENV` (a SQLite path, a port) that would win otherwise.
|
||||
(`SECRET_KEY="$APP_SECRET"`, `DATABASE_URL=...`). In an entrypoint for
|
||||
an upstream image, set the app's variables outright rather than "only if
|
||||
unset": the image's own `ENV` defaults (a SQLite path, a port) would win
|
||||
otherwise, and on a Core nobody else sets them. (In the app's own code,
|
||||
as above, the Core's values are defaults that the app's explicit
|
||||
settings override: that's for its other editions, not upstream `ENV`.)
|
||||
- **Images without a shell** (built `FROM scratch` or distroless) can't run
|
||||
an entrypoint script, and `coreapp shell` can't open one. Copy a static
|
||||
busybox in and run the script with it:
|
||||
@@ -427,6 +441,10 @@ coreapp signin /signin # a page whose button starts sign-in: pressed
|
||||
coreapp signin --cookies jar /login && curl -b jar https://<name>.<domain>/api/me
|
||||
```
|
||||
|
||||
Like the other commands, run it in the app's folder (it reads
|
||||
`coreapp.toml`); the cookie jar can be anywhere, e.g. `--cookies
|
||||
"$TMPDIR/jar"`.
|
||||
|
||||
A page with a sign-in button (a form with only hidden fields, such as a
|
||||
CSRF token) is submitted as a person pressing it would; with several such
|
||||
forms, pick one with `--form <action>`. Don't add routes to the app just for
|
||||
@@ -450,7 +468,8 @@ pages, and that the admin gets the admin role).
|
||||
|
||||
| Command | Shows |
|
||||
|---|---|
|
||||
| `coreapp status` | Its container, address, port, needs, the Core's database version, URL |
|
||||
| `coreapp status` | Its container, address, port, needs, URL, and the Core's PostgreSQL or MariaDB version if it needs one |
|
||||
| `coreapp mail` | What the Core's mail server did with the mail it sent (apps with `email`) |
|
||||
| `coreapp logs` / `coreapp logs -f` | The app's own log |
|
||||
| `coreapp signin [path]` | Signs in with the Core's test account and shows each step |
|
||||
| `coreapp shell '<command>'` | Run one command in its container, e.g. `coreapp shell 'id; env; ls -l /data'` (without a command it opens an interactive shell, which needs a terminal) |
|
||||
|
||||
Reference in New Issue
Block a user