feat: add SMTP auth support for K3s migration
- Support SMTP_USER/SMTP_PASS env vars for authenticated SMTP - Support SMTP_FROM env var for configurable sender address - Auto-detect secure mode for port 465 - Backwards compatible: falls back to unauthenticated local relay
This commit is contained in:
parent
02b2408772
commit
0902e1e437
9 changed files with 148 additions and 129 deletions
17
src/index.ts
17
src/index.ts
|
|
@ -54,7 +54,7 @@ app.use(compression());
|
|||
app.use((req, res, next) => {
|
||||
const isAuthBillingRoute = req.path.startsWith('/v1/signup') ||
|
||||
req.path.startsWith('/v1/recover') ||
|
||||
req.path.startsWith('/v1/billing') ||
|
||||
req.path.startsWith('/v1/billing');
|
||||
|
||||
if (isAuthBillingRoute) {
|
||||
res.setHeader("Access-Control-Allow-Origin", "https://docfast.dev");
|
||||
|
|
@ -184,12 +184,17 @@ app.get("/favicon.ico", (_req, res) => {
|
|||
res.sendFile(path.join(__dirname, "../public/favicon.svg"));
|
||||
});
|
||||
|
||||
app.use(express.static(path.join(__dirname, "../public"), {
|
||||
maxAge: "1d",
|
||||
etag: true,
|
||||
setHeaders: (res) => {
|
||||
res.setHeader('Cache-Control', 'public, max-age=86400');
|
||||
// Static asset cache headers middleware
|
||||
app.use((req, res, next) => {
|
||||
if (/\.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$/.test(req.path)) { console.log("CACHE HIT:", req.path);
|
||||
res.setHeader('Cache-Control', 'public, max-age=604800, immutable');
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
app.use(express.static(path.join(__dirname, "../public"), {
|
||||
etag: true,
|
||||
cacheControl: false,
|
||||
}));
|
||||
|
||||
// Docs page (clean URL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue