mirror of
https://github.com/immich-app/immich.git
synced 2025-01-13 15:35:15 +02:00
fix(server): enable/disable password login on truenas (#6433)
This commit is contained in:
parent
d3ff2408bc
commit
abce82e235
@ -1,5 +1,4 @@
|
|||||||
import { SystemConfigService } from '@app/domain';
|
import { SystemConfigService } from '@app/domain';
|
||||||
import axios from 'axios';
|
|
||||||
import { Command, CommandRunner } from 'nest-commander';
|
import { Command, CommandRunner } from 'nest-commander';
|
||||||
|
|
||||||
@Command({
|
@Command({
|
||||||
@ -15,7 +14,6 @@ export class EnablePasswordLoginCommand extends CommandRunner {
|
|||||||
const config = await this.configService.getConfig();
|
const config = await this.configService.getConfig();
|
||||||
config.passwordLogin.enabled = true;
|
config.passwordLogin.enabled = true;
|
||||||
await this.configService.updateConfig(config);
|
await this.configService.updateConfig(config);
|
||||||
await axios.post('http://localhost:3001/api/refresh-config');
|
|
||||||
console.log('Password login has been enabled.');
|
console.log('Password login has been enabled.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -33,7 +31,6 @@ export class DisablePasswordLoginCommand extends CommandRunner {
|
|||||||
const config = await this.configService.getConfig();
|
const config = await this.configService.getConfig();
|
||||||
config.passwordLogin.enabled = false;
|
config.passwordLogin.enabled = false;
|
||||||
await this.configService.updateConfig(config);
|
await this.configService.updateConfig(config);
|
||||||
await axios.post('http://localhost:3001/api/refresh-config');
|
|
||||||
console.log('Password login has been disabled.');
|
console.log('Password login has been disabled.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
import { LogLevel } from '@app/infra/entities';
|
||||||
import { CommandFactory } from 'nest-commander';
|
import { CommandFactory } from 'nest-commander';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
|
|
||||||
|
process.env.LOG_LEVEL = LogLevel.WARN;
|
||||||
|
|
||||||
export async function bootstrap() {
|
export async function bootstrap() {
|
||||||
await CommandFactory.run(AppModule, ['warn', 'error']);
|
await CommandFactory.run(AppModule);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { SystemConfigService } from '@app/domain';
|
import { SystemConfigService } from '@app/domain';
|
||||||
import { Controller, Get, Header, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
import { Controller, Get, Header } from '@nestjs/common';
|
||||||
import { ApiExcludeEndpoint } from '@nestjs/swagger';
|
import { ApiExcludeEndpoint } from '@nestjs/swagger';
|
||||||
import { PublicRoute } from '../app.guard';
|
import { PublicRoute } from '../app.guard';
|
||||||
|
|
||||||
@ -24,11 +24,4 @@ export class AppController {
|
|||||||
getCustomCss() {
|
getCustomCss() {
|
||||||
return this.service.getCustomCss();
|
return this.service.getCustomCss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiExcludeEndpoint()
|
|
||||||
@Post('refresh-config')
|
|
||||||
@HttpCode(HttpStatus.OK)
|
|
||||||
public reloadConfig() {
|
|
||||||
return this.service.refreshConfig();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user