Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 build: optimize image size under glibc env #4025

Merged
merged 37 commits into from
Sep 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3ecc15c
👷 build: optimize image size under `glibc` env
hezhijie0327 Sep 19, 2024
35ecda3
Merge branch 'main' into dockerfile
hezhijie0327 Sep 19, 2024
1641538
👷 build: add `startServer.js` as server launcher
hezhijie0327 Sep 19, 2024
f5419df
🐛 fix: `PROXY_URL` missing
hezhijie0327 Sep 19, 2024
63d837b
🔨 chore: exit if DB migration failed
hezhijie0327 Sep 19, 2024
0ca15f9
🔨 chore: allow resolve ipv6 address
hezhijie0327 Sep 19, 2024
28f1823
🔨 chore: rollback changes, cleanup code
hezhijie0327 Sep 19, 2024
44d09b8
🔨 chore: improve console log
hezhijie0327 Sep 19, 2024
fb2434b
🔨 chore: improve error print
hezhijie0327 Sep 19, 2024
0e914da
👷 build: add `isValidSSL` function to check SSL cert
hezhijie0327 Sep 19, 2024
ee775ce
🔨 chore: handle `CERT_HAS_EXPIRED` error
hezhijie0327 Sep 19, 2024
1e2e682
🔨 chore: cleanup code
hezhijie0327 Sep 19, 2024
48c9bee
🔨 chore: improve console log
hezhijie0327 Sep 19, 2024
de68ab4
👷 build: check oss & auth issuer ssl connection before running
hezhijie0327 Sep 19, 2024
513dd48
🔨 chore: improve console log
hezhijie0327 Sep 19, 2024
abe57cb
🔨 chore: change `SSL` to `TLS`
hezhijie0327 Sep 19, 2024
5d6559a
🐛 fix: fix `443` port not display in logs
hezhijie0327 Sep 19, 2024
c9aebf7
🔨 chore: improve console output
hezhijie0327 Sep 19, 2024
a640258
Merge branch 'main' into dockerfile
hezhijie0327 Sep 19, 2024
73a6232
🐛 fix: fix error catch
hezhijie0327 Sep 19, 2024
83fa139
🔨 chore: handle corner case
hezhijie0327 Sep 19, 2024
e5b774a
👷 build: support self-signed SSL cert, switch to system-wide CA cert
hezhijie0327 Sep 19, 2024
ddd37ce
🔨 chore: handle `UNABLE_TO_GET_ISSUER_CERT_LOCALLY` error
hezhijie0327 Sep 20, 2024
7bd0a95
🔨 chore: handle when `*_ISSUER` not existed
hezhijie0327 Sep 20, 2024
689b7e9
🔨 chore: handle non-https protocol, skip TLS checking
hezhijie0327 Sep 20, 2024
5fcf2d9
🔨 chore: improve console log
hezhijie0327 Sep 20, 2024
fac469d
🐛 fix: fix proxychains logs not available when host is ip addr
hezhijie0327 Sep 20, 2024
3e1a94c
👷 build: add DNS server self-check support, split DNS resolve function
hezhijie0327 Sep 22, 2024
f5f1858
🔨 chore: improve console.log
hezhijie0327 Sep 22, 2024
dc202ee
🔨 chore: print DNS server before db migration
hezhijie0327 Sep 22, 2024
32800ea
🔨 chore: update `isValidIP` & `resolveHostIP` function, ready for IPv6
hezhijie0327 Sep 22, 2024
d4b1d72
🐛 fix: fix error handle
hezhijie0327 Sep 22, 2024
e89929c
Merge branch 'main' into dockerfile
arvinxx Sep 24, 2024
dc8334a
Merge branch 'lobehub:main' into dockerfile
hezhijie0327 Sep 25, 2024
9e80f40
👷 build: set `ENTRYPOINT` to `/bin/node`
hezhijie0327 Sep 25, 2024
cdf934f
👷 build: set full path for `proxychains` & `node`, ready for distroless
hezhijie0327 Sep 25, 2024
deb3ea8
👷 build: pin node LTS version to 20
hezhijie0327 Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🔨 chore: change SSL to TLS
  • Loading branch information
hezhijie0327 authored Sep 19, 2024
commit abe57cb70a1114b93c15995bee90fdfe666e56ca
18 changes: 9 additions & 9 deletions scripts/serverLauncher/startServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function isValidIP(ip) {
return IP_REGEX.test(ip);
}

// Function to check if a URL using a valid SSL certificate
function isValidSSL(url) {
// Function to check if a URL using a valid TLS certificate
function isValidTLS(url) {
let { host, port } = parseUrl(url);

const options = {
Expand All @@ -30,11 +30,11 @@ function isValidSSL(url) {
};

return new Promise((resolve, reject) => {
console.log(`🔄 SSL Check: Connecting to ${host}:${port} to verify SSL certificate...`);
console.log(`🔄 TLS Check: Connecting to ${host}:${port} to verify TLS certificate...`);

const socket = tls.connect(options, () => {
if (socket.authorized) {
console.log(`✅ SSL Check: Certificate for ${host}:${port} is valid.`);
console.log(`✅ TLS Check: Certificate for ${host}:${port} is valid.`);
console.log('-------------------------------------');
resolve();
}
Expand All @@ -44,9 +44,9 @@ function isValidSSL(url) {

socket.on('error', (err) => {
if (err.code === 'DEPTH_ZERO_SELF_SIGNED_CERT' || err.code === 'CERT_HAS_EXPIRED') {
console.error(`❌ SSL Check: Certificate for ${host}:${port} is not valid. You can set NODE_TLS_REJECT_UNAUTHORIZED="0" to fix it. Error details:`);
console.error(`❌ TLS Check: Certificate for ${host}:${port} is not valid. You can set NODE_TLS_REJECT_UNAUTHORIZED="0" to fix it. Error details:`);
} else {
console.error(`❌ SSL Check: Unable to connect ${host}:${port}. Please check your network connection or firewall rule. Error details:`);
console.error(`❌ TLS Check: Unable to connect ${host}:${port}. Please check your network connection or firewall rule. Error details:`);
}
reject(err);
});
Expand Down Expand Up @@ -90,13 +90,13 @@ async function runDBMigrationScript() {

// Function to run OSS connection checker
async function runOSSConnChecker() {
isValidSSL(process.env.S3_ENDPOINT);
isValidSSL(process.env.S3_PUBLIC_DOMAIN);
isValidTLS(process.env.S3_ENDPOINT);
isValidTLS(process.env.S3_PUBLIC_DOMAIN);
}

// Function to run auth issuer connection checker
async function runAuthIssuerConnChecker() {
isValidSSL(getEnvVarsByKeyword("_ISSUER"));
isValidTLS(getEnvVarsByKeyword("_ISSUER"));
}

// Function to run ProxyChains conf generator
Expand Down