@peerbit/server 5.4.14 → 5.4.15

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.
@@ -23,7 +23,7 @@
23
23
  Learn how to configure a non-root public URL by running `npm run build`.
24
24
  -->
25
25
  <title>Peerbit</title>
26
- <script type="module" crossorigin src="/assets/index-BiNPt6Oq.js"></script>
26
+ <script type="module" crossorigin src="/assets/index-BPdbODjv.js"></script>
27
27
  <link rel="stylesheet" crossorigin href="/assets/index-CIfVvUo9.css">
28
28
  </head>
29
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peerbit/server",
3
- "version": "5.4.14",
3
+ "version": "5.4.15",
4
4
  "author": "dao.xyz",
5
5
  "repository": {
6
6
  "type": "git",
package/src/domain.ts CHANGED
@@ -156,7 +156,8 @@ export const startCertbot = async (
156
156
  -v $(pwd)/nginx_secrets:/etc/letsencrypt \
157
157
  -v ${nginxConfigPath}:/etc/nginx/user_conf.d:ro \
158
158
  -v $(pwd)/ui:/usr/share/nginx/html:ro \
159
- --name ${dockerProcessName} jonasal/nginx-certbot:latest`;
159
+ --name ${dockerProcessName} jonasal/nginx-certbot:latest \
160
+ --restart unless-stopped`;
160
161
 
161
162
  console.log("Starting Certbot");
162
163
  // try two times with some delay, because sometimes the docker daemon is not available immidatel
@@ -86,8 +86,16 @@ server {
86
86
  }
87
87
 
88
88
  server {
89
- server_name %DOMAIN%; # managed by Certbot
90
-
89
+ server_name %DOMAIN%;
90
+ listen [::]:443 ssl ipv6only=on;
91
+ listen 443 ssl;
92
+
93
+ # Allow ACME challenge to resolve even if a client lands on https
94
+ location ^~ /.well-known/acme-challenge/ {
95
+ root /var/www/letsencrypt;
96
+ default_type text/plain;
97
+ }
98
+
91
99
  root /usr/share/nginx/html;
92
100
  index index.html index.htm;
93
101
 
@@ -95,8 +103,6 @@ server {
95
103
  try_files $uri $uri/ =404;
96
104
  }
97
105
 
98
- listen [::]:443 ssl ipv6only=on; # managed by Certbot
99
- listen 443 ssl; # managed by Certbot
100
106
 
101
107
  # Load the certificate files.
102
108
  ssl_certificate /etc/letsencrypt/live/%DOMAIN%/fullchain.pem;
@@ -135,14 +141,13 @@ server {
135
141
  # Anything requesting this particular URL should be served content from
136
142
  # Certbot's folder so the HTTP-01 ACME challenges can be completed for the
137
143
  # HTTPS certificates.
138
- location '/.well-known/acme-challenge' {
139
- default_type "text/plain";
144
+ location ^~ /.well-known/acme-challenge/ {
140
145
  root /var/www/letsencrypt;
146
+ default_type text/plain;
141
147
  }
142
148
 
143
- if ($host = %DOMAIN%) {
149
+ # Everything else: redirect to HTTPS
150
+ location / {
144
151
  return 301 https://$host$request_uri;
145
- } # managed by Certbot
146
-
147
- return 404; # managed by Certbot
152
+ }
148
153
  }
package/src/routes.ts CHANGED
@@ -21,6 +21,6 @@ export const INSTALL_PATH = "/install";
21
21
  export const BOOTSTRAP_PATH = "/network/bootstrap";
22
22
  export const RESTART_PATH = "/restart";
23
23
  export const TERMINATE_PATH = "/terminate";
24
- export const STOP_PATH = "/path";
24
+ export const STOP_PATH = "/stop";
25
25
  export const LOG_PATH = "/log";
26
26
  export const VERSIONS_PATH = "/versions";
package/src/trust.ts CHANGED
@@ -29,7 +29,7 @@ export class Trust {
29
29
  }
30
30
 
31
31
  remove(hashcode: string) {
32
- const existing = this.trusted.findIndex((x) => (x = hashcode));
32
+ const existing = this.trusted.findIndex((x) => x === hashcode);
33
33
  if (existing >= 0) {
34
34
  this.trusted.splice(existing, 1);
35
35
  return true;