openc3 5.5.0 → 5.5.2.pre.beta0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of openc3 might be problematic. Click here for more details.

Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/data/config/_canvas_values.yaml +42 -0
  3. data/data/config/_graph_params.yaml +25 -0
  4. data/data/config/command.yaml +8 -3
  5. data/data/config/command_modifiers.yaml +26 -21
  6. data/data/config/graph_settings.yaml +54 -0
  7. data/data/config/interface_modifiers.yaml +8 -2
  8. data/data/config/item_modifiers.yaml +2 -2
  9. data/data/config/microservice.yaml +8 -1
  10. data/data/config/plugins.yaml +1 -0
  11. data/data/config/screen.yaml +45 -50
  12. data/data/config/settings.yaml +144 -0
  13. data/data/config/target.yaml +4 -0
  14. data/data/config/telemetry.yaml +15 -13
  15. data/data/config/telemetry_modifiers.yaml +9 -4
  16. data/data/config/tool.yaml +1 -0
  17. data/data/config/widgets.yaml +1745 -1493
  18. data/lib/openc3/api/settings_api.rb +12 -18
  19. data/lib/openc3/models/interface_model.rb +5 -2
  20. data/lib/openc3/models/microservice_model.rb +6 -5
  21. data/lib/openc3/models/plugin_model.rb +3 -1
  22. data/lib/openc3/models/scope_model.rb +5 -3
  23. data/lib/openc3/models/{settings_model.rb → setting_model.rb} +1 -1
  24. data/lib/openc3/models/tool_config_model.rb +6 -2
  25. data/lib/openc3/operators/microservice_operator.rb +2 -2
  26. data/lib/openc3/script/api_shared.rb +4 -0
  27. data/lib/openc3/utilities/authentication.rb +1 -1
  28. data/lib/openc3/utilities/aws_bucket.rb +6 -6
  29. data/lib/openc3/utilities/bucket.rb +1 -1
  30. data/lib/openc3/utilities/local_mode.rb +62 -7
  31. data/lib/openc3/utilities/redis_secrets.rb +4 -4
  32. data/lib/openc3/utilities/secrets.rb +5 -5
  33. data/lib/openc3/version.rb +6 -6
  34. data/templates/target/targets/TARGET/lib/target.rb +1 -1
  35. data/templates/target/targets/TARGET/screens/status.txt +1 -2
  36. metadata +9 -6
  37. data/lib/openc3/models/traefik_model.rb +0 -47
@@ -20,7 +20,7 @@
20
20
  # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
- require 'openc3/models/settings_model'
23
+ require 'openc3/models/setting_model'
24
24
 
25
25
  module OpenC3
26
26
  module Api
@@ -35,41 +35,35 @@ module OpenC3
35
35
 
36
36
  def list_settings(scope: $openc3_scope, token: $openc3_token)
37
37
  authorize(permission: 'system', scope: scope, token: token)
38
- SettingsModel.names(scope: scope)
38
+ SettingModel.names(scope: scope)
39
39
  end
40
40
 
41
41
  def get_all_settings(scope: $openc3_scope, token: $openc3_token)
42
42
  authorize(permission: 'system', scope: scope, token: token)
43
- SettingsModel.all(scope: scope)
43
+ SettingModel.all(scope: scope)
44
44
  end
45
45
 
46
46
  def get_setting(name, scope: $openc3_scope, token: $openc3_token)
47
47
  authorize(permission: 'system', scope: scope, token: token)
48
- setting = SettingsModel.get(name: name, scope: scope)
48
+ setting = SettingModel.get(name: name, scope: scope)
49
49
  if setting
50
- return setting["data"]
50
+ setting['data']
51
51
  else
52
- return nil
52
+ nil
53
53
  end
54
54
  end
55
55
 
56
- def get_settings(*args, scope: $openc3_scope, token: $openc3_token)
56
+ def get_settings(*settings, scope: $openc3_scope, token: $openc3_token)
57
57
  authorize(permission: 'system', scope: scope, token: token)
