4 Commits

Author SHA1 Message Date
9e1fefaa2f chore(changelog): update changelog for v0.4.0
All checks were successful
Build and upload Docker release image / upload-assets (release) Successful in 2m53s
2025-05-11 10:24:19 +00:00
a79eb29dab chore(version): bump to 0.4.0
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 4s
Auto Changelog & Release / changelog-only (push) Has been skipped
Auto Changelog & Release / release (push) Successful in 10s
Build and upload Docker nightly image / build-and-push (push) Successful in 2m48s
2025-05-11 12:24:01 +02:00
5f28d5ca7a chore(changelog): update unreleased changelog 2025-05-11 10:23:58 +00:00
d57cc27e19 feat(server): add graceful shutdown handling
Some checks failed
Auto Changelog & Release / detect-version-change (push) Successful in 4s
Auto Changelog & Release / changelog-only (push) Successful in 8s
Auto Changelog & Release / release (push) Has been skipped
Build and upload Docker nightly image / build-and-push (push) Has been cancelled
- Introduce signal listeners for SIGINT and SIGTERM to handle shutdown
- Use AbortController to terminate the server gracefully
- Improve server reliability and resource cleanup during termination
2025-05-11 12:23:38 +02:00
3 changed files with 18 additions and 1 deletions

View File

@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.4.0](https://git.0xmax42.io/maxp/lt-auth-proxy/compare/v0.3.0..v0.4.0) - 2025-05-11
### 🚀 Features
- *(server)* Add graceful shutdown handling - ([d57cc27](https://git.0xmax42.io/maxp/lt-auth-proxy/commit/d57cc27e19e68c13ac08af223c3721a9c45fafd1))
## [0.3.0](https://git.0xmax42.io/maxp/lt-auth-proxy/compare/v0.2.1..v0.3.0) - 2025-05-11 ## [0.3.0](https://git.0xmax42.io/maxp/lt-auth-proxy/compare/v0.2.1..v0.3.0) - 2025-05-11
### 🚀 Features ### 🚀 Features

View File

@@ -1 +1 @@
0.3.0 0.4.0

View File

@@ -3,6 +3,7 @@ import { Env } from './env.ts';
import { ltProxyAuth } from './ltProxyAuth.ts'; import { ltProxyAuth } from './ltProxyAuth.ts';
import { ltProxyHandler } from './ltProxyHandler.ts'; import { ltProxyHandler } from './ltProxyHandler.ts';
const ac = new AbortController();
const httpKernel = new HttpKernel(); const httpKernel = new HttpKernel();
httpKernel.route({ httpKernel.route({
@@ -11,9 +12,19 @@ httpKernel.route({
}).middleware(ltProxyAuth).handle(ltProxyHandler); }).middleware(ltProxyAuth).handle(ltProxyHandler);
Deno.serve({ Deno.serve({
signal: ac.signal,
port: Env.proxyPort, port: Env.proxyPort,
hostname: Env.proxyHost, hostname: Env.proxyHost,
onListen: ({ hostname, port }) => { onListen: ({ hostname, port }) => {
console.info(`lt-auth-proxy listening on ${hostname}:${port}`); console.info(`lt-auth-proxy listening on ${hostname}:${port}`);
}, },
}, async (req) => await httpKernel.handle(req)); }, async (req) => await httpKernel.handle(req));
const shutdown = () => {
console.info('Shutting down the server...');
ac.abort();
console.info('Server shut down successfully.');
};
Deno.addSignalListener('SIGINT', shutdown);
Deno.addSignalListener('SIGTERM', shutdown);