@fedify/cli 2.4.0-dev.1661 → 2.4.0-dev.1666
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/config.js +2 -5
- package/dist/deno.js +1 -1
- package/dist/options.js +2 -5
- package/dist/tempserver.js +3 -1
- package/dist/tunnel.js +3 -1
- package/dist/tunnelservice.js +40 -0
- package/package.json +10 -10
package/dist/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
|
+
import { TUNNEL_SERVICE_NAMES } from "./tunnelservice.js";
|
|
2
3
|
import { message } from "@optique/core";
|
|
3
4
|
import { printError } from "@optique/run";
|
|
4
5
|
import { readFileSync } from "node:fs";
|
|
@@ -92,11 +93,7 @@ const benchSchema = object$1({ format: optional$1(picklist([
|
|
|
92
93
|
const configContext = createConfigContext({ schema: object$1({
|
|
93
94
|
debug: optional$1(boolean()),
|
|
94
95
|
userAgent: optional$1(string$1()),
|
|
95
|
-
tunnelService: optional$1(picklist(
|
|
96
|
-
"localhost.run",
|
|
97
|
-
"serveo.net",
|
|
98
|
-
"pinggy.io"
|
|
99
|
-
])),
|
|
96
|
+
tunnelService: optional$1(picklist(TUNNEL_SERVICE_NAMES)),
|
|
100
97
|
webfinger: optional$1(webfingerSchema),
|
|
101
98
|
lookup: optional$1(lookupSchema),
|
|
102
99
|
inbox: optional$1(inboxSchema),
|
package/dist/deno.js
CHANGED
package/dist/options.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
|
+
import { TUNNEL_SERVICE_NAMES } from "./tunnelservice.js";
|
|
2
3
|
import { configContext } from "./config.js";
|
|
3
4
|
import { choice, constant, flag, map, merge, message, object, option, optional, or, string, withDefault } from "@optique/core";
|
|
4
5
|
import { bindConfig } from "@optique/config";
|
|
@@ -7,11 +8,7 @@ import { getUserAgent } from "@fedify/vocab-runtime";
|
|
|
7
8
|
/**
|
|
8
9
|
* Available tunneling services for exposing local servers to the public internet.
|
|
9
10
|
*/
|
|
10
|
-
const TUNNEL_SERVICES =
|
|
11
|
-
"localhost.run",
|
|
12
|
-
"serveo.net",
|
|
13
|
-
"pinggy.io"
|
|
14
|
-
];
|
|
11
|
+
const TUNNEL_SERVICES = TUNNEL_SERVICE_NAMES;
|
|
15
12
|
/**
|
|
16
13
|
* Creates a tunnel service option with customizable option names.
|
|
17
14
|
*/
|
package/dist/tempserver.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
|
-
import {
|
|
2
|
+
import { TUNNEL_SERVICE_REGISTRY } from "./tunnelservice.js";
|
|
3
3
|
import { openTunnel } from "@hongminhee/localtunnel";
|
|
4
|
+
import { getLogger } from "@logtape/logtape";
|
|
4
5
|
import { serve } from "srvx";
|
|
5
6
|
//#region src/tempserver.ts
|
|
6
7
|
const logger = getLogger([
|
|
@@ -56,6 +57,7 @@ async function spawnTemporaryServer(fetch, options = {}) {
|
|
|
56
57
|
logger.debug("Temporary server is listening on port {port}.", { port });
|
|
57
58
|
const tun = await openTunnel({
|
|
58
59
|
port: parseInt(port),
|
|
60
|
+
services: TUNNEL_SERVICE_REGISTRY,
|
|
59
61
|
service: options.service
|
|
60
62
|
});
|
|
61
63
|
logger.debug("Temporary server is tunneled to {url}.", { url: tun.url.href });
|
package/dist/tunnel.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
|
+
import { TUNNEL_SERVICE_REGISTRY } from "./tunnelservice.js";
|
|
2
3
|
import { createTunnelServiceOption } from "./options.js";
|
|
3
4
|
import { configureLogging } from "./log.js";
|
|
4
5
|
import process from "node:process";
|
|
5
6
|
import { argument, command, constant, integer, merge, message, object } from "@optique/core";
|
|
6
7
|
import { print, printError } from "@optique/run";
|
|
7
|
-
import ora from "ora";
|
|
8
8
|
import { openTunnel } from "@hongminhee/localtunnel";
|
|
9
|
+
import ora from "ora";
|
|
9
10
|
//#region src/tunnel.ts
|
|
10
11
|
const tunnelOptions = merge("Tunnel options", object({ command: constant("tunnel") }), object({
|
|
11
12
|
port: argument(integer({
|
|
@@ -36,6 +37,7 @@ async function runTunnel(command, deps = {
|
|
|
36
37
|
try {
|
|
37
38
|
tunnel = await deps.openTunnel({
|
|
38
39
|
port: command.port,
|
|
40
|
+
services: TUNNEL_SERVICE_REGISTRY,
|
|
39
41
|
service: command.service
|
|
40
42
|
});
|
|
41
43
|
} catch (error) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "temporal-polyfill";
|
|
2
|
+
import { SERVICES } from "@hongminhee/localtunnel";
|
|
3
|
+
//#region src/tunnelservice.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Fedify-operated public tunneling service.
|
|
6
|
+
*/
|
|
7
|
+
const FEDIFY_TUNNEL_SERVICE = {
|
|
8
|
+
host: "fedify.com.es:2222",
|
|
9
|
+
port: 80,
|
|
10
|
+
urlPattern: /https:\/\/[a-z0-9]{16}\.fedify\.com\.es(?=[/\s]|$)/,
|
|
11
|
+
extraOptions: [
|
|
12
|
+
"-o",
|
|
13
|
+
"PubkeyAuthentication=no",
|
|
14
|
+
"-o",
|
|
15
|
+
"PasswordAuthentication=no",
|
|
16
|
+
"-o",
|
|
17
|
+
"KbdInteractiveAuthentication=no",
|
|
18
|
+
"-o",
|
|
19
|
+
"ExitOnForwardFailure=yes",
|
|
20
|
+
"-o",
|
|
21
|
+
"ServerAliveInterval=30",
|
|
22
|
+
"-o",
|
|
23
|
+
"ServerAliveCountMax=3"
|
|
24
|
+
],
|
|
25
|
+
knownHosts: { "[fedify.com.es]:2222": ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOepK/E2PANumZNFCicc/zv4EkyraFwqV8qveMtDC5b+"] }
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Available tunneling services for exposing local servers to the public
|
|
29
|
+
* internet.
|
|
30
|
+
*/
|
|
31
|
+
const TUNNEL_SERVICE_REGISTRY = {
|
|
32
|
+
...SERVICES,
|
|
33
|
+
"fedify.com.es": FEDIFY_TUNNEL_SERVICE
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Available tunneling service names.
|
|
37
|
+
*/
|
|
38
|
+
const TUNNEL_SERVICE_NAMES = Object.freeze(Object.keys(TUNNEL_SERVICE_REGISTRY));
|
|
39
|
+
//#endregion
|
|
40
|
+
export { TUNNEL_SERVICE_NAMES, TUNNEL_SERVICE_REGISTRY };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/cli",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.1666+690d9b28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"README.md",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@optique/discover": "^1.1.0",
|
|
62
62
|
"@optique/run": "^1.1.0",
|
|
63
63
|
"@standard-schema/spec": "^1.1.0",
|
|
64
|
-
"@hongminhee/localtunnel": "^0.
|
|
64
|
+
"@hongminhee/localtunnel": "^0.5.0",
|
|
65
65
|
"@inquirer/prompts": "^7.8.4",
|
|
66
66
|
"@jimp/core": "^1.6.1",
|
|
67
67
|
"@jimp/wasm-webp": "^1.6.1",
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
"temporal-polyfill": "^1.0.1",
|
|
89
89
|
"valibot": "^1.4.0",
|
|
90
90
|
"yaml": "^2.9.0",
|
|
91
|
-
"@fedify/fedify": "2.4.0-dev.
|
|
92
|
-
"@fedify/
|
|
93
|
-
"@fedify/
|
|
94
|
-
"@fedify/
|
|
95
|
-
"@fedify/vocab": "2.4.0-dev.
|
|
96
|
-
"@fedify/
|
|
97
|
-
"@fedify/
|
|
98
|
-
"@fedify/
|
|
91
|
+
"@fedify/fedify": "2.4.0-dev.1666+690d9b28",
|
|
92
|
+
"@fedify/sqlite": "2.4.0-dev.1666+690d9b28",
|
|
93
|
+
"@fedify/vocab": "2.4.0-dev.1666+690d9b28",
|
|
94
|
+
"@fedify/relay": "2.4.0-dev.1666+690d9b28",
|
|
95
|
+
"@fedify/vocab-runtime": "2.4.0-dev.1666+690d9b28",
|
|
96
|
+
"@fedify/vocab-tools": "2.4.0-dev.1666+690d9b28",
|
|
97
|
+
"@fedify/webfinger": "2.4.0-dev.1666+690d9b28",
|
|
98
|
+
"@fedify/init": "2.4.0-dev.1666+690d9b28"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@types/bun": "^1.2.23",
|