@@ -24,10 +24,6 @@ namespace SimpleDnsCrypt.ViewModels
2424 [ Export ( typeof ( DomainBlacklistViewModel ) ) ]
2525 public class DomainBlacklistViewModel : Screen
2626 {
27- private const string WhitelistRuleFileName = "domain-whitelist.txt" ;
28- private const string BlacklistRuleFileName = "domain-blacklist.txt" ;
29- private const string BlacklistFileName = "blacklist.txt" ;
30-
3127 private static readonly ILog Log = LogManagerHelper . Factory ( ) ;
3228 private readonly IWindowManager _windowManager ;
3329 private readonly IEventAggregator _events ;
@@ -64,7 +60,7 @@ public DomainBlacklistViewModel(IWindowManager windowManager, IEventAggregator e
6460 else
6561 {
6662 //set default
67- _domainBlacklistFile = Path . Combine ( Directory . GetCurrentDirectory ( ) , Global . DnsCryptProxyFolder , BlacklistFileName ) ;
63+ _domainBlacklistFile = Path . Combine ( Directory . GetCurrentDirectory ( ) , Global . DnsCryptProxyFolder , Global . BlacklistFileName ) ;
6864 Properties . Settings . Default . DomainBlacklistFile = _domainBlacklistFile ;
6965 Properties . Settings . Default . Save ( ) ;
7066 }
@@ -80,7 +76,7 @@ public DomainBlacklistViewModel(IWindowManager windowManager, IEventAggregator e
8076 else
8177 {
8278 //set default
83- _domainWhitelistRuleFilePath = Path . Combine ( Directory . GetCurrentDirectory ( ) , Global . DnsCryptProxyFolder , WhitelistRuleFileName ) ;
79+ _domainWhitelistRuleFilePath = Path . Combine ( Directory . GetCurrentDirectory ( ) , Global . DnsCryptProxyFolder , Global . WhitelistRuleFileName ) ;
8480 Properties . Settings . Default . DomainWhitelistRules = _domainWhitelistRuleFilePath ;
8581 Properties . Settings . Default . Save ( ) ;
8682 }
@@ -96,7 +92,7 @@ public DomainBlacklistViewModel(IWindowManager windowManager, IEventAggregator e
9692 else
9793 {
9894 //set default
99- _domainBlacklistRuleFilePath = Path . Combine ( Directory . GetCurrentDirectory ( ) , Global . DnsCryptProxyFolder , BlacklistRuleFileName ) ;
95+ _domainBlacklistRuleFilePath = Path . Combine ( Directory . GetCurrentDirectory ( ) , Global . DnsCryptProxyFolder , Global . BlacklistRuleFileName ) ;
10096 Properties . Settings . Default . DomainBlacklistRules = _domainBlacklistRuleFilePath ;
10197 Properties . Settings . Default . Save ( ) ;
10298 }
@@ -138,11 +134,10 @@ private async void ManageDnsCryptBlacklist(DnscryptProxyConfiguration dnscryptPr
138134 var saveAndRestartService = false ;
139135 if ( dnscryptProxyConfiguration . blacklist == null )
140136 {
141- dnscryptProxyConfiguration . blacklist = new Blacklist ( )
137+ dnscryptProxyConfiguration . blacklist = new Blacklist
142138 {
143139 blacklist_file = _domainBlacklistFile ,
144- log_format = defaultLogFormat ,
145- log_file = "blocked.log"
140+ log_format = defaultLogFormat
146141 } ;
147142 saveAndRestartService = true ;
148143 }
@@ -227,7 +222,7 @@ public void ChangeBlacklistFilePath()
227222 var result = blacklistFolderDialog . ShowDialog ( ) ;
228223 if ( result == DialogResult . OK )
229224 {
230- DomainBlacklistFile = Path . Combine ( blacklistFolderDialog . SelectedPath , BlacklistFileName ) ;
225+ DomainBlacklistFile = Path . Combine ( blacklistFolderDialog . SelectedPath , Global . BlacklistFileName ) ;
231226 }
232227 }
233228 catch ( Exception exception )
@@ -334,7 +329,7 @@ public void ChangeWhitelistRulesFilePath()
334329 var result = whitelistFolderDialog . ShowDialog ( ) ;
335330 if ( result == DialogResult . OK )
336331 {
337- DomainWhitelistRuleFilePath = Path . Combine ( whitelistFolderDialog . SelectedPath , WhitelistRuleFileName ) ;
332+ DomainWhitelistRuleFilePath = Path . Combine ( whitelistFolderDialog . SelectedPath , Global . WhitelistRuleFileName ) ;
338333 }
339334 }
340335 catch ( Exception exception )
@@ -657,7 +652,7 @@ public void ChangeBlacklistRulesFilePath()
657652 var result = blacklistFolderDialog . ShowDialog ( ) ;
658653 if ( result == DialogResult . OK )
659654 {
660- DomainBlacklistRuleFilePath = Path . Combine ( blacklistFolderDialog . SelectedPath , BlacklistRuleFileName ) ;
655+ DomainBlacklistRuleFilePath = Path . Combine ( blacklistFolderDialog . SelectedPath , Global . BlacklistRuleFileName ) ;
661656 }
662657 }
663658 catch ( Exception exception )
0 commit comments