pal-explorer-cli 0.4.4 → 0.4.5
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/README.md +1 -1
- package/extensions/@palexplorer/auth-email/extension.json +1 -1
- package/extensions/@palexplorer/discovery/extension.json +2 -1
- package/extensions/@palexplorer/discovery/index.js +9 -0
- package/lib/commands/api-keys.js +1 -1
- package/lib/commands/share-link.js +1 -1
- package/lib/core/webServer.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,7 +176,7 @@ REST API + WebSocket for real-time transfer monitoring, chat, and Pro/billing ma
|
|
|
176
176
|
| `storage_path` | `./downloads` | Default download directory |
|
|
177
177
|
| `max_connections` | `50` | Max P2P connections |
|
|
178
178
|
| `bandwidth_cap` | `0` | Upload cap in KB/s (0 = unlimited) |
|
|
179
|
-
| `discovery_servers` | `https://discovery.palexplorer.com` | Discovery server URLs (comma-separated) |
|
|
179
|
+
| `discovery_servers` | `https://discovery-1.palexplorer.com, https://discovery-2.palexplorer.com` | Discovery server URLs (comma-separated) |
|
|
180
180
|
| `announce_interval` | -- | DHT announce interval in seconds |
|
|
181
181
|
|
|
182
182
|
Config file location: `~/.config/palexplorer-cli/config.json`
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"hooks": ["on:app:ready"],
|
|
9
9
|
"permissions": ["identity:read", "identity:write", "config:read", "config:write", "net:http", "notifications"],
|
|
10
10
|
"config": {
|
|
11
|
-
"server": { "type": "string", "default": "https://discovery.palexplorer.com", "description": "Discovery server for email auth" },
|
|
11
|
+
"server": { "type": "string", "default": "https://discovery-1.palexplorer.com", "description": "Discovery server for email auth" },
|
|
12
12
|
"verifiedEmail": { "type": "string", "default": "", "description": "Currently verified email" },
|
|
13
13
|
"verifiedToken": { "type": "string", "default": "", "description": "Verified JWT token" }
|
|
14
14
|
},
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"description": "Discover servers via DHT — adds @handles, online presence, and server-assisted peer finding",
|
|
5
5
|
"author": "Palexplorer Team",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "Proprietary",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"hooks": ["on:app:ready"],
|
|
9
9
|
"permissions": ["config:read", "config:write", "identity:read"],
|
|
10
10
|
"config": {
|
|
11
|
+
"bootstrapServers": { "type": "array", "default": ["https://discovery-1.palexplorer.com", "https://discovery-2.palexplorer.com"], "description": "Bootstrap discovery server URLs" },
|
|
11
12
|
"refreshInterval": { "type": "number", "default": 1800000, "description": "Server list refresh interval in ms (default: 30 min)" },
|
|
12
13
|
"enableGossip": { "type": "boolean", "default": true, "description": "Exchange server lists with connected peers" }
|
|
13
14
|
},
|
|
@@ -20,6 +20,15 @@ export async function activate(context) {
|
|
|
20
20
|
ctx.logger.info('Discovery extension enabled. Fetching server list from DHT...');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// Register bootstrap servers from config (immediate, before DHT resolves)
|
|
24
|
+
const bootstrapServers = ctx.config.get('bootstrapServers') || [];
|
|
25
|
+
if (bootstrapServers.length > 0) {
|
|
26
|
+
const { addBootstrapServer } = await import('../../../lib/core/serverList.js');
|
|
27
|
+
for (const url of bootstrapServers) {
|
|
28
|
+
addBootstrapServer(url);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
await fetchServerList();
|
|
24
33
|
|
|
25
34
|
const interval = ctx.config.get('refreshInterval') || 1800000;
|
package/lib/commands/api-keys.js
CHANGED
|
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
|
|
2
2
|
import config from '../utils/config.js';
|
|
3
3
|
import { getIdentity } from '../core/identity.js';
|
|
4
4
|
|
|
5
|
-
const DISCOVERY_URL = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery.palexplorer.com';
|
|
5
|
+
const DISCOVERY_URL = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery-1.palexplorer.com';
|
|
6
6
|
|
|
7
7
|
export default function apiKeysCommand(program) {
|
|
8
8
|
const cmd = program
|
|
@@ -3,7 +3,7 @@ import config from '../utils/config.js';
|
|
|
3
3
|
import { getIdentity } from '../core/identity.js';
|
|
4
4
|
import { listShares, getShareKey } from '../core/shares.js';
|
|
5
5
|
|
|
6
|
-
const DISCOVERY_URL = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery.palexplorer.com';
|
|
6
|
+
const DISCOVERY_URL = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery-1.palexplorer.com';
|
|
7
7
|
|
|
8
8
|
export default function shareLinkCommand(program) {
|
|
9
9
|
const cmd = program
|
package/lib/core/webServer.js
CHANGED
|
@@ -318,7 +318,7 @@ export function startWebServer(port, torrentClient, { bindAddress = '127.0.0.1'
|
|
|
318
318
|
const identity = config.get('identity');
|
|
319
319
|
if (!identity?.handle) return res.status(400).json({ error: 'No handle registered' });
|
|
320
320
|
|
|
321
|
-
const discoveryUrl = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery.palexplorer.com';
|
|
321
|
+
const discoveryUrl = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery-1.palexplorer.com';
|
|
322
322
|
const timestamp = Date.now();
|
|
323
323
|
|
|
324
324
|
try {
|
|
@@ -599,7 +599,7 @@ export function startWebServer(port, torrentClient, { bindAddress = '127.0.0.1'
|
|
|
599
599
|
const identity = config.get('identity');
|
|
600
600
|
if (!identity?.handle) return res.status(400).json({ error: 'No handle registered' });
|
|
601
601
|
|
|
602
|
-
const discoveryUrl = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery.palexplorer.com';
|
|
602
|
+
const discoveryUrl = process.env.PAL_DISCOVERY_URL || config.get('discoveryUrl') || 'https://discovery-1.palexplorer.com';
|
|
603
603
|
const timestamp = Date.now();
|
|
604
604
|
|
|
605
605
|
try {
|