fix: email templates not being included in builds

feat: implement nginx proxy
This commit is contained in:
Kakious 2024-10-16 17:42:02 -04:00
parent 65b957fbc2
commit 5c927a26cd
13 changed files with 10 additions and 8 deletions

View file

@ -4,6 +4,7 @@
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true,
"plugins": ["@nestjs/swagger"]
"plugins": ["@nestjs/swagger"],
"assets": ["**/*.hbs", "**/*.txt"]
}
}

View file

@ -19,7 +19,9 @@ export class ViewLoginGuard implements CanActivate {
'/',
];
if (loginPages.includes(context.switchToHttp().getRequest().url)) {
// remove the query string
const url = context.switchToHttp().getRequest().url.split('?')[0];
if (loginPages.includes(url)) {
if (authType === 'session') {
response.redirect('/home');
return false;

View file

@ -111,7 +111,7 @@ export class MailService {
*/
private async readHtmlTemplate(templateName: string): Promise<string> {
return (
await readFile(path.join(__dirname, '../..', 'mail/html', `${templateName}.hbs`))
await readFile(path.join(__dirname, '../..', 'resources/mail/html', `${templateName}.hbs`))
).toString();
}
@ -122,7 +122,7 @@ export class MailService {
*/
private async readTextTemplate(templateName: string): Promise<string> {
return (
await readFile(path.join(__dirname, '../..', 'mail/text', `${templateName}.txt`))
await readFile(path.join(__dirname, '../..', 'resources/mail/text', `${templateName}.txt`))
).toString();
}

View file

@ -32,14 +32,14 @@ http {
#OIDC Provider
location /oidc/ {
resolver 127.0.0.11 valid=30s; # Docker DNS
proxy_pass http://host.docker.internal:3001/api/; # Local back end
proxy_pass http://host.docker.internal:3001/oidc/; # Local back end
proxy_redirect default;
}
#Frontend Next.js App
location / {
resolver 127.0.0.11 valid=30s; # Docker DNS
proxy_pass http://host.docker.internal:3000/; # Local back end
proxy_pass http://host.docker.internal:3001/; # Local back end
proxy_redirect default;
}
}

View file

@ -19,8 +19,7 @@ services:
- "6379:6379"
nginx:
container_name: nginx-local-dev-proxy
image: nginx:1.21.3
image: nginx:latest
ports:
- target: 80
published: 80