58
- ret = []
59
- args.each do |name|
60
- setting = SettingsModel.get(name: name, scope: scope)
61
- if setting
62
- ret << setting["data"]
63
- else
64
- ret << nil
65
- end
66
- end
67
- return ret
58
+ result = []
59
+ settings.each { |name| result << get_setting(name, scope: scope, token: token) }
60
+ result
68
61
  end
69
62
 
70
63
  def save_setting(name, data, scope: $openc3_scope, token: $openc3_token)
71
64
  authorize(permission: 'admin', scope: scope, token: token)
72
- SettingsModel.set({ name: name, data: data }, scope: scope)
65
+ SettingModel.set({ name: name, data: data }, scope: scope)
66
+ LocalMode.save_setting(scope, name, data)
73
67
  end
74
68
  end
75
69
  end
@@ -257,12 +257,15 @@ module OpenC3
257
257
  @log_raw = true
258
258
 
259
259
  when 'SECRET'
260
- parser.verify_num_parameters(3, 4, "#{keyword} <Secret Type: ENV or FILE> <Secret Name> <Environment Variable Name or File Path> <Option Name (Optional)>")
260
+ parser.verify_num_parameters(3, 5, "#{keyword} <Secret Type: ENV or FILE> <Secret Name> <Environment Variable Name or File Path> <Option Name (Optional)> <Secret Store Name (Optional)>")
261
261
  @secrets << parameters[0..2]
262
- if parameters[3]
262
+ if ConfigParser.handle_nil(parameters[3])
263
263
  # Option Name, Secret Name
264
264
  @secret_options << [parameters[3], parameters[1]]
265
265
  end
266
+ if ConfigParser.handle_nil(parameters[4])
267
+ @secrets[-1] << parameters[4]
268
+ end
266
269
 
267
270
  else
268
271
  raise ConfigParser::Error.new(parser, "Unknown keyword and parameters for Interface/Router: #{keyword} #{parameters.join(" ")}")
@@ -23,7 +23,6 @@
23
23
  require 'openc3/top_level'
24
24
  require 'openc3/models/model'
25
25
  require 'openc3/models/metric_model'
26
- require 'openc3/models/traefik_model'
27
26
  require 'openc3/utilities/bucket'
28
27
 
29
28
  module OpenC3
@@ -193,8 +192,12 @@ module OpenC3
193
192
  parser.verify_num_parameters(1, 1, "#{keyword} <Container Image Name>")
194
193
  @container = parameters[0]
195
194
  when 'SECRET'
196
- parser.verify_num_parameters(3, 3, "#{keyword} <Secret Type: ENV or FILE> <Secret Name> <Environment Variable Name or File Path>")
197
- @secrets << parameters.dup
195
+ parser.verify_num_parameters(3, 4, "#{keyword} <Secret Type: ENV or FILE> <Secret Name> <Environment Variable Name or File Path> <Secret Store Name (Optional)>")
196
+ if ConfigParser.handle_nil(parameters[3])
197
+ @secrets << parameters.dup
198
+ else
199
+ @secrets << parameters[0..2]
200
+ end
198
201
  when 'ROUTE_PREFIX'
199
202
  parser.verify_num_parameters(1, 1, "#{keyword} <Route Prefix>")
200
203
  @prefix = parameters[0]
@@ -225,7 +228,6 @@ module OpenC3
225
228
  end
226
229
  end
227
230
  unless validate_only
228
- TraefikModel.register_route(microservice_name: @name, port: @ports[0][0], prefix: @prefix) if @ports[0] and ports[0][0] and @prefix
229
231
  ConfigTopic.write({ kind: 'created', type: 'microservice', name: @name, plugin: @plugin }, scope: @scope)
230
232
  end
231
233
  end
@@ -235,7 +237,6 @@ module OpenC3
235
237
  @bucket.list_objects(bucket: ENV['OPENC3_CONFIG_BUCKET'], prefix: prefix).each do |object|
236
238
  @bucket.delete_object(bucket: ENV['OPENC3_CONFIG_BUCKET'], key: object.key)
237
239
  end
