-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(settings): move network settings to their own settings tab (#…
…1287) * refactor(settings): move network settings to their own settings tab This PR moves the network settings out of the General Settings section to a new Netowrk Settings tab. * fix: add missing translations * fix: fix cypress tests for network settings * refactor: create a separate section for network settings
- Loading branch information
1 parent
0d2273f
commit 525a538
Showing
12 changed files
with
655 additions
and
398 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
33 changes: 33 additions & 0 deletions
33
server/lib/settings/migrations/0005_migrate_network_settings.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { AllSettings } from '@server/lib/settings'; | ||
|
||
const migrateNetworkSettings = (settings: any): AllSettings => { | ||
if (settings.network) { | ||
return settings; | ||
} | ||
const newSettings = { ...settings }; | ||
newSettings.network = { | ||
...settings.network, | ||
csrfProtection: settings.main.csrfProtection ?? false, | ||
trustProxy: settings.main.trustProxy ?? false, | ||
forceIpv4First: settings.main.forceIpv4First ?? false, | ||
dnsServers: settings.main.dnsServers ?? '', | ||
proxy: settings.main.proxy ?? { | ||
enabled: false, | ||
hostname: '', | ||
port: 8080, | ||
useSsl: false, | ||
user: '', | ||
password: '', | ||
bypassFilter: '', | ||
bypassLocalAddresses: true, | ||
}, | ||
}; | ||
delete settings.main.csrfProtection; | ||
delete settings.main.trustProxy; | ||
delete settings.main.forceIpv4First; | ||
delete settings.main.dnsServers; | ||
delete settings.main.proxy; | ||
return newSettings; | ||
}; | ||
|
||
export default migrateNetworkSettings; |
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
Oops, something went wrong.