@powerhousedao/ph-cli 2.5.0-dev.7 → 2.5.0-dev.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/ph-cli",
3
- "version": "2.5.0-dev.7",
3
+ "version": "2.5.0-dev.9",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -113,6 +113,16 @@ EOF
113
113
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
114
114
  echo " SSL Configuration"
115
115
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
116
+
117
+ # Add compression settings to nginx.conf if not exists
118
+ if ! grep -q "brotli_comp_level" /etc/nginx/nginx.conf; then
119
+ echo "Adding compression settings to nginx.conf..."
120
+ # Find the http block in nginx.conf
121
+ sudo sed -i '/http {/a \ # Compression settings\n # Brotli compression\n brotli on;\n brotli_comp_level 6;\n brotli_types text/plain text/css application/javascript application/json image/svg+xml application/xml+rss;\n brotli_static on;\n\n # Gzip compression\n gzip on;\n gzip_vary on;\n gzip_proxied any;\n gzip_comp_level 6;\n gzip_buffers 16 8k;\n gzip_http_version 1.1;\n gzip_types text/plain text/css application/javascript application/json image/svg+xml application/xml+rss;' /etc/nginx/nginx.conf
122
+ else
123
+ echo "Compression settings already present in nginx.conf"
124
+ fi
125
+
116
126
  echo "Choose SSL configuration:"
117
127
  echo "1) Let's Encrypt certificates for domains"
118
128
  echo "2) Self-signed certificate for machine hostname"
@@ -166,7 +176,18 @@ EOF
166
176
 
167
177
  # Obtain SSL certificates
168
178
  echo "Obtaining SSL certificates..."
169
- sudo certbot --nginx -d $connect_domain -d $switchboard_domain --non-interactive --agree-tos --email $admin_email --redirect
179
+ sudo certbot --nginx -d $connect_domain --non-interactive --agree-tos --email $admin_email --redirect
180
+ sudo certbot --nginx -d $switchboard_domain --non-interactive --agree-tos --email $admin_email --redirect
181
+
182
+ # Wait for certbot to finish and certificates to be installed
183
+ sleep 5
184
+
185
+ # Check if certificates were installed
186
+ if [ ! -f "/etc/letsencrypt/live/$connect_domain/fullchain.pem" ] || [ ! -f "/etc/letsencrypt/live/$switchboard_domain/fullchain.pem" ]; then
187
+ echo "Error: SSL certificates were not installed properly"
188
+ echo "Please check the certbot logs at /var/log/letsencrypt/letsencrypt.log"
189
+ exit 1
190
+ fi
170
191
 
171
192
  # Update Nginx configuration with proper SSL settings
172
193
  echo "Updating Nginx configuration with SSL settings..."
@@ -182,6 +203,9 @@ server {
182
203
  http2 on;
183
204
  server_name $connect_domain;
184
205
 
206
+ ssl_certificate /etc/letsencrypt/live/$connect_domain/fullchain.pem;
207
+ ssl_certificate_key /etc/letsencrypt/live/$connect_domain/privkey.pem;
208
+
185
209
  # SSL configuration
186
210
  ssl_protocols TLSv1.2 TLSv1.3;
187
211
  ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
@@ -194,6 +218,12 @@ server {
194
218
  resolver 8.8.8.8 8.8.4.4 valid=300s;
195
219
  resolver_timeout 5s;
196
220
 
221
+ # Security headers
222
+ add_header Strict-Transport-Security "max-age=63072000" always;
223
+ add_header X-Frame-Options DENY;
224
+ add_header X-Content-Type-Options nosniff;
225
+ add_header X-XSS-Protection "1; mode=block";
226
+
197
227
  if (\$http_x_forwarded_proto = "http") {
198
228
  return 301 https://\$server_name\$request_uri;
199
229
  }
@@ -217,6 +247,9 @@ server {
217
247
  http2 on;
218
248
  server_name $switchboard_domain;
219
249
 
250
+ ssl_certificate /etc/letsencrypt/live/$switchboard_domain/fullchain.pem;
251
+ ssl_certificate_key /etc/letsencrypt/live/$switchboard_domain/privkey.pem;
252
+
220
253
  # SSL configuration
221
254
  ssl_protocols TLSv1.2 TLSv1.3;
222
255
  ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
@@ -228,6 +261,12 @@ server {
228
261
  ssl_stapling_verify on;
229
262
  resolver 8.8.8.8 8.8.4.4 valid=300s;
230
263
  resolver_timeout 5s;
264
+
265
+ # Security headers
266
+ add_header Strict-Transport-Security "max-age=63072000" always;
267
+ add_header X-Frame-Options DENY;
268
+ add_header X-Content-Type-Options nosniff;
269
+ add_header X-XSS-Protection "1; mode=block";
231
270
 
232
271
  location / {
233
272
  proxy_pass http://localhost:4001;
@@ -323,21 +362,6 @@ EOF
323
362
  # =============================================================================
324
363
  pnpm prisma db push --schema node_modules/document-drive/dist/prisma/schema.prisma
325
364
 
326
- # Add global security headers and compression settings to main nginx.conf
327
- sudo tee -a /etc/nginx/nginx.conf > /dev/null << EOF
328
-
329
- # Global security headers
330
- add_header Strict-Transport-Security "max-age=63072000" always;
331
- add_header X-Frame-Options DENY;
332
- add_header X-Content-Type-Options nosniff;
333
- add_header X-XSS-Protection "1; mode=block";
334
-
335
- # Global compression settings
336
- brotli_comp_level 6;
337
- brotli_types text/plain text/css application/javascript application/json image/svg+xml application/xml+rss;
338
- brotli_static on;
339
- EOF
340
-
341
365
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
342
366
  echo " Environment setup complete!"
343
367
  echo " Use 'ph service start' to start services"
@@ -1,2 +1,2 @@
1
- export declare const version = "2.5.0-dev.7";
1
+ export declare const version = "2.5.0-dev.9";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated. DO NOT EDIT.
2
- export const version = "2.5.0-dev.7";
2
+ export const version = "2.5.0-dev.9";
3
3
  //# sourceMappingURL=version.js.map