@@ -17,6 +17,7 @@ it under the terms of the GNU General Public License as published by
1717using System . Threading . Tasks ;
1818using SharpWebserver . Config ;
1919using System . Runtime . InteropServices ;
20+ using Tomlyn ;
2021
2122namespace SharpWebserver ;
2223partial class ListenServer
@@ -45,6 +46,16 @@ You should have received a copy of the GNU General Public License
4546 static void Main ( string [ ] args )
4647 {
4748
49+ /*
50+ var GlobalToml = @"SafeMode = true
51+ PortNumber = 8080
52+ ";
53+
54+ var BlockToml = @"BlockList = [
55+ 'item', 'item2', 'item3'
56+ ]
57+ ";
58+ */
4859 ProcessArguments ( in args ) ;
4960
5061 if ( ExitNow )
@@ -80,7 +91,7 @@ static void Main(string[] args)
8091 Utilities . EnsureDirectory ( IncludesDir ) ;
8192
8293 //Load global config
83- if ( ConfigManager . LoadConfig < SharpConfig > ( "SharpConfig.json " ) is not SharpConfig gc )
94+ if ( ConfigManager . LoadConfig < SharpConfig > ( "SharpConfig.toml " ) is not SharpConfig gc )
8495 Logger . LogInfo ( "Using default global config" ) ;
8596 else
8697 GlobalConfig = gc ;
@@ -189,7 +200,7 @@ static void Main(string[] args)
189200 Console . ResetColor ( ) ;
190201 Console . Write ( " or your distro's equivalent superuser or edit " ) ;
191202 Console . ForegroundColor = ConsoleColor . Magenta ;
192- Console . Write ( "SharpConfig.json " ) ;
203+ Console . Write ( "SharpConfig.toml " ) ;
193204 Console . ResetColor ( ) ;
194205 Console . WriteLine ( " to change the port number.\n " ) ;
195206 }
@@ -214,7 +225,7 @@ static void Main(string[] args)
214225 #region Cleanup
215226
216227 //Perform cleanup and eventually save configurations here, etc
217- ConfigManager . SaveConfig ( "SharpConfig.json " , GlobalConfig ) ;
228+ ConfigManager . SaveConfig ( "SharpConfig.toml " , GlobalConfig ) ;
218229 Utilities . SecurityPolicy . SaveBlockList ( ) ;
219230
220231 #endregion
0 commit comments