@stacksjs/ts-cloud 0.16.7 → 0.16.8
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/bin/{chunk-ph1n2es7.js → chunk-pktsyjxj.js} +1 -1
- package/dist/bin/{chunk-zzwrhtmp.js → chunk-pymdbbsz.js} +66 -66
- package/dist/bin/{chunk-71ah0fk2.js → chunk-xcykps5r.js} +1 -1
- package/dist/bin/cli.js +4 -4
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/{chunk-910yrha7.js → chunk-rm0yzm1x.js} +81 -81
- package/dist/{chunk-r7x7y3ha.js → chunk-rphvchxh.js} +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/drivers/index.js +1 -1
- package/dist/drivers/shared/sqlite-shared-path.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +6 -6
- package/dist/ui/data/services.html +6 -6
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +6 -6
- package/dist/ui/integrations.html +1 -1
- package/dist/ui/operations/alerts.html +6 -6
- package/dist/ui/operations/configuration.html +5 -5
- package/dist/ui/operations/jobs.html +6 -6
- package/dist/ui/operations/maintenance.html +6 -6
- package/dist/ui/operations/observability.html +6 -6
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +6 -6
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +1 -1
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +5 -5
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +6 -6
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +5 -5
- package/dist/ui/server/security.html +1 -1
- package/dist/ui/server/services.html +1 -1
- package/dist/ui/server/sites.html +6 -6
- package/dist/ui/server/ssh-keys.html +6 -6
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +6 -6
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +6 -6
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +6 -6
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +5 -5
- package/package.json +3 -3
|
@@ -516,7 +516,7 @@ console.log(JSON.stringify({
|
|
|
516
516
|
`),s=`printf %s ${Buffer.from(r).toString("base64")} | base64 -d | bash`;await Re(t.host,s,t)}async function as(e){let t=await Re(e.host,lc(cc),e);return JSON.parse(t)}function cs(e,t){let r=[],s=new Set(t.firewallPorts),n=e.firewallPorts.filter((o)=>!s.has(o)),i=t.firewallPorts.filter((o)=>!e.firewallPorts.includes(o));if(!t.firewallActive)r.push("UFW is not active");if(n.length>0)r.push(`UFW is missing ports: ${n.join(", ")}`);if(i.length>0)r.push(`UFW has unexpected ports: ${i.join(", ")}`);if(t.passwordAuthentication)r.push("SSH password authentication remains enabled");if(t.rootPasswordLogin)r.push("SSH root password login remains enabled");if(!t.fail2banActive)r.push("fail2ban is not active");if(e.autoUpdates&&!t.unattendedUpgradesActive)r.push("unattended upgrades are not active");if(e.monitoring&&!t.metricsTimerActive)r.push("metrics timer is not active");if(e.monitoring&&!t.metricsSnapshotFresh)r.push("metrics snapshot is stale");if(e.swapGb>0&&t.swapBytes<e.swapGb*1073741824*0.9)r.push("configured swap is missing");if(t.failedUnits.length>0)r.push(`failed services: ${t.failedUnits.join(", ")}`);return r}import{mkdir as Dt,readFile as uc,rename as Vn,rmdir as pc,stat as dc,unlink as mc,writeFile as qn}from"node:fs/promises";import{join as At}from"node:path";function Ar(e){return At(_e(),`${e}-resize.json`)}function Xn(e){return At(_e(),`${e}-resize.lock`)}async function ls(e){try{return JSON.parse(await uc(Ar(e),"utf8"))}catch{return null}}async function gt(e){let t=Ar(e.stackName);await Dt(_e(),{recursive:!0});let r=`${t}.${process.pid}.tmp`;await qn(r,`${JSON.stringify(e,null,2)}
|
|
517
517
|
`,"utf8"),await Vn(r,t)}async function ds(e,t=1800000){let r=Xn(e);await Dt(_e(),{recursive:!0});try{await Dt(r)}catch(s){if(Date.now()-(await dc(r)).mtimeMs<=t)throw Error(`Another resize process holds ${r}.`);await Vn(r,`${r}.stale-${Date.now()}`),await Dt(r)}return await qn(At(r,"owner.json"),`${JSON.stringify({pid:process.pid,acquiredAt:new Date().toISOString()},null,2)}
|
|
518
518
|
`,"utf8"),async()=>{await mc(At(r,"owner.json")).catch(()=>{}),await pc(r).catch(()=>{})}}function Nt(e){return Object.entries(e).map(([t,r])=>`${t}=${Sc(String(r))}`).join(`
|
|
519
|
-
`)}function Sc(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}var vc=new Set(["sqlite","sqlite3"]),bc=new Set([":memory:","memory"]);function wc(e){let t=e?.DB_CONNECTION?.trim().toLowerCase();return t!=null&&vc.has(t)}function $c(e){let t=e.trim().replace(/^\.\//,"");if(t===""||t.startsWith("/")||t.startsWith("~"))return;if(t.split("/").includes(".."))return;return t.replace(/\/+$/,"")}function Nr(e,t=[]){if(!wc(e))return{};let r=e?.DB_DATABASE?.trim();if(r&&bc.has(r.toLowerCase()))return{};if(!r)return{warning:"DB_CONNECTION is sqlite but DB_DATABASE names
|
|
519
|
+
`)}function Sc(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}var vc=new Set(["sqlite","sqlite3"]),bc=new Set([":memory:","memory"]);function wc(e){let t=e?.DB_CONNECTION?.trim().toLowerCase();return t!=null&&vc.has(t)}function $c(e){let t=e.trim().replace(/^\.\//,"");if(t===""||t.startsWith("/")||t.startsWith("~"))return;if(t.split("/").includes(".."))return;return t.replace(/\/+$/,"")}function Nr(e,t=[]){if(!wc(e))return{};let r=e?.DB_DATABASE_PATH?.trim()||e?.DB_DATABASE?.trim();if(r&&bc.has(r.toLowerCase()))return{};if(!r)return{warning:"DB_CONNECTION is sqlite but neither DB_DATABASE_PATH nor DB_DATABASE names a file, so ts-cloud cannot tell where the database lives. If it is written inside the release directory, the next deploy discards it. Set DB_DATABASE_PATH, or list the file in the site's `sharedPaths`."};let s=$c(r);if(!s)return{};if(t.some((n)=>Ss(n)===s))return{};return{path:s}}function kt(e,t=[]){let{path:r}=Nr(e,t);return r?[r]:[]}var _c=/\.(?:[cm]?[jt]sx?)$/;function Lr(e,t,r){let s=t==="bun"?"/usr/local/bin/bun":t==="deno"?"/usr/local/bin/deno":"/usr/local/bin/node",n=e.trim();if(/^(?:bun|node|deno)\s+/.test(n))return`${s} ${n.replace(/^(?:bun|node|deno)\s+/,"")}`;let[i="",...o]=n.split(/\s+/);if(i&&!_c.test(i)){let a=i.startsWith("/")?i:r&&i.startsWith("./")?`${r.replace(/\/+$/,"")}/${i.replace(/^\.\//,"")}`:void 0;if(a)return[a,...o].join(" ")}return`${s} ${n}`}function Jn(e){return["TS_CLOUD_MEM_MB=$(awk '/^MemTotal:/{print int($2/1024)}' /proc/meminfo)","TS_CLOUD_HIGH_MB=$((TS_CLOUD_MEM_MB / 8))",'[ "$TS_CLOUD_HIGH_MB" -lt 512 ] && TS_CLOUD_HIGH_MB=512','[ "$TS_CLOUD_HIGH_MB" -gt 4096 ] && TS_CLOUD_HIGH_MB=4096',`mkdir -p /etc/systemd/system/${e}.d`,`printf '# Written by ts-cloud: memoryHigh resolved from this box.
|
|
520
520
|
# An eighth of %sMB RAM. Set memoryHigh in config to override.
|
|
521
521
|
[Service]
|
|
522
522
|
MemoryAccounting=true
|