@powerhousedao/ph-cli 2.5.0-dev.5 → 2.5.0-dev.6
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
|
@@ -130,94 +130,43 @@ EOF
|
|
|
130
130
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
131
131
|
read -p "Enter Connect domain (e.g. connect.google.com): " connect_domain
|
|
132
132
|
read -p "Enter Switchboard domain (e.g. switchboard.google.com): " switchboard_domain
|
|
133
|
+
read -p "Enter admin email for Let's Encrypt notifications: " admin_email
|
|
133
134
|
|
|
134
135
|
echo "Using domains:"
|
|
135
136
|
echo "Connect: $connect_domain"
|
|
136
137
|
echo "Switchboard: $switchboard_domain"
|
|
137
138
|
|
|
138
|
-
#
|
|
139
|
-
echo "
|
|
140
|
-
sudo
|
|
141
|
-
sudo openssl req -x509 -nodes -days 1 -newkey rsa:2048 \
|
|
142
|
-
-keyout /etc/nginx/ssl/temp.key \
|
|
143
|
-
-out /etc/nginx/ssl/temp.crt \
|
|
144
|
-
-subj "/CN=$connect_domain" \
|
|
145
|
-
-addext "subjectAltName = DNS:$connect_domain,DNS:$switchboard_domain"
|
|
146
|
-
|
|
147
|
-
# Check if Nginx configuration already exists
|
|
148
|
-
if [ -f "/etc/nginx/sites-available/$PROJECT_NAME" ]; then
|
|
149
|
-
echo "Nginx configuration for $PROJECT_NAME already exists"
|
|
150
|
-
read -p "Do you want to overwrite it? (y/n): " overwrite_nginx
|
|
151
|
-
if [ "$overwrite_nginx" != "y" ]; then
|
|
152
|
-
echo "Keeping existing Nginx configuration"
|
|
153
|
-
else
|
|
154
|
-
# Create Nginx configuration for domains
|
|
155
|
-
echo "Creating Nginx configuration..."
|
|
156
|
-
sudo tee /etc/nginx/sites-available/$PROJECT_NAME > /dev/null << EOF
|
|
139
|
+
# Create initial Nginx configuration for certbot
|
|
140
|
+
echo "Creating initial Nginx configuration..."
|
|
141
|
+
sudo tee /etc/nginx/sites-available/$PROJECT_NAME > /dev/null << EOF
|
|
157
142
|
server {
|
|
158
143
|
listen 80;
|
|
159
144
|
server_name $connect_domain $switchboard_domain;
|
|
160
|
-
return 301 https://\$host\$request_uri;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
server {
|
|
164
|
-
listen 443 ssl;
|
|
165
|
-
http2 on;
|
|
166
|
-
server_name $connect_domain;
|
|
167
|
-
|
|
168
|
-
ssl_certificate /etc/nginx/ssl/temp.crt;
|
|
169
|
-
ssl_certificate_key /etc/nginx/ssl/temp.key;
|
|
170
|
-
|
|
171
|
-
# SSL configuration
|
|
172
|
-
ssl_protocols TLSv1.2 TLSv1.3;
|
|
173
|
-
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;
|
|
174
|
-
ssl_prefer_server_ciphers off;
|
|
175
|
-
ssl_session_timeout 1d;
|
|
176
|
-
ssl_session_cache shared:SSL:50m;
|
|
177
|
-
ssl_session_tickets off;
|
|
178
|
-
ssl_stapling on;
|
|
179
|
-
ssl_stapling_verify on;
|
|
180
|
-
|
|
181
|
-
if (\$http_x_forwarded_proto = "http") {
|
|
182
|
-
return 301 https://\$server_name\$request_uri;
|
|
183
|
-
}
|
|
184
145
|
|
|
185
146
|
location / {
|
|
186
147
|
root /var/www/html/$PROJECT_NAME;
|
|
187
148
|
try_files \$uri \$uri/ /index.html;
|
|
188
|
-
add_header Cache-Control "no-cache";
|
|
189
|
-
add_header X-Forwarded-Proto \$scheme;
|
|
190
|
-
add_header X-Forwarded-Host \$host;
|
|
191
|
-
add_header X-Forwarded-Port \$server_port;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
server {
|
|
196
|
-
listen 443 ssl;
|
|
197
|
-
http2 on;
|
|
198
|
-
server_name $switchboard_domain;
|
|
199
|
-
|
|
200
|
-
ssl_certificate /etc/nginx/ssl/temp.crt;
|
|
201
|
-
ssl_certificate_key /etc/nginx/ssl/temp.key;
|
|
202
|
-
|
|
203
|
-
location / {
|
|
204
|
-
proxy_pass http://localhost:4001;
|
|
205
|
-
proxy_http_version 1.1;
|
|
206
|
-
proxy_set_header Upgrade \$http_upgrade;
|
|
207
|
-
proxy_set_header Connection 'upgrade';
|
|
208
|
-
proxy_set_header Host \$host;
|
|
209
|
-
proxy_cache_bypass \$http_upgrade;
|
|
210
|
-
proxy_set_header X-Real-IP \$remote_addr;
|
|
211
|
-
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
|
212
|
-
proxy_set_header X-Forwarded-Proto \$scheme;
|
|
213
149
|
}
|
|
214
150
|
}
|
|
215
151
|
EOF
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
152
|
+
|
|
153
|
+
# Enable the site
|
|
154
|
+
sudo ln -sf /etc/nginx/sites-available/$PROJECT_NAME /etc/nginx/sites-enabled/
|
|
155
|
+
sudo rm -f /etc/nginx/sites-enabled/default
|
|
156
|
+
|
|
157
|
+
# Test Nginx configuration
|
|
158
|
+
sudo nginx -t
|
|
159
|
+
|
|
160
|
+
# Restart Nginx to apply changes
|
|
161
|
+
sudo systemctl restart nginx
|
|
162
|
+
|
|
163
|
+
# Obtain SSL certificates
|
|
164
|
+
echo "Obtaining SSL certificates..."
|
|
165
|
+
sudo certbot --nginx -d $connect_domain -d $switchboard_domain --non-interactive --agree-tos --email $admin_email --redirect
|
|
166
|
+
|
|
167
|
+
# Update Nginx configuration with proper SSL settings
|
|
168
|
+
echo "Updating Nginx configuration with SSL settings..."
|
|
169
|
+
sudo tee /etc/nginx/sites-available/$PROJECT_NAME > /dev/null << EOF
|
|
221
170
|
server {
|
|
222
171
|
listen 80;
|
|
223
172
|
server_name $connect_domain $switchboard_domain;
|
|
@@ -225,13 +174,9 @@ server {
|
|
|
225
174
|
}
|
|
226
175
|
|
|
227
176
|
server {
|
|
228
|
-
listen 443 ssl;
|
|
229
|
-
http2 on;
|
|
177
|
+
listen 443 ssl http2;
|
|
230
178
|
server_name $connect_domain;
|
|
231
179
|
|
|
232
|
-
ssl_certificate /etc/nginx/ssl/temp.crt;
|
|
233
|
-
ssl_certificate_key /etc/nginx/ssl/temp.key;
|
|
234
|
-
|
|
235
180
|
# SSL configuration
|
|
236
181
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
237
182
|
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;
|
|
@@ -241,6 +186,8 @@ server {
|
|
|
241
186
|
ssl_session_tickets off;
|
|
242
187
|
ssl_stapling on;
|
|
243
188
|
ssl_stapling_verify on;
|
|
189
|
+
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
|
190
|
+
resolver_timeout 5s;
|
|
244
191
|
|
|
245
192
|
if (\$http_x_forwarded_proto = "http") {
|
|
246
193
|
return 301 https://\$server_name\$request_uri;
|
|
@@ -257,12 +204,20 @@ server {
|
|
|
257
204
|
}
|
|
258
205
|
|
|
259
206
|
server {
|
|
260
|
-
listen 443 ssl;
|
|
261
|
-
http2 on;
|
|
207
|
+
listen 443 ssl http2;
|
|
262
208
|
server_name $switchboard_domain;
|
|
263
209
|
|
|
264
|
-
|
|
265
|
-
|
|
210
|
+
# SSL configuration
|
|
211
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
|
212
|
+
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;
|
|
213
|
+
ssl_prefer_server_ciphers off;
|
|
214
|
+
ssl_session_timeout 1d;
|
|
215
|
+
ssl_session_cache shared:SSL:50m;
|
|
216
|
+
ssl_session_tickets off;
|
|
217
|
+
ssl_stapling on;
|
|
218
|
+
ssl_stapling_verify on;
|
|
219
|
+
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
|
220
|
+
resolver_timeout 5s;
|
|
266
221
|
|
|
267
222
|
location / {
|
|
268
223
|
proxy_pass http://localhost:4001;
|
|
@@ -277,21 +232,14 @@ server {
|
|
|
277
232
|
}
|
|
278
233
|
}
|
|
279
234
|
EOF
|
|
280
|
-
fi
|
|
281
|
-
|
|
282
|
-
# Enable the site
|
|
283
|
-
sudo ln -sf /etc/nginx/sites-available/$PROJECT_NAME /etc/nginx/sites-enabled/
|
|
284
|
-
sudo rm -f /etc/nginx/sites-enabled/default
|
|
285
235
|
|
|
286
|
-
# Test Nginx configuration
|
|
287
|
-
sudo nginx -t
|
|
288
|
-
|
|
289
|
-
# Obtain SSL certificates
|
|
290
|
-
echo "Obtaining SSL certificates..."
|
|
291
|
-
sudo certbot --nginx -d $connect_domain -d $switchboard_domain --non-interactive --agree-tos --email admin@$connect_domain
|
|
236
|
+
# Test and reload Nginx configuration
|
|
237
|
+
sudo nginx -t && sudo systemctl reload nginx
|
|
292
238
|
|
|
293
|
-
#
|
|
294
|
-
|
|
239
|
+
# Set up automatic renewal
|
|
240
|
+
echo "Setting up automatic certificate renewal..."
|
|
241
|
+
sudo systemctl enable certbot.timer
|
|
242
|
+
sudo systemctl start certbot.timer
|
|
295
243
|
|
|
296
244
|
else
|
|
297
245
|
# Get machine hostname
|
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.6";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/src/version.js
CHANGED