Beispiel #1
0
        // initialize servers
        public static void Initialize()
        {
            Dynamic = new DynamicServer();
            Plugins = new PluginServer();

            try
            {
                // initialize dynamic servers
                Dynamic.Initialize("");
                Dynamic.ProxyAddress = Config.Local.ProxyAddress;
                Dynamic.UseProxy     = Config.Local.UseProxy;
            }
            catch { }

            try
            {
                // initialized plugin servers
                Plugins.Initialize("");
                Plugins.ProxyAddress = Config.Local.ProxyAddress;
                Plugins.UseProxy     = Config.Local.UseProxy;
            }
            catch { }

            // mark initialization flag
            initialized = true;
        }
    private static Matcher CreateDynamicServerMatcher(DynamicServer server)
    {
        return((url) => {
            Match match;


            match = server.Pattern.Match(url);

            if (match.Success)
            {
                Hash hash;


                // The URL matched the pattern. Render the templates to get the HTTP
                // and SSH URLs, making the match available for the templates to use.
                hash = TemplateData.Create().Add(match).ToHash();

                return new StaticServer(
                    server.Http.Render(hash),
                    server.Ssh.Render(hash)
                    );
            }

            return null;
        });
    }
Beispiel #3
0
    public static void WebStart(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime)
    {
        SignumServer.Start(app, env, typeof(Startup).Assembly);

        AuthServer.Start(app, () => Starter.Configuration.Value.AuthTokens, "IMPORTANT SECRET FROM Southwind. CHANGE THIS STRING!!!");
        CacheServer.Start(app);
        FilesServer.Start(app);
        UserQueryServer.Start(app);
        DashboardServer.Start(app);
        WordServer.Start(app);
        ExcelServer.Start(app);
        ChartServer.Start(app);
        MapServer.Start(app);
        ToolbarServer.Start(app);
        TranslationServer.Start(app,
                                new AlreadyTranslatedTranslator(),
                                new AzureTranslator(
                                    () => Starter.Configuration.Value.Translation.AzureCognitiveServicesAPIKey,
                                    () => Starter.Configuration.Value.Translation.AzureCognitiveServicesRegion),
                                new DeepLTranslator(() => Starter.Configuration.Value.Translation.DeepLAPIKey)
                                ); //TranslationServer
        SchedulerServer.Start(app, lifetime);
        ProcessServer.Start(app);
        MailingServer.Start(app);
        ProfilerServer.Start(app);
        DiffLogServer.Start(app);
        RestServer.Start(app);
        RestLogServer.Start(app);
        PredictorServer.Start(app);
        WorkflowServer.Start(app);
        AlertsServer.Start(app);
        DynamicServer.Start(app);

        OmniboxServer.Start(app,
                            new EntityOmniboxResultGenenerator(),
                            new DynamicQueryOmniboxResultGenerator(),
                            new ChartOmniboxResultGenerator(),
                            new DashboardOmniboxResultGenerator(DashboardLogic.Autocomplete),
                            new UserQueryOmniboxResultGenerator(UserQueryLogic.Autocomplete),
                            new UserChartOmniboxResultGenerator(UserChartLogic.Autocomplete),
                            new MapOmniboxResultGenerator(type => OperationLogic.TypeOperations(type).Any()),
                            new ReactSpecialOmniboxGenerator()
                               //new HelpModuleOmniboxResultGenerator(),
                            ); //Omnibox

        ReflectionServer.RegisterLike(typeof(RegisterUserModel), () => true);

        SignumCultureSelectorFilter.GetCurrentCulture = (ctx) => GetCulture(ctx);
    }
Beispiel #4
0
        public static void WebStart(HttpConfiguration config)
        {
            SignumServer.Start(config, typeof(Global).Assembly);
            AuthServer.Start(config, () => Starter.Configuration.Value.AuthTokens, "IMPORTANT SECRET FROM Southwind. CHANGE THIS STRING!!!");
            CacheServer.Start(config);
            FilesServer.Start(config);
            UserQueryServer.Start(config);
            DashboardServer.Start(config);
            WordServer.Start(config);
            ExcelServer.Start(config);
            ChartServer.Start(config);
            MapServer.Start(config);
            ToolbarServer.Start(config);
            TranslationServer.Start(config, new AlreadyTranslatedTranslator(new AzureTranslator("Your API Key for Azure Translate")));
            SchedulerServer.Start(config);
            ProcessServer.Start(config);
            DisconnectedServer.Start(config);
            MailingServer.Start(config);
            ProfilerServer.Start(config);
            DiffLogServer.Start(config);
            PredictorServer.Start(config);
            WorkflowServer.Start(config);
            DynamicServer.Start(config);

            OmniboxServer.Start(config,
                                new EntityOmniboxResultGenenerator(),
                                new DynamicQueryOmniboxResultGenerator(),
                                new ChartOmniboxResultGenerator(),
                                new DashboardOmniboxResultGenerator(DashboardLogic.Autocomplete),
                                new UserQueryOmniboxResultGenerator(UserQueryLogic.Autocomplete),
                                new UserChartOmniboxResultGenerator(UserChartLogic.Autocomplete),
                                new MapOmniboxResultGenerator(type => OperationLogic.TypeOperations(type).Any()),
                                new ReactSpecialOmniboxGenerator()
                                   //new HelpModuleOmniboxResultGenerator(),
                                ); //Omnibox

            SignumAuthenticationFilterAttribute.GetCurrentCultures = (ac) => GetCulture(ac.Request);
        }