Add the coreapp skill; fix /data ownership; deploy --recreate, shell <cmd>
skills/coreapp/SKILL.md teaches a Claude Code agent to make or port an app for Federated Core: coreapp.toml, the needs, porting an existing app, the deploy and test loop, troubleshooting, what isn't supported yet and how to report back. update.sh links it into ~/.claude/skills/coreapp; uninstall.sh removes the link. Rehearsed with a small app (memo-board) ported by a fresh agent using only the skill. The installer now gives /data to the image's user before starting the container: Docker created it as root, so non-root apps couldn't write. coreapp deploy --recreate always starts a new container (to test that data survives); coreapp shell '<command>' runs one command without a terminal. PLAN.md: what would change on the Core to put the installer in /federated/bin/coreapps/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+20
-7
@@ -6,11 +6,13 @@
|
||||
# coreapp new [--postgres] [--sso] <name>
|
||||
# make a new app in ./<name> (with its own database,
|
||||
# sign-in through the Core's Authelia, or both)
|
||||
# coreapp deploy build, copy to the Core, install or update
|
||||
# coreapp deploy [--recreate]
|
||||
# build, copy to the Core, install or update
|
||||
# (--recreate: a new container even if nothing changed)
|
||||
# coreapp check the app answers at https://<name>.<domain>/
|
||||
# coreapp status its container, address and URL
|
||||
# coreapp logs [-f] its log
|
||||
# coreapp shell a shell in its container
|
||||
# coreapp shell [command] a shell in its container, or run one command there
|
||||
# coreapp remove uninstall it from the Core (asks first)
|
||||
# coreapp list the apps on the Core installed this way
|
||||
#
|
||||
@@ -187,7 +189,12 @@ cmd_new() {
|
||||
# --- deploy -----------------------------------------------------------------
|
||||
|
||||
cmd_deploy() {
|
||||
local plan state tier answer local_id core_id addon=""
|
||||
local plan state tier answer local_id core_id addon="" recreate=""
|
||||
case "${1:-}" in
|
||||
--recreate) recreate=--recreate ;;
|
||||
"") ;;
|
||||
*) die "Usage: coreapp deploy [--recreate]" ;;
|
||||
esac
|
||||
load_app
|
||||
|
||||
echo "Updating the installer on the Core ($REMOTE_INSTALLER)..."
|
||||
@@ -220,7 +227,7 @@ cmd_deploy() {
|
||||
|
||||
# Install, or update (which recreates the container if the image changed,
|
||||
# even under the same version)
|
||||
installer install $addon || exit 1
|
||||
installer install $addon $recreate || exit 1
|
||||
[[ "$state" == new ]] && echo "(coreapp check tests it from the internet.)"
|
||||
return 0
|
||||
}
|
||||
@@ -278,7 +285,13 @@ cmd_logs() {
|
||||
|
||||
cmd_shell() {
|
||||
load_app
|
||||
core_tty "docker exec -it $NAME sh -c 'command -v bash > /dev/null && exec bash || exec sh'"
|
||||
if [[ $# -gt 0 ]]; then
|
||||
# One command, without a terminal, so scripts and agents can use it:
|
||||
# coreapp shell 'ls -l /data'
|
||||
core "docker exec $NAME sh -c $(printf '%q' "$*")"
|
||||
else
|
||||
core_tty "docker exec -it $NAME sh -c 'command -v bash > /dev/null && exec bash || exec sh'"
|
||||
fi
|
||||
}
|
||||
|
||||
cmd_remove() {
|
||||
@@ -302,11 +315,11 @@ cmd="${1:-help}"
|
||||
[[ $# -gt 0 ]] && shift
|
||||
case "$cmd" in
|
||||
new) cmd_new "$@" ;;
|
||||
deploy) cmd_deploy ;;
|
||||
deploy) cmd_deploy "$@" ;;
|
||||
check) cmd_check ;;
|
||||
status) cmd_status ;;
|
||||
logs) cmd_logs "$@" ;;
|
||||
shell) cmd_shell ;;
|
||||
shell) cmd_shell "$@" ;;
|
||||
remove | rm) cmd_remove ;;
|
||||
list | ls) cmd_list ;;
|
||||
help | -h | --help) usage ;;
|
||||
|
||||
Reference in New Issue
Block a user