Пример #1
0
 public void Configuration(IAppBuilder app)
 {
     ConsoleLogger.Log("loading core service configuration");
     AntdBoot.StartDatabase();
     AntdBoot.StartSignalR(app, true);
     AntdBoot.StartNancy(app);
 }
Пример #2
0
        private static void Main(string[] args)
        {
            var startTime = DateTime.Now;

            Console.Title = "ANTD";

            AntdBoot.SetCoreParameters();

            var uri  = CoreParametersConfig.GetAntdUri();
            var stop = new ManualResetEvent(false);

            Console.CancelKeyPress +=
                (sender, e) => {
                Console.WriteLine("^C");
                stop.Set();
                e.Cancel = true;
            };

            //try {
            using (WebApp.Start <Startup>(uri)) {
                ConsoleLogger.Log("loading service");
                ConsoleLogger.Log("    server url -> {0}", uri);
                ConsoleLogger.Log("antd is running");

                AntdBoot.StartScheduler(true);
                AntdBoot.StartDirectoryWatcher(true, new [] { "/cfg", "/test" });
                AntdBoot.StartNetworkd();
                AntdBoot.CheckSysctl(false);

                ConsoleLogger.Log("loaded in: {0}", DateTime.Now - startTime);

                //ConsoleLogger.Log("Define p1");
                //string p1 = Console.ReadLine();
                //ConsoleLogger.Log("Define p2 now");
                //string p2 = Console.ReadLine();
                //ConsoleLogger.Log("Last one, define p3");
                //string p3 = Console.ReadLine();

                //ConsoleLogger.Log("Recap");
                //ConsoleLogger.Log("p1: {0}", p1);
                //ConsoleLogger.Log("p2: {0}", p2);
                //ConsoleLogger.Log("p3: {0}", p3);

                //Console.ReadLine();
                stop.WaitOne();
            }

            /*} catch (System.Reflection.TargetInvocationException ex) {
             *  ConsoleLogger.Warn(ex.Message);
             *  ConsoleLogger.Warn("Register +: urlacl");
             *  ConsoleLogger.Warn("on windows:");
             *  ConsoleLogger.Warn("netsh http add urlacl url=http://+:7777/ user=UserName");
             * }*/
        }
Пример #3
0
 private static void Configuration()
 {
     AntdBoot.CheckOsIsRw();
     AntdBoot.SetWorkingDirectories();
     AntdBoot.SetCoreParameters();
     AntdBoot.StartDatabase();
     AntdBoot.CheckCertificate();
     AntdBoot.ReloadUsers();
     AntdBoot.ReloadSsh();
     //AntdBoot.SetOverlayDirectories();
     //AntdBoot.SetSystemdJournald();
     AntdBoot.SetMounts();
     AntdBoot.SetOsMount();
     AntdBoot.LaunchDefaultOsConfiguration();
     //AntdBoot.SetWebsocketd();
     AntdBoot.CheckResolv();
     AntdBoot.SetFirewall();
     AntdBoot.ImportSystemInformation();
     //AntdBoot.StartScheduler(true);
     AntdBoot.StartDirectoryWatcher();
     AntdBoot.LaunchApps();
     //AntdBoot.StartWebsocketServer();
     //AntdBoot.DownloadDefaultRepoFiles();
 }