238
- TraefikModel.unregister_route(microservice_name: @name, port: @ports[0][0], prefix: @prefix) if @ports[0] and ports[0][0] and @prefix
239
240
  ConfigTopic.write({ kind: 'deleted', type: 'microservice', name: @name, plugin: @plugin }, scope: @scope)
240
241
  rescue Exception => error
241
242
  Logger.error("Error undeploying microservice model #{@name} in scope #{@scope} due to #{error}")
@@ -44,7 +44,7 @@ module OpenC3
44
44
  class PluginModel < Model
45
45
  PRIMARY_KEY = 'openc3_plugins'
46
46
  # Reserved VARIABLE names. See local_mode.rb: update_local_plugin()
47
- RESERVED_VARIABLE_NAMES = ['target_name', 'microservice_name']
47
+ RESERVED_VARIABLE_NAMES = ['target_name', 'microservice_name', 'scope']
48
48
 
49
49
  attr_accessor :variables
50
50
  attr_accessor :plugin_txt_lines
@@ -198,6 +198,8 @@ module OpenC3
198
198
  tf.close
199
199
  plugin_txt_path = tf.path
200
200
  variables = plugin_hash['variables']
201
+ variables ||= {}
202
+ variables['scope'] = scope
201
203
  if File.exist?(plugin_txt_path)
202
204
  parser = OpenC3::ConfigParser.new("https://openc3.com")
203
205
 
@@ -24,7 +24,7 @@ require 'openc3/version'
24
24
  require 'openc3/models/model'
25
25
  require 'openc3/models/plugin_model'
26
26
  require 'openc3/models/microservice_model'
27
- require 'openc3/models/settings_model'
27
+ require 'openc3/models/setting_model'
28
28
 
29
29
  module OpenC3
30
30
  class ScopeModel < Model
@@ -261,8 +261,10 @@ module OpenC3
261
261
  end
262
262
 
263
263
  def seed_database
264
- setting = SettingsModel.get(name: 'source_url')
265
- SettingsModel.set({ name: 'source_url', data: 'https://github.com/OpenC3/cosmos' }, scope: @scope) unless setting
264
+ setting = SettingModel.get(name: 'source_url')
265
+ SettingModel.set({ name: 'source_url', data: 'https://github.com/OpenC3/cosmos' }, scope: @scope) unless setting
266
+ setting = SettingModel.get(name: 'rubygems_url')
267
+ SettingModel.set({ name: 'rubygems_url', data: 'https://rubygems.org' }, scope: @scope) unless setting
266
268
  end
267
269
  end
268
270
  end
@@ -23,7 +23,7 @@
23
23
  require 'openc3/models/model'
24
24
 
25
25
  module OpenC3
26
- class SettingsModel < Model
26
+ class SettingModel < Model
27
27
  PRIMARY_KEY = 'openc3__settings'
28
28
 
29
29
  # NOTE: The following three class methods are used by the ModelController
@@ -17,9 +17,11 @@
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
+ require 'openc3/utilities/local_mode'
24
+
23
25
  module OpenC3
24
26
  class ToolConfigModel
25
27
  def self.list_configs(tool, scope: $openc3_scope)
@@ -30,12 +32,14 @@ module OpenC3
30
32
  Store.hget("#{scope}__config__#{tool}", name)
31
33
  end
32
34
 
33
- def self.save_config(tool, name, data, scope: $openc3_scope)
35
+ def self.save_config(tool, name, data, scope: $openc3_scope, local_mode: true)
34
36
  Store.hset("#{scope}__config__#{tool}", name, data)
37
+ LocalMode.save_tool_config(scope, tool, name, data) if local_mode
35
38
  end
36
39
 
37
40
  def self.delete_config(tool, name, scope: $openc3_scope)
38
41
  Store.hdel("#{scope}__config__#{tool}", name)
42
+ LocalMode.delete_tool_config(scope, tool, name)
39
43
  end
40
44
  end
41
45
  end
@@ -60,8 +60,8 @@ module OpenC3
60
60
  # Setup secrets for microservice
61
61
  secrets = microservice_config["secrets"]
62
62
  if secrets
