mirror of
https://github.com/sct/overseerr.git
synced 2025-12-26 16:27:17 +01:00
* fix: use fs/promises for settings This PR switches from synchronous operations with the 'fs' module to asynchronous operations with the 'fs/promises' module. It also corrects a small error with hostname migration. * fix: add missing merge function of default and current config * feat: add bypass list, bypass local addresses and username/password to proxy setting This PR adds more options to the proxy setting, like username/password authentication, bypass list of domains and bypass local addresses. The UX is taken from *arrs. * fix: add error handling for proxy creating * fix: remove logs
25 lines
618 B
TypeScript
25 lines
618 B
TypeScript
import type { MainSettings } from '@server/lib/settings';
|
|
import { getSettings } from '@server/lib/settings';
|
|
|
|
class RestartFlag {
|
|
private settings: MainSettings;
|
|
|
|
public initializeSettings(settings: MainSettings): void {
|
|
this.settings = { ...settings };
|
|
}
|
|
|
|
public isSet(): boolean {
|
|
const settings = getSettings().main;
|
|
|
|
return (
|
|
this.settings.csrfProtection !== settings.csrfProtection ||
|
|
this.settings.trustProxy !== settings.trustProxy ||
|
|
this.settings.proxy.enabled !== settings.proxy.enabled
|
|
);
|
|
}
|
|
}
|
|
|
|
const restartFlag = new RestartFlag();
|
|
|
|
export default restartFlag;
|