示例#1
0
        public static void GenerateSettings()
        {
            //web server settings
            Settings.Get()["General"] = new Settings.Header
            {
                {
                    "Version", Assembly.GetExecutingAssembly().GetName().Version
                },
                {
                    "RunStartup", true
                },
                {
                    "UploadLogs", true
                },
                {
                    "Github", "https://github.com/Ulterius"
                },
                {
                    "ServerIssues", "https://github.com/Ulterius/server/issues"
                },
                {
                    "ClientIssues", "https://github.com/Ulterius/client/issues"
                },
                {
                    //this is kind of nasty
                    "Maintainers", new[]
                    {
                        new
                        {
                            Name    = "Andrew Sampson",
                            Twitter = "https://twitter.com/Andrewmd5",
                            Github  = "https://github.com/codeusa",
                            Website = "https://andrew.im/"
                        },
                        new
                        {
                            Name    = "Evan Banyash",
                            Twitter = "https://twitter.com/frobthebuilder",
                            Github  = "https://github.com/FrobtheBuilder",
                            Website = "http://banyash.com/"
                        }
                    }
                }
            };
            Settings.Get()["WebServer"] = new Settings.Header
            {
                {
                    "WebFilePath", HttpServer.DefaultPath
                },
                {
                    "WebServerPort", 22006
                },
                {
                    "ToggleWebServer", true
                }
            };
            Settings.Get()["TaskServer"] = new Settings.Header
            {
                {
                    "TaskServerPort", 22007
                },
                {
                    "Encryption", true
                }
            };
            Settings.Get()["Network"] = new Settings.Header
            {
                {
                    "SkipHostNameResolve", false
                },
                {
                    "UpnpEnabled", true
                },
                {
                    "BindLocal", false
                }
            };
            Settings.Get()["Plugins"] = new Settings.Header
            {
                {
                    "LoadPlugins", true
                }
            };
            Settings.Get()["ScreenShareService"] = new Settings.Header
            {
                {
                    "ScreenSharePort", 22009
                }
            };
            Settings.Get()["Terminal"] = new Settings.Header
            {
                {
                    "AllowTerminal", true
                },
                {
                    "TerminalPort", 22008
                }
            };
            Settings.Get()["Webcams"] = new Settings.Header
            {
                {
                    "UseWebcams", true
                },
                {
                    "WebcamPort", 22010
                }
            };

            Settings.Get()["Debug"] = new Settings.Header
            {
                {
                    "TraceDebug", true
                }
            };

            Settings.Save();
        }
示例#2
0
        public static void ConfigureServer()
        {
            if (Settings.Empty)
            {
                //setup listen sh
                var prefix     = "http://*:22006/";
                var username   = Environment.GetEnvironmentVariable("USERNAME");
                var userdomain = Environment.GetEnvironmentVariable("USERDOMAIN");
                var command    = $@"/C netsh http add urlacl url={prefix} user={userdomain}\{username} listen=yes";
                Process.Start("CMD.exe", command);
                OpenPort(22006, "Ulterius Web Server");
                OpenPort(22007, "Ulterius Task Server");
                OpenPort(22008, "Ulterius Terminal Server");
                OpenPort(22009, "Ulterius ScreenShare");
                //web server settings
                Settings.Get()["General"] = new Settings.Header
                {
                    {
                        "Version", Assembly.GetExecutingAssembly().GetName().Version
                    },
                    {
                        "UploadLogs", false
                    },
                    {
                        "Github", "https://github.com/Ulterius"
                    },
                    {
                        "ServerIssues", "https://github.com/Ulterius/server/issues"
                    },
                    {
                        "ClientIssues", "https://github.com/Ulterius/client/issues"
                    },
                    {
                        //this is kind of nasty
                        "Maintainers", new[]
                        {
                            new { Name = "Andrew Sampson", Twitter = "https://twitter.com/Andrewmd5", Github = "https://github.com/codeusa", Website = "https://andrew.im/" },
                            new { Name = "Evan Banyash", Twitter = "https://twitter.com/frobthebuilder", Github = "https://github.com/FrobtheBuilder", Website = "http://banyash.com/" }
                        }
                    }
                };
                Settings.Get()["WebServer"] = new Settings.Header
                {
                    {
                        "WebFilePath", HttpServer.DefaultPath
                    },
                    {
                        "WebServerPort", 22006
                    },
                    {
                        "UseWebServer", true
                    }
                };
                Settings.Get()["TaskServer"] = new Settings.Header
                {
                    {
                        "TaskServerPort", 22007
                    },
                    {
                        "Encryption", true
                    }
                };
                Settings.Get()["Network"] = new Settings.Header
                {
                    {
                        "SkipHostNameResolve", false
                    }
                };
                Settings.Get()["Plugins"] = new Settings.Header
                {
                    {
                        "LoadPlugins", true
                    }
                };
                Settings.Get()["ScreenShare"] = new Settings.Header
                {
                    {
                        "ScreenSharePass", string.Empty
                    },
                    {
                        "ScreenSharePort", 22009
                    }
                };
                Settings.Get()["Terminal"] = new Settings.Header
                {
                    {
                        "AllowTerminal", true
                    }
                };

                Settings.Get()["Debug"] = new Settings.Header
                {
                    {
                        "TraceDebug", true
                    }
                };

                Settings.Save();
            }
        }