63
- secrets.each do |type, secret_name, env_name_or_path|
64
- secret_value = @secrets.get(secret_name, scope: scope)
63
+ secrets.each do |type, secret_name, env_name_or_path, secret_store|
64
+ secret_value = @secrets.get(secret_name, secret_store: secret_store, scope: scope)
65
65
  if secret_value
66
66
  case type
67
67
  when 'ENV'
@@ -501,6 +501,10 @@ module OpenC3
501
501
  return start(procedure_name)
502
502
  end
503
503
  def require_utility(procedure_name)
504
+ # Ensure require_utility works like require where you don't need the .rb extension
505
+ if File.extname(procedure_name) != '.rb'
506
+ procedure_name += '.rb'
507
+ end
504
508
  @require_utility_cache ||= {}
505
509
  if @require_utility_cache[procedure_name]
506
510
  return false
@@ -144,7 +144,7 @@ module OpenC3
144
144
 
145
145
  # Make the post request to keycloak
146
146
  def _make_request(headers, data)
147
- uri = URI("#{@url}/auth/realms/openc3/protocol/openid-connect/token")
147
+ uri = URI("#{@url}/realms/openc3/protocol/openid-connect/token")
148
148
  @log[0] = "request uri: #{uri.to_s} header: #{headers.to_s} body: #{data.to_s}"
149
149
  STDOUT.puts @log[0] if JsonDRb.debug?
150
150
  saved_verbose = $VERBOSE; $VERBOSE = nil
@@ -129,7 +129,7 @@ module OpenC3
129
129
  end
130
130
 
131
131
  # Lists the files under a specified path
132
- def list_files(bucket:, path:, only_directories: false, include_head: false)
132
+ def list_files(bucket:, path:, only_directories: false, metadata: false)
133
133
  # Trailing slash is important in AWS S3 when listing files
134
134
  # See https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Types/ListObjectsV2Output.html#common_prefixes-instance_method
135
135
  if path[-1] != '/'
@@ -163,8 +163,8 @@ module OpenC3
163
163
  item['name'] = aws_item.key.split('/')[-1]
164
164
  item['modified'] = aws_item.last_modified
165
165
  item['size'] = aws_item.size
166
- if include_head
167
- item['head'] = head_object(bucket: bucket, key: aws_item.key)
166
+ if metadata
167
+ item['metadata'] = head_object(bucket: bucket, key: aws_item.key)
168
168
  end
169
169
  files << item
170
170
  end
@@ -180,12 +180,12 @@ module OpenC3
180
180
 
181
181
  # get metadata for a specific object
182
182
  def head_object(bucket:, key:)
