Revert "make use of SSL certificates"
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m23s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m23s
This reverts commit e39797cf49
.
HTTPS on deno is not bad, but if you are handling a lot of connections, you are better off using a well tested reverse proxy like haproxy and nginx. They are more efficient at handling HTTPS traffic.
This commit is contained in:
parent
24eafee3e9
commit
2a37c1fe53
2 changed files with 5 additions and 18 deletions
|
@ -22,7 +22,7 @@ RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION
|
|||
RUN deno task compile
|
||||
|
||||
# Stage for creating the non-privileged user
|
||||
FROM i.sanxian.tech/alpine:3.20 AS user-stage
|
||||
FROM alpine:3.20 AS user-stage
|
||||
|
||||
RUN adduser -u 10001 -S appuser
|
||||
|
||||
|
|
21
src/main.ts
21
src/main.ts
|
@ -244,20 +244,7 @@ app.use("*", async (c, next) => {
|
|||
|
||||
routes(app, konfigStore);
|
||||
|
||||
const https = Deno.env.get("HTTPS");
|
||||
|
||||
if (https == "TRUE" || https == "true") {
|
||||
const cert = Deno.readTextFileSync("/data/cert.pem");
|
||||
const key = Deno.readTextFileSync("/data/key.key");
|
||||
Deno.serve({
|
||||
port: port,
|
||||
hostname: host,
|
||||
cert: cert,
|
||||
key: key,
|
||||
}, app.fetch);
|
||||
} else {
|
||||
Deno.serve({
|
||||
port: port,
|
||||
hostname: host,
|
||||
}, app.fetch);
|
||||
}
|
||||
Deno.serve({
|
||||
port: Number(port),
|
||||
hostname: host
|
||||
}, app.fetch);
|
||||
|
|
Reference in a new issue