Skip to content

Add oac uninstall - #726

Merged
SaladDay merged 1 commit into
mainfrom
add-oac-uninstall
Oct 15, 2026
Merged

SaladDay merged 1 commit into
mainfrom
add-oac-uninstall

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • oac uninstall (new services/core/cmd/oac/uninstall.go, one dispatch line and usage text in main.go). It takes the installation lock, reads the Compose project from .env, shows the project, data volume, directory and installation ID, and asks for the directory name or yes. It then runs docker compose -p <project> down --volumes --remove-orphans (so no compose.yaml or cwd is needed), removes the directory, the lock and the Windows sidecar, and prints the installation ID with node and E2B follow-ups and the docker image rm command (images are kept so a reinstall doesn't re-pull). A second run prints "Nothing is installed in ." and exits 0. A refused confirmation or a failed down changes nothing and keeps the directory so the command can be rerun.
  • Windows: the running oac.exe cannot delete itself, so the command removes everything else and prints the Remove-Item line for the rest. The logic is tested on Linux with keep.
  • The installer's Web port unavailable message names an oac-* Compose project that publishes the port and gives the docker compose -p … down --volumes --remove-orphans recovery (builds on Explain Docker and permission failures in the installer #720's message).
  • execRunner gains a project field that prepends -p.
  • Docs (EN + zh, source_hash refreshed): operations.md#uninstall rewritten around the command, with the manual fallback for a deleted directory, the lock path and the installation ID source; --rmi all is dropped; new "Single-host backup and restore" at the top of Back up; Upgrade step 2 links to it; the port troubleshooting row mentions the orphaned project.

Why (audit-core finding 10, 11, section 4; probes-mx 3, 6, 7)

The manual uninstall left core.lock, needed the cwd and files, stranded containers when the directory was deleted first, pointed to an installation ID the command had just deleted, and --rmi all removed postgres:16-alpine so a reinstall needed Docker Hub.

Decisions

  • No --yes flag and no --install-dir: no caller needs them (the command lives in the installation directory it removes).
  • The installation ID is read before the volume goes, with docker compose run --rm --no-deps -T --entrypoint cat core /run/oac/installation.id (the init image is distroless and has no cat). If that fails, the prompt says where to find the ID and uninstall still works.
  • Backup/restore recipe uses docker run … tar on the already-pulled postgres:16-alpine, and docker compose up --no-start to create the volume on restore (a hand-made volume triggers Compose's "not created by Docker Compose" warning).

Verification

  • go vet ./services/core/cmd/oac, go test ./services/core/cmd/oac: pass; GOOS=windows go vet: pass.
  • Real Docker smoke (scratch project, removed afterwards): refused answer leaves everything; yes removes container, network, volume, directory and lock; installation ID printed; backup/restore recipe round trip preserves ownership and symlinks; cat ID read verified against the real core image with the real mount.
  • node --test website/tests/translations.test.mjs (3/3, with vitepress borrowed from another worktree), python3 scripts/core-distribution-manifest.test.py BundledDocsTests, python3 scripts/check-names.py: pass.
  • Skipped: full make check, Web checks (no Web change). Lane H's Log why a node cannot connect #717 did not touch operations.md; the installation ID source is Settings → Service and deployment → Installation details (verified in locales/en/system.ts, navigation.ts).

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@SaladDay
SaladDay force-pushed the add-oac-uninstall branch 2 times, most recently from 899d9a7 to abc31ac Compare October 15, 2026 12:51
@SaladDay
SaladDay merged commit 536e8d3 into main Oct 15, 2026
1 check passed
@SaladDay
SaladDay deleted the add-oac-uninstall branch October 15, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant