Open WebUI rehearsal: coreapp shell sources /coreapp/env.sh
Settings an upstream image's entrypoint builds from the Core's (a database URL) go in /coreapp/env.sh, which the entrypoint sources and coreapp shell now sources too, for one command and interactively. Skill: that file; apps that migrate only inside the server; a pending role isn't read-only; a never-shown password when an app insists on one; keep the admin trigger when sso is dropped; $TMPDIR differs for any command outside the sandbox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -418,9 +418,10 @@ Common causes:
|
||||
check and its result (often the app refusing 127.0.0.1, see the porting
|
||||
checklist). An update rolls back; a first install stays, so deploy again
|
||||
once it's fixed.
|
||||
- `coreapp` runs outside the sandbox, where `$TMPDIR` is another folder:
|
||||
keep a file you pass between your shell and `coreapp` (or `docker cp`)
|
||||
in the app's folder, not in `$TMPDIR`.
|
||||
- Commands run outside the sandbox (`coreapp`, `docker`, anything with
|
||||
`dangerouslyDisableSandbox`) see another `$TMPDIR`: keep files they
|
||||
write or read in the app's folder (or a folder beside it), not in
|
||||
`$TMPDIR`.
|
||||
|
||||
The installer's own log (the Core's install scripts) is on the Core in
|
||||
`/federated/logs/coreapps/`. It contains secrets, so don't print it in full;
|
||||
|
||||
@@ -31,7 +31,10 @@ SKILL.md), and make the Dockerfile fit the Core:
|
||||
another shape (a mail URL instead of `SMTP_*`, a database URL, a hex
|
||||
key), build them from the Core's variables where the app loads its
|
||||
settings, so its command-line tools (`coreapp shell '<app> ...'`) get
|
||||
them too, not only the server started by the entrypoint.
|
||||
them too, not only the server started by the entrypoint. In an upstream
|
||||
image you can't change, put those lines (`export DATABASE_URL=...`) in
|
||||
`/coreapp/env.sh` and source it from the entrypoint: `coreapp shell`
|
||||
sources that file too.
|
||||
- **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=...`). In an entrypoint for
|
||||
@@ -48,7 +51,12 @@ SKILL.md), and make the Dockerfile fit the Core:
|
||||
not from the app's config, so export those in yours. If you need a step
|
||||
between its steps (after its migrations, before the server starts), run
|
||||
its migration command yourself in your entrypoint, then your step, then
|
||||
`exec` it (migrations are safe to run twice); editing the upstream
|
||||
`exec` it (migrations are safe to run twice). If the app has no
|
||||
migration command (it migrates when the server starts), call the
|
||||
function its server calls, from a short script in the app's language;
|
||||
run it from the app's folder with the app on the import path
|
||||
(`PYTHONPATH`), since a script in `/coreapp/` doesn't find the app's
|
||||
modules on its own. Editing the upstream
|
||||
script with `sed` is the last resort, since it breaks silently when the
|
||||
image changes.
|
||||
- **The image's `VOLUME`s** (`docker inspect -f '{{json .Config.Volumes}}'
|
||||
|
||||
@@ -94,13 +94,18 @@ else gets the lowest role that can look around. How:
|
||||
- If the app has its own first-run setup (an owner to create, a setup
|
||||
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.
|
||||
one), make `CORE_ADMIN_EMAIL` the owner at startup, without a password
|
||||
(or, if the app insists on one, a random one that is never shown or
|
||||
saved).
|
||||
- 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.
|
||||
- Other Core accounts join on their first Core sign-in, without an
|
||||
invitation, as read-only members (a viewer: they see what members see,
|
||||
change nothing). Not "nothing until an admin grants access".
|
||||
change nothing). Not "nothing until an admin grants access": a
|
||||
"pending" or "awaiting approval" role isn't read-only, it's locked out.
|
||||
If the app has no viewer role, use its regular user role and say so in
|
||||
your report.
|
||||
- The example app (`coreapp new --sso`) shows the admin check in `oidc.py`.
|
||||
- In an upstream image you can't change, use what it offers, in this
|
||||
order: a setting that names admins by email; its CLI or API at startup
|
||||
@@ -108,8 +113,9 @@ else gets the lowest role that can look around. How:
|
||||
rule has to hold on every sign-in and the app has no hook for it, a
|
||||
database trigger on its users table that touches only the
|
||||
`CORE_ADMIN_EMAIL` row (role, enabled, no password), made at startup by
|
||||
the entrypoint and explained in a comment. Say in your report which you
|
||||
used.
|
||||
the entrypoint and explained in a comment. Keep it if `sso` is dropped
|
||||
later: the admin rule holds without sign-in too. Say in your report
|
||||
which you used.
|
||||
|
||||
## Testing sign-in: coreapp signin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user