-
Notifications
You must be signed in to change notification settings - Fork 4
mainsync #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
mainsync #140
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
60914e3
Merge pull request #130 from automagik-dev/dev
namastex888 a07ade7
release: v3.0.0 — autopg org transfer + install.sh bootstrap repair
namastex888 ac76c56
Merge pull request #131 from automagik-dev/release/v3.0.0
namastex888 5c910a1
fix(release): scratch unbound var aborts every build-tarballs job
namastex888 657792a
Merge pull request #132 from automagik-dev/fix/fetch-postgres-bins-sc…
namastex888 aa4cbfe
release: v3.0.1 — first published v3 (post build-tarballs fix)
namastex888 5264524
Merge pull request #133 from automagik-dev/release/v3.0.1
namastex888 5add9bd
[skip ci] release v3.0.2
github-actions[bot] 6dea824
fix(release): repair v3 signed-release pipeline (Bugs #1a/#1b/#2/#3)
claude 3be462b
Merge pull request #134 from automagik-dev/fix/v3-build-pipeline-vers…
namastex888 cdecc7a
[skip ci] release v3.0.3
github-actions[bot] c37fbe0
fix(release): v3.0.3 build run follow-ups (4 more pipeline blockers)
claude 70d7535
Merge pull request #135 from automagik-dev/fix/v3-followup-arm64-musl…
namastex888 e84d5b3
[skip ci] release v3.0.4
github-actions[bot] bc3784a
fix(release): verify provenance with `gh attestation verify`, not sls…
claude 35f00dd
Merge pull request #136 from automagik-dev/fix/v3-slsa-verifier-attes…
namastex888 3a20f40
[skip ci] release v3.0.5
github-actions[bot] c6e432f
chore(release): update manifests (stable) → v3.0.5
1c15da7
fix(release): compile a unified CLI entry so the tarball autopg has a…
claude e7aff2a
Merge pull request #137 from automagik-dev/fix/v3-unified-compiled-cl…
namastex888 b44e54a
[skip ci] release v3.0.6
github-actions[bot] 4f142e2
chore(release): update manifests (stable) → v3.0.6
8e0c8cd
fix(install): honor runtime.enablePgvector from settings.json
namastex888 9fceefb
Merge pull request #138 from automagik-dev/fix/install-honor-runtime-…
namastex888 1acd326
[skip ci] release v3.0.7
github-actions[bot] be5b8a5
chore(release): update manifests (stable) → v3.0.7
91cef8f
fix: route autopg auth through wrapper
automagik-genie 7e8d508
Merge pull request #139 from automagik-dev/fix/auth-subcommand-routing
namastex888 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "schema_version": 1, | ||
| "channel": "stable", | ||
| "version": "3.0.7", | ||
| "released_at": "2026-05-22T17:18:27Z", | ||
| "tarball_base": "https://github.com/automagik-dev/autopg/releases/download/v3.0.7", | ||
| "platforms": ["linux-x64-glibc","linux-arm64","darwin-arm64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| #!/usr/bin/env bun | ||
|
|
||
| /** | ||
| * autopg-cli — the unified entry point for the COMPILED single-binary | ||
| * distribution (BRIEF-v3-build-fix blocker #10). | ||
| * | ||
| * `scripts/build-binary.sh` compiles THIS file with `bun build --compile`. | ||
| * The tarball's `autopg` IS this module. | ||
| * | ||
| * Why this exists: the npm package's bin (`bin/autopg-wrapper.cjs`) is a | ||
| * node launcher that resolves an external `bun` from node_modules and | ||
| * spawns it on `bin/postgres-server.js` for the long-running paths, while | ||
| * routing the pure-node operator verbs (install / verify / doctor / …) | ||
| * in-process through `src/cli-install.cjs`. That spawn-external-bun model | ||
| * cannot exist inside a single compiled binary — there is no node_modules | ||
| * and the binary already IS the runtime. Before this entry, the build | ||
| * compiled bare `postgres-server.js`, so the tarball `autopg` only knew | ||
| * `--version` / `postmaster` / `serve` and every operator verb (and | ||
| * install.sh's own final `autopg install`) exited 1 with a help dump. | ||
| * | ||
| * This entry mirrors the wrapper's dispatch, MINUS the bun-spawn: | ||
| * - `--version` / `-v` → print `autopg <version>` (exit 0) | ||
| * - install/operator verbs → src/cli-install.cjs `dispatch()` in | ||
| * process. The supervised postmaster | ||
| * command is THIS executable | ||
| * (`process.execPath`) invoked with | ||
| * `postmaster` — pm2 runs it under | ||
| * `--interpreter none`, and the binary | ||
| * handles `postmaster` natively. | ||
| * - postmaster/serve/help/… → delegate to bin/postgres-server.js | ||
| * (re-used as a module; it reads argv). | ||
| * | ||
| * Keep the verb set in sync with bin/autopg-wrapper.cjs's | ||
| * __installSubcommands — that file remains the npm-path dispatcher. | ||
| */ | ||
|
|
||
| import cliInstall from '../src/cli-install.cjs'; | ||
| import { readFileSync } from 'node:fs'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { dirname, join } from 'node:path'; | ||
|
|
||
| const args = process.argv.slice(2); | ||
| const sub = args[0]; | ||
|
|
||
| // `autopg --version` / `-v` — MUST exit 0 with `autopg <version>`. | ||
| // Same contract + version source as bin/postgres-server.js (the bun | ||
| // `--define BUILD_VERSION` literal in the compiled binary, package.json | ||
| // fallback otherwise). `typeof` on an undeclared id is the one safe form. | ||
| if (sub === '--version' || sub === '-v') { | ||
| process.stdout.write(`autopg ${resolveVersion()}\n`); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| // Mirror of bin/autopg-wrapper.cjs __installSubcommands (the authoritative | ||
| // npm-path routing). These are pure node + child_process — no bun, no | ||
| // running PG backend — so they run in-process here. | ||
| const INSTALL_SUBCOMMANDS = new Set([ | ||
| 'install', | ||
| 'uninstall', | ||
| 'status', | ||
| 'url', | ||
| 'port', | ||
| 'config', | ||
| 'update', | ||
| 'restart', | ||
| 'ui', | ||
| 'verify', | ||
| 'doctor', | ||
| 'trust', | ||
| 'gc', | ||
| 'provision', | ||
| 'create-app', | ||
| ]); | ||
|
|
||
| if (sub && INSTALL_SUBCOMMANDS.has(sub)) { | ||
| // In the compiled binary, the postmaster the supervisor (pm2) must run | ||
| // is THIS executable with `postmaster`. process.execPath is the compiled | ||
| // binary path; buildPm2StartArgs() does | ||
| // pm2 start <scriptPath> --interpreter none -- postmaster … | ||
| // so pm2 execs `<self> postmaster …`, which the binary handles. | ||
| const self = process.execPath; | ||
| const result = cliInstall.dispatch(sub, process.argv.slice(3), { | ||
| scriptPath: self, | ||
| wrapperPath: self, | ||
| }); | ||
|
|
||
| // dispatch() returns either a number (sync verbs) or a Promise (async | ||
| // verbs: uninstall/doctor/verify/trust/gc/provision/create-app/update). | ||
| // Mirror the wrapper's dual handling + the EADDRINUSE double-print guard. | ||
| if (result && typeof result.then === 'function') { | ||
| result.then( | ||
| (code) => process.exit(typeof code === 'number' ? code : 0), | ||
| (err) => { | ||
| if (err && err.code !== 'EADDRINUSE') { | ||
| process.stderr.write(`autopg: ${err?.message ?? err}\n`); | ||
| } | ||
| if (process.exitCode === undefined || process.exitCode === 0) { | ||
| process.exitCode = 1; | ||
| } | ||
| }, | ||
| ); | ||
| } else { | ||
| process.exit(typeof result === 'number' ? result : 0); | ||
| } | ||
| } else { | ||
| // postmaster / serve / --help / help / empty / unknown flags → | ||
| // bin/postgres-server.js owns this surface (it reads process.argv and | ||
| // dispatches, including its own `serve`→`postmaster` alias + the | ||
| // EX_USAGE-style unknown-verb exit). Re-used as a module so there is a | ||
| // single postmaster implementation. | ||
| await import('./postgres-server.js'); | ||
| } | ||
|
|
||
| function resolveVersion() { | ||
| if (typeof BUILD_VERSION !== 'undefined' && BUILD_VERSION) return BUILD_VERSION; | ||
| try { | ||
| const here = dirname(fileURLToPath(import.meta.url)); | ||
| const pkg = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')); | ||
| return pkg.version || '0.0.0'; | ||
| } catch { | ||
| return '0.0.0'; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
'auth'subcommand is missing fromINSTALL_SUBCOMMANDSin the compiled binary entry point (bin/autopg-cli.js), even though it was added to the wrapper (bin/autopg-wrapper.cjs). Without this, runningautopg authvia the compiled binary will fall through topostgres-server.jsand fail.