Skill consistency pass; pick -N releases from a repository
coreapp install <url> without a tag and coreapp update now count -N tags (v6.2.0-1) as releases, the same rule as the version ordering. Skill and README: a new account's first sign-in is repeated by deleting the user in the app; deploy and publish build the Dockerfile, not the Core; health paths should answer 2xx; the right cross-reference for waiting at startup; the update log's name; a description that covers mysql, mail, updating and publishing; updating.md and --form in README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -95,7 +95,7 @@ each new app explains the files and the settings it gets.
|
|||||||
| `coreapp core` | What the Core in the VM offers apps: PostgreSQL (and which extensions an app can enable), MariaDB, Authelia, the mail server and Traefik with their versions, Docker, and the machine |
|
| `coreapp core` | What the Core in the VM offers apps: PostgreSQL (and which extensions an app can enable), MariaDB, Authelia, the mail server and Traefik with their versions, Docker, and the machine |
|
||||||
| `coreapp mail` | What the Core's mail server did with the mail the app sent in the last day: accepted from its account, then delivered, deferred or bounced, with the reason (apps with `email`) |
|
| `coreapp mail` | What the Core's mail server did with the mail the app sent in the last day: accepted from its account, then delivered, deferred or bounced, with the reason (apps with `email`) |
|
||||||
| `coreapp inbox [--clear]` | The mail the Core's test account (`coreapp.test@<domain>`) got, the newest 10 with sender, subject and text (HTML as text, links' addresses shown), to check what the app sends; `--clear` empties it |
|
| `coreapp inbox [--clear]` | The mail the Core's test account (`coreapp.test@<domain>`) got, the newest 10 with sender, subject and text (HTML as text, links' addresses shown), to check what the app sends; `--clear` empties it |
|
||||||
| `coreapp signin [path]` | Sign in to it as a browser would, with the Core's test account (`coreapp.test@<domain>`, made on the VM's Core when first needed), starting at `path` (default `/login`), and show each step; `--cookies <file>` keeps the app's cookies, `--code` gets a code for apps that start sign-in in the browser, `--remove-account` removes the account |
|
| `coreapp signin [path]` | Sign in to it as a browser would, with the Core's test account (`coreapp.test@<domain>`, made on the VM's Core when first needed), starting at `path` (default `/login`), and show each step; `--cookies <file>` keeps the app's cookies, `--form <action>` picks the sign-in button on a page with several, `--code` gets a code for apps that start sign-in in the browser, `--remove-account` removes the account |
|
||||||
| `coreapp status` / `logs [-f]` / `shell [command]` | Its container, its log, a shell in it (or one command, without a terminal) |
|
| `coreapp status` / `logs [-f]` / `shell [command]` | Its container, its log, a shell in it (or one command, without a terminal) |
|
||||||
| `coreapp list` | The apps on the Core installed this way |
|
| `coreapp list` | The apps on the Core installed this way |
|
||||||
| `coreapp install [--downgrade] <https://host/owner/repo>[@tag]` | Install a published app from its repository on the Core, as its owner would: shows what it is and needs, asks, then installs (default: the newest release tag; an older release than the installed one only with `--downgrade`) |
|
| `coreapp install [--downgrade] <https://host/owner/repo>[@tag]` | Install a published app from its repository on the Core, as its owner would: shows what it is and needs, asks, then installs (default: the newest release tag; an older release than the installed one only with `--downgrade`) |
|
||||||
@@ -180,6 +180,6 @@ stay installed.
|
|||||||
| `templates/app/` | What `coreapp new` starts from |
|
| `templates/app/` | What `coreapp new` starts from |
|
||||||
| `templates/postgres/`, `templates/sso/` | Example apps laid over it by `--postgres` / `--sso`: their files replace the base's; `*.append` files are added to the base file, `.remove` lists base files to drop, `.needs` goes into `needs` |
|
| `templates/postgres/`, `templates/sso/` | Example apps laid over it by `--postgres` / `--sso`: their files replace the base's; `*.append` files are added to the base file, `.remove` lists base files to drop, `.needs` goes into `needs` |
|
||||||
| `templates/postgres-sso/` | The example app when both are used |
|
| `templates/postgres-sso/` | The example app when both are used |
|
||||||
| `skills/coreapp/` | A Claude Code skill for making apps (`SKILL.md`, with `references/porting.md`, `references/sign-in.md` and `references/publishing.md` read when needed); `update.sh` links it into `~/.claude/skills/` |
|
| `skills/coreapp/` | A Claude Code skill for making apps (`SKILL.md`, with `references/porting.md`, `references/sign-in.md`, `references/publishing.md` and `references/updating.md` read when needed); `update.sh` links it into `~/.claude/skills/` |
|
||||||
| `uninstall.sh` | Removes what coreapp-dev set up |
|
| `uninstall.sh` | Removes what coreapp-dev set up |
|
||||||
| [PLAN.md](PLAN.md), [TEST.md](TEST.md) | What's next, and how to test it |
|
| [PLAN.md](PLAN.md), [TEST.md](TEST.md) | What's next, and how to test it |
|
||||||
|
|||||||
@@ -262,7 +262,9 @@ The Core's own scripts trace secrets, so their output goes to
|
|||||||
refused before building ("has version 6.2.0 installed; 6.1.9 is
|
refused before building ("has version 6.2.0 installed; 6.1.9 is
|
||||||
older ... add --downgrade"); `coreapp deploy --downgrade` deploys it;
|
older ... add --downgrade"); `coreapp deploy --downgrade` deploys it;
|
||||||
`6.2.0-1` and the same `6.2.0` deploy without asking. Releases order
|
`6.2.0-1` and the same `6.2.0` deploy without asking. Releases order
|
||||||
`v1.2.0` < `v1.2.0-2` < `v1.10.0`. `coreapp status` shows "This
|
`v1.2.0` < `v1.2.0-2` < `v1.10.0`, and `coreapp install <url>` without
|
||||||
|
a tag (and `coreapp update`) picks `v6.2.0-1` over `v6.2.0`; tags like
|
||||||
|
`v6.2.0-rc1` aren't releases. `coreapp status` shows "This
|
||||||
folder: ..." and "Installed version: 6.2.0" from the Core.
|
folder: ..." and "Installed version: 6.2.0" from the Core.
|
||||||
5j. A container that fails to start (prints a line and exits): deploy
|
5j. A container that fails to start (prints a line and exits): deploy
|
||||||
prints the end of its log and "Its whole log, from its first start:
|
prints the end of its log and "Its whole log, from its first start:
|
||||||
|
|||||||
+1
-2
@@ -133,7 +133,6 @@ EXTENSION = r"[a-z0-9][a-z0-9_-]{0,62}"
|
|||||||
# the URL. Tags: v + a version; releases (picked by default) are numeric.
|
# the URL. Tags: v + a version; releases (picked by default) are numeric.
|
||||||
REPO_URL = r"https://[A-Za-z0-9.-]+(?::[0-9]{1,5})?(?:/[A-Za-z0-9._-]+){2,}?(?:\.git)?/?"
|
REPO_URL = r"https://[A-Za-z0-9.-]+(?::[0-9]{1,5})?(?:/[A-Za-z0-9._-]+){2,}?(?:\.git)?/?"
|
||||||
TAG = r"v[A-Za-z0-9][A-Za-z0-9._-]{0,63}"
|
TAG = r"v[A-Za-z0-9][A-Za-z0-9._-]{0,63}"
|
||||||
RELEASE_TAG = r"v[0-9]+(?:\.[0-9]+)*"
|
|
||||||
# git for untrusted repositories: https only, never asks for a password,
|
# git for untrusted repositories: https only, never asks for a password,
|
||||||
# ignores the system's and root's git settings
|
# ignores the system's and root's git settings
|
||||||
GIT_ENV = {"PATH": "/usr/bin:/bin", "GIT_TERMINAL_PROMPT": "0",
|
GIT_ENV = {"PATH": "/usr/bin:/bin", "GIT_TERMINAL_PROMPT": "0",
|
||||||
@@ -584,7 +583,7 @@ def fetch_repo(arg, staging):
|
|||||||
+ no_access)
|
+ no_access)
|
||||||
tags = [line.split("refs/tags/", 1)[1] for line in out.stdout.decode().splitlines()
|
tags = [line.split("refs/tags/", 1)[1] for line in out.stdout.decode().splitlines()
|
||||||
if "refs/tags/" in line]
|
if "refs/tags/" in line]
|
||||||
releases = [t for t in tags if re.fullmatch(RELEASE_TAG, t)]
|
releases = [t for t in tags if is_release(t)]
|
||||||
if not releases:
|
if not releases:
|
||||||
raise Refused(f"{url} has no release tags (like v1.2.0). Publish a release "
|
raise Refused(f"{url} has no release tags (like v1.2.0). Publish a release "
|
||||||
"(coreapp publish tags it), or name a tag: <url>@<tag>.")
|
"(coreapp publish tags it), or name a tag: <url>@<tag>.")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: coreapp
|
name: coreapp
|
||||||
description: Build, port and test apps ("Coreapps") for Federated Core with coreapp-dev. Use this whenever someone wants to make an app run on a Federated Core, package an existing web app or repository for a Core, write or fix a coreapp.toml, give an app sign-in with Core accounts (Authelia) or a database on the Core's PostgreSQL, or deploy and test an app on the Core in the local coreapp-dev VM (coreapp deploy, coreapp check), even if they just say "make this work on our Core" or "Coreapp".
|
description: Build, port and test apps ("Coreapps") for Federated Core with coreapp-dev. Use this whenever someone wants to make an app run on a Federated Core, package an existing web app or repository for a Core, write or fix a coreapp.toml, give an app sign-in with Core accounts (Authelia) or a database on the Core's PostgreSQL, a database on MySQL/MariaDB, sending mail through the Core, deploy and test an app on the Core in the local coreapp-dev VM (coreapp deploy, coreapp check, coreapp signin, coreapp inbox), update an app to a new upstream version, or publish a release that Cores install from its repository (coreapp publish, coreapp install), even if they just say "make this work on our Core" or "Coreapp".
|
||||||
---
|
---
|
||||||
|
|
||||||
# Making apps for Federated Core
|
# Making apps for Federated Core
|
||||||
@@ -86,7 +86,7 @@ that are read by shell and YAML:
|
|||||||
not ending with `-`. Names of Federated's own apps (nextcloud, gitea,
|
not ending with `-`. Names of Federated's own apps (nextcloud, gitea,
|
||||||
listmonk, ..., including ones not installed) and the Core's hostnames
|
listmonk, ..., including ones not installed) and the Core's hostnames
|
||||||
(www, mail, ...) are refused: check `coreapp core`'s "Names apps can't
|
(www, mail, ...) are refused: check `coreapp core`'s "Names apps can't
|
||||||
use" before choosing one. For an app Federated also offers, use another
|
use" (Workflow, step 1) before choosing one. For an app Federated also offers, use another
|
||||||
name (e.g. `listmonk-app`) and keep its usual `title`.
|
name (e.g. `listmonk-app`) and keep its usual `title`.
|
||||||
- `title`: up to 40 letters, digits, spaces and `. , ! ? ( ) & + _ -`.
|
- `title`: up to 40 letters, digits, spaces and `. , ! ? ( ) & + _ -`.
|
||||||
- `description`: up to 200 characters, no `"`, `$`, backtick, `\`, `@` or
|
- `description`: up to 200 characters, no `"`, `$`, backtick, `\`, `@` or
|
||||||
@@ -292,7 +292,7 @@ Core's spam filter files it as junk.
|
|||||||
To test the app's mail, send to the Core's test account,
|
To test the app's mail, send to the Core's test account,
|
||||||
`coreapp.test@<domain>`, which has a mailbox: trigger the mail the app's
|
`coreapp.test@<domain>`, which has a mailbox: trigger the mail the app's
|
||||||
usual way (a password reset, an invitation or a notification for that
|
usual way (a password reset, an invitation or a notification for that
|
||||||
address; `coreapp signin` first if the app only knows people who signed
|
address; `coreapp signin` (step 3) first if the app only knows people who signed
|
||||||
in), then `coreapp inbox` shows what arrived (sender, subject and text,
|
in), then `coreapp inbox` shows what arrived (sender, subject and text,
|
||||||
HTML as text with each link's address), so you can check it and follow
|
HTML as text with each link's address), so you can check it and follow
|
||||||
its link. `coreapp inbox --clear` empties it before a test. If nothing
|
its link. `coreapp inbox --clear` empties it before a test. If nothing
|
||||||
@@ -464,6 +464,7 @@ Common causes:
|
|||||||
The installer's own log (the Core's install scripts) is on the Core in
|
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;
|
`/federated/logs/coreapps/`. It contains secrets, so don't print it in full;
|
||||||
look at the end of it with `coreapp-vm ssh tail -n 40 /federated/logs/coreapps/<name>-install.log`
|
look at the end of it with `coreapp-vm ssh tail -n 40 /federated/logs/coreapps/<name>-install.log`
|
||||||
|
(`<name>-update.log` for an update)
|
||||||
only when a deploy fails in the installer itself. It's a shell trace
|
only when a deploy fails in the installer itself. It's a shell trace
|
||||||
(`bash -x`): look for the last command before the error, not for words.
|
(`bash -x`): look for the last command before the error, not for words.
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ SKILL.md), and make the Dockerfile fit the Core:
|
|||||||
sharing the Dockerfile), keep those working: choose the Core's behaviour
|
sharing the Dockerfile), keep those working: choose the Core's behaviour
|
||||||
in the app when `CORE_DOMAIN` is set (the Core's variables become
|
in the app when `CORE_DOMAIN` is set (the Core's variables become
|
||||||
defaults; the app's own explicit settings still win), not by changing
|
defaults; the app's own explicit settings still win), not by changing
|
||||||
the Dockerfile's `ENV` or `ENTRYPOINT` for everyone. The Core builds the
|
the Dockerfile's `ENV` or `ENTRYPOINT` for everyone. `coreapp deploy` and `coreapp publish` build the
|
||||||
`Dockerfile` at the repository's root. Where the app's settings have
|
`Dockerfile` at the repository's root. Where the app's settings have
|
||||||
another shape (a mail URL instead of `SMTP_*`, a database URL, a hex
|
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
|
key), build them from the Core's variables where the app loads its
|
||||||
@@ -123,7 +123,8 @@ SKILL.md), and make the Dockerfile fit the Core:
|
|||||||
placeholder. `coreapp deploy` and `publish` say if it's unusable, not
|
placeholder. `coreapp deploy` and `publish` say if it's unusable, not
|
||||||
square or under 80 pixels; `publish` refuses one the Core can't use.
|
square or under 80 pixels; `publish` refuses one the Core can't use.
|
||||||
- **Answer on `health`** once ready (a dedicated health endpoint, or `/` if
|
- **Answer on `health`** once ready (a dedicated health endpoint, or `/` if
|
||||||
it returns 2xx-4xx without signing in).
|
it returns 2xx without signing in: `coreapp check` needs a 2xx, though
|
||||||
|
deploy accepts anything below 500).
|
||||||
- **One container.** If the upstream project ships a compose file with
|
- **One container.** If the upstream project ships a compose file with
|
||||||
several services, keep only the app, use `needs = ["postgres"]` (or
|
several services, keep only the app, use `needs = ["postgres"]` (or
|
||||||
`["mysql"]` for MySQL/MariaDB) for its database, and stop if it needs other services (see "Not available yet").
|
`["mysql"]` for MySQL/MariaDB) for its database, and stop if it needs other services (see "Not available yet").
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ person has signed in, so a curl of the authorize URL can't show those are
|
|||||||
right; `coreapp signin` can. Changing `[sso]` and deploying registers the
|
right; `coreapp signin` can. Changing `[sso]` and deploying registers the
|
||||||
client again; Authelia restarts for it (a few seconds of 404s from it).
|
client again; Authelia restarts for it (a few seconds of 404s from it).
|
||||||
Many apps fetch discovery only once at startup: wait for it in the
|
Many apps fetch discovery only once at startup: wait for it in the
|
||||||
entrypoint (SKILL.md, "Wait for what it needs at startup").
|
entrypoint (porting.md, "Wait for what it needs at startup").
|
||||||
|
|
||||||
Use the app's own OpenID Connect support or its framework's library: most
|
Use the app's own OpenID Connect support or its framework's library: most
|
||||||
self-hosted apps have "generic OIDC" settings that map onto `OIDC_*`. Set
|
self-hosted apps have "generic OIDC" settings that map onto `OIDC_*`. Set
|
||||||
@@ -132,7 +132,7 @@ says whether it got back to the app signed in. Run it in the app's folder
|
|||||||
coreapp signin # starts at /login
|
coreapp signin # starts at /login
|
||||||
coreapp signin /auth/login # the app's own page that starts sign-in
|
coreapp signin /auth/login # the app's own page that starts sign-in
|
||||||
coreapp signin /signin # a page whose button starts sign-in: pressed
|
coreapp signin /signin # a page whose button starts sign-in: pressed
|
||||||
coreapp signin /auth/login # or whose "Sign in with Core SSO" link starts it: followed
|
coreapp signin /login # or whose "Sign in with Core SSO" link starts it: followed
|
||||||
jar=$(mktemp) && coreapp signin --cookies "$jar" /login && curl -b "$jar" https://<name>.<domain>/api/me
|
jar=$(mktemp) && coreapp signin --cookies "$jar" /login && curl -b "$jar" https://<name>.<domain>/api/me
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ and publish commands around it.
|
|||||||
(`v<version>`). For a port, follow upstream's version (`6.2.0`); for a
|
(`v<version>`). For a port, follow upstream's version (`6.2.0`); for a
|
||||||
release that changes only the Coreapp on the same upstream version (the
|
release that changes only the Coreapp on the same upstream version (the
|
||||||
entrypoint, a setting), add `-N` (`6.2.0-1`, `6.2.0-2`): the Core orders
|
entrypoint, a setting), add `-N` (`6.2.0-1`, `6.2.0-2`): the Core orders
|
||||||
`6.2.0` < `6.2.0-1` < `6.2.1`. Raise it for every release; while you're
|
`6.2.0` < `6.2.0-1` < `6.2.1`, and `coreapp install <url>` and
|
||||||
|
`coreapp update` pick the newest that way. Raise it for every release; while you're
|
||||||
trying things on your own Core, you don't need to.
|
trying things on your own Core, you don't need to.
|
||||||
|
|
||||||
A Core refuses an older version than the one it has, unless asked:
|
A Core refuses an older version than the one it has, unless asked:
|
||||||
@@ -46,8 +47,9 @@ Test it over an install that has real data, not a fresh one:
|
|||||||
user), so you can compare after.
|
user), so you can compare after.
|
||||||
3. Deploy the new version over it and compare: the data, the settings
|
3. Deploy the new version over it and compare: the data, the settings
|
||||||
the Core writes (sign-in and mail still work), sessions, uploads. Sign
|
the Core writes (sign-in and mail still work), sessions, uploads. Sign
|
||||||
in again, and as a brand-new account (`coreapp signin --remove-account`
|
in again, and as a brand-new account (delete the test account's user
|
||||||
first): new versions change first sign-in and roles.
|
in the app first, as sign-in.md says): new versions change first
|
||||||
|
sign-in and roles.
|
||||||
4. `coreapp deploy --recreate` once more on the new version.
|
4. `coreapp deploy --recreate` once more on the new version.
|
||||||
|
|
||||||
To see a failed update roll back, deploy a throwaway version (say
|
To see a failed update roll back, deploy a throwaway version (say
|
||||||
|
|||||||
Reference in New Issue
Block a user