@powerhousedao/ph-cli 2.5.0-dev.12 → 2.5.0-dev.14
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/package.json +1 -1
- package/dist/scripts/manage-environment +7 -1
- package/dist/scripts/setup-environment +18 -2
- package/dist/src/help.d.ts +1 -1
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +4 -6
- package/dist/src/help.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +9 -9
package/dist/package.json
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
PROJECT_NAME=${1:-"global"}
|
|
7
7
|
ACTION=${2:-"status"}
|
|
8
8
|
|
|
9
|
+
# Get Switchboard port from .env or use default
|
|
10
|
+
if [ -f ".env" ]; then
|
|
11
|
+
SWITCHBOARD_PORT=$(grep "SWITCHBOARD_PORT=" .env | cut -d'=' -f2)
|
|
12
|
+
fi
|
|
13
|
+
SWITCHBOARD_PORT=${SWITCHBOARD_PORT:-4001}
|
|
14
|
+
|
|
9
15
|
# =============================================================================
|
|
10
16
|
# OS Detection and Windows Handling
|
|
11
17
|
# =============================================================================
|
|
@@ -95,7 +101,7 @@ else
|
|
|
95
101
|
# Start Switchboard via PM2
|
|
96
102
|
if ! pm2 list | grep -q "switchboard_${PROJECT_NAME}"; then
|
|
97
103
|
cd $PROJECT_NAME
|
|
98
|
-
pm2 start "pnpm switchboard" --name "switchboard_${PROJECT_NAME}"
|
|
104
|
+
pm2 start "pnpm switchboard --port $SWITCHBOARD_PORT" --name "switchboard_${PROJECT_NAME}"
|
|
99
105
|
pm2 save
|
|
100
106
|
else
|
|
101
107
|
pm2 start "switchboard_${PROJECT_NAME}"
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
TARGET_TAG=${1:-"latest"}
|
|
7
7
|
PROJECT_NAME=${2:-"global"}
|
|
8
8
|
|
|
9
|
+
# Function to find an available port
|
|
10
|
+
find_available_port() {
|
|
11
|
+
local port=4001
|
|
12
|
+
while netstat -tuln | grep -q ":$port "; do
|
|
13
|
+
port=$((port + 1))
|
|
14
|
+
done
|
|
15
|
+
echo $port
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
# =============================================================================
|
|
10
19
|
# OS Detection and Windows Handling
|
|
11
20
|
# =============================================================================
|
|
@@ -114,6 +123,13 @@ EOF
|
|
|
114
123
|
echo " SSL Configuration"
|
|
115
124
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
116
125
|
|
|
126
|
+
# Find an available port for Switchboard
|
|
127
|
+
SWITCHBOARD_PORT=$(find_available_port)
|
|
128
|
+
echo "Using port $SWITCHBOARD_PORT for Switchboard"
|
|
129
|
+
|
|
130
|
+
# Save Switchboard port to configuration
|
|
131
|
+
echo "SWITCHBOARD_PORT=$SWITCHBOARD_PORT" | sudo tee -a .env
|
|
132
|
+
|
|
117
133
|
# Add compression settings to nginx.conf if not exists
|
|
118
134
|
if ! grep -q "brotli_comp_level" /etc/nginx/nginx.conf || ! grep -q "gzip_comp_level" /etc/nginx/nginx.conf; then
|
|
119
135
|
echo "Adding compression settings to nginx.conf..."
|
|
@@ -276,7 +292,7 @@ server {
|
|
|
276
292
|
add_header X-XSS-Protection "1; mode=block";
|
|
277
293
|
|
|
278
294
|
location / {
|
|
279
|
-
proxy_pass http://localhost
|
|
295
|
+
proxy_pass http://localhost:$SWITCHBOARD_PORT;
|
|
280
296
|
proxy_http_version 1.1;
|
|
281
297
|
proxy_set_header Upgrade \$http_upgrade;
|
|
282
298
|
proxy_set_header Connection 'upgrade';
|
|
@@ -343,7 +359,7 @@ server {
|
|
|
343
359
|
}
|
|
344
360
|
|
|
345
361
|
location /switchboard {
|
|
346
|
-
proxy_pass http://localhost
|
|
362
|
+
proxy_pass http://localhost:$SWITCHBOARD_PORT;
|
|
347
363
|
proxy_http_version 1.1;
|
|
348
364
|
proxy_set_header Upgrade \$http_upgrade;
|
|
349
365
|
proxy_set_header Connection 'upgrade';
|
package/dist/src/help.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const inspectHelp = "\nCommand Overview:\n The inspect command e
|
|
|
37
37
|
/**
|
|
38
38
|
* Help text for the service command
|
|
39
39
|
*/
|
|
40
|
-
export declare const serviceHelp = "\nCommand Overview:\n The service command manages Powerhouse services, allowing you to start, stop, check status,\n and more. It provides a centralized way to control the lifecycle of services in your project.\n\n This command:\n 1. Controls service lifecycle (start, stop, status, etc.)\n 2. Manages multiple services from a single interface\n 3. Provides detailed information about running services\n 4. Uses PM2 under the hood for process management\n\nArguments:\n <action> The action to perform. Available actions:\n - start: Launch the specified service\n - stop: Terminate the specified service\n - status: Check the current status of services\n - list: List all managed services (default)\n - startup: Configure services to start on system boot\n - unstartup: Remove services from system startup\n \n [service] Optional. The service to act upon. Available services:\n - switchboard: The document processing engine\n - connect: The Connect Studio interface\n - all: Act on all services (default)\n\nExamples:\n $ ph service
|
|
40
|
+
export declare const serviceHelp = "\nCommand Overview:\n The service command manages Powerhouse services, allowing you to start, stop, check status,\n and more. It provides a centralized way to control the lifecycle of services in your project.\n\n This command:\n 1. Controls service lifecycle (start, stop, status, etc.)\n 2. Manages multiple services from a single interface\n 3. Provides detailed information about running services\n 4. Uses PM2 under the hood for process management\n\nArguments:\n <action> The action to perform. Available actions:\n - start: Launch the specified service\n - stop: Terminate the specified service\n - status: Check the current status of services\n - list: List all managed services (default)\n - startup: Configure services to start on system boot\n - unstartup: Remove services from system startup\n \n [service] Optional. The service to act upon. Available services:\n - switchboard: The document processing engine\n - connect: The Connect Studio interface\n - all: Act on all services (default)\n\nExamples:\n $ ph service setup # Setup services\n $ ph service start # Start the services\n $ ph service stop # Stop the services\n $ ph service status # Check status of all services\n \n\nNotes:\n - Services are managed using PM2, a process manager for Node.js applications\n - The 'status' action shows uptime, memory usage, CPU usage, and other metrics\n - The 'list' action is the default when no action is specified\n - The 'all' service is the default when no service is specified\n";
|
|
41
41
|
/**
|
|
42
42
|
* Help text for the switchboard command
|
|
43
43
|
*/
|
package/dist/src/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,itDAkC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,2nBAU5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,yXAS9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,kpGA0DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,itDAkC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,2nBAU5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,yXAS9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,kpGA0DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+zDAqCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,ixDAoC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,s6DAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,2kCA0BvB,CAAC"}
|
package/dist/src/help.js
CHANGED
|
@@ -350,13 +350,11 @@ Arguments:
|
|
|
350
350
|
- all: Act on all services (default)
|
|
351
351
|
|
|
352
352
|
Examples:
|
|
353
|
-
$ ph service
|
|
354
|
-
$ ph service start
|
|
355
|
-
$ ph service stop
|
|
356
|
-
$ ph service start all # Start all services
|
|
353
|
+
$ ph service setup # Setup services
|
|
354
|
+
$ ph service start # Start the services
|
|
355
|
+
$ ph service stop # Stop the services
|
|
357
356
|
$ ph service status # Check status of all services
|
|
358
|
-
|
|
359
|
-
$ ph service unstartup # Remove services from system startup
|
|
357
|
+
|
|
360
358
|
|
|
361
359
|
Notes:
|
|
362
360
|
- Services are managed using PM2, a process manager for Node.js applications
|
package/dist/src/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mCAAmC,EACnC,wBAAwB,GACzB,MAAM,4CAA4C,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;2EAM2C,uBAAuB;6FACL,mCAAmC;uEACzD,wBAAwB;;CAE9F,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;CASjC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,G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AEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.5.0-dev.
|
|
1
|
+
export declare const version = "2.5.0-dev.14";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/src/version.js
CHANGED