openc3 6.10.4 → 7.0.0.pre.rc2
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 +2 -1
- data/Guardfile +4 -9
- data/LICENSE.md +85 -0
- data/README.md +8 -8
- data/Rakefile +3 -9
- data/bin/cstol_converter +3 -8
- data/bin/openc3cli +64 -35
- data/data/config/command_modifiers.yaml +18 -1
- data/data/config/interface_modifiers.yaml +0 -2
- data/data/config/plugins.yaml +14 -18
- data/data/config/screen.yaml +1 -1
- data/data/config/target.yaml +26 -79
- data/data/config/telemetry_modifiers.yaml +15 -0
- data/data/config/widgets.yaml +32 -32
- data/ext/openc3/ext/array/array.c +4 -9
- data/ext/openc3/ext/buffered_file/buffered_file.c +4 -9
- data/ext/openc3/ext/burst_protocol/burst_protocol.c +3 -8
- data/ext/openc3/ext/config_parser/config_parser.c +2 -7
- data/ext/openc3/ext/crc/crc.c +3 -8
- data/ext/openc3/ext/openc3_io/openc3_io.c +4 -9
- data/ext/openc3/ext/packet/packet.c +7 -9
- data/ext/openc3/ext/platform/platform.c +3 -8
- data/ext/openc3/ext/polynomial_conversion/polynomial_conversion.c +16 -12
- data/ext/openc3/ext/string/string.c +4 -9
- data/ext/openc3/ext/structure/structure.c +5 -9
- data/ext/openc3/ext/tabbed_plots_config/tabbed_plots_config.c +4 -9
- data/ext/openc3/ext/telemetry/telemetry.c +8 -12
- data/lib/cosmos.rb +4 -9
- data/lib/cosmosc2.rb +4 -9
- data/lib/openc3/accessors/accessor.rb +10 -13
- data/lib/openc3/accessors/binary_accessor.rb +18 -17
- data/lib/openc3/accessors/cbor_accessor.rb +3 -8
- data/lib/openc3/accessors/form_accessor.rb +4 -9
- data/lib/openc3/accessors/html_accessor.rb +3 -8
- data/lib/openc3/accessors/http_accessor.rb +4 -9
- data/lib/openc3/accessors/json_accessor.rb +4 -9
- data/lib/openc3/accessors/template_accessor.rb +4 -9
- data/lib/openc3/accessors/xml_accessor.rb +4 -9
- data/lib/openc3/accessors.rb +3 -8
- data/lib/openc3/api/README.md +1 -1
- data/lib/openc3/api/api.rb +3 -8
- data/lib/openc3/api/authorized_api.rb +4 -9
- data/lib/openc3/api/cmd_api.rb +3 -8
- data/lib/openc3/api/config_api.rb +3 -8
- data/lib/openc3/api/interface_api.rb +4 -9
- data/lib/openc3/api/limits_api.rb +3 -8
- data/lib/openc3/api/metrics_api.rb +2 -19
- data/lib/openc3/api/offline_access_api.rb +2 -7
- data/lib/openc3/api/router_api.rb +5 -10
- data/lib/openc3/api/settings_api.rb +3 -8
- data/lib/openc3/api/stash_api.rb +2 -7
- data/lib/openc3/api/target_api.rb +3 -8
- data/lib/openc3/api/tlm_api.rb +15 -38
- data/lib/openc3/bridge/bridge.rb +3 -8
- data/lib/openc3/bridge/bridge_config.rb +5 -10
- data/lib/openc3/bridge/bridge_interface_thread.rb +4 -9
- data/lib/openc3/bridge/bridge_router_thread.rb +4 -9
- data/lib/openc3/ccsds/ccsds_packet.rb +4 -9
- data/lib/openc3/ccsds/ccsds_parser.rb +3 -8
- data/lib/openc3/config/config_parser.rb +3 -8
- data/lib/openc3/config/meta_config_parser.rb +3 -8
- data/lib/openc3/conversions/bit_reverse_conversion.rb +3 -8
- data/lib/openc3/conversions/conversion.rb +3 -8
- data/lib/openc3/conversions/generic_conversion.rb +3 -8
- data/lib/openc3/conversions/ip_read_conversion.rb +3 -8
- data/lib/openc3/conversions/ip_write_conversion.rb +3 -8
- data/lib/openc3/conversions/object_read_conversion.rb +3 -8
- data/lib/openc3/conversions/object_write_conversion.rb +3 -8
- data/lib/openc3/conversions/packet_time_formatted_conversion.rb +4 -9
- data/lib/openc3/conversions/packet_time_seconds_conversion.rb +4 -9
- data/lib/openc3/conversions/polynomial_conversion.rb +6 -8
- data/lib/openc3/conversions/processor_conversion.rb +3 -8
- data/lib/openc3/conversions/received_count_conversion.rb +4 -9
- data/lib/openc3/conversions/received_time_formatted_conversion.rb +4 -9
- data/lib/openc3/conversions/received_time_seconds_conversion.rb +4 -9
- data/lib/openc3/conversions/segmented_polynomial_conversion.rb +6 -8
- data/lib/openc3/conversions/unix_time_conversion.rb +3 -8
- data/lib/openc3/conversions/unix_time_formatted_conversion.rb +3 -8
- data/lib/openc3/conversions/unix_time_seconds_conversion.rb +3 -8
- data/lib/openc3/conversions.rb +3 -8
- data/lib/openc3/core_ext/array.rb +3 -8
- data/lib/openc3/core_ext/binding.rb +4 -9
- data/lib/openc3/core_ext/class.rb +4 -9
- data/lib/openc3/core_ext/exception.rb +3 -8
- data/lib/openc3/core_ext/file.rb +4 -9
- data/lib/openc3/core_ext/io.rb +4 -9
- data/lib/openc3/core_ext/kernel.rb +3 -8
- data/lib/openc3/core_ext/math.rb +4 -9
- data/lib/openc3/core_ext/matrix.rb +4 -9
- data/lib/openc3/core_ext/objectspace.rb +4 -9
- data/lib/openc3/core_ext/openc3_io.rb +4 -9
- data/lib/openc3/core_ext/range.rb +4 -9
- data/lib/openc3/core_ext/socket.rb +4 -9
- data/lib/openc3/core_ext/string.rb +3 -8
- data/lib/openc3/core_ext/stringio.rb +4 -9
- data/lib/openc3/core_ext/tempfile.rb +4 -9
- data/lib/openc3/core_ext/time.rb +3 -8
- data/lib/openc3/core_ext.rb +3 -8
- data/lib/openc3/interfaces/file_interface.rb +3 -8
- data/lib/openc3/interfaces/http_client_interface.rb +3 -8
- data/lib/openc3/interfaces/http_server_interface.rb +3 -8
- data/lib/openc3/interfaces/interface.rb +3 -8
- data/lib/openc3/interfaces/mqtt_interface.rb +3 -8
- data/lib/openc3/interfaces/mqtt_stream_interface.rb +3 -8
- data/lib/openc3/interfaces/protocols/burst_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/cmd_response_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/cobs_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/crc_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/fixed_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/ignore_packet_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/length_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/preidentified_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/slip_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/template_protocol.rb +3 -8
- data/lib/openc3/interfaces/protocols/terminated_protocol.rb +3 -8
- data/lib/openc3/interfaces/serial_interface.rb +3 -8
- data/lib/openc3/interfaces/simulated_target_interface.rb +3 -8
- data/lib/openc3/interfaces/stream_interface.rb +3 -8
- data/lib/openc3/interfaces/tcpip_client_interface.rb +3 -8
- data/lib/openc3/interfaces/tcpip_server_interface.rb +3 -8
- data/lib/openc3/interfaces/udp_interface.rb +3 -8
- data/lib/openc3/interfaces.rb +3 -8
- data/lib/openc3/io/buffered_file.rb +4 -9
- data/lib/openc3/io/io_multiplexer.rb +4 -9
- data/lib/openc3/io/json_api.rb +3 -8
- data/lib/openc3/io/json_api_object.rb +4 -9
- data/lib/openc3/io/json_drb.rb +3 -8
- data/lib/openc3/io/json_drb_object.rb +4 -9
- data/lib/openc3/io/json_drb_rack.rb +4 -9
- data/lib/openc3/io/json_rpc.rb +3 -8
- data/lib/openc3/io/posix_serial_driver.rb +3 -8
- data/lib/openc3/io/serial_driver.rb +3 -8
- data/lib/openc3/io/stderr.rb +4 -9
- data/lib/openc3/io/stdout.rb +4 -9
- data/lib/openc3/io/udp_sockets.rb +3 -8
- data/lib/openc3/io/win32_serial_driver.rb +4 -9
- data/lib/openc3/logs/buffered_packet_log_reader.rb +3 -8
- data/lib/openc3/logs/buffered_packet_log_writer.rb +3 -8
- data/lib/openc3/logs/log_writer.rb +3 -8
- data/lib/openc3/logs/packet_log_constants.rb +3 -8
- data/lib/openc3/logs/packet_log_reader.rb +3 -8
- data/lib/openc3/logs/packet_log_writer.rb +3 -8
- data/lib/openc3/logs/stream_log.rb +3 -8
- data/lib/openc3/logs/stream_log_pair.rb +3 -8
- data/lib/openc3/logs/text_log_writer.rb +3 -8
- data/lib/openc3/logs.rb +3 -8
- data/lib/openc3/microservices/cleanup_microservice.rb +4 -14
- data/lib/openc3/microservices/decom_microservice.rb +3 -8
- data/lib/openc3/microservices/interface_decom_common.rb +3 -8
- data/lib/openc3/microservices/interface_microservice.rb +5 -9
- data/lib/openc3/microservices/log_microservice.rb +3 -8
- data/lib/openc3/microservices/microservice.rb +24 -12
- data/lib/openc3/microservices/multi_microservice.rb +2 -7
- data/lib/openc3/microservices/periodic_microservice.rb +3 -8
- data/lib/openc3/microservices/plugin_microservice.rb +3 -8
- data/lib/openc3/microservices/queue_microservice.rb +3 -8
- data/lib/openc3/microservices/router_microservice.rb +3 -8
- data/lib/openc3/microservices/scope_cleanup_microservice.rb +3 -8
- data/lib/openc3/microservices/text_log_microservice.rb +3 -8
- data/lib/openc3/migrations/20251213120000_reinstall_plugins.rb +45 -0
- data/lib/openc3/migrations/20260204000000_remove_decom_reducer.rb +60 -0
- data/lib/openc3/models/activity_model.rb +4 -8
- data/lib/openc3/models/auth_model.rb +57 -38
- data/lib/openc3/models/cvt_model.rb +203 -62
- data/lib/openc3/models/environment_model.rb +4 -9
- data/lib/openc3/models/gem_model.rb +3 -8
- data/lib/openc3/models/info_model.rb +4 -9
- data/lib/openc3/models/interface_model.rb +6 -10
- data/lib/openc3/models/interface_status_model.rb +4 -9
- data/lib/openc3/models/metadata_model.rb +3 -8
- data/lib/openc3/models/metric_model.rb +3 -8
- data/lib/openc3/models/microservice_model.rb +24 -10
- data/lib/openc3/models/microservice_status_model.rb +3 -8
- data/lib/openc3/models/migration_model.rb +3 -8
- data/lib/openc3/models/model.rb +3 -8
- data/lib/openc3/models/news_model.rb +3 -8
- data/lib/openc3/models/note_model.rb +3 -8
- data/lib/openc3/models/offline_access_model.rb +3 -8
- data/lib/openc3/models/ping_model.rb +4 -9
- data/lib/openc3/models/plugin_model.rb +14 -9
- data/lib/openc3/models/plugin_store_model.rb +21 -17
- data/lib/openc3/models/process_status_model.rb +4 -9
- data/lib/openc3/models/python_package_model.rb +3 -8
- data/lib/openc3/models/queue_model.rb +3 -8
- data/lib/openc3/models/reaction_model.rb +9 -10
- data/lib/openc3/models/router_model.rb +4 -9
- data/lib/openc3/models/router_status_model.rb +4 -9
- data/lib/openc3/models/scope_model.rb +4 -9
- data/lib/openc3/models/script_engine_model.rb +3 -8
- data/lib/openc3/models/script_status_model.rb +3 -8
- data/lib/openc3/models/secret_model.rb +3 -8
- data/lib/openc3/models/setting_model.rb +3 -8
- data/lib/openc3/models/sorted_model.rb +3 -8
- data/lib/openc3/models/stash_model.rb +3 -8
- data/lib/openc3/models/target_model.rb +99 -229
- data/lib/openc3/models/timeline_model.rb +3 -8
- data/lib/openc3/models/tool_config_model.rb +3 -8
- data/lib/openc3/models/tool_model.rb +10 -10
- data/lib/openc3/models/trigger_group_model.rb +3 -8
- data/lib/openc3/models/trigger_model.rb +3 -8
- data/lib/openc3/models/widget_model.rb +3 -8
- data/lib/openc3/operators/microservice_operator.rb +7 -8
- data/lib/openc3/operators/operator.rb +3 -8
- data/lib/openc3/packets/command_validator.rb +3 -8
- data/lib/openc3/packets/commands.rb +32 -14
- data/lib/openc3/packets/json_packet.rb +7 -19
- data/lib/openc3/packets/limits.rb +3 -8
- data/lib/openc3/packets/limits_response.rb +3 -8
- data/lib/openc3/packets/packet.rb +38 -32
- data/lib/openc3/packets/packet_config.rb +23 -13
- data/lib/openc3/packets/packet_item.rb +3 -8
- data/lib/openc3/packets/packet_item_limits.rb +3 -8
- data/lib/openc3/packets/parsers/format_string_parser.rb +3 -8
- data/lib/openc3/packets/parsers/limits_parser.rb +3 -8
- data/lib/openc3/packets/parsers/limits_response_parser.rb +3 -8
- data/lib/openc3/packets/parsers/packet_item_parser.rb +7 -8
- data/lib/openc3/packets/parsers/packet_parser.rb +3 -8
- data/lib/openc3/packets/parsers/processor_parser.rb +3 -8
- data/lib/openc3/packets/parsers/state_parser.rb +3 -8
- data/lib/openc3/packets/parsers/xtce_converter.rb +12 -9
- data/lib/openc3/packets/parsers/xtce_parser.rb +3 -8
- data/lib/openc3/packets/structure.rb +14 -11
- data/lib/openc3/packets/structure_item.rb +4 -9
- data/lib/openc3/packets/telemetry.rb +7 -11
- data/lib/openc3/processors/processor.rb +5 -10
- data/lib/openc3/processors/statistics_processor.rb +4 -9
- data/lib/openc3/processors/watermark_processor.rb +4 -9
- data/lib/openc3/processors.rb +4 -9
- data/lib/openc3/script/api_shared.rb +8 -37
- data/lib/openc3/script/autonomic.rb +3 -8
- data/lib/openc3/script/calendar.rb +3 -8
- data/lib/openc3/script/commands.rb +3 -8
- data/lib/openc3/script/critical_cmd.rb +3 -8
- data/lib/openc3/script/exceptions.rb +4 -9
- data/lib/openc3/script/extract.rb +3 -8
- data/lib/openc3/script/limits.rb +3 -8
- data/lib/openc3/script/metadata.rb +3 -8
- data/lib/openc3/script/packages.rb +3 -8
- data/lib/openc3/script/plugins.rb +3 -8
- data/lib/openc3/script/queue.rb +3 -8
- data/lib/openc3/script/screen.rb +7 -8
- data/lib/openc3/script/script.rb +3 -8
- data/lib/openc3/script/script_runner.rb +3 -8
- data/lib/openc3/script/storage.rb +6 -10
- data/lib/openc3/script/suite.rb +3 -8
- data/lib/openc3/script/suite_results.rb +3 -8
- data/lib/openc3/script/suite_runner.rb +3 -8
- data/lib/openc3/script/tables.rb +3 -8
- data/lib/openc3/script/telemetry.rb +3 -8
- data/lib/openc3/script/web_socket_api.rb +8 -13
- data/lib/openc3/script.rb +4 -9
- data/lib/openc3/script_engines/script_engine.rb +3 -8
- data/lib/openc3/streams/mqtt_stream.rb +3 -8
- data/lib/openc3/streams/serial_stream.rb +3 -8
- data/lib/openc3/streams/stream.rb +3 -8
- data/lib/openc3/streams/tcpip_client_stream.rb +3 -8
- data/lib/openc3/streams/tcpip_socket_stream.rb +3 -8
- data/lib/openc3/streams/web_socket_client_stream.rb +3 -8
- data/lib/openc3/system/system.rb +3 -8
- data/lib/openc3/system/target.rb +3 -8
- data/lib/openc3/system.rb +3 -8
- data/lib/openc3/tools/cmd_tlm_server/api.rb +4 -9
- data/lib/openc3/tools/cmd_tlm_server/interface_thread.rb +3 -8
- data/lib/openc3/tools/table_manager/table.rb +3 -8
- data/lib/openc3/tools/table_manager/table_config.rb +3 -8
- data/lib/openc3/tools/table_manager/table_item.rb +4 -9
- data/lib/openc3/tools/table_manager/table_item_parser.rb +3 -8
- data/lib/openc3/tools/table_manager/table_manager_core.rb +3 -8
- data/lib/openc3/tools/table_manager/table_parser.rb +3 -8
- data/lib/openc3/tools/test_runner/test.rb +4 -9
- data/lib/openc3/top_level.rb +3 -8
- data/lib/openc3/topics/autonomic_topic.rb +4 -9
- data/lib/openc3/topics/calendar_topic.rb +4 -9
- data/lib/openc3/topics/command_decom_topic.rb +14 -17
- data/lib/openc3/topics/command_topic.rb +14 -10
- data/lib/openc3/topics/config_topic.rb +3 -8
- data/lib/openc3/topics/decom_interface_topic.rb +3 -8
- data/lib/openc3/topics/interface_topic.rb +3 -8
- data/lib/openc3/topics/limits_event_topic.rb +3 -8
- data/lib/openc3/topics/notebook_topic.rb +32 -0
- data/lib/openc3/topics/queue_topic.rb +3 -8
- data/lib/openc3/topics/router_topic.rb +3 -8
- data/lib/openc3/topics/system_events_topic.rb +3 -8
- data/lib/openc3/topics/telemetry_decom_topic.rb +12 -12
- data/lib/openc3/topics/telemetry_topic.rb +3 -8
- data/lib/openc3/topics/timeline_topic.rb +4 -9
- data/lib/openc3/topics/topic.rb +3 -8
- data/lib/openc3/utilities/authentication.rb +29 -10
- data/lib/openc3/utilities/authorization.rb +4 -9
- data/lib/openc3/utilities/aws_bucket.rb +126 -16
- data/lib/openc3/utilities/bucket.rb +9 -9
- data/lib/openc3/utilities/bucket_file_cache.rb +3 -13
- data/lib/openc3/utilities/bucket_require.rb +3 -8
- data/lib/openc3/utilities/bucket_utilities.rb +3 -10
- data/lib/openc3/utilities/cli_generator.rb +11 -16
- data/lib/openc3/utilities/cmd_log.rb +3 -8
- data/lib/openc3/utilities/crc.rb +3 -8
- data/lib/openc3/utilities/csv.rb +4 -9
- data/lib/openc3/utilities/local_bucket.rb +5 -10
- data/lib/openc3/utilities/local_mode.rb +14 -18
- data/lib/openc3/utilities/logger.rb +3 -8
- data/lib/openc3/utilities/message_log.rb +3 -8
- data/lib/openc3/utilities/metric.rb +3 -8
- data/lib/openc3/utilities/migration.rb +3 -8
- data/lib/openc3/utilities/open_telemetry.rb +3 -8
- data/lib/openc3/utilities/process_manager.rb +3 -8
- data/lib/openc3/utilities/python_proxy.rb +3 -8
- data/lib/openc3/utilities/quaternion.rb +3 -8
- data/lib/openc3/utilities/questdb_client.rb +210 -0
- data/lib/openc3/utilities/redis_secrets.rb +3 -8
- data/lib/openc3/utilities/ruby_lex_utils.rb +3 -8
- data/lib/openc3/utilities/running_script.rb +13 -11
- data/lib/openc3/utilities/s3_autoload.rb +9 -2
- data/lib/openc3/utilities/secrets.rb +8 -9
- data/lib/openc3/utilities/simulated_target.rb +4 -9
- data/lib/openc3/utilities/sleeper.rb +3 -8
- data/lib/openc3/utilities/store.rb +4 -9
- data/lib/openc3/utilities/store_autoload.rb +7 -14
- data/lib/openc3/utilities/store_queued.rb +6 -9
- data/lib/openc3/utilities/target_file.rb +3 -8
- data/lib/openc3/utilities/thread_manager.rb +3 -8
- data/lib/openc3/utilities/throttle.rb +3 -8
- data/lib/openc3/utilities/zip.rb +4 -9
- data/lib/openc3/utilities.rb +4 -9
- data/lib/openc3/version.rb +8 -8
- data/lib/openc3/win32/excel.rb +4 -9
- data/lib/openc3/win32/win32.rb +4 -9
- data/lib/openc3/win32/win32_main.rb +3 -8
- data/lib/openc3.rb +3 -12
- data/tasks/gemfile_stats.rake +4 -9
- data/tasks/spec.rake +4 -9
- data/templates/plugin/README.md +2 -2
- data/templates/plugin/plugin.gemspec +1 -1
- data/templates/tool_angular/package.json +1 -1
- data/templates/tool_vue/package.json +3 -3
- data/templates/tool_vue/vite.config.js +2 -1
- data/templates/widget/package.json +3 -3
- data/templates/widget/vite.config.js +1 -1
- metadata +49 -26
- data/LICENSE.txt +0 -729
- data/bin/rubysloc +0 -142
- data/ext/openc3/ext/reducer_microservice/extconf.rb +0 -13
- data/ext/openc3/ext/reducer_microservice/reducer_microservice.c +0 -165
- data/lib/openc3/microservices/reducer_microservice.rb +0 -640
- data/lib/openc3/models/reducer_model.rb +0 -72
- data/lib/openc3/topics/telemetry_reduced_topics.rb +0 -80
- /data/templates/plugin/{LICENSE.txt → LICENSE.md} +0 -0
- /data/templates/widget/{LICENSE.txt → LICENSE.md} +0 -0
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -30,25 +25,30 @@ module OpenC3
|
|
|
30
25
|
# Need to build a JSON hash of the decommutated data
|
|
31
26
|
# Support "downward typing"
|
|
32
27
|
# everything base name is RAW (including DERIVED)
|
|
33
|
-
# Request for
|
|
28
|
+
# Request for FORMATTED, etc will look down until it finds something
|
|
34
29
|
# If nothing - item does not exist - nil
|
|
35
|
-
# __ as separators ITEM1, ITEM1__C, ITEM1__F
|
|
30
|
+
# __ as separators ITEM1, ITEM1__C, ITEM1__F
|
|
36
31
|
|
|
37
32
|
json_hash = CvtModel.build_json_from_packet(packet)
|
|
33
|
+
# Convert to JSON-safe types once and reuse for both topic write and CVT set
|
|
34
|
+
json_safe_hash = json_hash.as_json
|
|
35
|
+
json_data = JSON.generate(json_safe_hash, allow_nan: true)
|
|
38
36
|
# Write to stream
|
|
39
37
|
msg_hash = {
|
|
40
38
|
:time => packet.packet_time.to_nsec_from_epoch,
|
|
39
|
+
:received_time => packet.received_time.to_nsec_from_epoch,
|
|
41
40
|
:stored => packet.stored.to_s,
|
|
42
41
|
:target_name => packet.target_name,
|
|
43
42
|
:packet_name => packet.packet_name,
|
|
44
43
|
:received_count => packet.received_count,
|
|
45
|
-
:json_data =>
|
|
44
|
+
:json_data => json_data,
|
|
46
45
|
}
|
|
47
46
|
Topic.write_topic("#{scope}__DECOM__{#{packet.target_name}}__#{packet.packet_name}", msg_hash, id)
|
|
48
47
|
|
|
49
48
|
unless packet.stored
|
|
50
49
|
# Also update the current value table with the latest decommutated data
|
|
51
|
-
|
|
50
|
+
# Pass pre-serialized JSON to avoid calling as_json twice
|
|
51
|
+
CvtModel.set_json(json_data, json_safe_hash, target_name: packet.target_name, packet_name: packet.packet_name, scope: scope)
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -3,21 +3,16 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
|
-
# This file may also be used under the terms of a commercial license
|
|
15
|
+
# This file may also be used under the terms of a commercial license
|
|
21
16
|
# if purchased from OpenC3, Inc.
|
|
22
17
|
|
|
23
18
|
require 'openc3/topics/topic'
|
data/lib/openc3/topics/topic.rb
CHANGED
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -33,16 +28,40 @@ module OpenC3
|
|
|
33
28
|
# OpenC3 COSMOS Core authentication code
|
|
34
29
|
class OpenC3Authentication
|
|
35
30
|
def initialize()
|
|
36
|
-
|
|
37
|
-
if
|
|
31
|
+
password = ENV['OPENC3_API_PASSWORD']
|
|
32
|
+
if password.nil?
|
|
38
33
|
raise OpenC3AuthenticationError, "Authentication requires environment variable OPENC3_API_PASSWORD"
|
|
39
34
|
end
|
|
35
|
+
@service = password == ENV['OPENC3_SERVICE_PASSWORD']
|
|
36
|
+
response = _make_auth_request(password)
|
|
37
|
+
@token = response.body
|
|
38
|
+
if @token.nil? or @token.empty?
|
|
39
|
+
raise OpenC3AuthenticationError, "Authentication failed. Please check the password in the environment variable OPENC3_API_PASSWORD"
|
|
40
|
+
end
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
# Load the token from the environment
|
|
43
44
|
def token(include_bearer: true)
|
|
44
45
|
@token
|
|
45
46
|
end
|
|
47
|
+
|
|
48
|
+
def _make_auth_request(password)
|
|
49
|
+
Faraday.new.post(_generate_auth_url, '{"password": "' + password + '"}', {'Content-Type' => 'application/json'})
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def _generate_auth_url
|
|
53
|
+
schema = ENV['OPENC3_API_SCHEMA'] || 'http'
|
|
54
|
+
hostname = ENV['OPENC3_API_HOSTNAME'] || (ENV['OPENC3_DEVEL'] ? '127.0.0.1' : 'openc3-cosmos-cmd-tlm-api')
|
|
55
|
+
port = ENV['OPENC3_API_PORT'] || '2901'
|
|
56
|
+
port = port.to_i
|
|
57
|
+
endpoint = if @service
|
|
58
|
+
"auth/verify_service"
|
|
59
|
+
else
|
|
60
|
+
"auth/verify"
|
|
61
|
+
end
|
|
62
|
+
return "#{schema}://#{hostname}:#{port}/openc3-api/#{endpoint}"
|
|
63
|
+
end
|
|
64
|
+
|
|
46
65
|
end
|
|
47
66
|
|
|
48
67
|
# OpenC3 enterprise Keycloak authentication code
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -43,7 +38,7 @@ rescue LoadError
|
|
|
43
38
|
if $openc3_authorize
|
|
44
39
|
raise AuthError.new("Token is required") unless token
|
|
45
40
|
unless OpenC3::AuthModel.verify(token)
|
|
46
|
-
raise AuthError.new("
|
|
41
|
+
raise AuthError.new("Token is invalid")
|
|
47
42
|
end
|
|
48
43
|
end
|
|
49
44
|
return "anonymous"
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -29,6 +24,15 @@ module OpenC3
|
|
|
29
24
|
super()
|
|
30
25
|
@client = Aws::S3::Client.new
|
|
31
26
|
@aws_arn = ENV['OPENC3_AWS_ARN_PREFIX'] || 'arn:aws'
|
|
27
|
+
# Checksums are supported by real AWS S3 but may not be supported by
|
|
28
|
+
# S3-compatible backends like versitygw. Auto-detect based on
|
|
29
|
+
# whether a custom endpoint is configured. Can be overridden with ENV var.
|
|
30
|
+
@use_checksum = if ENV.key?('OPENC3_NO_S3_CHECKSUM')
|
|
31
|
+
ENV['OPENC3_NO_S3_CHECKSUM'].to_s.empty? # Empty string means use checksum
|
|
32
|
+
else
|
|
33
|
+
# If OPENC3_BUCKET_URL is set, we're using a non-AWS S3 backend
|
|
34
|
+
!ENV.key?('OPENC3_BUCKET_URL')
|
|
35
|
+
end
|
|
32
36
|
end
|
|
33
37
|
|
|
34
38
|
def create(bucket)
|
|
@@ -83,7 +87,106 @@ module OpenC3
|
|
|
83
87
|
]
|
|
84
88
|
}
|
|
85
89
|
EOL
|
|
86
|
-
|
|
90
|
+
begin
|
|
91
|
+
options = { bucket: bucket, policy: policy }
|
|
92
|
+
options[:checksum_algorithm] = "SHA256" if @use_checksum
|
|
93
|
+
@client.put_bucket_policy(options)
|
|
94
|
+
rescue Aws::S3::Errors::NotImplemented, Aws::S3::Errors::ServiceError, Aws::S3::Errors::InternalError => e
|
|
95
|
+
Logger.warn("put_bucket_policy not supported by S3 backend: #{e.message}")
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Apply bucket policy to grant ScriptRunner user access to config and logs buckets
|
|
101
|
+
# This provides reduced permissions compared to the root user for security
|
|
102
|
+
def ensure_scriptrunner_policy(config_bucket, logs_bucket)
|
|
103
|
+
sr_username = ENV['OPENC3_SR_BUCKET_USERNAME']
|
|
104
|
+
return unless sr_username
|
|
105
|
+
return if sr_username == ENV['OPENC3_BUCKET_USERNAME'] # Same as root, no policy needed
|
|
106
|
+
|
|
107
|
+
# Policy for config bucket - read targets, read/write targets_modified
|
|
108
|
+
# Note: versitygw expects Principal as comma-separated raw usernames
|
|
109
|
+
config_policy = <<~EOL
|
|
110
|
+
{
|
|
111
|
+
"Version": "2012-10-17",
|
|
112
|
+
"Statement": [
|
|
113
|
+
{
|
|
114
|
+
"Sid": "ScriptRunnerListBucket",
|
|
115
|
+
"Effect": "Allow",
|
|
116
|
+
"Principal": ["#{sr_username}"],
|
|
117
|
+
"Action": [
|
|
118
|
+
"s3:ListBucket",
|
|
119
|
+
"s3:GetBucketLocation"
|
|
120
|
+
],
|
|
121
|
+
"Resource": "#{@aws_arn}:s3:::#{config_bucket}"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"Sid": "ScriptRunnerReadTargets",
|
|
125
|
+
"Effect": "Allow",
|
|
126
|
+
"Principal": ["#{sr_username}"],
|
|
127
|
+
"Action": "s3:GetObject",
|
|
128
|
+
"Resource": "#{@aws_arn}:s3:::#{config_bucket}/*"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"Sid": "ScriptRunnerWriteTargetsModified",
|
|
132
|
+
"Effect": "Allow",
|
|
133
|
+
"Principal": ["#{sr_username}"],
|
|
134
|
+
"Action": [
|
|
135
|
+
"s3:PutObject",
|
|
136
|
+
"s3:DeleteObject"
|
|
137
|
+
],
|
|
138
|
+
"Resource": "#{@aws_arn}:s3:::#{config_bucket}/*/targets_modified/*"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
EOL
|
|
143
|
+
|
|
144
|
+
# Policy for logs bucket - read/write tool_logs/sr
|
|
145
|
+
logs_policy = <<~EOL
|
|
146
|
+
{
|
|
147
|
+
"Version": "2012-10-17",
|
|
148
|
+
"Statement": [
|
|
149
|
+
{
|
|
150
|
+
"Sid": "ScriptRunnerListBucket",
|
|
151
|
+
"Effect": "Allow",
|
|
152
|
+
"Principal": ["#{sr_username}"],
|
|
153
|
+
"Action": [
|
|
154
|
+
"s3:ListBucket",
|
|
155
|
+
"s3:GetBucketLocation"
|
|
156
|
+
],
|
|
157
|
+
"Resource": "#{@aws_arn}:s3:::#{logs_bucket}"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"Sid": "ScriptRunnerWriteToolLogs",
|
|
161
|
+
"Effect": "Allow",
|
|
162
|
+
"Principal": ["#{sr_username}"],
|
|
163
|
+
"Action": [
|
|
164
|
+
"s3:GetObject",
|
|
165
|
+
"s3:PutObject",
|
|
166
|
+
"s3:DeleteObject"
|
|
167
|
+
],
|
|
168
|
+
"Resource": "#{@aws_arn}:s3:::#{logs_bucket}/*/tool_logs/sr/*"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
EOL
|
|
173
|
+
|
|
174
|
+
begin
|
|
175
|
+
Logger.info("Applying ScriptRunner bucket policy to #{config_bucket}")
|
|
176
|
+
options = { bucket: config_bucket, policy: config_policy }
|
|
177
|
+
options[:checksum_algorithm] = "SHA256" if @use_checksum
|
|
178
|
+
@client.put_bucket_policy(options)
|
|
179
|
+
rescue Aws::S3::Errors::NotImplemented, Aws::S3::Errors::ServiceError, Aws::S3::Errors::InternalError => e
|
|
180
|
+
Logger.warn("put_bucket_policy for #{config_bucket} not supported by S3 backend: #{e.message}")
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
begin
|
|
184
|
+
Logger.info("Applying ScriptRunner bucket policy to #{logs_bucket}")
|
|
185
|
+
options = { bucket: logs_bucket, policy: logs_policy }
|
|
186
|
+
options[:checksum_algorithm] = "SHA256" if @use_checksum
|
|
187
|
+
@client.put_bucket_policy(options)
|
|
188
|
+
rescue Aws::S3::Errors::NotImplemented, Aws::S3::Errors::ServiceError, Aws::S3::Errors::InternalError => e
|
|
189
|
+
Logger.warn("put_bucket_policy for #{logs_bucket} not supported by S3 backend: #{e.message}")
|
|
87
190
|
end
|
|
88
191
|
end
|
|
89
192
|
|
|
@@ -194,9 +297,16 @@ module OpenC3
|
|
|
194
297
|
|
|
195
298
|
# put_object fires off the request to store but does not confirm
|
|
196
299
|
def put_object(bucket:, key:, body:, content_type: nil, cache_control: nil, metadata: nil)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
300
|
+
options = {
|
|
301
|
+
bucket: bucket,
|
|
302
|
+
key: key,
|
|
303
|
+
body: body,
|
|
304
|
+
content_type: content_type,
|
|
305
|
+
cache_control: cache_control,
|
|
306
|
+
metadata: metadata
|
|
307
|
+
}
|
|
308
|
+
options[:checksum_algorithm] = "SHA256" if @use_checksum
|
|
309
|
+
@client.put_object(**options)
|
|
200
310
|
end
|
|
201
311
|
|
|
202
312
|
# @returns [Boolean] Whether the file exists
|
|
@@ -222,14 +332,14 @@ module OpenC3
|
|
|
222
332
|
|
|
223
333
|
def delete_object(bucket:, key:)
|
|
224
334
|
@client.delete_object(bucket: bucket, key: key)
|
|
225
|
-
rescue Exception
|
|
226
|
-
Logger.error("Error deleting object bucket: #{bucket}, key: #{key}")
|
|
335
|
+
rescue Exception => e
|
|
336
|
+
Logger.error("Error deleting object bucket: #{bucket}, key: #{key}: #{e.message}")
|
|
227
337
|
end
|
|
228
338
|
|
|
229
339
|
def delete_objects(bucket:, keys:)
|
|
230
340
|
@client.delete_objects(bucket: bucket, delete: { objects: keys.map {|key| { key: key } } })
|
|
231
|
-
rescue Exception
|
|
232
|
-
Logger.error("Error deleting objects bucket: #{bucket}, keys: #{keys}")
|
|
341
|
+
rescue Exception => e
|
|
342
|
+
Logger.error("Error deleting objects bucket: #{bucket}, keys: #{keys}: #{e.message}")
|
|
233
343
|
end
|
|
234
344
|
|
|
235
345
|
def presigned_request(bucket:, key:, method:, internal: true)
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -27,7 +22,7 @@ module OpenC3
|
|
|
27
22
|
|
|
28
23
|
def self.getClient
|
|
29
24
|
raise 'OPENC3_CLOUD environment variable is required' unless ENV['OPENC3_CLOUD']
|
|
30
|
-
# Base is AwsBucket which works with
|
|
25
|
+
# Base is AwsBucket which works with S3-compatible storage (versitygw), Enterprise implements additional
|
|
31
26
|
bucket_class = ENV['OPENC3_CLOUD'].capitalize + 'Bucket'
|
|
32
27
|
klass = OpenC3.require_class('openc3/utilities/'+bucket_class.class_name_to_filename)
|
|
33
28
|
klass.new
|
|
@@ -45,6 +40,11 @@ module OpenC3
|
|
|
45
40
|
raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
|
|
46
41
|
end
|
|
47
42
|
|
|
43
|
+
# Apply bucket policies for ScriptRunner user (only applicable for local mode)
|
|
44
|
+
def ensure_scriptrunner_policy(config_bucket, logs_bucket)
|
|
45
|
+
# No-op by default, implemented by AwsBucket for local mode
|
|
46
|
+
end
|
|
47
|
+
|
|
48
48
|
def exist?(bucket)
|
|
49
49
|
raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
|
|
50
50
|
end
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -51,9 +46,6 @@ class BucketFile
|
|
|
51
46
|
path_split = @bucket_path.split("/")
|
|
52
47
|
scope = path_split[0].to_s.upcase
|
|
53
48
|
stream_mode = path_split[1].to_s.split("_")[0].to_s.upcase
|
|
54
|
-
if stream_mode == 'REDUCED'
|
|
55
|
-
stream_mode << '_' << path_split[1].to_s.split("_")[1].to_s.upcase
|
|
56
|
-
end
|
|
57
49
|
cmd_or_tlm = path_split[2].to_s.upcase
|
|
58
50
|
target_name = path_split[3].to_s.upcase
|
|
59
51
|
if stream_mode == 'RAW'
|
|
@@ -61,8 +53,6 @@ class BucketFile
|
|
|
61
53
|
else
|
|
62
54
|
if stream_mode == 'DECOM'
|
|
63
55
|
type = (cmd_or_tlm == 'CMD') ? 'DECOMCMD' : 'DECOM'
|
|
64
|
-
else
|
|
65
|
-
type = stream_mode # REDUCED_MINUTE, REDUCED_HOUR, or REDUCED_DAY
|
|
66
56
|
end
|
|
67
57
|
end
|
|
68
58
|
@topic_prefix = "#{scope}__#{type}__{#{target_name}}"
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# encoding: ascii-8bit
|
|
2
2
|
|
|
3
|
-
# Copyright
|
|
3
|
+
# Copyright 2026 OpenC3, Inc.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
#
|
|
16
11
|
# This file may also be used under the terms of a commercial license
|
|
17
12
|
# if purchased from OpenC3, Inc.
|
|
@@ -3,18 +3,13 @@
|
|
|
3
3
|
# Copyright 2022 Ball Aerospace & Technologies Corp.
|
|
4
4
|
# All Rights Reserved.
|
|
5
5
|
#
|
|
6
|
-
# This program is free software; you can modify and/or redistribute it
|
|
7
|
-
# under the terms of the GNU Affero General Public License
|
|
8
|
-
# as published by the Free Software Foundation; version 3 with
|
|
9
|
-
# attribution addendums as found in the LICENSE.txt
|
|
10
|
-
#
|
|
11
6
|
# This program is distributed in the hope that it will be useful,
|
|
12
7
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
14
|
-
#
|
|
8
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
# See LICENSE.md for more details.
|
|
15
10
|
|
|
16
11
|
# Modified by OpenC3, Inc.
|
|
17
|
-
# All changes Copyright
|
|
12
|
+
# All changes Copyright 2026, OpenC3, Inc.
|
|
18
13
|
# All Rights Reserved
|
|
19
14
|
#
|
|
20
15
|
# This file may also be used under the terms of a commercial license
|
|
@@ -22,7 +17,6 @@
|
|
|
22
17
|
|
|
23
18
|
require 'openc3/utilities/bucket'
|
|
24
19
|
require 'openc3/utilities/target_file'
|
|
25
|
-
require 'openc3/models/reducer_model'
|
|
26
20
|
require 'zlib'
|
|
27
21
|
|
|
28
22
|
module OpenC3
|
|
@@ -111,7 +105,6 @@ module OpenC3
|
|
|
111
105
|
end
|
|
112
106
|
|
|
113
107
|
Logger.debug "wrote #{ENV['OPENC3_LOGS_BUCKET']}/#{bucket_key}"
|
|
114
|
-
ReducerModel.add_file(bucket_key) # Record the new file for data reduction
|
|
115
108
|
|
|
116
109
|
File.delete(orig_filename) if orig_filename
|
|
117
110
|
File.delete(filename)
|