@haakco/hostingctl 1.0.310 → 1.0.312

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/main.js CHANGED
@@ -24745,7 +24745,11 @@ var hostingWorkloadServerModeEnumSchema = _enum(["shared", "dedicated"]).describ
24745
24745
  var createHostingEnvironmentRequestSchema = object({
24746
24746
  certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
24747
24747
  applicationLayout: _enum(["dedicated"]).optional().describe("How an environment's web applications are served. `DEDICATED` preserves existing environments and initial Node workload sets: one Pod per application, each with its own CPU and memory limits. Existing layouts never change merely because a new creation default is released. `SHARED_WORDPRESS` is plan 40's layout: one Apache/mod_php container serves every WordPress application in the environment, and each member keeps its own tree, Service, Ingress, certificate and database identity. The container carries the SUM of its members' limits. `SHARED_APPLICATIONS` is plan 48's layout and a superset of the WordPress case: one Pod holds the WordPress container AND one container per Moodle application, with the aggregate CPU/memory ceiling on the POD and no per-container limit, so WordPress may borrow capacity Moodle is not using and the reverse. It is a separate value rather than a reinterpretation of `SHARED_WORDPRESS`, because an environment that adopted WordPress sharing never consented to moving its Moodle applications into that Pod. `SHARED_ENVIRONMENT` is the new PHP environment default: web, cron, Redis and tools share one parent cap with requests-only containers. MariaDB remains separate. Component settings are persisted at creation or explicit adoption and read from PostgreSQL thereafter. `SHARED_PHP` is the shared environment with **one** PHP container instead of one container per PHP application: the same web, cron, Redis and tools Pod, but the Apache/PHP container serves every WordPress AND Moodle member as vhosts. N PHP applications then cost about one runtime's memory instead of N runtimes'. It is a value of its own rather than a change to `SHARED_APPLICATIONS` or `SHARED_ENVIRONMENT`, because an environment already composing those layouts keeps composing them exactly as before; a member joins the one container only in an environment that selected this. The stored value is this case's name, so a layout is a value the platform declares and validates rather than a branch keyed by a string somewhere.\n"),
24748
- resourceProfile: _enum(["small_sites", "empty_environment"]).optional(),
24748
+ resourceProfile: _enum([
24749
+ "small_sites",
24750
+ "empty_environment",
24751
+ "low_end"
24752
+ ]).optional(),
24749
24753
  name: string().max(100),
24750
24754
  slug: string().min(3).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/),
24751
24755
  budget: object({
@@ -36508,7 +36512,7 @@ function writeUpdateState(state, env = process.env) {
36508
36512
  }
36509
36513
  //#endregion
36510
36514
  //#region src/version.ts
36511
- var VERSION = "0.0.0-dev";
36515
+ var VERSION = "1.0.312";
36512
36516
  //#endregion
36513
36517
  //#region src/commands/update.ts
36514
36518
  /**
@@ -36583,7 +36587,7 @@ var update = {
36583
36587
  }, process.env);
36584
36588
  return {
36585
36589
  ...known,
36586
- current: after ?? "0.0.0-dev",
36590
+ current: after ?? "1.0.312",
36587
36591
  latest: after ?? latest,
36588
36592
  upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
36589
36593
  action: "run",
@@ -36821,6 +36825,13 @@ function startsWith(path, prefix) {
36821
36825
  return prefix.every((one, index) => path[index] === one);
36822
36826
  }
36823
36827
  /**
36828
+ * How long the notice waits for the lock that guards the state file.
36829
+ *
36830
+ * Short, because the notice runs beside a command a person is waiting on: a machine that is busy updating
36831
+ * its session is not a reason to hold this one up, and the check simply happens again next time.
36832
+ */
36833
+ var NOTICE_LOCK_WAIT_MS = 150;
36834
+ /**
36824
36835
  * Tell the client, once a day, that a newer version is published.
36825
36836
  *
36826
36837
  * The notice goes to stderr, so it never mixes into a command's output, and it names `hostingctl update`
@@ -36829,6 +36840,34 @@ function startsWith(path, prefix) {
36829
36840
  */
36830
36841
  async function printUpdateNotice(options) {
36831
36842
  if (options.json) return;
36843
+ const env = options.env ?? process.env;
36844
+ if (isSet(env.CI)) return;
36845
+ if (isSet(env.HOSTINGCTL_NO_UPDATE_CHECK)) return;
36846
+ const state = readUpdateState(env);
36847
+ const now = Date.now();
36848
+ if (state !== null && now - state.checkedAt < 864e5) return;
36849
+ const latest = await latestVersion();
36850
+ try {
36851
+ mkdirSync(credentialDirectory(env), {
36852
+ recursive: true,
36853
+ mode: 448
36854
+ });
36855
+ await withCredentialLock(async () => {
36856
+ writeUpdateState({
36857
+ method: state?.method ?? null,
36858
+ entry: state?.entry ?? "",
36859
+ checkedAt: now,
36860
+ latest
36861
+ }, env);
36862
+ }, env, { waitMs: NOTICE_LOCK_WAIT_MS });
36863
+ } catch {}
36864
+ if (latest === null) return;
36865
+ if (!isNewerVersion(latest, "1.0.312")) return;
36866
+ process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
36867
+ }
36868
+ /** Whether an environment variable is set to something, which is how CI and the opt-out are read. */
36869
+ function isSet(value) {
36870
+ return value !== void 0 && value !== "";
36832
36871
  }
36833
36872
  //#endregion
36834
36873
  //#region src/main.ts