183
- head = @client.head_object({
183
+ @client.head_object({
184
184
  bucket: bucket,
185
185
  key: key
186
186
  })
187
- rescue Aws::S3::Errors::NotFound => error
188
- raise NotFound, "Object: #{bucket}/#{key}"
187
+ rescue Aws::S3::Errors::NotFound
188
+ raise NotFound, "Object '#{bucket}/#{key}' does not exist."
189
189
  end
190
190
 
191
191
  # put_object fires off the request to store but does not confirm
@@ -61,7 +61,7 @@ module OpenC3
61
61
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
62
62
  end
63
63
 
64
- def list_files(bucket:, path:, only_directories: false)
64
+ def list_files(bucket:, path:, only_directories: false, metadata: false)
65
65
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
66
66
  end
67
67
 
@@ -58,7 +58,10 @@ module OpenC3
58
58
  puts "Local init found scope: #{scope_dir}"
59
59
  Dir.each_child("#{OPENC3_LOCAL_MODE_PATH}/#{scope_dir}") do |plugin_dir|
60
60
  full_folder_path = "#{OPENC3_LOCAL_MODE_PATH}/#{scope_dir}/#{plugin_dir}"
61
- next if plugin_dir == "targets_modified" or not File.directory?(full_folder_path)
61
+ if plugin_dir == "targets_modified" || plugin_dir == "tool_config" ||
62
+ plugin_dir == "settings" || !File.directory?(full_folder_path)
63
+ next
64
+ end
62
65
  puts "Local init found plugin_dir: #{full_folder_path}"
63
66
  gems, plugin_instance = scan_plugin_dir(full_folder_path)
64
67
 
@@ -79,6 +82,8 @@ module OpenC3
79
82
  end
80
83
  end
81
84
  sync_targets_modified()
85
+ sync_tool_config()
86
+ sync_settings()
82
87
  puts "Local init complete"
83
88
  else
84
89
  puts "Local init canceled: Local mode not enabled or #{OPENC3_LOCAL_MODE_PATH} does not exist"
@@ -322,12 +327,10 @@ module OpenC3
322
327
  end
323
328
 
324
329
  def self.sync_targets_modified
325
- if ENV['OPENC3_LOCAL_MODE'] and Dir.exist?(OPENC3_LOCAL_MODE_PATH)
326
- bucket = Bucket.getClient()
327
- scopes = ScopeModel.names()
328
- scopes.each do |scope|
329
- sync_with_bucket(bucket, scope: scope)
330
- end
330
+ bucket = Bucket.getClient()
331
+ scopes = ScopeModel.names()
332
+ scopes.each do |scope|
333
+ sync_with_bucket(bucket, scope: scope)
331
334
  end
332
335
  end
333
336
 
@@ -417,6 +420,58 @@ module OpenC3
417
420
  return files.sort
418
421
  end
419
422
 
423
+ def self.sync_tool_config()
424
+ scopes = ScopeModel.names()
425
+ scopes.each do |scope|
426
+ Dir["#{OPENC3_LOCAL_MODE_PATH}/#{scope}/tool_config/**/*.json"].each do |config|
427
+ parts = config.split('/')
428
+ puts "Syncing tool_config #{parts[-2]} #{File.basename(config)}"
429
+ data = File.read(config)
430
+ begin
431
+ # Parse just to ensure we have valid JSON
432
+ JSON.parse(data, :allow_nan => true, :create_additions => true)
433
+ # Only save if the parse was successful
434
+ ToolConfigModel.save_config(parts[-2], File.basename(config), data, scope: scope, local_mode: false)
435
+ rescue JSON::ParserError => error
436
+ puts "Unable to initialize tool config due to #{error.message}"
437
+ end
438
+ end
439
+ end
440
+ end
441
+
442
+ def self.save_tool_config(scope, tool, name, data)
443
+ json = JSON.parse(data, :allow_nan => true, :create_additions => true)
444
+ config_path = "#{OPENC3_LOCAL_MODE_PATH}/#{scope}/tool_config/#{tool}/#{name}.json"
445
+ FileUtils.mkdir_p(File.dirname(config_path))
446
+ File.open(config_path, 'w') do |file|
447
+ file.write(JSON.pretty_generate(json, :allow_nan => true))
448
+ end
449
+ end
450
+
451
+ def self.delete_tool_config(scope, tool, name)
452
+ FileUtils.rm_f("#{OPENC3_LOCAL_MODE_PATH}/#{scope}/tool_config/#{tool}/#{name}.json")
453
+ end
454
+
455
+ def self.sync_settings()
456
+ scopes = ScopeModel.names()
457
+ scopes.each do |scope|
458
+ Dir["#{OPENC3_LOCAL_MODE_PATH}/#{scope}/settings/*.json"].each do |config|
459
+ name = File.basename(config, ".json")
460
+ puts "Syncing setting #{name}"
461
+ # Anything can be stored in settings so read and set directly
462
+ data = File.read(config)
463
+ SettingModel.set({ name: name, data: data }, scope: scope)
464
+ end
465
+ end
466
+ end
467
+
468
+ def self.save_setting(scope, name, data)
469
+ config_path = "#{OPENC3_LOCAL_MODE_PATH}/#{scope}/settings/#{name}.json"
470
+ FileUtils.mkdir_p(File.dirname(config_path))
471
+ # Anything can be stored as a setting so write it out directly
472
+ File.write(config_path, data)
473
+ end
474
+
420
475
  # Helper methods
421
476
 
422
477
  def self.sync_remote_to_local(bucket, key)
@@ -21,11 +21,11 @@ require 'openc3/utilities/secrets'
21
21
 
22
22
  module OpenC3
23
23
  class RedisSecrets < Secrets
24
- def keys(scope:)
24
+ def keys(secret_store: nil, scope:)
25
25
  SecretModel.names(scope: scope)
26
26
  end
27
27
 
28
- def get(key, scope:)
28
+ def get(key, secret_store: nil, scope:)
29
29
  data = SecretModel.get(name: key, scope: scope)
30
30
  if data
31
31
  return data['value']
@@ -34,11 +34,11 @@ module OpenC3
34
34
  end
35
35
  end
36
36
 
37
- def set(key, value, scope:)
37
+ def set(key, value, secret_store: nil, scope:)
38
38
  SecretModel.set( {name: key, value: value.to_s }, scope: scope)
39
39
  end
40
40
 
41
- def delete(key, scope:)
41
+ def delete(key, secret_store: nil, scope:)
42
42
  model = SecretModel.get_model(name: key, scope: scope)
43
43
  model.destroy if model
44
44
  end
@@ -31,24 +31,24 @@ module OpenC3
31
31
  klass.new
32
32
  end
33
33
 
34
- def keys(scope:)
34
+ def keys(secret_store: nil, scope:)
35
35
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
36
36
  end
37
37
 
38
- def get(key, scope:)
38
+ def get(key, secret_store: nil, scope:)
39
39
  return @local_secrets[key]
40
40
  end
41
41
 
42
- def set(key, value, scope:)
42
+ def set(key, value, secret_store: nil, scope:)
43
43
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
44
44
  end
45
45
 
46
- def delete(key, scope:)
46
+ def delete(key, secret_store: nil, scope:)
47
47
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
48
48
  end
49
49
 
50
50
  def setup(secrets)
51
- secrets.each do |type, key, data|
51
+ secrets.each do |type, key, data, secret_store|
52
52
  case type
53
53
  when 'ENV'
54
54
  @local_secrets[key] = ENV[data]
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.5.0'
3
+ OPENC3_VERSION = '5.5.2-beta0'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
7
  MINOR = '5'
8
- PATCH = '0'
9
- OTHER = ''
10
- BUILD = '6e9e3efe6170bd7adca14b849620f03fb622338d'
8
+ PATCH = '2'
9
+ OTHER = 'pre.beta0'
10
+ BUILD = '417d0e4ab762ecc0ada17fd8e230b394721f9cd4'
11
11
  end
12
- VERSION = '5.5.0'
13
- GEM_VERSION = '5.5.0'
12
+ VERSION = '5.5.2-beta0'
13
+ GEM_VERSION = '5.5.2.pre.beta0'
14
14
  end
@@ -1,5 +1,5 @@
1
1
  # This class can be used in your scripts like so:
2
- # require '<%= target_lib_filename %>'
2
+ # require_utility '<%= target_class.upcase %>/lib/<%= target_lib_filename %>'
3
3
  # <%= target_object %> = <%= target_class %>.new
4
4
  # <%= target_object %>.utility
5
5
  # For more information see the OpenC3 scripting guide
@@ -2,8 +2,7 @@ SCREEN AUTO AUTO 1.0
2
2
 
3
3
  TITLE "Status"
4
4
 
5
- VERTICALBOX
6
- SECTIONHEADER "Information"
5
+ VERTICALBOX "Information"
7
6
  LABELVALUE <%= target_name %> STATUS VALUE
8
7
  LABELVALUE <%= target_name %> STATUS BOOL
9
8
  END
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openc3
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.0
4
+ version: 5.5.2.pre.beta0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-23 00:00:00.000000000 Z
12
+ date: 2023-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -692,6 +692,8 @@ files:
692
692
  - bin/openc3cli
693
693
  - bin/rubysloc
694
694
  - data/config/_array_params.yaml
695
+ - data/config/_canvas_values.yaml
696
+ - data/config/_graph_params.yaml
695
697
  - data/config/_id_items.yaml
696
698
  - data/config/_id_params.yaml
697
699
  - data/config/_interfaces.yaml
@@ -700,6 +702,7 @@ files:
700
702
  - data/config/command.yaml
701
703
  - data/config/command_modifiers.yaml
702
704
  - data/config/command_telemetry.yaml
705
+ - data/config/graph_settings.yaml
703
706
  - data/config/interface_modifiers.yaml
704
707
  - data/config/item_modifiers.yaml
705
708
  - data/config/microservice.yaml
@@ -708,6 +711,7 @@ files:
708
711
  - data/config/plugins.yaml
709
712
  - data/config/protocols.yaml
710
713
  - data/config/screen.yaml
714
+ - data/config/settings.yaml
711
715
  - data/config/table_manager.yaml
712
716
  - data/config/table_parameter_modifiers.yaml
713
717
  - data/config/target.yaml
@@ -892,14 +896,13 @@ files:
892
896
  - lib/openc3/models/router_status_model.rb
893
897
  - lib/openc3/models/scope_model.rb
894
898
  - lib/openc3/models/secret_model.rb
895
- - lib/openc3/models/settings_model.rb
899
+ - lib/openc3/models/setting_model.rb
896
900
  - lib/openc3/models/sorted_model.rb
897
901
  - lib/openc3/models/stash_model.rb
898
902
  - lib/openc3/models/target_model.rb
899
903
  - lib/openc3/models/timeline_model.rb
900
904
  - lib/openc3/models/tool_config_model.rb
901
905
  - lib/openc3/models/tool_model.rb
902
- - lib/openc3/models/traefik_model.rb
903
906
  - lib/openc3/models/trigger_group_model.rb
904
907
  - lib/openc3/models/trigger_model.rb
905
908
  - lib/openc3/models/widget_model.rb
@@ -1045,9 +1048,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1045
1048
  version: '2.7'
1046
1049
  required_rubygems_version: !ruby/object:Gem::Requirement
1047
1050
  requirements:
1048
- - - ">="
1051
+ - - ">"
1049
1052
  - !ruby/object:Gem::Version
1050
- version: '0'
1053
+ version: 1.3.1
1051
1054
  requirements: []
1052
1055
  rubygems_version: 3.3.14
1053
1056
  signing_key:
@@ -1,47 +0,0 @@
1
- # encoding: ascii-8bit
2
-
3
- # Copyright 2023 OpenC3, Inc.
4
- # All Rights Reserved.
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
- # This program is distributed in the hope that it will be useful,
12
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- # GNU Affero General Public License for more details.
15
- #
16
- # This file may also be used under the terms of a commercial license
17
- # if purchased from OpenC3, Inc.
18
-
19
- require 'openc3/utilities/store'
20
-
21
- module OpenC3
22
- class TraefikModel
23
- def self.register_route(microservice_name:, port:, prefix:, priority: 20)
24
- prefix = '/' + prefix unless prefix[0] == '/'
25
- if ENV['KUBERNETES_SERVICE_HOST']
26
- url = "http://#{microservice_name.gsub('__', '-')}:#{port}"
27
- else
28
- url = "http://openc3-operator:#{port}"
29
- end
30
- service_name = microservice_name
31
- router_name = microservice_name
32
- Store.set("traefik/http/services/#{service_name}/loadbalancer/servers/0/url", url)
33
- Store.set("traefik/http/routers/#{router_name}/service", service_name)
34
- Store.set("traefik/http/routers/#{router_name}/priority", priority)
35
- Store.set("traefik/http/routers/#{router_name}/rule", "PathPrefix(`#{prefix}`)")
36
- end
37
-
38
- def self.unregister_route(microservice_name:)
39
- service_name = microservice_name
40
- router_name = microservice_name
41
- Store.del("traefik/http/routers/#{router_name}/rule")
42
- Store.del("traefik/http/routers/#{router_name}/priority")
43
- Store.del("traefik/http/routers/#{router_name}/service")
44
- Store.del("traefik/http/services/#{service_name}/loadbalancer/servers/0/url")
45
- end
46
- end
47
- end