From c5591bd2ced30d87032d3e4f269ab33e3ef22904 Mon Sep 17 00:00:00 2001 From: skadefro Date: Wed, 15 Nov 2023 13:37:25 +0100 Subject: [PATCH 1/2] cleanup config settings --- OpenFlow/src/Config.ts | 12 - OpenFlow/src/LoginProvider.ts | 1 - OpenFlow/src/Messages/Message.ts | 4 +- OpenFlow/src/public/Nodered.html | 682 ------------------ OpenFlow/src/public/WebSocketClientService.ts | 2 - OpenFlow/src/public/index.html | 2 +- test/docker-compose.yml | 1 - 7 files changed, 3 insertions(+), 701 deletions(-) delete mode 100644 OpenFlow/src/public/Nodered.html diff --git a/OpenFlow/src/Config.ts b/OpenFlow/src/Config.ts index 0484174d..e5c705cf 100644 --- a/OpenFlow/src/Config.ts +++ b/OpenFlow/src/Config.ts @@ -25,7 +25,6 @@ export class dbConfig extends Base { public allow_skiphistory: boolean; public max_memory_restart_mb: number; - public allow_personal_nodered: boolean; public amqp_enabled_exchange: boolean; public log_with_trace: boolean; public log_with_colors: boolean; @@ -86,7 +85,6 @@ export class dbConfig extends Base { public ensure_indexes: boolean; public text_index_name_fields: string[]; - public metadata_collections: string[]; public auto_create_users: boolean; public auto_create_user_from_jwt: boolean; @@ -147,7 +145,6 @@ export class dbConfig extends Base { Config.log_with_trace = Config.parseBoolean(!NoderedUtil.IsNullEmpty(conf.log_with_trace) ? conf.log_with_trace : Config.getEnv("log_with_trace", "false")); if (!NoderedUtil.IsNullEmpty(conf.auto_create_users)) Config.auto_create_users = Config.parseBoolean(conf.auto_create_users); - if (!NoderedUtil.IsNullEmpty(conf.allow_personal_nodered)) Config.allow_personal_nodered = Config.parseBoolean(conf.allow_personal_nodered); if (!NoderedUtil.IsNullEmpty(conf.amqp_enabled_exchange)) Config.amqp_enabled_exchange = Config.parseBoolean(conf.amqp_enabled_exchange); Logger.instanse.info("db version: " + conf.version, parent); @@ -225,7 +222,6 @@ export class dbConfig extends Base { Config.ensure_indexes = Config.parseBoolean(!NoderedUtil.IsNullEmpty(conf.ensure_indexes) ? conf.ensure_indexes : Config.getEnv("ensure_indexes", "true")); Config.text_index_name_fields = Config.parseArray(!NoderedUtil.IsNullEmpty(conf.text_index_name_fields) ? conf.text_index_name_fields.toString() : Config.getEnv("text_index_name_fields", "name,_names")) - Config.metadata_collections = Config.parseArray(!NoderedUtil.IsNullEmpty(conf.metadata_collections) ? conf.metadata_collections.toString() : Config.getEnv("metadata_collections", "")) Config.auto_create_users = Config.parseBoolean(!NoderedUtil.IsNullEmpty(conf.auto_create_users) ? conf.auto_create_users : Config.getEnv("auto_create_users", "false")) Config.auto_create_user_from_jwt = Config.parseBoolean(!NoderedUtil.IsNullEmpty(conf.auto_create_user_from_jwt) ? conf.auto_create_user_from_jwt : Config.getEnv("auto_create_user_from_jwt", "")) @@ -346,8 +342,6 @@ export class Config { Config.enable_nodered_tours = Config.parseBoolean(Config.getEnv("enable_nodered_tours", "true")); Config.grafana_url = Config.getEnv("grafana_url", ""); Config.auto_hourly_housekeeping = Config.parseBoolean(Config.getEnv("auto_hourly_housekeeping", "true")); - Config.housekeeping_update_usage_hourly = Config.parseBoolean(Config.getEnv("housekeeping_update_usage_hourly", "false")); - Config.housekeeping_update_usersize_hourly = Config.parseBoolean(Config.getEnv("housekeeping_update_usersize_hourly", "true")); Config.housekeeping_skip_collections = Config.getEnv("housekeeping_skip_collections", ""); Config.workitem_queue_monitoring_enabled = Config.parseBoolean(Config.getEnv("workitem_queue_monitoring_enabled", "true")); Config.workitem_queue_monitoring_interval = parseInt(Config.getEnv("workitem_queue_monitoring_interval", (10 * 1000).toString())); // 10 sec @@ -373,14 +367,12 @@ export class Config { Config.supports_watch = Config.parseBoolean(Config.getEnv("supports_watch", "false")); Config.ensure_indexes = Config.parseBoolean(Config.getEnv("ensure_indexes", "true")); Config.text_index_name_fields = Config.parseArray(Config.getEnv("text_index_name_fields", "name,_names")); - Config.metadata_collections = Config.parseArray(Config.getEnv("metadata_collections", "")); Config.auto_create_users = Config.parseBoolean(Config.getEnv("auto_create_users", "false")); Config.auto_create_user_from_jwt = Config.parseBoolean(Config.getEnv("auto_create_user_from_jwt", "false")); Config.auto_create_domains = Config.parseArray(Config.getEnv("auto_create_domains", "")); Config.persist_user_impersonation = Config.parseBoolean(Config.getEnv("persist_user_impersonation", "true")); Config.ping_clients_interval = parseInt(Config.getEnv("ping_clients_interval", (10000).toString())); // 10 seconds - Config.allow_personal_nodered = Config.parseBoolean(Config.getEnv("allow_personal_nodered", "false")); Config.use_ingress_beta1_syntax = Config.parseBoolean(Config.getEnv("use_ingress_beta1_syntax", "false")); Config.use_openshift_routes = Config.parseBoolean(Config.getEnv("use_openshift_routes", "false")); Config.agent_image_pull_secrets = Config.parseArray(Config.getEnv("agent_image_pull_secrets", "")); @@ -629,8 +621,6 @@ export class Config { public static enable_nodered_tours: boolean = Config.parseBoolean(Config.getEnv("enable_nodered_tours", "true")); public static grafana_url:string = Config.getEnv("grafana_url", ""); public static auto_hourly_housekeeping: boolean = Config.parseBoolean(Config.getEnv("auto_hourly_housekeeping", "true")); - public static housekeeping_update_usage_hourly: boolean = Config.parseBoolean(Config.getEnv("housekeeping_update_usage_hourly", "false")); - public static housekeeping_update_usersize_hourly: boolean = Config.parseBoolean(Config.getEnv("housekeeping_update_usersize_hourly", "true")); public static housekeeping_skip_collections: string = Config.getEnv("housekeeping_skip_collections", ""); public static workitem_queue_monitoring_enabled: boolean = Config.parseBoolean(Config.getEnv("workitem_queue_monitoring_enabled", "true")); public static workitem_queue_monitoring_interval: number = parseInt(Config.getEnv("workitem_queue_monitoring_interval", (10 * 1000).toString())); // 10 sec @@ -656,7 +646,6 @@ export class Config { public static supports_watch: boolean = Config.parseBoolean(Config.getEnv("supports_watch", "false")); public static ensure_indexes: boolean = Config.parseBoolean(Config.getEnv("ensure_indexes", "true")); public static text_index_name_fields: string[] = Config.parseArray(Config.getEnv("text_index_name_fields", "name,_names")); - public static metadata_collections: string[] = Config.parseArray(Config.getEnv("metadata_collections", "")); public static auto_create_users: boolean = Config.parseBoolean(Config.getEnv("auto_create_users", "false")); public static auto_create_user_from_jwt: boolean = Config.parseBoolean(Config.getEnv("auto_create_user_from_jwt", "false")); @@ -664,7 +653,6 @@ export class Config { public static persist_user_impersonation: boolean = Config.parseBoolean(Config.getEnv("persist_user_impersonation", "true")); public static ping_clients_interval: number = parseInt(Config.getEnv("ping_clients_interval", (10000).toString())); // 10 seconds - public static allow_personal_nodered: boolean = Config.parseBoolean(Config.getEnv("allow_personal_nodered", "false")); public static use_ingress_beta1_syntax: boolean = Config.parseBoolean(Config.getEnv("use_ingress_beta1_syntax", "false")); public static use_openshift_routes: boolean = Config.parseBoolean(Config.getEnv("use_openshift_routes", "false")); public static agent_image_pull_secrets: string[] = Config.parseArray(Config.getEnv("agent_image_pull_secrets", "")); diff --git a/OpenFlow/src/LoginProvider.ts b/OpenFlow/src/LoginProvider.ts index 4931d853..c5df1248 100644 --- a/OpenFlow/src/LoginProvider.ts +++ b/OpenFlow/src/LoginProvider.ts @@ -1148,7 +1148,6 @@ export class LoginProvider { wsurl: _url, domain: Config.domain, auto_create_users: Config.auto_create_users, - allow_personal_nodered: Config.allow_personal_nodered, auto_create_personal_nodered_group: Config.auto_create_personal_nodered_group, auto_create_personal_noderedapi_group: Config.auto_create_personal_noderedapi_group, namespace: Config.namespace, diff --git a/OpenFlow/src/Messages/Message.ts b/OpenFlow/src/Messages/Message.ts index 9b283b8d..66adde12 100644 --- a/OpenFlow/src/Messages/Message.ts +++ b/OpenFlow/src/Messages/Message.ts @@ -295,12 +295,12 @@ export class Message { // if ((error.consumedPoints % 10) == 1 || error.consumedPoints > 0) { // // Logger.instanse.warn("[" + username + "/" + cli.clientagent + "/" + cli.id + "] SOCKET_RATE_LIMIT consumedPoints: " + error.consumedPoints + " remainingPoints: " + error.remainingPoints + " msBeforeNext: " + error.msBeforeNext, span); // } - // if (error.consumedPoints >= Config.socket_rate_limit_points_disconnect) { + if (error.consumedPoints >= Config.socket_rate_limit_points_disconnect) { // Logger.instanse.warn("[" + username + "/" + cli.clientagent + "/" + cli.id + "] SOCKET_RATE_LIMIT: Disconnecing client ! consumedPoints: " + error.consumedPoints + " remainingPoints: " + error.remainingPoints + " msBeforeNext: " + error.msBeforeNext, span); // cli.devnull = true; // cli.Close(span); // return; - // } + } // setTimeout(() => { this.Process(cli); }, 250); // } // return; diff --git a/OpenFlow/src/public/Nodered.html b/OpenFlow/src/public/Nodered.html deleted file mode 100644 index 6d4e2a68..00000000 --- a/OpenFlow/src/public/Nodered.html +++ /dev/null @@ -1,682 +0,0 @@ -
-

nodered

-
- -
-
-
-
- - - - - - - Open - Nodered -
-
-
-
- -
-
-
- -
- {{ instance.metadata.name }} -
- -
- {{ instance.metrics.cpu + "/" + - instance.spec.containers[0].resources.limits.cpu }} -
- -
- {{ instance.metrics.memory + "/" + - instance.spec.containers[0].resources.limits.memory }} -
- -
- {{ (this.instance.metadata.deletionTimestamp != null ? " deleting" : - instance.status.phase) }} -
- -
- - - -
-
-
- -
- {{ instance.Image || instance.spec.containers[0].image }} -
-
- - -
-
-
- {{ instance.status.message }} -
-
-
-
-
-
- -
-
{{ ctrl.instancelog }}
-
-
-
- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
- -
-
- - - -
-
-
- -
- -
-
-
-
-
- -
- - {{key + '=' + - ctrl.label[key]}} -
- - - - -
-
-
-
-
-
- -
-
-
-
-
- - Free nodered instances will be shutdown after 8 hours. Create a customer, and add billing information, in order to - buy the option to get more RAM for a nodered that will not stop after 8 hours. - -
-
\ No newline at end of file diff --git a/OpenFlow/src/public/WebSocketClientService.ts b/OpenFlow/src/public/WebSocketClientService.ts index 4ee5e0dd..ba35b869 100644 --- a/OpenFlow/src/public/WebSocketClientService.ts +++ b/OpenFlow/src/public/WebSocketClientService.ts @@ -26,7 +26,6 @@ export class WebSocketClientService { this.version = data.version; this.allow_user_registration = data.allow_user_registration; - this.allow_personal_nodered = data.allow_personal_nodered; this.auto_create_personal_nodered_group = data.auto_create_personal_nodered_group; this.namespace = data.namespace; this.nodered_domain_schema = data.nodered_domain_schema; @@ -180,7 +179,6 @@ export class WebSocketClientService { public connected: boolean = false; public domain: string = ""; public allow_user_registration: boolean = false; - public allow_personal_nodered: boolean = false; public auto_create_personal_nodered_group: boolean = false; public namespace: string = ""; public nodered_domain_schema: string = ""; diff --git a/OpenFlow/src/public/index.html b/OpenFlow/src/public/index.html index 9633e771..bdf3ca7e 100644 --- a/OpenFlow/src/public/index.html +++ b/OpenFlow/src/public/index.html @@ -212,7 +212,7 @@ ng-show="(menuctrl.hasrole('users') && !menuctrl.hasrole('menu hide rpaworkflows')) || menuctrl.hasrole('admins')">rpaworkflows clients + + + + + + diff --git a/OpenFlow/src/public/Controllers.ts b/OpenFlow/src/public/Controllers.ts index 5a3809f4..8c8e8c2b 100644 --- a/OpenFlow/src/public/Controllers.ts +++ b/OpenFlow/src/public/Controllers.ts @@ -7247,9 +7247,11 @@ export class ConsoleCtrl extends entityCtrl { WebSocketClientService.onSignedin(async (_user: TokenUser) => { await this.RegisterQueue(); this.loadData(); + this.loading = false; this.$scope.$on('signin', (event, data) => { this.RegisterQueue(); this.loadData(); + this.loading = false; }); }); } @@ -7371,6 +7373,379 @@ export class ConsoleCtrl extends entityCtrl { } } +export class ConfigCtrl extends entityCtrl { + public arguments: any; + public users: TokenUser[]; + public user: TokenUser; + public messages: any[] = []; + public watchid: string = ""; + public timeout: string = (60 * 1000).toString(); // 1 min; + public lines: string = "100"; + public exchange: RegisterExchangeResponse = null; + public paused: boolean = false; + public host: boolean = false; + public agent: boolean = false; + public cls: boolean = false; + public func: boolean = true; + public searchstring: string = ""; + public settings: any[] = []; + constructor( + public $rootScope: ng.IRootScopeService, + public $scope: ng.IScope, + public $location: ng.ILocationService, + public $routeParams: ng.route.IRouteParamsService, + public $sce: ng.ISCEService, + public $interval: ng.IIntervalService, + public WebSocketClientService: WebSocketClientService, + public api: api, + public userdata: userdata + ) { + super($rootScope, $scope, $location, $routeParams, $sce, $interval, WebSocketClientService, api, userdata); + console.debug("ConsoleCtrl"); + this.collection = "config"; + this.basequery = { "_type": "config" } + this.messages = []; + this.postloadData = this.processdata; + this.settings = [ + {"name": "license_key", "type": "string", "default": ""}, + {"name": "enable_openai", "type": "boolean", "default": "false"}, + {"name": "enable_openapi", "type": "boolean", "default": "true"}, + {"name": "enable_openaiauth", "type": "boolean", "default": "true"}, + {"name": "openai_token", "type": "string", "default": ""}, + {"name": "log_with_colors", "type": "boolean", "default": "true"}, + {"name": "cache_store_type", "type": "string", "default": "memory"}, + {"name": "cache_store_max", "type": "number", "default": "1000"}, + {"name": "cache_store_ttl_seconds", "type": "number", "default": "300"}, + {"name": "cache_store_redis_host", "type": "string", "default": ""}, + {"name": "cache_store_redis_port", "type": "number", "default": "6379"}, + {"name": "cache_store_redis_password", "type": "string", "default": ""}, + {"name": "cache_workitem_queues", "type": "boolean", "default": "false"}, + {"name": "heapdump_onstop", "type": "boolean", "default": "false"}, + {"name": "amqp_allow_replyto_empty_queuename", "type": "boolean", "default": "false"}, + {"name": "enable_openflow_amqp", "type": "boolean", "default": "false"}, + // {"name": "log_to_exchange", "type": "boolean", "default": "false"}, + {"name": "openflow_amqp_expiration", "type": "number", "default": "1500000"}, // 25 min in milliseconds + {"name": "amqp_prefetch", "type": "number", "default": "25"}, + {"name": "enable_entity_restriction", "type": "boolean", "default": "false"}, + {"name": "enable_web_tours", "type": "boolean", "default": "true"}, + {"name": "enable_nodered_tours", "type": "boolean", "default": "true"}, + {"name": "grafana_url", "type": "string", "default": ""}, + {"name": "auto_hourly_housekeeping", "type": "boolean", "default": "true"}, + {"name": "housekeeping_skip_collections", "type": "string", "default": ""}, + {"name": "workitem_queue_monitoring_enabled", "type": "boolean", "default": "true"}, + {"name": "workitem_queue_monitoring_interval", "type": "number", "default": "10000"}, // 10 sec + {"name": "upload_max_filesize_mb", "type": "number", "default": "25"}, + {"name": "getting_started_url", "type": "string", "default": ""}, + {"name": "NODE_ENV", "type": "string", "default": "development"}, + {"name": "HTTP_PROXY", "type": "string", "default": ""}, + {"name": "HTTPS_PROXY", "type": "string", "default": ""}, + {"name": "NO_PROXY", "type": "string", "default": ""}, + {"name": "agent_HTTP_PROXY", "type": "string", "default": ""}, + {"name": "agent_HTTPS_PROXY", "type": "string", "default": ""}, + {"name": "agent_NO_PROXY", "type": "string", "default": ""}, + {"name": "stripe_api_key", "type": "string", "default": ""}, + {"name": "stripe_api_secret", "type": "string", "default": ""}, + {"name": "stripe_force_vat", "type": "boolean", "default": "false"}, + {"name": "stripe_force_checkout", "type": "boolean", "default": "false"}, + {"name": "stripe_allow_promotion_codes", "type": "boolean", "default": "true"}, + {"name": "supports_watch", "type": "boolean", "default": "false"}, + {"name": "ensure_indexes", "type": "boolean", "default": "true"}, + {"name": "text_index_name_fields", "type": "string[]", "default": "name,_names"}, + {"name": "auto_create_users", "type": "boolean", "default": "false"}, + {"name": "auto_create_user_from_jwt", "type": "boolean", "default": "false"}, + {"name": "auto_create_domains", "type": "string[]", "default": ""}, + {"name": "persist_user_impersonation", "type": "boolean", "default": "true"}, + {"name": "ping_clients_interval", "type": "number", "default": "10000"}, // 10 seconds + {"name": "use_ingress_beta1_syntax", "type": "boolean", "default": "false"}, + {"name": "use_openshift_routes", "type": "boolean", "default": "false"}, + {"name": "agent_image_pull_secrets", "type": "string[]", "default": ""}, + {"name": "auto_create_personal_nodered_group", "type": "boolean", "default": "false"}, + {"name": "auto_create_personal_noderedapi_group", "type": "boolean", "default": "false"}, + {"name": "force_add_admins", "type": "boolean", "default": "true"}, + {"name": "validate_emails", "type": "boolean", "default": "false"}, + {"name": "forgot_pass_emails", "type": "boolean", "default": "false"}, + {"name": "smtp_service", "type": "string", "default": ""}, + {"name": "smtp_from", "type": "string", "default": ""}, + {"name": "smtp_user", "type": "string", "default": ""}, + {"name": "smtp_pass", "type": "string", "default": ""}, + {"name": "smtp_url", "type": "string", "default": ""}, + {"name": "debounce_lookup", "type": "boolean", "default": "false"}, + {"name": "validate_emails_disposable", "type": "boolean", "default": "false"}, + {"name": "tls_crt", "type": "string", "default": ""}, + {"name": "tls_key", "type": "string", "default": ""}, + {"name": "tls_ca", "type": "string", "default": ""}, + {"name": "tls_passphrase", "type": "string", "default": ""}, + + {"name": "oidc_access_token_ttl", "type": "number", "default": "480"}, + {"name": "oidc_authorization_code_ttl", "type": "number", "default": "480"}, + {"name": "oidc_client_credentials_ttl", "type": "number", "default": "480"}, + {"name": "oidc_refresh_token_ttl", "type": "number", "default": "20160"}, + {"name": "oidc_session_ttl", "type": "number", "default": "20160"}, + + {"name": "oidc_cookie_key", "type": "string", "default": ""}, + {"name": "api_rate_limit", "type": "boolean", "default": "true"}, + {"name": "api_rate_limit_points", "type": "number", "default": "20"}, + {"name": "api_rate_limit_duration", "type": "number", "default": "1"}, + {"name": "socket_rate_limit", "type": "boolean", "default": "true"}, + {"name": "socket_rate_limit_points", "type": "number", "default": "30"}, + {"name": "socket_rate_limit_points_disconnect", "type": "number", "default": "100"}, + {"name": "socket_rate_limit_duration", "type": "number", "default": "1"}, + {"name": "socket_error_rate_limit_points", "type": "number", "default": "30"}, + {"name": "socket_error_rate_limit_duration", "type": "number", "default": "1"}, + + {"name": "client_heartbeat_timeout", "type": "number", "default": "60"}, + {"name": "client_signin_timeout", "type": "number", "default": "120"}, + {"name": "client_disconnect_signin_error", "type": "boolean", "default": "false"}, + + {"name": "expected_max_roles", "type": "number", "default": "20000"}, + {"name": "decorate_roles_fetching_all_roles", "type": "boolean", "default": "true"}, + {"name": "max_recursive_group_depth", "type": "number", "default": "2"}, + {"name": "update_acl_based_on_groups", "type": "boolean", "default": "true"}, + {"name": "allow_merge_acl", "type": "boolean", "default": "false"}, + + {"name": "multi_tenant", "type": "boolean", "default": "false"}, + {"name": "cleanup_on_delete_customer", "type": "boolean", "default": "false"}, + {"name": "cleanup_on_delete_user", "type": "boolean", "default": "false"}, + {"name": "api_bypass_perm_check", "type": "boolean", "default": "false"}, + {"name": "ignore_expiration", "type": "boolean", "default": "false"}, + {"name": "force_audit_ts", "type": "boolean", "default": "false"}, + {"name": "force_dbusage_ts", "type": "boolean", "default": "false"}, + {"name": "migrate_audit_to_ts", "type": "boolean", "default": "true"}, + {"name": "websocket_package_size", "type": "number", "default": "25000"}, + {"name": "websocket_max_package_count", "type": "number", "default": "25000"}, + {"name": "websocket_message_callback_timeout", "type": "number", "default": "3600"}, + {"name": "websocket_disconnect_out_of_sync", "type": "boolean", "default": "false"}, + {"name": "protocol", "type": "string", "default": "http"}, + {"name": "port", "type": "number", "default": "80"}, + {"name": "domain", "type": "string", "default": "localhost"}, + {"name": "cookie_secret", "type": "string", "default": "NLgUIsozJaxO38ze0WuHthfj2eb1eIEu"}, + {"name": "max_ace_count", "type": "number", "default": "128"}, + + {"name": "amqp_reply_expiration", "type": "number", "default": "60000"}, + {"name": "amqp_force_queue_prefix", "type": "boolean", "default": "false"}, + {"name": "amqp_force_exchange_prefix", "type": "boolean", "default": "false"}, + {"name": "amqp_force_sender_has_read", "type": "boolean", "default": "true"}, + {"name": "amqp_force_sender_has_invoke", "type": "boolean", "default": "false"}, + {"name": "amqp_force_consumer_has_update", "type": "boolean", "default": "false"}, + {"name": "amqp_enabled_exchange", "type": "boolean", "default": "false"}, + {"name": "amqp_url", "type": "string", "default": "amqp://localhost"}, + {"name": "amqp_username", "type": "string", "default": "guest"}, + {"name": "amqp_password", "type": "string", "default": "guest"}, + + {"name": "amqp_check_for_consumer", "type": "boolean", "default": "true"}, + {"name": "amqp_check_for_consumer_count", "type": "boolean", "default": "false"}, + {"name": "amqp_default_expiration", "type": "number", "default": "60000"}, + {"name": "amqp_requeue_time", "type": "number", "default": "1000"}, + {"name": "amqp_dlx", "type": "string", "default": "openflow-dlx"}, + + {"name": "mongodb_url", "type": "string", "default": "mongodb://localhost:27017"}, + {"name": "mongodb_db", "type": "string", "default": "openflow"}, + {"name": "mongodb_minpoolsize", "type": "number", "default": "25"}, + {"name": "mongodb_maxpoolsize", "type": "number", "default": "25"}, + + {"name": "skip_history_collections", "type": "string", "default": "audit,openrpa_instances,workflow_instances"}, + {"name": "history_delta_count", "type": "number", "default": "1000"}, + {"name": "allow_skiphistory", "type": "boolean", "default": "false"}, + {"name": "max_memory_restart_mb", "type": "number", "default": "0"}, + {"name": "saml_issuer", "type": "string", "default": "the-issuer"}, + // {"name": "aes_secret", "type": "string", "default": ""}, + {"name": "signing_crt", "type": "string", "default": ""}, + {"name": "singing_key", "type": "string", "default": ""}, + {"name": "wapid_mail", "type": "string", "default": ""}, + {"name": "wapid_pub", "type": "string", "default": ""}, + {"name": "wapid_key", "type": "string", "default": ""}, + {"name": "shorttoken_expires_in", "type": "string", "default": "5m"}, + {"name": "longtoken_expires_in", "type": "string", "default": "365d"}, + {"name": "downloadtoken_expires_in", "type": "string", "default": "15m"}, + {"name": "personalnoderedtoken_expires_in", "type": "string", "default": "365d"}, + {"name": "agent_images", "type": "NoderedImage[]", "default": "[{\"name\":\"Agent\", \"image\":\"openiap/nodeagent\", \"languages\": [\"nodejs\", \"python\"]}, {\"name\":\"Agent+Chromium\", \"image\":\"openiap/nodechromiumagent\", \"chromium\": true, \"languages\": [\"nodejs\", \"python\"]}, {\"name\":\"NodeRED\", \"image\":\"openiap/noderedagent\", \"port\": 3000}, {\"name\":\"DotNet 6\", \"image\":\"openiap/dotnetagent\", \"languages\": [\"dotnet\"]} , {\"name\":\"PowerShell 7.3\", \"image\":\"openiap/nodeagent:pwsh\", \"languages\": [\"powershell\"]}]"}, + {"name": "agent_domain_schema", "type": "string", "default": ""}, + {"name": "agent_node_selector", "type": "string", "default": ""}, + {"name": "agent_apiurl", "type": "string", "default": ""}, + {"name": "agent_oidc_config", "type": "string", "default": ""}, + {"name": "agent_oidc_client_id", "type": "string", "default": ""}, + {"name": "agent_oidc_client_secret", "type": "string", "default": ""}, + {"name": "agent_oidc_userinfo_endpoint", "type": "string", "default": ""}, + {"name": "agent_oidc_issuer", "type": "string", "default": ""}, + {"name": "agent_oidc_authorization_endpoint", "type": "string", "default": ""}, + {"name": "agent_oidc_token_endpoint", "type": "string", "default": ""}, + {"name": "saml_federation_metadata", "type": "string", "default": ""}, + {"name": "api_ws_url", "type": "string", "default": ""}, + {"name": "nodered_ws_url", "type": "string", "default": ""}, + {"name": "nodered_saml_entrypoint", "type": "string", "default": ""}, + {"name": "agent_docker_entrypoints", "type": "string", "default": "web"}, + {"name": "agent_docker_use_project", "type": "boolean", "default": "false"}, + {"name": "agent_docker_certresolver", "type": "string", "default": ""}, + {"name": "namespace", "type": "string", "default": ""}, + {"name": "nodered_domain_schema", "type": "string", "default": ""}, + {"name": "nodered_initial_liveness_delay", "type": "number", "default": "60"}, + {"name": "nodered_allow_nodeselector", "type": "boolean", "default": "false"}, + {"name": "nodered_liveness_failurethreshold", "type": "number", "default": "5"}, + {"name": "nodered_liveness_timeoutseconds", "type": "number", "default": "5"}, + {"name": "noderedcatalogues", "type": "string", "default": ""}, + + {"name": "otel_measure_nodeid", "type": "boolean", "default": "false"}, + {"name": "otel_measure_queued_messages", "type": "boolean", "default": "false"}, + {"name": "otel_measure__mongodb_watch", "type": "boolean", "default": "false"}, + {"name": "otel_measure_onlineuser", "type": "boolean", "default": "false"}, + {"name": "enable_analytics", "type": "boolean", "default": "true"}, + {"name": "enable_detailed_analytic", "type": "boolean", "default": "false"}, + {"name": "otel_debug_log", "type": "boolean", "default": "false"}, + {"name": "otel_warn_log", "type": "boolean", "default": "false"}, + {"name": "otel_err_log", "type": "boolean", "default": "false"}, + {"name": "otel_trace_url", "type": "string", "default": ""}, + {"name": "otel_metric_url", "type": "string", "default": ""}, + {"name": "otel_trace_interval", "type": "number", "default": "5000"}, + {"name": "otel_metric_interval", "type": "number", "default": "5000"}, + {"name": "otel_trace_pingclients", "type": "boolean", "default": "false"}, + {"name": "otel_trace_dashboardauth", "type": "boolean", "default": "false"}, + {"name": "otel_trace_include_query", "type": "boolean", "default": "false"}, + {"name": "otel_trace_connection_ips", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_per_users", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_query_per_users", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_count_per_users", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_aggregate_per_users", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_insert_per_users", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_update_per_users", "type": "boolean", "default": "false"}, + {"name": "otel_trace_mongodb_delete_per_users", "type": "boolean", "default": "false"}, + + {"name": "grpc_keepalive_time_ms", "type": "number", "default": "-1"}, + {"name": "grpc_keepalive_timeout_ms", "type": "number", "default": "-1"}, + {"name": "grpc_http2_min_ping_interval_without_data_ms", "type": "number", "default": "-1"}, + {"name": "grpc_max_connection_idle_ms", "type": "number", "default": "-1"}, + {"name": "grpc_max_connection_age_ms", "type": "number", "default": "-1"}, + {"name": "grpc_max_connection_age_grace_ms", "type": "number", "default": "-1"}, + {"name": "grpc_http2_max_pings_without_data", "type": "number", "default": "-1"}, + {"name": "grpc_keepalive_permit_without_calls", "type": "number", "default": "-1"}, + {"name": "grpc_max_receive_message_length", "type": "number", "default": "-1"}, + {"name": "grpc_max_send_message_length", "type": "number", "default": "-1"}, + {"name": "validate_user_form", "type": "string", "default": ""} + ] + WebSocketClientService.onSignedin(async (_user: TokenUser) => { + await this.RegisterWatch(); + console.log("Load data") + this.loading = false; + this.loadData(); + this.$scope.$on('signin', (event, data) => { + this.RegisterWatch(); + console.log("Load data") + this.loading = false; + this.loadData(); + }); + }); + } + async RegisterWatch() { + console.log("RegisterWatch") + try { + if (!NoderedUtil.IsNullEmpty(this.watchid)) { + await NoderedUtil.UnWatch({ id: this.watchid }); + } + this.watchid = await NoderedUtil.Watch({ + aggregates: [{ "$match": { "fullDocument._type": "config" } }], collectionname: "config", callback: (data) => { + console.log(data); + this.loading = false; + this.loadData(); + } + }) + console.debug("watchid: ", this.watchid); + } catch (error) { + console.debug("register queue failed, start reconnect. " + error.message ? error.message : error) + setTimeout(this.RegisterWatch.bind(this), (Math.floor(Math.random() * 6) + 1) * 500); + } + } + processdata() { + console.log("processdata") + // console.log(this.model); + // for(let i = 0; i < this.settings.length; i++) { + // if (this.model[this.settings[i].name] == null) { + // this.model[this.settings[i].name] = this.settings[i].default; + // } + // } + const ids: string[] = []; + if (this.collection == "files") { + for (let i: number = 0; i < (this.model as any).metadata._acl.length; i++) { + ids.push((this.model as any).metadata._acl[i]._id); + } + } else { + for (let i: number = 0; i < this.model._acl.length; i++) { + ids.push(this.model._acl[i]._id); + } + } + if (this.model._encrypt == null) { this.model._encrypt = []; } + if (!this.$scope.$$phase) { this.$scope.$apply(); } + this.fixtextarea(); + this.loading = false; + } + async submit(): Promise { + try { + for(let i = 0; i < this.settings.length; i++) { + if (this.model[this.settings[i].name] == null || this.model[this.settings[i].name] == "" + || this.model[this.settings[i].name] == this.settings[i].default) { + delete this.model[this.settings[i].name]; + } + } + + if (this.model._id) { + await NoderedUtil.UpdateOne({ collectionname: this.collection, item: this.model }); + } else { + await NoderedUtil.InsertOne({ collectionname: this.collection, item: this.model }); + } + // this.$location.path("/Providers"); + } catch (error) { + this.errormessage = error.message ? error.message : error; + } + if (!this.$scope.$$phase) { this.$scope.$apply(); } + } + hasprop(name) { + return this.messages.filter(x => !NoderedUtil.IsNullEmpty(x[name])).length > 0 + } + cached = {} + getstep(key, obj) { + if (this.gettype(obj) == "number") { + if (obj.toString().indexOf(".") > -1) { + var decimals = obj.toString().split(".")[1].length; + this.cached[key] = 1 / Math.pow(10, decimals); + return this.cached[key]; + } else { + if (this.cached[key]) return this.cached[key]; + } + } + this.cached[key] = 1; + return 1; + } + gettype(obj) { + return typeof obj; + } + getinputtype(obj, key) { + if (this.model._encrypt.indexOf(key)) + if (typeof obj === "string") return "text"; + if (typeof obj === "number") return "number"; + if (typeof obj === "boolean") return "checkbox"; + } + + isobject(object: any) { + return typeof object === 'object'; + } + fixtextarea() { + setTimeout(() => { + const tx = document.getElementsByTagName('textarea'); + for (let i = 0; i < tx.length; i++) { + tx[i].setAttribute('style', 'height:' + (tx[i].scrollHeight) + 'px;overflow-y:hidden;'); + } + }, 500); + } + delayhandler = null; + delayedUpdate() { + if(this.loading == true) return; + if(this.delayhandler ! = null) return; + console.log("delayedUpdate", this.loading) + this.delayhandler = setTimeout(() => { + console.log("do it") + this.delayhandler = null; + this.submit(); + }, 500); + } +} export class AgentsCtrl extends entitiesCtrl { diff --git a/OpenFlow/src/public/WebSocketClientService.ts b/OpenFlow/src/public/WebSocketClientService.ts index ba35b869..c1f702ba 100644 --- a/OpenFlow/src/public/WebSocketClientService.ts +++ b/OpenFlow/src/public/WebSocketClientService.ts @@ -38,7 +38,6 @@ export class WebSocketClientService { this.forgot_pass_emails = data.forgot_pass_emails; this.multi_tenant = data.multi_tenant; - this.nodered_images = data.nodered_images; this.agent_images = data.agent_images; this.enable_entity_restriction = data.enable_entity_restriction; this.enable_web_tours = data.enable_web_tours; @@ -188,7 +187,6 @@ export class WebSocketClientService { public validate_user_form: string = ""; public validate_emails: boolean = false; public forgot_pass_emails: boolean = false; - public nodered_images: nodered_image[]; public agent_images: nodered_image[]; public multi_tenant: boolean; public enable_entity_restriction: boolean; diff --git a/OpenFlow/src/public/app.ts b/OpenFlow/src/public/app.ts index 34be772f..569a07ac 100644 --- a/OpenFlow/src/public/app.ts +++ b/OpenFlow/src/public/app.ts @@ -5,7 +5,9 @@ import { MenuCtrl, ProvidersCtrl, MainCtrl, LoginCtrl, ProviderCtrl, UsersCtrl, UserCtrl, RolesCtrl, RoleCtrl, RPAWorkflowsCtrl, RPAWorkflowCtrl, WorkflowsCtrl, ReportsCtrl, EditFormCtrl, FormsCtrl, FormCtrl, FilesCtrl, EntitiesCtrl, EntityCtrl, HistoryCtrl, hdrobotsCtrl, ClientsCtrl, AuditlogsCtrl, CredentialsCtrl, CredentialCtrl, DuplicatesCtrl, - OAuthClientsCtrl, OAuthClientCtrl, DeletedCtrl, CustomerCtrl, EntityRestrictionsCtrl, EntityRestrictionCtrl, CustomersCtrl, ResourcesCtrl, ResourceCtrl, WorkitemsCtrl, WorkitemCtrl, WorkitemQueuesCtrl, WorkitemQueueCtrl, MailHistCtrl, MailHistsCtrl, FormResourcesCtrl, FormResourceCtrl, WebsocketClientsCtrl, ConsoleCtrl, AgentsCtrl, AgentCtrl, PackagesCtrl, PackageCtrl, RunPackageCtrl + OAuthClientsCtrl, OAuthClientCtrl, DeletedCtrl, CustomerCtrl, EntityRestrictionsCtrl, EntityRestrictionCtrl, CustomersCtrl, ResourcesCtrl, + ResourceCtrl, WorkitemsCtrl, WorkitemCtrl, WorkitemQueuesCtrl, WorkitemQueueCtrl, MailHistCtrl, MailHistsCtrl, FormResourcesCtrl, FormResourceCtrl, + WebsocketClientsCtrl, ConsoleCtrl, AgentsCtrl, AgentCtrl, PackagesCtrl, PackageCtrl, RunPackageCtrl, ConfigCtrl } from "./Controllers"; require('angular-route'); @@ -141,6 +143,7 @@ module openflow { .when('/WebsocketClients', { templateUrl: 'WebsocketClients.html', controller: WebsocketClientsCtrl, controllerAs: 'ctrl' }) .when('/Console', { templateUrl: 'Console.html', controller: ConsoleCtrl, controllerAs: 'ctrl' }) + .when('/Config', { templateUrl: 'Config.html', controller: ConfigCtrl, controllerAs: 'ctrl' }) // .when('/WebsocketClients/:id', { templateUrl: 'WebsocketClients.html', controller: WebsocketClientsCtrl, controllerAs: 'ctrl' }) .when('/MailHists', { templateUrl: 'MailHists.html', controller: MailHistsCtrl, controllerAs: 'ctrl' }) diff --git a/OpenFlow/src/public/index.html b/OpenFlow/src/public/index.html index bdf3ca7e..dc5f0ff3 100644 --- a/OpenFlow/src/public/index.html +++ b/OpenFlow/src/public/index.html @@ -102,6 +102,9 @@ ng-show="menuctrl.hasrole('customer admins') || menuctrl.hasrole('resellers')" ng-class="{active: menuctrl.PathIs(['/FormResources', '/FormResource', '/FormResource/'])}">formresources + config providers diff --git a/docker-compose.yml b/docker-compose.yml index ccef6dc3..ee68de8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,8 +67,6 @@ services: # - enable_nodered_tours=false # - enable_openflow_amqp=true - # - nodered_images=[{"name":"Latest Plain Nodered", - # "image":"localhost:5000/openiap/nodered:staging"}] # - nodered_ws_url=ws://api:3000 # - domain=localhost.openiap.io diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 025a62bd..021824ec 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -97,10 +97,6 @@ services: - socket_rate_limit_points=1000 - socket_rate_limit_points_disconnect=2500 - - nodered_images=[{"name":"Latest Plain Nodered", - "image":"openiap/nodered:edge"},{"name":"Latest Puppeteer Nodered", - "image":"openiap/nodered-puppeteer"},{"name":"Latest TagUI Nodered", - "image":"openiap/nodered-tagui"}] - nodered_ws_url=ws://api:3000 - saml_federation_metadata=http://api:3000/issue/FederationMetadata/2007-06/FederationMetadata.xml - nodered_saml_entrypoint=http://localhost.openiap.io/issue