Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable/disable password login on truenas #6433

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions server/src/immich-admin/commands/password-login.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SystemConfigService } from '@app/domain';
import axios from 'axios';
import { Command, CommandRunner } from 'nest-commander';

@Command({
Expand All @@ -15,7 +14,6 @@ export class EnablePasswordLoginCommand extends CommandRunner {
const config = await this.configService.getConfig();
config.passwordLogin.enabled = true;
await this.configService.updateConfig(config);
await axios.post('http://localhost:3001/api/refresh-config');
console.log('Password login has been enabled.');
}
}
Expand All @@ -33,7 +31,6 @@ export class DisablePasswordLoginCommand extends CommandRunner {
const config = await this.configService.getConfig();
config.passwordLogin.enabled = false;
await this.configService.updateConfig(config);
await axios.post('http://localhost:3001/api/refresh-config');
console.log('Password login has been disabled.');
}
}
5 changes: 4 additions & 1 deletion server/src/immich-admin/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { LogLevel } from '@app/infra/entities';
import { CommandFactory } from 'nest-commander';
import { AppModule } from './app.module';

process.env.LOG_LEVEL = LogLevel.WARN;

export async function bootstrap() {
await CommandFactory.run(AppModule, ['warn', 'error']);
await CommandFactory.run(AppModule);
}
9 changes: 1 addition & 8 deletions server/src/immich/controllers/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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 { PublicRoute } from '../app.guard';

Expand All @@ -24,11 +24,4 @@ export class AppController {
getCustomCss() {
return this.service.getCustomCss();
}

@ApiExcludeEndpoint()
@Post('refresh-config')
@HttpCode(HttpStatus.OK)
public reloadConfig() {
return this.service.refreshConfig();
}
}
Loading