@powerhousedao/ph-cli 2.5.0-dev.8 → 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.8",
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,13 +176,14 @@ 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
170
181
 
171
182
  # Wait for certbot to finish and certificates to be installed
172
183
  sleep 5
173
184
 
174
185
  # Check if certificates were installed
175
- if [ ! -f "/etc/letsencrypt/live/$connect_domain/fullchain.pem" ]; then
186
+ if [ ! -f "/etc/letsencrypt/live/$connect_domain/fullchain.pem" ] || [ ! -f "/etc/letsencrypt/live/$switchboard_domain/fullchain.pem" ]; then
176
187
  echo "Error: SSL certificates were not installed properly"
177
188
  echo "Please check the certbot logs at /var/log/letsencrypt/letsencrypt.log"
178
189
  exit 1
@@ -207,6 +218,12 @@ server {
207
218
  resolver 8.8.8.8 8.8.4.4 valid=300s;
208
219
  resolver_timeout 5s;
209
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
+
210
227
  if (\$http_x_forwarded_proto = "http") {
211
228
  return 301 https://\$server_name\$request_uri;
212
229
  }
@@ -230,8 +247,8 @@ server {
230
247
  http2 on;
231
248
  server_name $switchboard_domain;
232
249
 
233
- ssl_certificate /etc/letsencrypt/live/$connect_domain/fullchain.pem;
234
- ssl_certificate_key /etc/letsencrypt/live/$connect_domain/privkey.pem;
250
+ ssl_certificate /etc/letsencrypt/live/$switchboard_domain/fullchain.pem;
251
+ ssl_certificate_key /etc/letsencrypt/live/$switchboard_domain/privkey.pem;
235
252
 
236
253
  # SSL configuration
237
254
  ssl_protocols TLSv1.2 TLSv1.3;
@@ -244,6 +261,12 @@ server {
244
261
  ssl_stapling_verify on;
245
262
  resolver 8.8.8.8 8.8.4.4 valid=300s;
246
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";
247
270
 
248
271
  location / {
249
272
  proxy_pass http://localhost:4001;
@@ -339,26 +362,6 @@ EOF
339
362
  # =============================================================================
340
363
  pnpm prisma db push --schema node_modules/document-drive/dist/prisma/schema.prisma
341
364
 
342
- # Check if security headers and compression settings are already present
343
- if ! grep -q "Strict-Transport-Security" /etc/nginx/nginx.conf; then
344
- # Add global security headers and compression settings to main nginx.conf
345
- sudo tee -a /etc/nginx/nginx.conf > /dev/null << EOF
346
-
347
- # Global security headers
348
- add_header Strict-Transport-Security "max-age=63072000" always;
349
- add_header X-Frame-Options DENY;
350
- add_header X-Content-Type-Options nosniff;
351
- add_header X-XSS-Protection "1; mode=block";
352
-
353
- # Global compression settings
354
- brotli_comp_level 6;
355
- brotli_types text/plain text/css application/javascript application/json image/svg+xml application/xml+rss;
356
- brotli_static on;
357
- EOF
358
- else
359
- echo "Security headers and compression settings already present in nginx.conf"
360
- fi
361
-
362
365
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
363
366
  echo " Environment setup complete!"
364
367
  echo " Use 'ph service start' to start services"
@@ -1,2 +1,2 @@
1
- export declare const version = "2.5.0-dev.8";
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.8";
2
+ export const version = "2.5.0-dev.9";
3
3
  //# sourceMappingURL=version.js.map