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.
Add client side preference verification
Add support for hostname override
- Loading branch information
1 parent
145ff69
commit dac4389
Showing
25 changed files
with
253 additions
and
137 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Injectable, Logger } from '@nestjs/common'; | ||
import { SysPreference } from 'picsur-shared/dist/dto/sys-preferences.enum'; | ||
import { HasFailed } from 'picsur-shared/dist/types'; | ||
import { SysPreferenceDbService } from '../../collections/preference-db/sys-preference-db.service'; | ||
|
||
@Injectable() | ||
export class InfoConfigService { | ||
private readonly logger = new Logger(InfoConfigService.name); | ||
|
||
constructor(private readonly prefService: SysPreferenceDbService) {} | ||
|
||
public async getHostnameOverride(): Promise<string | undefined> { | ||
const hostname = await this.prefService.getStringPreference( | ||
SysPreference.HostOverride, | ||
); | ||
if (HasFailed(hostname)) { | ||
this.logger.warn(hostname.print()); | ||
return undefined; | ||
} | ||
|
||
return hostname; | ||
} | ||
} |
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,10 +1,10 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { EarlyConfigModule } from '../../../config/early/early-config.module'; | ||
import { LateConfigModule } from '../../../config/late/late-config.module'; | ||
import { UsageManagerModule } from '../../../managers/usage/usage.module'; | ||
import { InfoController } from './info.controller'; | ||
|
||
@Module({ | ||
imports: [EarlyConfigModule, UsageManagerModule], | ||
imports: [LateConfigModule, UsageManagerModule], | ||
controllers: [InfoController], | ||
}) | ||
export class InfoModule {} |
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.