@codions/portta 0.0.0-develop.150.sha-ed65081 → 0.0.0-develop.153.sha-2877bc7
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 +35 -28
- 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.153.sha-2877bc7",
|
|
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:20:48Z" : 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:20:48Z" : (/* @__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",
|
|
@@ -121803,7 +121812,7 @@ async function inspectCommand(command) {
|
|
|
121803
121812
|
const options = globals8(command);
|
|
121804
121813
|
const context = gatewayContext({ profile: options.profile });
|
|
121805
121814
|
const output2 = new Output(options);
|
|
121806
|
-
const secrets = /* @__PURE__ */ new Set(["TS_AUTHKEY", "CF_DNS_API_TOKEN", "
|
|
121815
|
+
const secrets = /* @__PURE__ */ new Set(["TS_AUTHKEY", "CF_DNS_API_TOKEN", "PORTTA_AUTH_SECRET"]);
|
|
121807
121816
|
const configuration = Object.fromEntries(Object.entries(context.env).filter(([key]) => key.startsWith("PORTTA_") || ["TLS_ENABLED", "TLS_MODE", "PUBLIC_DOMAIN", "PRIVATE_DOMAIN", "TAILSCALE_ENABLED"].includes(key)).map(([key, value3]) => [key, secrets.has(key) ? value3 ? "<set>" : "<unset>" : value3]));
|
|
121808
121817
|
if (output2.json) output2.data({ profile: context.config.profile, configuration, composeFiles: context.composeFiles });
|
|
121809
121818
|
else {
|
|
@@ -122315,8 +122324,6 @@ var SETTINGS = {
|
|
|
122315
122324
|
};
|
|
122316
122325
|
var SECRETS = /* @__PURE__ */ new Set([
|
|
122317
122326
|
"PORTTA_AUTH_SECRET",
|
|
122318
|
-
"PORTTA_RUNTIME_DB_PASSWORD",
|
|
122319
|
-
"PORTTA_RUNTIME_DATABASE_URL",
|
|
122320
122327
|
"TS_AUTHKEY",
|
|
122321
122328
|
"CF_DNS_API_TOKEN"
|
|
122322
122329
|
]);
|
|
@@ -123327,7 +123334,7 @@ function paths2(root2) {
|
|
|
123327
123334
|
init_src();
|
|
123328
123335
|
init_context();
|
|
123329
123336
|
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";
|
|
123337
|
+
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
123338
|
import { hostname as hostname3, tmpdir as tmpdir5 } from "node:os";
|
|
123332
123339
|
import { dirname as dirname32, join as join65 } from "node:path";
|
|
123333
123340
|
function globals16(command) {
|
|
@@ -123350,19 +123357,19 @@ function parseManifest(text) {
|
|
|
123350
123357
|
return null;
|
|
123351
123358
|
}
|
|
123352
123359
|
}
|
|
123353
|
-
function dbContainer(env) {
|
|
123354
|
-
return `${env["PORTTA_PROJECT_NAME"] || "portta"}-db-1`;
|
|
123355
|
-
}
|
|
123356
123360
|
async function containerRunning(name) {
|
|
123357
123361
|
const result = await runProcess("docker", ["inspect", "-f", "{{.State.Running}}", name], { reject: false });
|
|
123358
123362
|
return !result.failed && result.stdout.trim() === "true";
|
|
123359
123363
|
}
|
|
123360
123364
|
async function dumpDatabase(context, target) {
|
|
123361
|
-
const
|
|
123362
|
-
if (!
|
|
123363
|
-
const
|
|
123364
|
-
|
|
123365
|
-
|
|
123365
|
+
const source = databaseFileFor(context.root);
|
|
123366
|
+
if (!existsSync43(source)) return false;
|
|
123367
|
+
const sqlite = await runProcess("sh", ["-c", "command -v sqlite3"], { reject: false });
|
|
123368
|
+
const binary = sqlite.stdout.trim();
|
|
123369
|
+
if (sqlite.failed || !binary) return false;
|
|
123370
|
+
const copied = await runProcess(binary, [source, `VACUUM INTO '${target.replaceAll("'", "''")}'`], { reject: false });
|
|
123371
|
+
if (copied.failed || !existsSync43(target)) return false;
|
|
123372
|
+
chmodSync14(target, 384);
|
|
123366
123373
|
return true;
|
|
123367
123374
|
}
|
|
123368
123375
|
async function backupCommand(options, command) {
|
|
@@ -123387,7 +123394,7 @@ async function backupCommand(options, command) {
|
|
|
123387
123394
|
}
|
|
123388
123395
|
let database = false;
|
|
123389
123396
|
if (options.database !== false) {
|
|
123390
|
-
database = await dumpDatabase(context, join65(staging, "
|
|
123397
|
+
database = await dumpDatabase(context, join65(staging, "panel.db"));
|
|
123391
123398
|
if (!database) {
|
|
123392
123399
|
output2.warning("the panel database was not included");
|
|
123393
123400
|
output2.hint("it is only there when the panel is running; --no-database silences this");
|
|
@@ -123465,18 +123472,18 @@ async function restoreCommand(archive, options, command) {
|
|
|
123465
123472
|
output2.progress("configuration and state restored");
|
|
123466
123473
|
}
|
|
123467
123474
|
if (existsSync43(join65(context.root, ".env"))) chmodSync14(join65(context.root, ".env"), 384);
|
|
123468
|
-
const dump = join65(staging, "
|
|
123475
|
+
const dump = join65(staging, "panel.db");
|
|
123469
123476
|
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`);
|
|
123477
|
+
const panelUp = await containerRunning(`${context.env["PORTTA_PROJECT_NAME"] || "portta"}-web-1`);
|
|
123478
|
+
const target = databaseFileFor(context.root);
|
|
123479
|
+
if (panelUp) {
|
|
123480
|
+
output2.warning("the panel is running, so its database was not replaced");
|
|
123481
|
+
output2.hint(`portta web down then: portta restore ${archive} --force`);
|
|
123479
123482
|
} else {
|
|
123483
|
+
mkdirSync23(dirname32(target), { recursive: true });
|
|
123484
|
+
for (const file2 of databaseFiles(target)) rmSync12(file2, { force: true });
|
|
123485
|
+
copyFileSync5(dump, target);
|
|
123486
|
+
chmodSync14(target, 384);
|
|
123480
123487
|
output2.progress("panel database restored");
|
|
123481
123488
|
}
|
|
123482
123489
|
}
|