brokeless: fully local by default, and a README for it
- BROKE_OFFLINE=1 (on in Docker) turns off the GitHub update check and the exchange-rate fetch, so the server makes no calls out - auto-update in scripts/start.mjs pulls from your own repo (origin), never upstream - install.sh points at brokeless; drop the workflow that merged upstream by itself - compose project and image are named brokeless - README: what changed from broke, how to run it, how to review upstream Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
861e65021f
commit
cec3b15c2c
9 files changed
+139
-94
No files matched your search
+3
-2
@@ -19,14 +19,15 @@ const npm = (...args) => spawnSync("npm", args, { stdio: "inherit", shell: win }
|
||||
// Checks for next itself, not node_modules: a stopped first install leaves a half-full node_modules.
|
||||
const nextBin = join("node_modules", ".bin", win ? "next.cmd" : "next");
|
||||
|
||||
// Auto-update: each start brings in the newest broke when this copy has no changes of its own (a fast-forward only).
|
||||
// Auto-update: each start brings in the newest commits from your own repo (the "origin" remote, or BROKE_REPO), when
|
||||
// this copy has no changes of its own (a fast-forward only). Never from upstream: those are reviewed and merged by hand.
|
||||
// Your own changes or commits, no git, no internet, or BROKE_NO_AUTO_UPDATE=1: it starts the copy you have.
|
||||
const git = (...args) => spawnSync("git", args, { encoding: "utf8", shell: win });
|
||||
let lockChanged = false;
|
||||
if (existsSync(".git") && !process.env.BROKE_NO_AUTO_UPDATE) {
|
||||
if (git("status", "--porcelain").stdout.trim() === "M package-lock.json") git("checkout", "--", "package-lock.json"); // npm's rewrite, not yours
|
||||
const clean = git("status", "--porcelain").stdout.trim() === "";
|
||||
const fetched = git("fetch", "--quiet", process.env.BROKE_REPO || "https://github.com/nextwork-projects/broke.git", "main").status === 0;
|
||||
const fetched = git("fetch", "--quiet", process.env.BROKE_REPO || "origin", "main").status === 0;
|
||||
const head = git("rev-parse", "HEAD").stdout.trim(), latest = fetched ? git("rev-parse", "FETCH_HEAD").stdout.trim() : head;
|
||||
if (latest !== head) {
|
||||
const behindOnly = git("merge-base", "--is-ancestor", "HEAD", latest).status === 0;
|
||||
|
||||
Reference in new issue
Block a user