forked from CaramelFur/Picsur
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix everything needed for correct build
- Loading branch information
1 parent
d0dea59
commit 62a4c91
Showing
53 changed files
with
490 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
node_modules | ||
**/node_modules | ||
dist | ||
**/dist | ||
|
||
Dockerfile | ||
docker-compose.yml | ||
support | ||
backend/dist | ||
frontend/dist | ||
shared/dist | ||
**/.angular | ||
|
||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.pnp.* | ||
|
||
yarn-error.log | ||
temp | ||
|
||
.vscode | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
backend/src/collections/preference-db/preference-db.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { ConfigService } from '@nestjs/config'; | ||
import { ParseString } from 'picsur-shared/dist/util/parse-simple'; | ||
import { EnvPrefix } from '../config.static'; | ||
|
||
@Injectable() | ||
export class EarlyJwtConfigService { | ||
constructor(private readonly configService: ConfigService) {} | ||
|
||
public getJwtSecret(): string | undefined { | ||
return this.configService.get<string>(`${EnvPrefix}JWT_SECRET`); | ||
return ( | ||
ParseString(this.configService.get(`${EnvPrefix}JWT_SECRET`)) ?? undefined | ||
); | ||
} | ||
|
||
public getJwtExpiresIn(): string | undefined { | ||
return this.configService.get<string>(`${EnvPrefix}JWT_EXPIRY`); | ||
return ( | ||
ParseString(this.configService.get(`${EnvPrefix}JWT_EXPIRY`)) ?? undefined | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,48 @@ | ||
import { Injectable, Logger } from '@nestjs/common'; | ||
import { ConfigService } from '@nestjs/config'; | ||
import { | ||
ParseBool, | ||
ParseInt, | ||
ParseString | ||
} from 'picsur-shared/dist/util/parse-simple'; | ||
import { EnvPrefix } from '../config.static'; | ||
|
||
@Injectable() | ||
export class HostConfigService { | ||
private readonly logger = new Logger('HostConfigService'); | ||
|
||
constructor(private readonly configService: ConfigService) { | ||
this.logger.log('Production: ' + this.isProduction()); | ||
this.logger.log('Host: ' + this.getHost()); | ||
this.logger.log('Port: ' + this.getPort()); | ||
this.logger.log('Demo: ' + this.isDemo()); | ||
this.logger.log('Demo Interval: ' + this.getDemoInterval() / 1000 + 's'); | ||
} | ||
|
||
public getHost(): string { | ||
const host = this.configService.get<string>(`${EnvPrefix}HOST`, '0.0.0.0'); | ||
return host; | ||
return ParseString(this.configService.get(`${EnvPrefix}HOST`), '0.0.0.0'); | ||
} | ||
|
||
public getPort(): number { | ||
const port = this.configService.get<number>(`${EnvPrefix}PORT`, 8080); | ||
return port; | ||
return ParseInt(this.configService.get(`${EnvPrefix}PORT`), 8080); | ||
} | ||
|
||
public isDemo() { | ||
const enabled = this.configService.get<boolean>(`${EnvPrefix}DEMO`, false); | ||
return enabled; | ||
return ParseBool(this.configService.get(`${EnvPrefix}DEMO`), false); | ||
} | ||
|
||
public getDemoInterval() { | ||
const interval = this.configService.get<number>( | ||
`${EnvPrefix}DEMO_INTERVAL`, | ||
return ParseInt( | ||
this.configService.get(`${EnvPrefix}DEMO_INTERVAL`), | ||
1000 * 60 * 5, | ||
); | ||
return interval; | ||
} | ||
|
||
public isProduction() { | ||
const enabled = this.configService.get<boolean>( | ||
`${EnvPrefix}PRODUCTION`, | ||
false, | ||
); | ||
return enabled; | ||
return ParseBool(this.configService.get(`${EnvPrefix}PRODUCTION`), false); | ||
} | ||
|
||
public getVersion() { | ||
const version = this.configService.get<string>( | ||
`npm_package_version`, | ||
'0.0.0', | ||
); | ||
return version; | ||
return ParseString(this.configService.get(`npm_package_version`), '0.0.0'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.