openc3 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Guardfile +0 -0
- data/LICENSE.md +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/openc3cli +138 -0
- data/bin/pipuninstall +0 -0
- data/bin/uvinstall +10 -3
- data/data/config/_array_params.yaml +0 -0
- data/data/config/_canvas_values.yaml +0 -0
- data/data/config/_graph_params.yaml +0 -0
- data/data/config/_id_items.yaml +0 -0
- data/data/config/_id_params.yaml +0 -0
- data/data/config/_interfaces.yaml +0 -0
- data/data/config/_items.yaml +0 -0
- data/data/config/_params.yaml +0 -0
- data/data/config/command.yaml +0 -0
- data/data/config/command_modifiers.yaml +2 -0
- data/data/config/command_telemetry.yaml +0 -0
- data/data/config/conversions.yaml +0 -0
- data/data/config/graph_settings.yaml +0 -0
- data/data/config/interface_modifiers.yaml +103 -1
- data/data/config/item_modifiers.yaml +0 -0
- data/data/config/microservice.yaml +5 -2
- data/data/config/param_item_modifiers.yaml +0 -0
- data/data/config/parameter_modifiers.yaml +0 -0
- data/data/config/plugins.yaml +0 -0
- data/data/config/processors.yaml +0 -0
- data/data/config/protocols.yaml +0 -0
- data/data/config/screen.yaml +0 -0
- data/data/config/settings.yaml +0 -0
- data/data/config/table_manager.yaml +0 -0
- data/data/config/table_parameter_modifiers.yaml +0 -0
- data/data/config/target.yaml +0 -0
- data/data/config/target_config.yaml +0 -0
- data/data/config/telemetry.yaml +0 -0
- data/data/config/telemetry_modifiers.yaml +2 -0
- data/data/config/tool.yaml +0 -0
- data/data/config/unknown.yaml +0 -0
- data/data/config/widgets.yaml +6 -0
- data/data/xtce_schemas/SpaceSystem_20180204.xsd +0 -0
- data/data/xtce_schemas/xml.xsd +0 -0
- data/ext/openc3/ext/array/array.c +0 -0
- data/ext/openc3/ext/array/extconf.rb +0 -0
- data/ext/openc3/ext/buffered_file/buffered_file.c +0 -0
- data/ext/openc3/ext/buffered_file/extconf.rb +0 -0
- data/ext/openc3/ext/burst_protocol/burst_protocol.c +6 -0
- data/ext/openc3/ext/burst_protocol/extconf.rb +0 -0
- data/ext/openc3/ext/config_parser/config_parser.c +0 -0
- data/ext/openc3/ext/config_parser/extconf.rb +0 -0
- data/ext/openc3/ext/crc/crc.c +0 -0
- data/ext/openc3/ext/crc/extconf.rb +0 -0
- data/ext/openc3/ext/openc3_io/extconf.rb +0 -0
- data/ext/openc3/ext/openc3_io/openc3_io.c +0 -0
- data/ext/openc3/ext/packet/extconf.rb +0 -0
- data/ext/openc3/ext/packet/packet.c +0 -0
- data/ext/openc3/ext/platform/extconf.rb +0 -0
- data/ext/openc3/ext/platform/platform.c +4 -1
- data/ext/openc3/ext/polynomial_conversion/extconf.rb +0 -0
- data/ext/openc3/ext/polynomial_conversion/polynomial_conversion.c +0 -0
- data/ext/openc3/ext/string/extconf.rb +0 -0
- data/ext/openc3/ext/string/string.c +0 -0
- data/ext/openc3/ext/structure/structure.c +49 -17
- data/ext/openc3/ext/tabbed_plots_config/extconf.rb +0 -0
- data/ext/openc3/ext/tabbed_plots_config/tabbed_plots_config.c +0 -0
- data/ext/openc3/ext/telemetry/extconf.rb +0 -0
- data/ext/openc3/ext/telemetry/telemetry.c +0 -0
- data/lib/cosmos.rb +0 -0
- data/lib/cosmosc2.rb +0 -0
- data/lib/openc3/accessors/accessor.rb +0 -0
- data/lib/openc3/accessors/binary_accessor.rb +63 -9
- data/lib/openc3/accessors/cbor_accessor.rb +0 -0
- data/lib/openc3/accessors/form_accessor.rb +0 -0
- data/lib/openc3/accessors/html_accessor.rb +0 -0
- data/lib/openc3/accessors/http_accessor.rb +0 -0
- data/lib/openc3/accessors/json_accessor.rb +0 -0
- data/lib/openc3/accessors/template_accessor.rb +0 -0
- data/lib/openc3/accessors/xml_accessor.rb +0 -0
- data/lib/openc3/accessors.rb +0 -0
- data/lib/openc3/api/README.md +0 -0
- data/lib/openc3/api/api.rb +0 -0
- data/lib/openc3/api/authorized_api.rb +0 -0
- data/lib/openc3/api/calendar_api.rb +0 -0
- data/lib/openc3/api/cmd_api.rb +1 -1
- data/lib/openc3/api/config_api.rb +0 -0
- data/lib/openc3/api/interface_api.rb +0 -0
- data/lib/openc3/api/limits_api.rb +0 -0
- data/lib/openc3/api/metrics_api.rb +1 -1
- data/lib/openc3/api/offline_access_api.rb +1 -1
- data/lib/openc3/api/router_api.rb +0 -0
- data/lib/openc3/api/settings_api.rb +22 -18
- data/lib/openc3/api/stash_api.rb +1 -1
- data/lib/openc3/api/target_api.rb +0 -0
- data/lib/openc3/api/tlm_api.rb +4 -3
- data/lib/openc3/bridge/bridge.rb +0 -0
- data/lib/openc3/bridge/bridge_config.rb +0 -0
- data/lib/openc3/bridge/bridge_interface_thread.rb +0 -0
- data/lib/openc3/bridge/bridge_router_thread.rb +0 -0
- data/lib/openc3/ccsds/ccsds_packet.rb +0 -0
- data/lib/openc3/ccsds/ccsds_parser.rb +0 -0
- data/lib/openc3/config/config_parser.rb +78 -17
- data/lib/openc3/config/meta_config_parser.rb +0 -0
- data/lib/openc3/conversions/bit_reverse_conversion.rb +0 -0
- data/lib/openc3/conversions/conversion.rb +0 -0
- data/lib/openc3/conversions/generic_conversion.rb +0 -0
- data/lib/openc3/conversions/ip_read_conversion.rb +0 -0
- data/lib/openc3/conversions/ip_write_conversion.rb +0 -0
- data/lib/openc3/conversions/object_read_conversion.rb +0 -0
- data/lib/openc3/conversions/object_write_conversion.rb +0 -0
- data/lib/openc3/conversions/packet_time_formatted_conversion.rb +0 -0
- data/lib/openc3/conversions/packet_time_seconds_conversion.rb +0 -0
- data/lib/openc3/conversions/polynomial_conversion.rb +0 -0
- data/lib/openc3/conversions/processor_conversion.rb +0 -0
- data/lib/openc3/conversions/received_count_conversion.rb +0 -0
- data/lib/openc3/conversions/received_time_formatted_conversion.rb +0 -0
- data/lib/openc3/conversions/received_time_seconds_conversion.rb +0 -0
- data/lib/openc3/conversions/segmented_polynomial_conversion.rb +0 -0
- data/lib/openc3/conversions/unix_time_conversion.rb +0 -0
- data/lib/openc3/conversions/unix_time_formatted_conversion.rb +0 -0
- data/lib/openc3/conversions/unix_time_seconds_conversion.rb +0 -0
- data/lib/openc3/conversions.rb +0 -0
- data/lib/openc3/core_ext/array.rb +0 -0
- data/lib/openc3/core_ext/binding.rb +0 -0
- data/lib/openc3/core_ext/class.rb +0 -0
- data/lib/openc3/core_ext/exception.rb +0 -0
- data/lib/openc3/core_ext/faraday.rb +0 -0
- data/lib/openc3/core_ext/file.rb +0 -0
- data/lib/openc3/core_ext/io.rb +0 -0
- data/lib/openc3/core_ext/kernel.rb +0 -0
- data/lib/openc3/core_ext/math.rb +0 -0
- data/lib/openc3/core_ext/matrix.rb +0 -0
- data/lib/openc3/core_ext/objectspace.rb +0 -0
- data/lib/openc3/core_ext/openc3_io.rb +0 -0
- data/lib/openc3/core_ext/range.rb +0 -0
- data/lib/openc3/core_ext/socket.rb +0 -0
- data/lib/openc3/core_ext/string.rb +0 -0
- data/lib/openc3/core_ext/stringio.rb +0 -0
- data/lib/openc3/core_ext/tempfile.rb +0 -0
- data/lib/openc3/core_ext/time.rb +0 -0
- data/lib/openc3/core_ext.rb +0 -0
- data/lib/openc3/ext/.keep +0 -0
- data/lib/openc3/interfaces/file_interface.rb +0 -0
- data/lib/openc3/interfaces/http_client_interface.rb +0 -0
- data/lib/openc3/interfaces/http_server_interface.rb +0 -0
- data/lib/openc3/interfaces/interface.rb +5 -4
- data/lib/openc3/interfaces/mqtt_interface.rb +0 -0
- data/lib/openc3/interfaces/mqtt_stream_interface.rb +2 -0
- data/lib/openc3/interfaces/protocols/burst_protocol.rb +27 -0
- data/lib/openc3/interfaces/protocols/cmd_response_protocol.rb +0 -0
- data/lib/openc3/interfaces/protocols/cobs_protocol.rb +0 -0
- data/lib/openc3/interfaces/protocols/crc_protocol.rb +0 -0
- data/lib/openc3/interfaces/protocols/fixed_protocol.rb +0 -0
- data/lib/openc3/interfaces/protocols/ignore_packet_protocol.rb +0 -0
- data/lib/openc3/interfaces/protocols/length_protocol.rb +7 -0
- data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +7 -0
- data/lib/openc3/interfaces/protocols/protocol.rb +4 -4
- data/lib/openc3/interfaces/protocols/slip_protocol.rb +0 -0
- data/lib/openc3/interfaces/protocols/template_protocol.rb +2 -2
- data/lib/openc3/interfaces/protocols/terminated_protocol.rb +0 -0
- data/lib/openc3/interfaces/serial_interface.rb +2 -0
- data/lib/openc3/interfaces/simulated_target_interface.rb +0 -0
- data/lib/openc3/interfaces/stream_interface.rb +0 -0
- data/lib/openc3/interfaces/tcpip_client_interface.rb +2 -0
- data/lib/openc3/interfaces/tcpip_server_interface.rb +0 -0
- data/lib/openc3/interfaces/udp_interface.rb +16 -5
- data/lib/openc3/interfaces.rb +0 -0
- data/lib/openc3/io/buffered_file.rb +0 -0
- data/lib/openc3/io/io_multiplexer.rb +0 -0
- data/lib/openc3/io/json_api.rb +3 -2
- data/lib/openc3/io/json_api_object.rb +0 -0
- data/lib/openc3/io/json_drb.rb +20 -4
- data/lib/openc3/io/json_drb_object.rb +0 -0
- data/lib/openc3/io/json_drb_rack.rb +0 -0
- data/lib/openc3/io/json_rpc.rb +0 -0
- data/lib/openc3/io/posix_serial_driver.rb +0 -0
- data/lib/openc3/io/serial_driver.rb +0 -0
- data/lib/openc3/io/stderr.rb +0 -0
- data/lib/openc3/io/stdout.rb +0 -0
- data/lib/openc3/io/udp_sockets.rb +38 -8
- data/lib/openc3/io/win32_serial_driver.rb +1 -0
- data/lib/openc3/logs/buffered_packet_log_reader.rb +0 -0
- data/lib/openc3/logs/buffered_packet_log_writer.rb +0 -0
- data/lib/openc3/logs/log_writer.rb +0 -0
- data/lib/openc3/logs/packet_log_constants.rb +0 -0
- data/lib/openc3/logs/packet_log_reader.rb +23 -2
- data/lib/openc3/logs/packet_log_writer.rb +5 -0
- data/lib/openc3/logs/stream_log.rb +1 -1
- data/lib/openc3/logs/stream_log_pair.rb +0 -0
- data/lib/openc3/logs/text_log_writer.rb +0 -0
- data/lib/openc3/logs.rb +0 -0
- data/lib/openc3/microservices/cleanup_microservice.rb +0 -0
- data/lib/openc3/microservices/decom_common.rb +0 -0
- data/lib/openc3/microservices/decom_microservice.rb +0 -0
- data/lib/openc3/microservices/interface_decom_common.rb +2 -1
- data/lib/openc3/microservices/interface_microservice.rb +72 -25
- data/lib/openc3/microservices/log_microservice.rb +0 -0
- data/lib/openc3/microservices/microservice.rb +3 -3
- data/lib/openc3/microservices/multi_microservice.rb +1 -1
- data/lib/openc3/microservices/periodic_microservice.rb +2 -2
- data/lib/openc3/microservices/plugin_microservice.rb +0 -0
- data/lib/openc3/microservices/queue_microservice.rb +0 -0
- data/lib/openc3/microservices/router_microservice.rb +0 -0
- data/lib/openc3/microservices/scope_cleanup_microservice.rb +0 -0
- data/lib/openc3/microservices/text_log_microservice.rb +0 -0
- data/lib/openc3/migrations/20220420190000_log_stuff.rb +0 -0
- data/lib/openc3/migrations/20221202214600_add_target_names.rb +0 -0
- data/lib/openc3/migrations/20221210174900_convert_to_multi.rb +0 -0
- data/lib/openc3/migrations/20230915000002_no_scope_log_messages.rb +0 -0
- data/lib/openc3/migrations/20231022000000_tlm_viewer_config.rb +0 -0
- data/lib/openc3/migrations/20241208080000_no_critical_cmd.rb +0 -0
- data/lib/openc3/migrations/20241208080001_no_trigger_group.rb +0 -0
- data/lib/openc3/migrations/20250108060000_news_feed.rb +0 -0
- data/lib/openc3/migrations/20250402000000_periodic_only_default.rb +0 -0
- data/lib/openc3/migrations/20260203000000_remove_store_id.rb +0 -0
- data/lib/openc3/migrations/20260204000000_remove_decom_reducer.rb +0 -0
- data/lib/openc3/migrations/20260701000000_updated_at_to_int.rb +0 -0
- data/lib/openc3/migrations/20260704000000_default_bridge.rb +38 -0
- data/lib/openc3/migrations/20260731000000_system_health_json.rb +11 -0
- data/lib/openc3/models/activity_model.rb +0 -0
- data/lib/openc3/models/auth_model.rb +35 -7
- data/lib/openc3/models/bridge_model.rb +133 -0
- data/lib/openc3/models/config_keyword_model.rb +63 -0
- data/lib/openc3/models/cvt_model.rb +0 -0
- data/lib/openc3/models/db_sharded_model.rb +0 -0
- data/lib/openc3/models/environment_model.rb +0 -0
- data/lib/openc3/models/gem_model.rb +12 -9
- data/lib/openc3/models/host_interface_microservice_model.rb +114 -0
- data/lib/openc3/models/info_model.rb +0 -0
- data/lib/openc3/models/interface_model.rb +178 -19
- data/lib/openc3/models/interface_status_model.rb +0 -0
- data/lib/openc3/models/metadata_model.rb +0 -0
- data/lib/openc3/models/metric_model.rb +0 -0
- data/lib/openc3/models/microservice_model.rb +9 -22
- data/lib/openc3/models/microservice_status_model.rb +0 -0
- data/lib/openc3/models/migration_model.rb +0 -0
- data/lib/openc3/models/model.rb +0 -0
- data/lib/openc3/models/news_model.rb +0 -0
- data/lib/openc3/models/note_model.rb +0 -0
- data/lib/openc3/models/offline_access_model.rb +0 -0
- data/lib/openc3/models/ping_model.rb +0 -0
- data/lib/openc3/models/plugin_model.rb +9 -2
- data/lib/openc3/models/plugin_store_model.rb +0 -0
- data/lib/openc3/models/process_status_model.rb +0 -0
- data/lib/openc3/models/python_package_model.rb +4 -4
- data/lib/openc3/models/queue_model.rb +0 -0
- data/lib/openc3/models/reaction_model.rb +0 -0
- data/lib/openc3/models/reingest_job_model.rb +0 -0
- data/lib/openc3/models/router_model.rb +0 -0
- data/lib/openc3/models/router_status_model.rb +0 -0
- data/lib/openc3/models/scope_model.rb +51 -26
- data/lib/openc3/models/script_engine_model.rb +0 -0
- data/lib/openc3/models/script_status_model.rb +0 -0
- data/lib/openc3/models/secret_model.rb +0 -0
- data/lib/openc3/models/setting_model.rb +546 -3
- data/lib/openc3/models/sorted_model.rb +0 -0
- data/lib/openc3/models/stash_model.rb +0 -0
- data/lib/openc3/models/target_model.rb +30 -25
- data/lib/openc3/models/timeline_model.rb +0 -0
- data/lib/openc3/models/tool_config_model.rb +0 -0
- data/lib/openc3/models/tool_model.rb +1 -0
- data/lib/openc3/models/trigger_group_model.rb +0 -0
- data/lib/openc3/models/trigger_model.rb +20 -0
- data/lib/openc3/models/widget_model.rb +0 -0
- data/lib/openc3/operators/microservice_operator.rb +64 -22
- data/lib/openc3/operators/operator.rb +4 -4
- data/lib/openc3/packets/binary_accessor.rb +0 -0
- data/lib/openc3/packets/command_validator.rb +0 -0
- data/lib/openc3/packets/commands.rb +0 -0
- data/lib/openc3/packets/json_packet.rb +0 -0
- data/lib/openc3/packets/limits.rb +0 -0
- data/lib/openc3/packets/limits_response.rb +0 -0
- data/lib/openc3/packets/packet.rb +4 -0
- data/lib/openc3/packets/packet_config.rb +0 -0
- data/lib/openc3/packets/packet_item.rb +0 -0
- data/lib/openc3/packets/packet_item_limits.rb +0 -0
- data/lib/openc3/packets/parsers/format_string_parser.rb +0 -0
- data/lib/openc3/packets/parsers/limits_parser.rb +0 -0
- data/lib/openc3/packets/parsers/limits_response_parser.rb +0 -0
- data/lib/openc3/packets/parsers/packet_item_parser.rb +0 -0
- data/lib/openc3/packets/parsers/packet_parser.rb +0 -0
- data/lib/openc3/packets/parsers/processor_parser.rb +0 -0
- data/lib/openc3/packets/parsers/state_parser.rb +0 -0
- data/lib/openc3/packets/parsers/xtce_converter.rb +0 -0
- data/lib/openc3/packets/parsers/xtce_parser.rb +0 -0
- data/lib/openc3/packets/structure.rb +7 -1
- data/lib/openc3/packets/structure_item.rb +0 -0
- data/lib/openc3/packets/telemetry.rb +0 -0
- data/lib/openc3/processors/processor.rb +2 -0
- data/lib/openc3/processors/statistics_processor.rb +0 -0
- data/lib/openc3/processors/watermark_processor.rb +0 -0
- data/lib/openc3/processors.rb +0 -0
- data/lib/openc3/script/api_shared.rb +0 -0
- data/lib/openc3/script/autonomic.rb +12 -12
- data/lib/openc3/script/calendar.rb +0 -0
- data/lib/openc3/script/commands.rb +0 -0
- data/lib/openc3/script/critical_cmd.rb +0 -0
- data/lib/openc3/script/exceptions.rb +0 -0
- data/lib/openc3/script/extract.rb +0 -0
- data/lib/openc3/script/limits.rb +0 -0
- data/lib/openc3/script/metadata.rb +0 -0
- data/lib/openc3/script/packages.rb +0 -0
- data/lib/openc3/script/plugins.rb +0 -0
- data/lib/openc3/script/queue.rb +0 -0
- data/lib/openc3/script/screen.rb +0 -0
- data/lib/openc3/script/script.rb +2 -2
- data/lib/openc3/script/script_runner.rb +0 -0
- data/lib/openc3/script/storage.rb +4 -4
- data/lib/openc3/script/suite.rb +0 -0
- data/lib/openc3/script/suite_results.rb +0 -0
- data/lib/openc3/script/suite_runner.rb +26 -0
- data/lib/openc3/script/tables.rb +0 -0
- data/lib/openc3/script/telemetry.rb +9 -3
- data/lib/openc3/script/web_socket_api.rb +218 -145
- data/lib/openc3/script.rb +0 -0
- data/lib/openc3/script_engines/script_engine.rb +0 -0
- data/lib/openc3/streams/mqtt_stream.rb +0 -0
- data/lib/openc3/streams/serial_stream.rb +0 -0
- data/lib/openc3/streams/stream.rb +0 -0
- data/lib/openc3/streams/tcpip_client_stream.rb +0 -0
- data/lib/openc3/streams/tcpip_socket_stream.rb +0 -0
- data/lib/openc3/streams/web_socket_client_stream.rb +0 -0
- data/lib/openc3/subpacketizers/subpacketizer.rb +0 -0
- data/lib/openc3/system/system.rb +0 -0
- data/lib/openc3/system/target.rb +0 -0
- data/lib/openc3/system.rb +0 -0
- data/lib/openc3/tools/cmd_tlm_server/api.rb +0 -0
- data/lib/openc3/tools/cmd_tlm_server/interface_thread.rb +7 -0
- data/lib/openc3/tools/table_manager/table.rb +0 -0
- data/lib/openc3/tools/table_manager/table_config.rb +0 -0
- data/lib/openc3/tools/table_manager/table_item.rb +0 -0
- data/lib/openc3/tools/table_manager/table_item_parser.rb +0 -0
- data/lib/openc3/tools/table_manager/table_manager_core.rb +0 -0
- data/lib/openc3/tools/table_manager/table_parser.rb +0 -0
- data/lib/openc3/tools/test_runner/test.rb +0 -0
- data/lib/openc3/top_level.rb +1 -1
- data/lib/openc3/topics/autonomic_topic.rb +0 -0
- data/lib/openc3/topics/calendar_topic.rb +0 -0
- data/lib/openc3/topics/command_decom_topic.rb +0 -0
- data/lib/openc3/topics/command_topic.rb +0 -0
- data/lib/openc3/topics/config_topic.rb +0 -0
- data/lib/openc3/topics/decom_interface_topic.rb +2 -1
- data/lib/openc3/topics/interface_topic.rb +8 -2
- data/lib/openc3/topics/limits_event_topic.rb +0 -0
- data/lib/openc3/topics/notebook_topic.rb +0 -0
- data/lib/openc3/topics/queue_topic.rb +0 -0
- data/lib/openc3/topics/router_topic.rb +6 -1
- data/lib/openc3/topics/system_events_topic.rb +0 -0
- data/lib/openc3/topics/telemetry_decom_topic.rb +0 -0
- data/lib/openc3/topics/telemetry_topic.rb +0 -0
- data/lib/openc3/topics/timeline_topic.rb +0 -0
- data/lib/openc3/topics/topic.rb +0 -0
- data/lib/openc3/utilities/authentication.rb +4 -4
- data/lib/openc3/utilities/authorization.rb +0 -0
- data/lib/openc3/utilities/aws_bucket.rb +2 -2
- data/lib/openc3/utilities/bucket.rb +1 -1
- data/lib/openc3/utilities/bucket_file_cache.rb +55 -22
- data/lib/openc3/utilities/bucket_require.rb +0 -0
- data/lib/openc3/utilities/bucket_utilities.rb +3 -4
- data/lib/openc3/utilities/cli_generator.rb +0 -0
- data/lib/openc3/utilities/cmd_log.rb +0 -0
- data/lib/openc3/utilities/config_overlay.rb +75 -0
- data/lib/openc3/utilities/cosmos_rails_formatter.rb +0 -0
- data/lib/openc3/utilities/crc.rb +59 -32
- data/lib/openc3/utilities/csv.rb +0 -0
- data/lib/openc3/utilities/ctrf.rb +0 -0
- data/lib/openc3/utilities/env_helper.rb +0 -0
- data/lib/openc3/utilities/local_bucket.rb +0 -0
- data/lib/openc3/utilities/local_mode.rb +32 -6
- data/lib/openc3/utilities/logger.rb +30 -8
- data/lib/openc3/utilities/message_log.rb +0 -0
- data/lib/openc3/utilities/metric.rb +0 -0
- data/lib/openc3/utilities/migration.rb +0 -0
- data/lib/openc3/utilities/open_telemetry.rb +0 -0
- data/lib/openc3/utilities/process_manager.rb +0 -0
- data/lib/openc3/utilities/pypi_url.rb +0 -0
- data/lib/openc3/utilities/python_proxy.rb +0 -0
- data/lib/openc3/utilities/python_venv.rb +135 -0
- data/lib/openc3/utilities/quaternion.rb +0 -0
- data/lib/openc3/utilities/questdb_client.rb +0 -0
- data/lib/openc3/utilities/redis_secrets.rb +0 -0
- data/lib/openc3/utilities/reingest_job.rb +0 -0
- data/lib/openc3/utilities/ruby_lex_utils.rb +0 -0
- data/lib/openc3/utilities/rubygems_url.rb +39 -0
- data/lib/openc3/utilities/running_script.rb +24 -55
- data/lib/openc3/utilities/s3_autoload.rb +5 -5
- data/lib/openc3/utilities/script.rb +12 -8
- data/lib/openc3/utilities/secrets.rb +48 -3
- data/lib/openc3/utilities/simulated_target.rb +0 -0
- data/lib/openc3/utilities/sleeper.rb +0 -0
- data/lib/openc3/utilities/store.rb +0 -0
- data/lib/openc3/utilities/store_autoload.rb +2 -2
- data/lib/openc3/utilities/store_queued.rb +0 -0
- data/lib/openc3/utilities/target_file.rb +18 -1
- data/lib/openc3/utilities/thread_manager.rb +0 -0
- data/lib/openc3/utilities/throttle.rb +0 -0
- data/lib/openc3/utilities/zip.rb +0 -0
- data/lib/openc3/utilities.rb +0 -0
- data/lib/openc3/version.rb +5 -5
- data/lib/openc3/win32/excel.rb +0 -0
- data/lib/openc3/win32/win32.rb +0 -0
- data/lib/openc3/win32/win32_main.rb +0 -0
- data/lib/openc3.rb +2 -2
- data/tasks/gemfile_stats.rake +0 -0
- data/tasks/spec.rake +0 -0
- data/templates/command_validator/command_validator.py +0 -0
- data/templates/command_validator/command_validator.rb +0 -0
- data/templates/conversion/conversion.py +0 -0
- data/templates/conversion/conversion.rb +0 -0
- data/templates/limits_response/response.py +0 -0
- data/templates/limits_response/response.rb +0 -0
- data/templates/microservice/microservices/TEMPLATE/microservice.py +0 -0
- data/templates/microservice/microservices/TEMPLATE/microservice.rb +0 -0
- data/templates/plugin/.gitignore +0 -0
- data/templates/plugin/LICENSE.md +0 -0
- data/templates/plugin/README.md +0 -0
- data/templates/plugin/Rakefile +0 -0
- data/templates/plugin/plugin.gemspec +0 -0
- data/templates/plugin/plugin.txt +0 -0
- data/templates/processor/processor.py +1 -1
- data/templates/processor/processor.rb +0 -0
- data/templates/target/targets/TARGET/cmd_tlm/cmd.txt +0 -0
- data/templates/target/targets/TARGET/cmd_tlm/tlm.txt +0 -0
- data/templates/target/targets/TARGET/lib/target.py +0 -0
- data/templates/target/targets/TARGET/lib/target.rb +0 -0
- data/templates/target/targets/TARGET/procedures/procedure.py +0 -0
- data/templates/target/targets/TARGET/procedures/procedure.rb +0 -0
- data/templates/target/targets/TARGET/public/README.txt +0 -0
- data/templates/target/targets/TARGET/screens/status.txt +0 -0
- data/templates/target/targets/TARGET/target.txt +0 -0
- data/templates/tool_angular/.editorconfig +0 -0
- data/templates/tool_angular/.gitignore +0 -0
- data/templates/tool_angular/.vscode/extensions.json +0 -0
- data/templates/tool_angular/.vscode/launch.json +0 -0
- data/templates/tool_angular/.vscode/tasks.json +0 -0
- data/templates/tool_angular/angular.json +0 -0
- data/templates/tool_angular/extra-webpack.config.js +0 -0
- data/templates/tool_angular/package.json +2 -2
- data/templates/tool_angular/src/app/app-routing.module.ts +0 -0
- data/templates/tool_angular/src/app/app.component.html +0 -0
- data/templates/tool_angular/src/app/app.component.scss +0 -0
- data/templates/tool_angular/src/app/app.component.spec.ts +0 -0
- data/templates/tool_angular/src/app/app.component.ts +0 -0
- data/templates/tool_angular/src/app/app.module.ts +0 -0
- data/templates/tool_angular/src/app/custom-overlay-container.ts +0 -0
- data/templates/tool_angular/src/app/empty-route/empty-route.component.ts +0 -0
- data/templates/tool_angular/src/app/openc3-api.d.ts +0 -0
- data/templates/tool_angular/src/assets/.gitkeep +0 -0
- data/templates/tool_angular/src/environments/environment.prod.ts +0 -0
- data/templates/tool_angular/src/environments/environment.ts +0 -0
- data/templates/tool_angular/src/favicon.ico +0 -0
- data/templates/tool_angular/src/index.html +0 -0
- data/templates/tool_angular/src/main.single-spa.ts +0 -0
- data/templates/tool_angular/src/single-spa/asset-url.ts +0 -0
- data/templates/tool_angular/src/single-spa/single-spa-props.ts +0 -0
- data/templates/tool_angular/src/styles.scss +0 -0
- data/templates/tool_angular/tsconfig.app.json +0 -0
- data/templates/tool_angular/tsconfig.json +0 -0
- data/templates/tool_angular/tsconfig.spec.json +0 -0
- data/templates/tool_react/.eslintrc +0 -0
- data/templates/tool_react/.gitignore +0 -0
- data/templates/tool_react/.prettierignore +0 -0
- data/templates/tool_react/babel.config.json +0 -0
- data/templates/tool_react/jest.config.js +0 -0
- data/templates/tool_react/package.json +1 -1
- data/templates/tool_react/src/openc3-tool_name.js +0 -0
- data/templates/tool_react/src/root.component.js +0 -0
- data/templates/tool_react/src/root.component.test.js +0 -0
- data/templates/tool_react/webpack.config.js +0 -0
- data/templates/tool_svelte/.gitignore +0 -0
- data/templates/tool_svelte/.prettierignore +0 -0
- data/templates/tool_svelte/.prettierrc.js +0 -0
- data/templates/tool_svelte/babel.config.js +0 -0
- data/templates/tool_svelte/build/smui.css +0 -0
- data/templates/tool_svelte/jest.config.js +0 -0
- data/templates/tool_svelte/package.json +1 -1
- data/templates/tool_svelte/rollup.config.js +0 -0
- data/templates/tool_svelte/src/App.svelte +0 -0
- data/templates/tool_svelte/src/App.test.js +0 -0
- data/templates/tool_svelte/src/theme/_smui-theme.scss +0 -0
- data/templates/tool_svelte/src/tool_name.js +0 -0
- data/templates/tool_vue/.env.standalone +0 -0
- data/templates/tool_vue/.gitignore +0 -0
- data/templates/tool_vue/.prettierrc.cjs +0 -0
- data/templates/tool_vue/eslint.config.mjs +0 -0
- data/templates/tool_vue/jsconfig.json +0 -0
- data/templates/tool_vue/package.json +3 -3
- data/templates/tool_vue/src/App.vue +0 -0
- data/templates/tool_vue/src/main.js +0 -0
- data/templates/tool_vue/src/router.js +0 -0
- data/templates/tool_vue/src/tools/tool_name/tool_name.vue +0 -0
- data/templates/tool_vue/vite.config.js +1 -1
- data/templates/widget/.prettierrc.cjs +0 -0
- data/templates/widget/LICENSE.md +0 -0
- data/templates/widget/Rakefile +0 -0
- data/templates/widget/package.json +2 -2
- data/templates/widget/src/Widget.vue +0 -0
- data/templates/widget/vite.config.js +0 -0
- metadata +36 -9
|
@@ -50,6 +50,7 @@ module OpenC3
|
|
|
50
50
|
STRING_TYPE = 'string'.freeze
|
|
51
51
|
REGEX_TYPE = 'regex'.freeze
|
|
52
52
|
TRIGGER_TYPE = 'trigger'.freeze
|
|
53
|
+
ITEM_VALUE_TYPES = ['RAW', 'CONVERTED', 'FORMATTED', 'WITH_UNITS'].freeze
|
|
53
54
|
|
|
54
55
|
def self.create_unique_name(group:, scope:)
|
|
55
56
|
trigger_names = self.names(group: group, scope: scope)
|
|
@@ -180,6 +181,24 @@ module OpenC3
|
|
|
180
181
|
end
|
|
181
182
|
end
|
|
182
183
|
|
|
184
|
+
# Validate the items hold a legal valueType and reference telemetry items
|
|
185
|
+
# which actually exist. Only called on create and update, never from initialize.
|
|
186
|
+
# Anything which can reject an already persisted trigger must live here rather than
|
|
187
|
+
# in validate_operand, because validate_operand runs on every from_json
|
|
188
|
+
def validate_trigger_items
|
|
189
|
+
{'left' => @left, 'right' => @right}.each do |side, operand|
|
|
190
|
+
next unless operand.is_a?(Hash) and operand['type'] == ITEM_TYPE
|
|
191
|
+
unless ITEM_VALUE_TYPES.include?(operand['valueType'])
|
|
192
|
+
raise TriggerInputError.new "invalid #{side} operand, valueType '#{operand['valueType']}' must be one of #{ITEM_VALUE_TYPES}"
|
|
193
|
+
end
|
|
194
|
+
begin
|
|
195
|
+
TargetModel.packet_item(operand['target'], operand['packet'], operand['item'], scope: @scope)
|
|
196
|
+
rescue StandardError => e
|
|
197
|
+
raise TriggerInputError.new "invalid #{side} trigger: #{e.message}"
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
183
202
|
# Validate that all root triggers exist, but do not persist dependent changes yet.
|
|
184
203
|
# Returns the list of root trigger models that need updating.
|
|
185
204
|
def validate_roots
|
|
@@ -207,6 +226,7 @@ module OpenC3
|
|
|
207
226
|
unless Store.hget(@primary_key, @name).nil?
|
|
208
227
|
raise TriggerInputError.new "existing trigger found: '#{@name}'"
|
|
209
228
|
end
|
|
229
|
+
validate_trigger_items()
|
|
210
230
|
models = validate_roots()
|
|
211
231
|
@updated_at = Time.now.to_nsec_from_epoch
|
|
212
232
|
Store.hset(@primary_key, @name, JSON.generate(as_json, allow_nan: true))
|
|
File without changes
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
require 'openc3'
|
|
19
19
|
require 'openc3/models/microservice_model'
|
|
20
20
|
require 'openc3/operators/operator'
|
|
21
|
+
require 'openc3/utilities/python_venv'
|
|
21
22
|
require 'openc3/utilities/secrets'
|
|
22
23
|
require 'redis'
|
|
23
24
|
require 'open3'
|
|
@@ -56,28 +57,13 @@ module OpenC3
|
|
|
56
57
|
plugin_venv_dir = nil
|
|
57
58
|
if plugin_name
|
|
58
59
|
scope = microservice_name.split("__")[0]
|
|
59
|
-
|
|
60
|
-
candidate = "/gems/plugin_venvs/#{sanitized_name}/.venv"
|
|
61
|
-
plugin_venv_dir = candidate if File.directory?(candidate)
|
|
60
|
+
plugin_venv_dir = PythonVenv.plugin_venv_path(scope: scope, plugin_name: plugin_name)
|
|
62
61
|
end
|
|
63
62
|
|
|
64
63
|
if plugin_venv_dir
|
|
65
|
-
env
|
|
66
|
-
env['PATH'] = "#{plugin_venv_dir}/bin:#{ENV.fetch('PATH', '')}"
|
|
67
|
-
env['PYTHONUSERBASE'] = plugin_venv_dir
|
|
68
|
-
# Add the plugin venv's site-packages to PYTHONPATH so the base venv's
|
|
69
|
-
# Python binary can find plugin-specific packages. We keep the base binary
|
|
70
|
-
# because it has openc3 core installed; PYTHONPATH is always respected by
|
|
71
|
-
# CPython regardless of venv activation state.
|
|
72
|
-
site_packages = Dir.glob("#{plugin_venv_dir}/lib/python*/site-packages").first
|
|
73
|
-
existing_pythonpath = ENV.fetch('PYTHONPATH', '')
|
|
74
|
-
if site_packages
|
|
75
|
-
env['PYTHONPATH'] = existing_pythonpath.empty? ? site_packages : "#{site_packages}:#{existing_pythonpath}"
|
|
76
|
-
else
|
|
77
|
-
env['PYTHONPATH'] = existing_pythonpath.empty? ? nil : existing_pythonpath
|
|
78
|
-
end
|
|
64
|
+
PythonVenv.configure_environment(env, plugin_venv_dir)
|
|
79
65
|
else
|
|
80
|
-
env['PYTHONUSERBASE'] =
|
|
66
|
+
env['PYTHONUSERBASE'] = PythonVenv::DEFAULT_PYTHONUSERBASE
|
|
81
67
|
env['PYTHONPATH'] = ENV.fetch('PYTHONPATH', nil)
|
|
82
68
|
end
|
|
83
69
|
else
|
|
@@ -98,10 +84,7 @@ module OpenC3
|
|
|
98
84
|
if type == 'ENV'
|
|
99
85
|
env[env_name_or_path] = secret_value
|
|
100
86
|
elsif type == 'FILE'
|
|
101
|
-
|
|
102
|
-
File.open(env_name_or_path, 'wb') do |file|
|
|
103
|
-
file.write(secret_value)
|
|
104
|
-
end
|
|
87
|
+
write_secret_file(microservice_name, secret_name, env_name_or_path, secret_value)
|
|
105
88
|
end
|
|
106
89
|
else
|
|
107
90
|
Logger.error("Microservice #{microservice_name} references unknown secret: #{secret_name}")
|
|
@@ -112,6 +95,65 @@ module OpenC3
|
|
|
112
95
|
return process_definition, work_dir, env, scope, container
|
|
113
96
|
end
|
|
114
97
|
|
|
98
|
+
# Writes a FILE type secret to disk. The path is first validated lexically
|
|
99
|
+
# (see Secrets.validate_file_path) and then checked against the filesystem to
|
|
100
|
+
# make sure no symlink redirects the write outside of Secrets.secret_file_dir.
|
|
101
|
+
# Both checks happen before any directory is created so that mkdir_p can
|
|
102
|
+
# never create directories outside of the base.
|
|
103
|
+
def write_secret_file(microservice_name, secret_name, env_name_or_path, secret_value)
|
|
104
|
+
begin
|
|
105
|
+
path = Secrets.validate_file_path(env_name_or_path)
|
|
106
|
+
rescue ArgumentError => error
|
|
107
|
+
Logger.error("Microservice #{microservice_name} secret #{secret_name} has an invalid file path: #{error.message}")
|
|
108
|
+
return
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# validate_file_path is purely lexical, so a symlink under the secret file
|
|
112
|
+
# directory could still redirect the write outside of it. Resolve symlinks
|
|
113
|
+
# here, where the filesystem being written to is the one being checked.
|
|
114
|
+
begin
|
|
115
|
+
real_base = File.realpath(Secrets.secret_file_dir)
|
|
116
|
+
rescue SystemCallError => error
|
|
117
|
+
Logger.error("Microservice #{microservice_name} secret #{secret_name} secret file directory is unusable: #{error.message}")
|
|
118
|
+
return
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Check the deepest directory that already exists before creating anything.
|
|
122
|
+
# If an existing component is a symlink out of the base, mkdir_p would
|
|
123
|
+
# otherwise create the remaining directories outside of it.
|
|
124
|
+
dir = File.dirname(path)
|
|
125
|
+
existing = dir
|
|
126
|
+
existing = File.dirname(existing) until File.directory?(existing) or existing == File.dirname(existing)
|
|
127
|
+
begin
|
|
128
|
+
real_existing = File.realpath(existing)
|
|
129
|
+
rescue SystemCallError => error
|
|
130
|
+
Logger.error("Microservice #{microservice_name} secret #{secret_name} file path is unusable: #{error.message}")
|
|
131
|
+
return
|
|
132
|
+
end
|
|
133
|
+
unless Secrets.path_contained?(real_base, real_existing)
|
|
134
|
+
Logger.error("Microservice #{microservice_name} secret #{secret_name} file path contains a symlinked directory which resolves outside of #{real_base}: #{path}")
|
|
135
|
+
return
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
FileUtils.mkdir_p(dir)
|
|
139
|
+
# Re-check after creating the directories in case one was created through a
|
|
140
|
+
# symlink or the tree changed underneath us.
|
|
141
|
+
real_dir = File.realpath(dir)
|
|
142
|
+
unless Secrets.path_contained?(real_base, real_dir)
|
|
143
|
+
Logger.error("Microservice #{microservice_name} secret #{secret_name} file path resolves outside of #{real_base}: #{path}")
|
|
144
|
+
return
|
|
145
|
+
end
|
|
146
|
+
# File.symlink? uses lstat and so does not follow the link, unlike the
|
|
147
|
+
# File.open below which would write through it.
|
|
148
|
+
if File.symlink?(path)
|
|
149
|
+
Logger.error("Microservice #{microservice_name} secret #{secret_name} file path is a symlink which is not allowed: #{path}")
|
|
150
|
+
return
|
|
151
|
+
end
|
|
152
|
+
File.open(path, 'wb') do |file|
|
|
153
|
+
file.write(secret_value)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
115
157
|
# Handle the detection of a new microservice model
|
|
116
158
|
def handle_new_microservice(microservice_name, microservice_config)
|
|
117
159
|
parent = microservice_config['parent']
|
|
@@ -233,18 +233,18 @@ module OpenC3
|
|
|
233
233
|
PROCESS_SHUTDOWN_SECONDS = 5.0
|
|
234
234
|
|
|
235
235
|
def initialize
|
|
236
|
-
Logger.level = Logger
|
|
236
|
+
Logger.level = Logger.default_level
|
|
237
237
|
Logger.microservice_name = 'MicroserviceOperator'
|
|
238
238
|
|
|
239
239
|
OperatorProcess.setup()
|
|
240
|
-
@cycle_time = (
|
|
240
|
+
@cycle_time = ENV.fetch('OPERATOR_CYCLE_TIME', CYCLE_TIME).to_f # time in seconds
|
|
241
241
|
# Maximum number of new microservices to start per cycle. This spreads a
|
|
242
242
|
# large startup burst (e.g. installing a plugin with many targets) across
|
|
243
243
|
# multiple cycles so the shared services (object store, redis) aren't
|
|
244
244
|
# stampeded by every microservice connecting at once. 0 = no limit.
|
|
245
|
-
@max_start_per_cycle = (
|
|
245
|
+
@max_start_per_cycle = ENV.fetch('OPENC3_OPERATOR_MAX_START_PER_CYCLE', 5).to_i
|
|
246
246
|
|
|
247
|
-
@ruby_process_name = ENV
|
|
247
|
+
@ruby_process_name = ENV.fetch('OPENC3_RUBY', nil)
|
|
248
248
|
if RUBY_ENGINE != 'ruby'
|
|
249
249
|
@ruby_process_name ||= 'jruby'
|
|
250
250
|
else
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -637,6 +637,10 @@ module OpenC3
|
|
|
637
637
|
else
|
|
638
638
|
value = super(item, :RAW, buffer)
|
|
639
639
|
end
|
|
640
|
+
# An item beyond the end of a short buffer reads as nil (ALLOW_SHORT).
|
|
641
|
+
# Conversions, states and format strings can't be applied to a nil value.
|
|
642
|
+
return nil if value.nil? && @short_buffer_allowed && item.data_type != :DERIVED
|
|
643
|
+
|
|
640
644
|
derived_raw = false
|
|
641
645
|
if item.data_type == :DERIVED && value_type == :RAW
|
|
642
646
|
value_type = :CONVERTED
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -617,7 +617,13 @@ module OpenC3
|
|
|
617
617
|
return 62
|
|
618
618
|
end
|
|
619
619
|
else
|
|
620
|
-
|
|
620
|
+
total_bit_size = (length_value * item.variable_bit_size['length_bits_per_count']) + item.variable_bit_size['length_value_bit_offset']
|
|
621
|
+
available_bit_size = (@buffer.length * 8) - item.bit_offset
|
|
622
|
+
if total_bit_size < 0 ||
|
|
623
|
+
(!@short_buffer_allowed && (available_bit_size < 0 || total_bit_size > available_bit_size))
|
|
624
|
+
raise ArgumentError, "Variable bit size #{total_bit_size} for item #{item.name} exceeds the #{[available_bit_size, 0].max} bits available in the buffer"
|
|
625
|
+
end
|
|
626
|
+
return total_bit_size
|
|
621
627
|
end
|
|
622
628
|
else
|
|
623
629
|
raise "Length value #{item.variable_bit_size['length_item_name']} for item #{item.name} is nil"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/openc3/processors.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -67,7 +67,7 @@ module OpenC3
|
|
|
67
67
|
if response.nil? || response.status != 200
|
|
68
68
|
if response
|
|
69
69
|
parsed = JSON.parse(response.body)
|
|
70
|
-
raise "autonomic_group_destroy error: #{parsed['
|
|
70
|
+
raise "autonomic_group_destroy error: #{parsed['message']}"
|
|
71
71
|
else
|
|
72
72
|
raise "autonomic_group_destroy failed"
|
|
73
73
|
end
|
|
@@ -105,7 +105,7 @@ module OpenC3
|
|
|
105
105
|
if response.nil? || response.status != 201
|
|
106
106
|
if response
|
|
107
107
|
parsed = JSON.parse(response.body)
|
|
108
|
-
raise "autonomic_trigger_create error: #{parsed['
|
|
108
|
+
raise "autonomic_trigger_create error: #{parsed['message']}"
|
|
109
109
|
else
|
|
110
110
|
raise "autonomic_trigger_create failed"
|
|
111
111
|
end
|
|
@@ -136,7 +136,7 @@ module OpenC3
|
|
|
136
136
|
if response.nil? || response.status != 200
|
|
137
137
|
if response
|
|
138
138
|
parsed = JSON.parse(response.body)
|
|
139
|
-
raise "autonomic_trigger_enable error: #{parsed['
|
|
139
|
+
raise "autonomic_trigger_enable error: #{parsed['message']}"
|
|
140
140
|
else
|
|
141
141
|
raise "autonomic_trigger_enable failed"
|
|
142
142
|
end
|
|
@@ -154,7 +154,7 @@ module OpenC3
|
|
|
154
154
|
if response.nil? || response.status != 200
|
|
155
155
|
if response
|
|
156
156
|
parsed = JSON.parse(response.body)
|
|
157
|
-
raise "autonomic_trigger_disable error: #{parsed['
|
|
157
|
+
raise "autonomic_trigger_disable error: #{parsed['message']}"
|
|
158
158
|
else
|
|
159
159
|
raise "autonomic_trigger_disable failed"
|
|
160
160
|
end
|
|
@@ -176,7 +176,7 @@ module OpenC3
|
|
|
176
176
|
if response.nil? || response.status != 200
|
|
177
177
|
if response
|
|
178
178
|
parsed = JSON.parse(response.body)
|
|
179
|
-
raise "autonomic_trigger_update error: #{parsed['
|
|
179
|
+
raise "autonomic_trigger_update error: #{parsed['message']}"
|
|
180
180
|
else
|
|
181
181
|
raise "autonomic_trigger_update failed"
|
|
182
182
|
end
|
|
@@ -194,7 +194,7 @@ module OpenC3
|
|
|
194
194
|
if response.nil? || response.status != 200
|
|
195
195
|
if response
|
|
196
196
|
parsed = JSON.parse(response.body)
|
|
197
|
-
raise "autonomic_trigger_destroy error: #{parsed['
|
|
197
|
+
raise "autonomic_trigger_destroy error: #{parsed['message']}"
|
|
198
198
|
else
|
|
199
199
|
raise "autonomic_trigger_destroy failed"
|
|
200
200
|
end
|
|
@@ -232,7 +232,7 @@ module OpenC3
|
|
|
232
232
|
if response.nil? || response.status != 201
|
|
233
233
|
if response
|
|
234
234
|
parsed = JSON.parse(response.body)
|
|
235
|
-
raise "autonomic_reaction_create error: #{parsed['
|
|
235
|
+
raise "autonomic_reaction_create error: #{parsed['message']}"
|
|
236
236
|
else
|
|
237
237
|
raise "autonomic_reaction_create failed"
|
|
238
238
|
end
|
|
@@ -263,7 +263,7 @@ module OpenC3
|
|
|
263
263
|
if response.nil? || response.status != 200
|
|
264
264
|
if response
|
|
265
265
|
parsed = JSON.parse(response.body)
|
|
266
|
-
raise "autonomic_reaction_enable error: #{parsed['
|
|
266
|
+
raise "autonomic_reaction_enable error: #{parsed['message']}"
|
|
267
267
|
else
|
|
268
268
|
raise "autonomic_reaction_enable failed"
|
|
269
269
|
end
|
|
@@ -281,7 +281,7 @@ module OpenC3
|
|
|
281
281
|
if response.nil? || response.status != 200
|
|
282
282
|
if response
|
|
283
283
|
parsed = JSON.parse(response.body)
|
|
284
|
-
raise "autonomic_reaction_disable error: #{parsed['
|
|
284
|
+
raise "autonomic_reaction_disable error: #{parsed['message']}"
|
|
285
285
|
else
|
|
286
286
|
raise "autonomic_reaction_disable failed"
|
|
287
287
|
end
|
|
@@ -299,7 +299,7 @@ module OpenC3
|
|
|
299
299
|
if response.nil? || response.status != 200
|
|
300
300
|
if response
|
|
301
301
|
parsed = JSON.parse(response.body)
|
|
302
|
-
raise "autonomic_reaction_execute error: #{parsed['
|
|
302
|
+
raise "autonomic_reaction_execute error: #{parsed['message']}"
|
|
303
303
|
else
|
|
304
304
|
raise "autonomic_reaction_execute failed"
|
|
305
305
|
end
|
|
@@ -322,7 +322,7 @@ module OpenC3
|
|
|
322
322
|
if response.nil? || response.status != 200
|
|
323
323
|
if response
|
|
324
324
|
parsed = JSON.parse(response.body)
|
|
325
|
-
raise "autonomic_reaction_update error: #{parsed['
|
|
325
|
+
raise "autonomic_reaction_update error: #{parsed['message']}"
|
|
326
326
|
else
|
|
327
327
|
raise "autonomic_reaction_update failed"
|
|
328
328
|
end
|
|
@@ -340,7 +340,7 @@ module OpenC3
|
|
|
340
340
|
if response.nil? || response.status != 200
|
|
341
341
|
if response
|
|
342
342
|
parsed = JSON.parse(response.body)
|
|
343
|
-
raise "autonomic_reaction_destroy error: #{parsed['
|
|
343
|
+
raise "autonomic_reaction_destroy error: #{parsed['message']}"
|
|
344
344
|
else
|
|
345
345
|
raise "autonomic_reaction_destroy failed"
|
|
346
346
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/openc3/script/limits.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/openc3/script/queue.rb
CHANGED
|
File without changes
|
data/lib/openc3/script/screen.rb
CHANGED
|
File without changes
|
data/lib/openc3/script/script.rb
CHANGED
|
@@ -241,7 +241,7 @@ module OpenC3
|
|
|
241
241
|
# script_run("INST/procedures/collect.rb")
|
|
242
242
|
#
|
|
243
243
|
def initialize_offline_access
|
|
244
|
-
keycloak_url = ENV
|
|
244
|
+
keycloak_url = ENV.fetch('OPENC3_KEYCLOAK_URL', nil)
|
|
245
245
|
if keycloak_url.nil? or keycloak_url.empty?
|
|
246
246
|
raise "initialize_offline_access only valid in COSMOS Enterprise. OPENC3_KEYCLOAK_URL environment variable must be set."
|
|
247
247
|
end
|
|
@@ -383,4 +383,4 @@ module OpenC3
|
|
|
383
383
|
end
|
|
384
384
|
end
|
|
385
385
|
|
|
386
|
-
$VERBOSE = saved_verbose
|
|
386
|
+
$VERBOSE = saved_verbose
|
|
File without changes
|
|
@@ -169,17 +169,17 @@ module OpenC3
|
|
|
169
169
|
|
|
170
170
|
def _get_uri(url)
|
|
171
171
|
if $openc3_in_cluster
|
|
172
|
-
case ENV
|
|
172
|
+
case ENV.fetch('OPENC3_CLOUD', nil)
|
|
173
173
|
when 'local'
|
|
174
|
-
bucket_url = ENV
|
|
174
|
+
bucket_url = ENV.fetch("OPENC3_BUCKET_URL", "http://openc3-buckets:9000")
|
|
175
175
|
URI.parse("#{bucket_url}#{url}")
|
|
176
176
|
when 'aws'
|
|
177
|
-
URI.parse("https://s3.#{ENV
|
|
177
|
+
URI.parse("https://s3.#{ENV.fetch('AWS_REGION')}.amazonaws.com" + url)
|
|
178
178
|
when 'gcp'
|
|
179
179
|
URI.parse("https://storage.googleapis.com" + url)
|
|
180
180
|
# when 'azure'
|
|
181
181
|
else
|
|
182
|
-
raise "Unknown cloud #{ENV
|
|
182
|
+
raise "Unknown cloud #{ENV.fetch('OPENC3_CLOUD', nil)}"
|
|
183
183
|
end
|
|
184
184
|
else
|
|
185
185
|
URI.parse($api_server.generate_url + url)
|
data/lib/openc3/script/suite.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -30,6 +30,12 @@ module OpenC3
|
|
|
30
30
|
# the values stay consistent in one place.
|
|
31
31
|
DEFAULT_METHOD = 'start'
|
|
32
32
|
DEFAULT_OPTIONS = ['continueAfterError'].freeze
|
|
33
|
+
# The only SuiteRunner entry points a client may request
|
|
34
|
+
ALLOWED_METHODS = ['start', 'setup', 'teardown'].freeze
|
|
35
|
+
# Suite and Group are Ruby constant (class) names, optionally namespaced
|
|
36
|
+
CLASS_NAME_REGEX = /\A[A-Z]\w*(::[A-Z]\w*)*\z/
|
|
37
|
+
# Script is a Ruby method name on the Group
|
|
38
|
+
METHOD_NAME_REGEX = /\A[a-z_]\w*[?!]?\z/
|
|
33
39
|
|
|
34
40
|
@@suites = []
|
|
35
41
|
@@settings = {}
|
|
@@ -55,12 +61,32 @@ module OpenC3
|
|
|
55
61
|
raise ArgumentError, "Script #{script} requires a Group" if script and not group
|
|
56
62
|
end
|
|
57
63
|
|
|
64
|
+
# Validate that the raw (client supplied) suite_runner values are plain
|
|
65
|
+
# identifiers. These values are interpolated into the Ruby snippet the
|
|
66
|
+
# running script evaluates, so anything other than a bare class / method
|
|
67
|
+
# name must be rejected before it reaches the interpreter.
|
|
68
|
+
def self.validate_identifiers(suite:, group: nil, script: nil, method: nil)
|
|
69
|
+
unless suite.is_a?(String) and CLASS_NAME_REGEX.match?(suite)
|
|
70
|
+
raise ArgumentError, "Invalid Suite name: #{suite.inspect}"
|
|
71
|
+
end
|
|
72
|
+
if group && !(group.is_a?(String) and CLASS_NAME_REGEX.match?(group))
|
|
73
|
+
raise ArgumentError, "Invalid Group name: #{group.inspect}"
|
|
74
|
+
end
|
|
75
|
+
if script && !(script.is_a?(String) and METHOD_NAME_REGEX.match?(script))
|
|
76
|
+
raise ArgumentError, "Invalid Script name: #{script.inspect}"
|
|
77
|
+
end
|
|
78
|
+
if method && !ALLOWED_METHODS.include?(method.to_s)
|
|
79
|
+
raise ArgumentError, "Invalid method: #{method.inspect}"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
58
83
|
# Build the canonical, validated suite_runner hash from raw values,
|
|
59
84
|
# applying defaults. Shared by openc3cli (constructing from CLI flags) and
|
|
60
85
|
# the running script (normalizing a received hash before dispatch) so the
|
|
61
86
|
# hash shape, defaults, and validation live in one place.
|
|
62
87
|
def self.build_options(suite:, group: nil, script: nil, method: nil, options: nil)
|
|
63
88
|
validate_options(group: group, script: script)
|
|
89
|
+
validate_identifiers(suite: suite, group: group, script: script, method: method)
|
|
64
90
|
suite_runner = { 'suite' => suite }
|
|
65
91
|
if group
|
|
66
92
|
suite_runner['group'] = group
|
data/lib/openc3/script/tables.rb
CHANGED
|
File without changes
|
|
@@ -40,9 +40,15 @@ module OpenC3
|
|
|
40
40
|
# inject_tlm, set_tlm, override_tlm, and normalize_tlm are implemented here simply to add a puts
|
|
41
41
|
# these methods modify the telemetry so the user should be notified in the Script Runner log messages
|
|
42
42
|
|
|
43
|
-
def inject_tlm(target_name, packet_name, item_hash = nil, type: :CONVERTED, stored: false, scope: $openc3_scope, token: $openc3_token)
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
def inject_tlm(target_name, packet_name, item_hash = nil, type: :CONVERTED, stored: false, received_time: nil, scope: $openc3_scope, token: $openc3_token)
|
|
44
|
+
message = "inject_tlm(\"#{target_name}\", \"#{packet_name}\", #{item_hash}, type: #{type}, stored: #{stored}"
|
|
45
|
+
kwargs = { type: type, stored: stored, scope: scope, token: token }
|
|
46
|
+
unless received_time.nil?
|
|
47
|
+
message << ", received_time: #{received_time}"
|
|
48
|
+
kwargs[:received_time] = received_time
|
|
49
|
+
end
|
|
50
|
+
puts "#{message})"
|
|
51
|
+
$api_server.method_missing(:inject_tlm, target_name, packet_name, item_hash, **kwargs)
|
|
46
52
|
end
|
|
47
53
|
|
|
48
54
|
def set_tlm(*args, type: :ALL, scope: $openc3_scope, token: $openc3_token)
|