@rubytech/create-maxy-code 0.1.367 → 0.1.368
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2003,6 +2003,12 @@ function deployPayload() {
|
|
|
2003
2003
|
// Persistent config lives at ~/{configDir}/ — survives rm -rf ~/{installDir}
|
|
2004
2004
|
const persistentDir = resolve(process.env.HOME ?? "/root", BRAND.configDir);
|
|
2005
2005
|
const persistentPasswordFile = join(persistentDir, ".neo4j-password");
|
|
2006
|
+
// Email credentials (platform/plugins/email/mcp/src/lib/credentials.ts) are
|
|
2007
|
+
// written only to <PLATFORM_ROOT>/config/email-credentials.json — i.e.
|
|
2008
|
+
// INSTALL_DIR/platform/config/, inside the wipe zone below. Unlike
|
|
2009
|
+
// .neo4j-password there is no persistent source of truth, so the live file is
|
|
2010
|
+
// the only copy: back it up before the wipe and restore it after deploy.
|
|
2011
|
+
const persistentEmailCredFile = join(persistentDir, "email-credentials.json");
|
|
2006
2012
|
// users.json lives at <persistentDir>/users.json. Writers (paths.ts,
|
|
2007
2013
|
// admin-add, set-pin, seed-neo4j.sh) target the persistent file directly —
|
|
2008
2014
|
// see comment in platform/ui/app/lib/paths.ts.
|
|
@@ -2093,6 +2099,13 @@ function deployPayload() {
|
|
|
2093
2099
|
shell(c.command, c.args, { sudo: true, bestEffort: true });
|
|
2094
2100
|
}
|
|
2095
2101
|
}
|
|
2102
|
+
// Save email credentials before the wipe — the live file under platform/ is
|
|
2103
|
+
// the only copy (see persistentEmailCredFile above). Restored after deploy.
|
|
2104
|
+
const liveEmailCredFile = join(INSTALL_DIR, "platform/config/email-credentials.json");
|
|
2105
|
+
if (existsSync(liveEmailCredFile)) {
|
|
2106
|
+
cpSync(liveEmailCredFile, persistentEmailCredFile);
|
|
2107
|
+
console.log(" Saved email credentials to persistent store.");
|
|
2108
|
+
}
|
|
2096
2109
|
// Wipe deployment directories to prevent stale files.
|
|
2097
2110
|
// data/ is NOT wiped — it contains user data (accounts, uploads) that must survive.
|
|
2098
2111
|
for (const dir of ["platform", "server", "maxy", "premium-plugins", "docs", ".claude"]) {
|
|
@@ -2119,6 +2132,11 @@ function deployPayload() {
|
|
|
2119
2132
|
cpSync(persistentPasswordFile, join(configDir, ".neo4j-password"));
|
|
2120
2133
|
console.log(" Restored Neo4j password.");
|
|
2121
2134
|
}
|
|
2135
|
+
if (existsSync(persistentEmailCredFile)) {
|
|
2136
|
+
cpSync(persistentEmailCredFile, join(configDir, "email-credentials.json"));
|
|
2137
|
+
chmodSync(join(configDir, "email-credentials.json"), 0o600);
|
|
2138
|
+
console.log(" Restored email credentials.");
|
|
2139
|
+
}
|
|
2122
2140
|
// users.json is read directly from persistentDir by both
|
|
2123
2141
|
// platform/ui/app/lib/paths.ts (USERS_FILE = MAXY_DIR/users.json) and the
|
|
2124
2142
|
// admin MCP plugin (USERS_FILE = CONFIG_DIR/users.json). No copy into the
|