Skip to content

Commit cd0a104

Browse files
committed
server-ssl.js
when determining if a new Lets Encrypt! certificate should be created the SAN and CN will be taken into consideration, if it has changed since last server restart, a certificate can be generated. improved the auto restart /root │ ├── /error │ ├── 404.html │ └── 500.html │ ├── /ssl │ ├── /module │ │ ├── /crypt │ │ ├── /jose │ │ └── lets-encrypt-acme-client.js │ │ │ ├── acmeKeys │ ├── private-key.pem │ └── certificate.pem │ ├── /website │ └── index.html <---- Your website goes here │ ├── node.exe ├── server-ssl.js └── start-windows.bat
1 parent a8dd08a commit cd0a104

2 files changed

Lines changed: 183 additions & 13 deletions

File tree

error/404.html

Lines changed: 92 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,106 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>404 - Not Found</title>
8-
<link rel="stylesheet" href="style/responsive.css">
7+
<title>404 - Page Not Found</title>
98
<style>
9+
:root {
10+
--primary-color: #4f5558;
11+
--secondary-color: #282d30;
12+
--accent-color: #ffab40;
13+
--text-color: #ffffff;
14+
--text-secondary: #04141b;
15+
--background-color: #0f0f0f;
16+
--background-secondary: #1d2022;
17+
--border-color: #171a1b;
18+
--shadow: 0 2px 4px rgba(37, 36, 36, 0.5);
19+
--radius: 4px;
20+
--spacing: 1rem;
21+
}
22+
23+
* {
24+
margin: 0;
25+
padding: 0;
26+
box-sizing: border-box;
27+
}
28+
1029
body {
30+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
31+
background-color: var(--background-color);
32+
min-height: 100vh;
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
36+
padding: var(--spacing);
37+
color: var(--text-color);
38+
}
39+
40+
.error-container {
41+
background-color: var(--background-secondary);
42+
padding: calc(var(--spacing) * 2.5);
43+
border-radius: var(--radius);
44+
box-shadow: var(--shadow);
1145
text-align: center;
46+
max-width: 480px;
47+
width: 100%;
48+
border: 1px solid var(--border-color);
49+
}
50+
51+
.error-code {
52+
font-size: 6rem;
53+
font-weight: bold;
54+
color: var(--accent-color);
55+
line-height: 1;
56+
margin-bottom: var(--spacing);
57+
}
58+
59+
.error-title {
60+
font-size: 1.5rem;
61+
color: var(--text-color);
62+
margin-bottom: var(--spacing);
63+
}
64+
65+
.error-message {
66+
color: var(--primary-color);
67+
margin-bottom: calc(var(--spacing) * 2);
68+
line-height: 1.5;
69+
}
70+
71+
.error-button {
72+
display: inline-block;
73+
background-color: var(--primary-color);
74+
color: var(--text-color);
75+
padding: calc(var(--spacing) * 0.75) calc(var(--spacing) * 1.5);
76+
border-radius: var(--radius);
77+
text-decoration: none;
78+
font-weight: 500;
79+
transition: all 0.2s;
80+
}
81+
82+
.error-button:hover {
83+
background-color: var(--secondary-color);
84+
box-shadow: 0 0 12px var(--primary-color);
85+
}
86+
87+
@media (max-width: 480px) {
88+
.error-code {
89+
font-size: 4rem;
90+
}
91+
92+
.error-title {
93+
font-size: 1.25rem;
94+
}
1295
}
1396
</style>
1497
</head>
1598

1699
<body>
17-
<section class="card">
18-
<h1>404 Not Found</h1>
19-
<p>Sorry, the page you are looking for does not exist.</p>
20-
<a href="/">Return to Home</a>
21-
</section>
100+
<div class="error-container">
101+
<div class="error-code">404</div>
102+
<h1 class="error-title">Page Not Found</h1>
103+
<p class="error-message">The page you are looking for might have been removed, had its name changed, or is
104+
temporarily unavailable.</p>
105+
<a href="/" class="error-button">Go Back Home</a>
106+
</div>
22107
</body>
23108

24109
</html>

error/500.html

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,105 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>500 - Server Error</title>
8-
<link rel="stylesheet" href="style/responsive.css">
98
<style>
9+
:root {
10+
--primary-color: #4f5558;
11+
--secondary-color: #282d30;
12+
--accent-color: #ffab40;
13+
--text-color: #ffffff;
14+
--text-secondary: #04141b;
15+
--background-color: #0f0f0f;
16+
--background-secondary: #1d2022;
17+
--border-color: #171a1b;
18+
--shadow: 0 2px 4px rgba(37, 36, 36, 0.5);
19+
--radius: 4px;
20+
--spacing: 1rem;
21+
}
22+
23+
* {
24+
margin: 0;
25+
padding: 0;
26+
box-sizing: border-box;
27+
}
28+
1029
body {
30+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
31+
background-color: var(--background-color);
32+
min-height: 100vh;
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
36+
padding: var(--spacing);
37+
color: var(--text-color);
38+
}
39+
40+
.error-container {
41+
background-color: var(--background-secondary);
42+
padding: calc(var(--spacing) * 2.5);
43+
border-radius: var(--radius);
44+
box-shadow: var(--shadow);
1145
text-align: center;
46+
max-width: 480px;
47+
width: 100%;
48+
border: 1px solid var(--border-color);
49+
}
50+
51+
.error-code {
52+
font-size: 6rem;
53+
font-weight: bold;
54+
color: var(--accent-color);
55+
line-height: 1;
56+
margin-bottom: var(--spacing);
57+
}
58+
59+
.error-title {
60+
font-size: 1.5rem;
61+
color: var(--text-color);
62+
margin-bottom: var(--spacing);
63+
}
64+
65+
.error-message {
66+
color: var(--primary-color);
67+
margin-bottom: calc(var(--spacing) * 2);
68+
line-height: 1.5;
69+
}
70+
71+
.error-button {
72+
display: inline-block;
73+
background-color: var(--primary-color);
74+
color: var(--text-color);
75+
padding: calc(var(--spacing) * 0.75) calc(var(--spacing) * 1.5);
76+
border-radius: var(--radius);
77+
text-decoration: none;
78+
font-weight: 500;
79+
transition: all 0.2s;
80+
}
81+
82+
.error-button:hover {
83+
background-color: var(--secondary-color);
84+
box-shadow: 0 0 12px var(--primary-color);
85+
}
86+
87+
@media (max-width: 480px) {
88+
.error-code {
89+
font-size: 4rem;
90+
}
91+
92+
.error-title {
93+
font-size: 1.25rem;
94+
}
1295
}
1396
</style>
1497
</head>
1598

1699
<body>
17-
<section class="card">
18-
<h1>500 Server Error</h1>
19-
<p>Oops! Something went wrong on our end. Please try again later.</p>
20-
<a href="/">Return to Home</a>
21-
</section>
100+
<div class="error-container">
101+
<div class="error-code">500</div>
102+
<h1 class="error-title">Server Error</h1>
103+
<p class="error-message">Sorry, something went wrong on our servers. We're working to fix the issue. Please try
104+
again later.</p>
105+
<a href="/" class="error-button">Go Back Home</a>
106+
</div>
22107
</body>
23108

24109
</html>

0 commit comments

Comments
 (0)