@codions/portta 0.0.0-develop.150.sha-ed65081 → 0.0.0-develop.151.sha-fde6403
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/cli.js +34 -25
- package/dist/documentation.json +1 -1
- package/dist/host.js +1 -1
- package/dist/runtime/VERSION +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -22364,7 +22364,7 @@ var init_package = __esm({
|
|
|
22364
22364
|
"package.json"() {
|
|
22365
22365
|
package_default = {
|
|
22366
22366
|
name: "@codions/portta",
|
|
22367
|
-
version: "0.0.0-develop.
|
|
22367
|
+
version: "0.0.0-develop.151.sha-fde6403",
|
|
22368
22368
|
description: "Machine-first CLI for a shared Docker development gateway",
|
|
22369
22369
|
license: "MIT",
|
|
22370
22370
|
type: "module",
|
|
@@ -22438,7 +22438,7 @@ var init_version = __esm({
|
|
|
22438
22438
|
"use strict";
|
|
22439
22439
|
init_package();
|
|
22440
22440
|
CLI_VERSION = package_default.version;
|
|
22441
|
-
CLI_BUILD_DATE = true ? "2026-09-16T05:
|
|
22441
|
+
CLI_BUILD_DATE = true ? "2026-09-16T05:14:39Z" : void 0;
|
|
22442
22442
|
}
|
|
22443
22443
|
});
|
|
22444
22444
|
|
|
@@ -89799,7 +89799,7 @@ function createDaemonTaskflowHost(context) {
|
|
|
89799
89799
|
port: hostListen(env).port,
|
|
89800
89800
|
workflowBuiltinsDir: taskflowAssets(env).workflowBuiltinsDir,
|
|
89801
89801
|
version: env.PORTTA_VERSION || "0.0.0-local",
|
|
89802
|
-
buildDate: true ? "2026-09-16T05:
|
|
89802
|
+
buildDate: true ? "2026-09-16T05:14:39Z" : (/* @__PURE__ */ new Date()).toISOString(),
|
|
89803
89803
|
environmentStore: createEnvironmentStore(paths3.database),
|
|
89804
89804
|
hostEnvironmentProvider: new HostEnvironmentProvider(),
|
|
89805
89805
|
devContainerProvider: new DevContainerProvider(),
|
|
@@ -115055,6 +115055,8 @@ var ProjectSummary = named(
|
|
|
115055
115055
|
description: external_exports.string().nullable(),
|
|
115056
115056
|
archived: external_exports.boolean(),
|
|
115057
115057
|
taskProvider: TaskProvider.nullable().describe("Null means derived: GitHub when a repository has a GitHub remote"),
|
|
115058
|
+
/** The Linear team, when the provider is Linear. Null otherwise. */
|
|
115059
|
+
linearTeam: external_exports.string().nullable(),
|
|
115058
115060
|
relativePath: external_exports.string().nullable(),
|
|
115059
115061
|
location: ProjectLocation,
|
|
115060
115062
|
repositoryCount: external_exports.number().int(),
|
|
@@ -115083,6 +115085,8 @@ var Project = named(
|
|
|
115083
115085
|
description: external_exports.string().nullable(),
|
|
115084
115086
|
archived: external_exports.boolean(),
|
|
115085
115087
|
taskProvider: TaskProvider.nullable().describe("Null means derived: GitHub when a repository has a GitHub remote"),
|
|
115088
|
+
/** The Linear team, when the provider is Linear. GitHub needs no equivalent: its coordinate is the remote. */
|
|
115089
|
+
linearTeam: external_exports.string().nullable(),
|
|
115086
115090
|
/** Where this Project's work actually is, once the provider is resolved. */
|
|
115087
115091
|
work: external_exports.object({
|
|
115088
115092
|
provider: TaskProvider.nullable(),
|
|
@@ -119027,12 +119031,17 @@ function prepareWebUp(options, command) {
|
|
|
119027
119031
|
}
|
|
119028
119032
|
}
|
|
119029
119033
|
const protectedPanel = initial.env["PORTTA_AUTH_MODE"] === "required";
|
|
119030
|
-
if (expose
|
|
119034
|
+
if (!allowsDisabledAuth(expose) && !protectedPanel) {
|
|
119031
119035
|
throw new RefusedError(
|
|
119032
|
-
`panel access '${expose}'
|
|
119036
|
+
`panel access '${expose}' answers whoever finds the address, and the panel would answer them as the local operator`,
|
|
119033
119037
|
"portta config set panel.auth required"
|
|
119034
119038
|
);
|
|
119035
119039
|
}
|
|
119040
|
+
if (allowsDisabledAuth(expose) && !protectedPanel && expose !== "local") {
|
|
119041
|
+
new Output(globals4(command)).warning(
|
|
119042
|
+
`anybody who reaches the panel over the ${expose === "tailscale" ? "tailnet" : "VPN"} is the local operator`
|
|
119043
|
+
);
|
|
119044
|
+
}
|
|
119036
119045
|
const readOnly = options.writable ? false : options.readOnly ?? (expose === "vpn" ? true : initial.config.webReadOnly);
|
|
119037
119046
|
const values = {
|
|
119038
119047
|
PORTTA_WEB: "true",
|
|
@@ -123327,7 +123336,7 @@ function paths2(root2) {
|
|
|
123327
123336
|
init_src();
|
|
123328
123337
|
init_context();
|
|
123329
123338
|
init_errors3();
|
|
123330
|
-
import { chmodSync as chmodSync14, cpSync as cpSync2, existsSync as existsSync43, mkdirSync as mkdirSync23, mkdtempSync as mkdtempSync3, readFileSync as readFileSync35, rmSync as rmSync12, statSync as statSync12, writeFileSync as writeFileSync17 } from "node:fs";
|
|
123339
|
+
import { chmodSync as chmodSync14, copyFileSync as copyFileSync5, cpSync as cpSync2, existsSync as existsSync43, mkdirSync as mkdirSync23, mkdtempSync as mkdtempSync3, readFileSync as readFileSync35, rmSync as rmSync12, statSync as statSync12, writeFileSync as writeFileSync17 } from "node:fs";
|
|
123331
123340
|
import { hostname as hostname3, tmpdir as tmpdir5 } from "node:os";
|
|
123332
123341
|
import { dirname as dirname32, join as join65 } from "node:path";
|
|
123333
123342
|
function globals16(command) {
|
|
@@ -123350,19 +123359,19 @@ function parseManifest(text) {
|
|
|
123350
123359
|
return null;
|
|
123351
123360
|
}
|
|
123352
123361
|
}
|
|
123353
|
-
function dbContainer(env) {
|
|
123354
|
-
return `${env["PORTTA_PROJECT_NAME"] || "portta"}-db-1`;
|
|
123355
|
-
}
|
|
123356
123362
|
async function containerRunning(name) {
|
|
123357
123363
|
const result = await runProcess("docker", ["inspect", "-f", "{{.State.Running}}", name], { reject: false });
|
|
123358
123364
|
return !result.failed && result.stdout.trim() === "true";
|
|
123359
123365
|
}
|
|
123360
123366
|
async function dumpDatabase(context, target) {
|
|
123361
|
-
const
|
|
123362
|
-
if (!
|
|
123363
|
-
const
|
|
123364
|
-
|
|
123365
|
-
|
|
123367
|
+
const source = databaseFileFor(context.root);
|
|
123368
|
+
if (!existsSync43(source)) return false;
|
|
123369
|
+
const sqlite = await runProcess("sh", ["-c", "command -v sqlite3"], { reject: false });
|
|
123370
|
+
const binary = sqlite.stdout.trim();
|
|
123371
|
+
if (sqlite.failed || !binary) return false;
|
|
123372
|
+
const copied = await runProcess(binary, [source, `VACUUM INTO '${target.replaceAll("'", "''")}'`], { reject: false });
|
|
123373
|
+
if (copied.failed || !existsSync43(target)) return false;
|
|
123374
|
+
chmodSync14(target, 384);
|
|
123366
123375
|
return true;
|
|
123367
123376
|
}
|
|
123368
123377
|
async function backupCommand(options, command) {
|
|
@@ -123387,7 +123396,7 @@ async function backupCommand(options, command) {
|
|
|
123387
123396
|
}
|
|
123388
123397
|
let database = false;
|
|
123389
123398
|
if (options.database !== false) {
|
|
123390
|
-
database = await dumpDatabase(context, join65(staging, "
|
|
123399
|
+
database = await dumpDatabase(context, join65(staging, "panel.db"));
|
|
123391
123400
|
if (!database) {
|
|
123392
123401
|
output2.warning("the panel database was not included");
|
|
123393
123402
|
output2.hint("it is only there when the panel is running; --no-database silences this");
|
|
@@ -123465,18 +123474,18 @@ async function restoreCommand(archive, options, command) {
|
|
|
123465
123474
|
output2.progress("configuration and state restored");
|
|
123466
123475
|
}
|
|
123467
123476
|
if (existsSync43(join65(context.root, ".env"))) chmodSync14(join65(context.root, ".env"), 384);
|
|
123468
|
-
const dump = join65(staging, "
|
|
123477
|
+
const dump = join65(staging, "panel.db");
|
|
123469
123478
|
if (existsSync43(dump)) {
|
|
123470
|
-
const
|
|
123471
|
-
const
|
|
123472
|
-
|
|
123473
|
-
|
|
123474
|
-
|
|
123475
|
-
) : { failed: true };
|
|
123476
|
-
if (loaded.failed) {
|
|
123477
|
-
output2.warning("the database dump was not loaded");
|
|
123478
|
-
output2.hint(`start the gateway, then: portta restore ${archive} --force`);
|
|
123479
|
+
const panelUp = await containerRunning(`${context.env["PORTTA_PROJECT_NAME"] || "portta"}-web-1`);
|
|
123480
|
+
const target = databaseFileFor(context.root);
|
|
123481
|
+
if (panelUp) {
|
|
123482
|
+
output2.warning("the panel is running, so its database was not replaced");
|
|
123483
|
+
output2.hint(`portta web down then: portta restore ${archive} --force`);
|
|
123479
123484
|
} else {
|
|
123485
|
+
mkdirSync23(dirname32(target), { recursive: true });
|
|
123486
|
+
for (const file2 of databaseFiles(target)) rmSync12(file2, { force: true });
|
|
123487
|
+
copyFileSync5(dump, target);
|
|
123488
|
+
chmodSync14(target, 384);
|
|
123480
123489
|
output2.progress("panel database restored");
|
|
123481
123490
|
}
|
|
123482
123491
|
}
|