foreman_rh_cloud 12.2.12 → 13.0.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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +24 -78
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +24 -78
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +23 -77
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +23 -77
  6. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +23 -77
  7. data/app/controllers/concerns/insights_cloud/package_profile_upload_extensions.rb +3 -2
  8. data/app/models/insights_hit.rb +1 -1
  9. data/app/services/foreman_rh_cloud/cert_auth.rb +3 -13
  10. data/app/services/foreman_rh_cloud/gateway_request.rb +26 -0
  11. data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +1 -3
  12. data/app/services/foreman_rh_cloud/tags_auth.rb +1 -2
  13. data/lib/foreman_inventory_upload/async/generate_report_job.rb +8 -13
  14. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +4 -4
  15. data/lib/foreman_inventory_upload/async/upload_report_job.rb +5 -6
  16. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +2 -2
  17. data/lib/foreman_inventory_upload/generators/slice.rb +3 -3
  18. data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +1 -7
  19. data/lib/foreman_rh_cloud/engine.rb +15 -33
  20. data/lib/foreman_rh_cloud/plugin.rb +9 -9
  21. data/lib/foreman_rh_cloud/version.rb +1 -1
  22. data/lib/tasks/rh_cloud_inventory.rake +31 -14
  23. data/locale/foreman_rh_cloud.pot +157 -261
  24. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  25. data/locale/fr/foreman_rh_cloud.po +26 -79
  26. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  27. data/locale/ja/foreman_rh_cloud.po +26 -79
  28. data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  29. data/locale/ka/foreman_rh_cloud.po +24 -77
  30. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  31. data/locale/ko/foreman_rh_cloud.po +25 -78
  32. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  33. data/locale/zh_CN/foreman_rh_cloud.po +25 -78
  34. data/package.json +1 -1
  35. data/test/jobs/upload_report_job_test.rb +1 -2
  36. data/test/unit/fact_helpers_test.rb +0 -47
  37. data/test/unit/slice_generator_test.rb +0 -57
  38. data/webpack/ForemanRhCloudFills.js +2 -6
  39. data/webpack/ForemanRhCloudHelpers.js +0 -4
  40. data/webpack/InsightsHostDetailsTab/InsightsTab.scss +0 -4
  41. data/webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js +23 -59
  42. data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +16 -3
  43. data/webpack/InsightsVulnerabilityHostIndexExtensions/CVECountCell.js +2 -8
  44. data/webpack/InsightsVulnerabilityHostIndexExtensions/__tests__/CVECountCell.test.js +2 -48
  45. data/webpack/__tests__/ForemanRhCloudHelpers.test.js +1 -16
  46. data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +0 -6
  47. metadata +4 -10
  48. data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +0 -29
  49. data/lib/foreman_inventory_upload/async/generate_host_report.rb +0 -20
  50. data/lib/foreman_inventory_upload/async/host_inventory_report_job.rb +0 -39
  51. data/lib/foreman_inventory_upload/async/single_host_report_job.rb +0 -20
  52. data/test/jobs/queue_for_upload_job_test.rb +0 -63
  53. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTotalRiskChart.test.js +0 -194
@@ -3,10 +3,10 @@
3
3
  "locale_data": {
4
4
  "foreman_rh_cloud": {
5
5
  "": {
6
- "Project-Id-Version": "foreman_rh_cloud 13.0.5",
6
+ "Project-Id-Version": "foreman_rh_cloud 11.1.0",
7
7
  "Report-Msgid-Bugs-To": "",
8
8
  "PO-Revision-Date": "2023-01-20 13:26+0000",
9
- "Last-Translator": "Ondřej Gajdušek, 2025",
9
+ "Last-Translator": "Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025",
10
10
  "Language-Team": "Chinese (China) (https://app.transifex.com/foreman/teams/114/zh_CN/)",
11
11
  "MIME-Version": "1.0",
12
12
  "Content-Type": "text/plain; charset=UTF-8",
@@ -35,9 +35,6 @@
35
35
  "All recommendations are now selected.": [
36
36
  "现在选择了所有建议。"
37
37
  ],
38
- "Analytics data collection": [
39
- "数据收集分析"
40
- ],
41
38
  "Any Organization": [
42
39
  "任意机构"
43
40
  ],
@@ -119,17 +116,11 @@
119
116
  "Enable automatic deletion of mismatched host records from the Red Hat cloud": [
120
117
  "启用自动删除来自红帽云的主机记录"
121
118
  ],
122
- "Enable automatic deletion of mismatched host records from the Red Hat cloud. Ignored when using local Insights.": [
123
- ""
124
- ],
125
119
  "Enable automatic synchronization of Insights recommendations from the Red Hat cloud": [
126
120
  "启用来自红帽云的 Insights 建议自动同步"
127
121
  ],
128
- "Enable automatic synchronization of Insights recommendations from the Red Hat cloud. Ignored when using local Insights.": [
129
- ""
130
- ],
131
- "Enable automatic upload of your host inventory to the Red Hat cloud. Ignored when using local Insights.": [
132
- ""
122
+ "Enable automatic upload of your host inventory to the Red Hat cloud": [
123
+ "启用自动将主机清单上传到红帽云"
133
124
  ],
134
125
  "Enable automatic upload of your hosts inventory to the Red Hat cloud": [
135
126
  "启用自动将主机清单上传到红帽云"
@@ -143,14 +134,17 @@
143
134
  "Encountered an error while trying to access the server:": [
144
135
  "在尝试访问服务器时遇到错误:"
145
136
  ],
146
- "Exclude installed packages": [
137
+ "Exclude installed Packages": [
147
138
  "排除安装的软件包"
148
139
  ],
149
140
  "Exclude installed packages from being uploaded to the Red Hat cloud": [
150
141
  "将安装的软件包上传到红帽云"
151
142
  ],
152
- "Exclude installed packages from being uploaded to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored and installed packages are always excluded.) Ignored when using local Insights.": [
153
- ""
143
+ "Exclude packages": [
144
+ "排除软件包"
145
+ ],
146
+ "Exclude packages from being uploaded to the Red Hat cloud": [
147
+ "排除软件包上传到红帽云"
154
148
  ],
155
149
  "Exit Code: %s": [
156
150
  "退出代码:%s"
@@ -185,9 +179,6 @@
185
179
  "Generate and upload report": [
186
180
  "生成并上传报告"
187
181
  ],
188
- "Generate report": [
189
- "生成报告"
190
- ],
191
182
  "Generate the report, but do not upload": [
192
183
  "生成报告,但不上传"
193
184
  ],
@@ -215,9 +206,6 @@
215
206
  "Host Insights recommendations": [
216
207
  "主机 Insights 建议"
217
208
  ],
218
- "Host inventory report job": [
219
- ""
220
- ],
221
209
  "Host was not uploaded to your RH cloud inventory": [
222
210
  "主机没有上传到您的 RH 云清单"
223
211
  ],
@@ -260,9 +248,6 @@
260
248
  "Knowledgebase article": [
261
249
  "知识库文章"
262
250
  ],
263
- "Learn more about {minimalDataCollectionSetting}.": [
264
- "了解有关 {minimalDataCollectionSetting} 的更多信息。"
265
- ],
266
251
  "List of host UUIDs": [
267
252
  "主机 UUID 列表"
268
253
  ],
@@ -278,12 +263,6 @@
278
263
  "Manual": [
279
264
  "手册"
280
265
  ],
281
- "Minimal data collection": [
282
- "最小数据收集"
283
- ],
284
- "Missing Insights facets created: %s": [
285
- ""
286
- ],
287
266
  "Moderate": [
288
267
  "中等"
289
268
  ],
@@ -314,33 +293,21 @@
314
293
  "Notice": [
315
294
  "注意事項"
316
295
  ],
296
+ "Obfuscate IPs": [
297
+ "模糊 IP"
298
+ ],
317
299
  "Obfuscate host ipv4 addresses": [
318
300
  "模糊的主机 ipv4 地址"
319
301
  ],
320
- "Obfuscate host ipv4 addresses.": [
321
- "对主机 ipv4 地址进行模糊化处理"
322
- ],
323
302
  "Obfuscate host names": [
324
303
  "模糊主机名"
325
304
  ],
326
305
  "Obfuscate host names sent to the Red Hat cloud": [
327
306
  "发送到红帽云的模糊主机名"
328
307
  ],
329
- "Obfuscate host names sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host names are not included in the report.) Ignored when using local Insights.": [
330
- ""
331
- ],
332
308
  "Obfuscate ipv4 addresses sent to the Red Hat cloud": [
333
309
  "发送到红帽云的模糊 ipv4 地址"
334
310
  ],
335
- "Obfuscate ipv4 addresses sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host IPv4 addresses are not included in the report.) Ignored when using local Insights.": [
336
- ""
337
- ],
338
- "Only include the minimum required data in inventory reports for uploading to Red Hat cloud. When this is true, installed packages are excluded from the report regardless of the exclude_installed_packages setting, and host names and IPv4 addresses are excluded from the report regardless of obfuscation settings. Ignored when using local Insights.": [
339
- ""
340
- ],
341
- "Only send the minimum required data to Red Hat cloud, obfuscation settings are disabled": [
342
- "仅将最低所需的数据发送到红帽云,禁用模糊设置"
343
- ],
344
311
  "Oops! Couldn't find organization that matches your query": [
345
312
  "未找到与您的查询匹配的机构"
346
313
  ],
@@ -356,8 +323,11 @@
356
323
  "RH Cloud": [
357
324
  "RH Cloud"
358
325
  ],
359
- "RHC daemon id. Ignored when using local Insights.": [
360
- ""
326
+ "RHC daemon id": [
327
+ "RHC 守护进程 ID"
328
+ ],
329
+ "RHCloud": [
330
+ "RHCloud"
361
331
  ],
362
332
  "Read more about it in RH cloud insights": [
363
333
  "在 RH Cloud insights 中了解更多有关它的信息"
@@ -416,7 +386,7 @@
416
386
  "Run RH Cloud playbook": [
417
387
  "运行 RH Cloud playbook"
418
388
  ],
419
- "Run playbook generated by Red Hat remediations app": [
389
+ "Run playbook genrated by Red Hat remediations app": [
420
390
  "运行由红帽补救应用生成的 playbook"
421
391
  ],
422
392
  "Run remediation playbook generated by Insights": [
@@ -431,17 +401,14 @@
431
401
  "Select recommendations from all pages": [
432
402
  "在所有页面中选择建议"
433
403
  ],
434
- "Send additional data to enhance Insights services, as per the settings": [
435
- "根据设置,发送额外数据以增强 Insights 服务"
436
- ],
437
404
  "Set the current organization context for the request": [
438
405
  "设置请求的当前机构上下文"
439
406
  ],
440
407
  "Settings": [
441
408
  "设置"
442
409
  ],
443
- "Should import include parameter tags from Foreman? Ignored when using local Insights.": [
444
- ""
410
+ "Should import include parameter tags from Foreman?": [
411
+ "应从 Foreman 导入包含参数标签?"
445
412
  ],
446
413
  "Show Advanced Settings": [
447
414
  "显示高级设置"
@@ -449,12 +416,6 @@
449
416
  "Show if system is configured to use local iop-advisor-engine.": [
450
417
  "显示系统是否被配置为使用本地 iop-advisor-engine。"
451
418
  ],
452
- "Single-host report job": [
453
- ""
454
- ],
455
- "Single-host report job for host %s": [
456
- ""
457
- ],
458
419
  "Start inventory synchronization": [
459
420
  "启动清单同步"
460
421
  ],
@@ -485,8 +446,8 @@
485
446
  "The report file %{filename} doesn't exist": [
486
447
  "报告文件 %{filename} 不存在"
487
448
  ],
488
- "The scheduled process is disabled because this Foreman is configured with a local IoP Smart Proxy.": [
489
- "调度的进程被禁用,因为此 Foreman 配置了一个本地 IoP Smart Proxy。"
449
+ "The scheduled process is disabled because this Foreman is configured with the use_local_advisor_engine option.": [
450
+ "调度的进程被禁用,因为此 Foreman 配置了 use_local_advisor_engine 选项。"
490
451
  ],
491
452
  "The server returned the following error: %s": [
492
453
  "服务器返回以下错误:%s"
@@ -497,9 +458,6 @@
497
458
  "There are no recommendations for your hosts": [
498
459
  "没有适用于您的主机的建议"
499
460
  ],
500
- "There were no missing Insights facets": [
501
- ""
502
- ],
503
461
  "This action will also enable automatic reports upload": [
504
462
  "此操作还会启用自动报告上传"
505
463
  ],
@@ -509,9 +467,6 @@
509
467
  "To manually upload the data for a specific organization, select an organization and click {restartButtonName}.": [
510
468
  "要手动上传特定机构的数据,请选择机构并点 {restartButtonName}。"
511
469
  ],
512
- "Total CVEs": [
513
- "CVE 总数"
514
- ],
515
470
  "Total risk": [
516
471
  "总风险"
517
472
  ],
@@ -539,12 +494,6 @@
539
494
  "View in Red Hat Insights": [
540
495
  "禁用 Red Hat Insights"
541
496
  ],
542
- "Vulnerabilities": [
543
- "安全漏洞"
544
- ],
545
- "Vulnerability": [
546
- "安全漏洞"
547
- ],
548
497
  "Wait and %s": [
549
498
  "等待和 %s"
550
499
  ],
@@ -611,9 +560,6 @@
611
560
  "rule title": [
612
561
  "rule 标题"
613
562
  ],
614
- "setting minimal data collection": [
615
- "设置最小数据收集"
616
- ],
617
563
  "solution url": [
618
564
  "solution url"
619
565
  ],
@@ -15,10 +15,11 @@ module InsightsCloud
15
15
  logger.debug("Generating host-specific report for host #{@host.name}")
16
16
 
17
17
  ForemanTasks.async_task(
18
- ForemanInventoryUpload::Async::SingleHostReportJob,
18
+ ForemanInventoryUpload::Async::GenerateReportJob,
19
19
  ForemanInventoryUpload.generated_reports_folder,
20
20
  @host.organization_id,
21
- @host.id
21
+ false,
22
+ "id=#{@host.id}"
22
23
  )
23
24
 
24
25
  # in IoP case, the hosts are identified by the sub-man ID, and we can assume they already
@@ -1,6 +1,6 @@
1
1
  class InsightsHit < ApplicationRecord
2
2
  include ::Authorizable
3
- belongs_to :host, class_name: 'Host::Base'
3
+ belongs_to :host
4
4
  # since the facet is one-to-one association with a host, we can connect
5
5
  # through host_id column on both this model and facet.
6
6
  belongs_to :insights_facet, foreign_key: 'host_id', primary_key: 'host_id', counter_cache: :hits_count
@@ -11,21 +11,11 @@ module ForemanRhCloud
11
11
 
12
12
  def execute_cloud_request(params)
13
13
  organization = params.delete(:organization)
14
- # Cache the value of with_iop_smart_proxy? to avoid multiple calls to the database
15
- with_iop_smart_proxy = ForemanRhCloud.with_iop_smart_proxy?
16
- certs = with_iop_smart_proxy ? foreman_certificate : candlepin_id_cert(organization)
17
- default_params = {
14
+ certs = ForemanRhCloud.with_iop_smart_proxy? ? foreman_certificate : candlepin_id_cert(organization)
15
+ final_params = {
18
16
  ssl_client_cert: OpenSSL::X509::Certificate.new(certs[:cert]),
19
17
  ssl_client_key: OpenSSL::PKey.read(certs[:key]),
20
- }
21
-
22
- if with_iop_smart_proxy && organization&.label
23
- default_params[:headers] = {
24
- 'X-Org-Id' => organization&.label,
25
- }
26
- end
27
-
28
- final_params = default_params.deep_merge(params)
18
+ }.deep_merge(params)
29
19
 
30
20
  super(final_params)
31
21
  end
@@ -0,0 +1,26 @@
1
+ module ForemanRhCloud
2
+ module GatewayRequest
3
+ extend ActiveSupport::Concern
4
+
5
+ include CloudRequest
6
+
7
+ def execute_cloud_request(params)
8
+ certs = params.delete(:certs) || foreman_certificates
9
+ final_params = {
10
+ ssl_client_cert: OpenSSL::X509::Certificate.new(certs[:cert]),
11
+ ssl_client_key: OpenSSL::PKey.read(certs[:key]),
12
+ ssl_ca_file: Setting[:ssl_ca_file],
13
+ verify_ssl: OpenSSL::SSL::VERIFY_PEER,
14
+ }.deep_merge(params)
15
+
16
+ super(final_params)
17
+ end
18
+
19
+ def foreman_certificates
20
+ {
21
+ cert: File.read(Setting[:ssl_certificate]),
22
+ key: File.read(Setting[:ssl_priv_key]),
23
+ }
24
+ end
25
+ end
26
+ end
@@ -2,7 +2,7 @@ require 'rest-client'
2
2
 
3
3
  module ForemanRhCloud
4
4
  class InsightsApiForwarder
5
- include ForemanRhCloud::CertAuth
5
+ include ForemanRhCloud::GatewayRequest
6
6
 
7
7
  SCOPED_REQUESTS = [
8
8
  { test: %r{api/vulnerability/v1/vulnerabilities/cves}, tag_name: :tags },
@@ -26,8 +26,6 @@ module ForemanRhCloud
26
26
 
27
27
  request_opts = prepare_request_opts(original_request, path, forward_payload, forward_params)
28
28
 
29
- request_opts[:organization] = organization
30
-
31
29
  logger.debug("Sending request to: #{request_opts[:url]}")
32
30
 
33
31
  execute_cloud_request(request_opts)
@@ -1,6 +1,6 @@
1
1
  module ForemanRhCloud
2
2
  class TagsAuth
3
- include CertAuth
3
+ include GatewayRequest
4
4
 
5
5
  TAG_NAMESPACE = 'sat_iam'.freeze
6
6
  TAG_SHORT_NAME = 'scope'.freeze
@@ -24,7 +24,6 @@ module ForemanRhCloud
24
24
 
25
25
  payload = tags_query_payload
26
26
  params = {
27
- organization: @org,
28
27
  method: :post,
29
28
  url: "#{InsightsCloud.gateway_url}/tags",
30
29
  headers: {
@@ -5,7 +5,7 @@ module ForemanInventoryUpload
5
5
  "report_for_#{label}"
6
6
  end
7
7
 
8
- def plan(base_folder, organization_id, disconnected = false, hosts_filter = nil)
8
+ def plan(base_folder, organization_id, disconnected, hosts_filter = nil)
9
9
  sequence do
10
10
  super(
11
11
  GenerateReportJob.output_label("#{organization_id}#{hosts_filter.empty? ? nil : "[#{hosts_filter.to_s.parameterize}]"}"),
@@ -14,14 +14,13 @@ module ForemanInventoryUpload
14
14
  hosts_filter: hosts_filter
15
15
  )
16
16
 
17
- unless content_disconnected?(disconnected)
18
- plan_action(
19
- QueueForUploadJob,
20
- base_folder,
21
- ForemanInventoryUpload.facts_archive_name(organization_id, hosts_filter),
22
- organization_id
23
- )
24
- end
17
+ plan_action(
18
+ QueueForUploadJob,
19
+ base_folder,
20
+ ForemanInventoryUpload.facts_archive_name(organization_id, hosts_filter),
21
+ organization_id,
22
+ disconnected
23
+ )
25
24
  end
26
25
  end
27
26
 
@@ -41,10 +40,6 @@ module ForemanInventoryUpload
41
40
  )
42
41
  end
43
42
 
44
- def content_disconnected?(disconnected)
45
- disconnected || !Setting[:subscription_connection_enabled]
46
- end
47
-
48
43
  def base_folder
49
44
  input[:base_folder]
50
45
  end
@@ -1,9 +1,9 @@
1
1
  module ForemanInventoryUpload
2
2
  module Async
3
3
  class QueueForUploadJob < ::Actions::EntryAction
4
- def plan(base_folder, report_file, organization_id)
4
+ def plan(base_folder, report_file, organization_id, disconnected)
5
5
  enqueue_task = plan_self(base_folder: base_folder, report_file: report_file)
6
- plan_upload_report(enqueue_task.output[:enqueued_file_name], organization_id)
6
+ plan_upload_report(enqueue_task.output[:enqueued_file_name], organization_id, disconnected)
7
7
  end
8
8
 
9
9
  def run
@@ -59,8 +59,8 @@ module ForemanInventoryUpload
59
59
  input[:report_file]
60
60
  end
61
61
 
62
- def plan_upload_report(enqueued_file_name, organization_id)
63
- plan_action(UploadReportJob, enqueued_file_name, organization_id)
62
+ def plan_upload_report(enqueued_file_name, organization_id, disconnected)
63
+ plan_action(UploadReportJob, enqueued_file_name, organization_id, disconnected)
64
64
  end
65
65
  end
66
66
  end
@@ -7,15 +7,15 @@ module ForemanInventoryUpload
7
7
  "upload_for_#{label}"
8
8
  end
9
9
 
10
- def plan(filename, organization_id)
10
+ def plan(filename, organization_id, disconnected = false)
11
11
  label = UploadReportJob.output_label(organization_id)
12
- super(label, filename: filename, organization_id: organization_id)
12
+ super(label, filename: filename, organization_id: organization_id, disconnected: disconnected)
13
13
  end
14
14
 
15
15
  def try_execute
16
16
  if content_disconnected?
17
17
  progress_output do |progress_output|
18
- progress_output.write_line("Report was not moved and upload was canceled because connection to Insights is not enabled. Report location: #{filename}.")
18
+ progress_output.write_line('Upload canceled because connection to Insights is not enabled or the --no-upload option was passed.')
19
19
  progress_output.status = "Task aborted, exit 1"
20
20
  done!
21
21
  end
@@ -48,8 +48,7 @@ module ForemanInventoryUpload
48
48
  def env
49
49
  env_vars = super.merge(
50
50
  'FILES' => filename,
51
- 'CER_PATH' => @cer_path,
52
- 'ORG_ID' => organization.label
51
+ 'CER_PATH' => @cer_path
53
52
  )
54
53
 
55
54
  http_proxy_string = ForemanRhCloud.http_proxy_string
@@ -90,7 +89,7 @@ module ForemanInventoryUpload
90
89
  end
91
90
 
92
91
  def content_disconnected?
93
- !Setting[:subscription_connection_enabled]
92
+ input[:disconnected] || !Setting[:subscription_connection_enabled]
94
93
  end
95
94
  end
96
95
  end
@@ -59,7 +59,7 @@ module ForemanInventoryUpload
59
59
  def obfuscate_hostname?(host)
60
60
  # Returns true if hostname obfuscation should be applied for a given host, based on hierarchy:
61
61
  # 1. Global setting for hostname obfuscation.
62
- return true if Setting[:obfuscate_inventory_hostnames] && !ForemanRhCloud.with_iop_smart_proxy?
62
+ return true if Setting[:obfuscate_inventory_hostnames]
63
63
 
64
64
  insights_client_setting = fact_value(host, 'insights_client::obfuscate_hostname_enabled')
65
65
  insights_client_setting = ActiveModel::Type::Boolean.new.cast(insights_client_setting)
@@ -99,7 +99,7 @@ module ForemanInventoryUpload
99
99
  def obfuscate_ips?(host)
100
100
  # Returns true if IP obfuscation should be applied for a given host, based on hierarchy:
101
101
  # 1. Global setting for IP obfuscation.
102
- return true if Setting[:obfuscate_inventory_ips] && !ForemanRhCloud.with_iop_smart_proxy?
102
+ return true if Setting[:obfuscate_inventory_ips]
103
103
 
104
104
  insights_client_ipv4_setting = fact_value(host, 'insights_client::obfuscate_ipv4_enabled')
105
105
  insights_client_ipv6_setting = fact_value(host, 'insights_client::obfuscate_ipv6_enabled')
@@ -90,7 +90,7 @@ module ForemanInventoryUpload
90
90
  def report_host(host)
91
91
  host_ips_cache = host_ips(host)
92
92
  @stream.object do
93
- if Setting[:insights_minimal_data_collection] && !ForemanRhCloud.with_iop_smart_proxy?
93
+ if Setting[:insights_minimal_data_collection]
94
94
  insights_minimal_data_collection(host)
95
95
  else
96
96
  @stream.simple_field('fqdn', fqdn(host))
@@ -205,7 +205,7 @@ module ForemanInventoryUpload
205
205
  end.join(', '))
206
206
  end
207
207
  end
208
- if ForemanRhCloud.with_iop_smart_proxy? || (!Setting[:insights_minimal_data_collection] && !Setting[:exclude_installed_packages])
208
+ if !Setting[:insights_minimal_data_collection] && !Setting[:exclude_installed_packages]
209
209
  @stream.array_field('installed_packages') do
210
210
  first = true
211
211
  host.installed_packages.each do |package|
@@ -256,7 +256,7 @@ module ForemanInventoryUpload
256
256
 
257
257
  @stream.array_field('yum_repos') do
258
258
  host.content_facet.bound_repositories.each_with_index do |repo, index|
259
- report_yum_repo(host.content_source&.load_balancer_pulp_content_url || ::SmartProxy.pulp_primary.pulp_content_url, repo)
259
+ report_yum_repo(host.content_source.load_balancer_pulp_content_url, repo)
260
260
  @stream.comma unless index == host.content_facet.bound_repositories.count - 1
261
261
  end
262
262
  end
@@ -27,12 +27,6 @@ else
27
27
  AUTH_VAL="\"$RH_USERNAME\":\"$RH_PASSWORD\""
28
28
  fi
29
29
 
30
- ORG_HEADER=()
31
- if [ -n "$ORG_ID" ]
32
- then
33
- ORG_HEADER=("-H" "X-Org-Id: $ORG_ID")
34
- fi
35
-
36
30
  # /tmp/a b/x.pem
37
31
  # curl --cert /tmp/a\ b/x.pem
38
32
 
@@ -42,7 +36,7 @@ mkdir -p $DONE_DIR
42
36
 
43
37
  for f in $FILES
44
38
  do
45
- curl -k -vvv -# --fail -F "file=@$f;type=application/vnd.redhat.qpc.tar+tgz" $DEST "$AUTH_KEY" "$AUTH_VAL" "${ORG_HEADER[@]}"
39
+ curl -k -vvv -# --fail -F "file=@$f;type=application/vnd.redhat.qpc.tar+tgz" $DEST "$AUTH_KEY" "$AUTH_VAL"
46
40
  status=$?
47
41
  if [ $status -eq 0 ]; then
48
42
  mv $f $DONE_DIR
@@ -83,27 +83,6 @@ module ForemanRhCloud
83
83
  :description => N_('Configure Cloud Connector on given hosts'),
84
84
  :proxy_selector_override => ::RemoteExecutionProxySelector::INTERNAL_PROXY
85
85
  )
86
-
87
- ScopedSearch::AutoCompleteBuilder.class_eval do
88
- # Insights rule IDs always contain a pipe character.
89
- # example: hardening_ssh_config_perms|OPENSSH_HARDENING_CONFIG_PERMS
90
- # We need to override this method of scoped_search so that autocomplete
91
- # will correctly put the value in quotes (otherwise the "|" will be
92
- # interpreted as an OR.)
93
- # The only change from scoped_search code is adding the | to the regex in the final map.
94
- def complete_value_from_db(field, special_values, val)
95
- count = 20 - special_values.count
96
- completer_scope(field)
97
- .where(@options[:value_filter])
98
- .where(value_conditions(field.quoted_field, val))
99
- .select(field.quoted_field)
100
- .limit(count)
101
- .distinct
102
- .map(&field.field)
103
- .compact
104
- .map { |v| v.to_s =~ /\s|\|/ ? "\"#{v.gsub('"', '\"')}\"" : v }
105
- end
106
- end
107
86
  end
108
87
 
109
88
  # Ideally this code belongs to an initializer. The problem is that Katello controllers are not initialized completely until after the end of the to_prepare blocks
@@ -115,20 +94,23 @@ module ForemanRhCloud
115
94
  if defined?(Katello) && !Foreman.in_setup_db_rake?
116
95
  Katello::Api::V2::OrganizationsController.include Foreman::Controller::SmartProxyAuth
117
96
  # patch the callbacks order for :download_debug_certificate, since local_find_taxonomy has to run after the user is already initialized
118
- Katello::Api::V2::OrganizationsController.before_find_taxonomy_actions do
119
- Katello::Api::V2::OrganizationsController.add_smart_proxy_filters(
120
- [:index, :download_debug_certificate],
121
- features: ForemanRhCloud.on_prem_smart_proxy_features
122
- )
123
- end
97
+ Katello::Api::V2::OrganizationsController.skip_before_action(:local_find_taxonomy, only: :download_debug_certificate)
98
+ Katello::Api::V2::OrganizationsController.add_smart_proxy_filters(
99
+ [:index, :download_debug_certificate],
100
+ features: ForemanRhCloud.on_prem_smart_proxy_features
101
+ )
102
+ Katello::Api::V2::OrganizationsController.before_action(:local_find_taxonomy, only: :download_debug_certificate)
103
+
124
104
  Katello::Api::V2::RepositoriesController.include Foreman::Controller::SmartProxyAuth
125
105
  # patch the callbacks order for :index, since find_product has to run after the user is already initialized
126
- Katello::Api::V2::RepositoriesController.before_index_actions do
127
- Katello::Api::V2::RepositoriesController.add_smart_proxy_filters(
128
- :index,
129
- features: ForemanRhCloud.on_prem_smart_proxy_features
130
- )
131
- end
106
+ Katello::Api::V2::RepositoriesController.skip_before_action(:find_product, only: :index)
107
+ Katello::Api::V2::RepositoriesController.skip_before_action(:find_optional_organization, only: :index)
108
+ Katello::Api::V2::RepositoriesController.add_smart_proxy_filters(
109
+ :index,
110
+ features: ForemanRhCloud.on_prem_smart_proxy_features
111
+ )
112
+ Katello::Api::V2::RepositoriesController.before_action(:find_product, only: :index)
113
+ Katello::Api::V2::RepositoriesController.before_action(:find_optional_organization, only: :index)
132
114
  end
133
115
  end
134
116
 
@@ -13,15 +13,15 @@ module ForemanRhCloud
13
13
 
14
14
  settings do
15
15
  category(:rh_cloud, N_('Insights')) do
16
- setting('allow_auto_inventory_upload', type: :boolean, description: N_('Enable automatic upload of your host inventory to the Red Hat cloud. Ignored when using local Insights.'), default: true, full_name: N_('Automatic inventory upload'))
17
- setting('allow_auto_insights_sync', type: :boolean, description: N_('Enable automatic synchronization of Insights recommendations from the Red Hat cloud. Ignored when using local Insights.'), default: true, full_name: N_('Synchronize recommendations Automatically'))
18
- setting('allow_auto_insights_mismatch_delete', type: :boolean, description: N_('Enable automatic deletion of mismatched host records from the Red Hat cloud. Ignored when using local Insights.'), default: false, full_name: N_('Automatic mismatch deletion'))
19
- setting('obfuscate_inventory_hostnames', type: :boolean, description: N_('Obfuscate host names sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host names are not included in the report.) Ignored when using local Insights.'), default: false, full_name: N_('Obfuscate host names'))
20
- setting('obfuscate_inventory_ips', type: :boolean, description: N_('Obfuscate ipv4 addresses sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host IPv4 addresses are not included in the report.) Ignored when using local Insights.'), default: false, full_name: N_('Obfuscate host ipv4 addresses.'))
21
- setting('exclude_installed_packages', type: :boolean, description: N_('Exclude installed packages from being uploaded to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored and installed packages are always excluded.) Ignored when using local Insights.'), default: false, full_name: N_("Exclude installed packages"))
22
- setting('include_parameter_tags', type: :boolean, description: N_('Should import include parameter tags from Foreman? Ignored when using local Insights.'), default: false, full_name: N_('Include parameters in insights-client reports'))
23
- setting('rhc_instance_id', type: :string, description: N_('RHC daemon id. Ignored when using local Insights.'), default: nil, full_name: N_('ID of the RHC(Yggdrasil) daemon'))
24
- setting('insights_minimal_data_collection', type: :boolean, default: false, full_name: N_('Minimal data collection'), description: N_('Only include the minimum required data in inventory reports for uploading to Red Hat cloud. When this is true, installed packages are excluded from the report regardless of the exclude_installed_packages setting, and host names and IPv4 addresses are excluded from the report regardless of obfuscation settings. Ignored when using local Insights.'))
16
+ setting('allow_auto_inventory_upload', type: :boolean, description: N_('Enable automatic upload of your host inventory to the Red Hat cloud'), default: true, full_name: N_('Automatic inventory upload'))
17
+ setting('allow_auto_insights_sync', type: :boolean, description: N_('Enable automatic synchronization of Insights recommendations from the Red Hat cloud'), default: true, full_name: N_('Synchronize recommendations Automatically'))
18
+ setting('allow_auto_insights_mismatch_delete', type: :boolean, description: N_('Enable automatic deletion of mismatched host records from the Red Hat cloud'), default: false, full_name: N_('Automatic mismatch deletion'))
19
+ setting('obfuscate_inventory_hostnames', type: :boolean, description: N_('Obfuscate host names sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host names are not included in the report.)'), default: false, full_name: N_('Obfuscate host names'))
20
+ setting('obfuscate_inventory_ips', type: :boolean, description: N_('Obfuscate ipv4 addresses sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host IPv4 addresses are not included in the report.)'), default: false, full_name: N_('Obfuscate host ipv4 addresses.'))
21
+ setting('exclude_installed_packages', type: :boolean, description: N_('Exclude installed packages from being uploaded to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored and installed packages are always excluded.)'), default: false, full_name: N_("Exclude installed packages"))
22
+ setting('include_parameter_tags', type: :boolean, description: N_('Should import include parameter tags from Foreman?'), default: false, full_name: N_('Include parameters in insights-client reports'))
23
+ setting('rhc_instance_id', type: :string, description: N_('RHC daemon id'), default: nil, full_name: N_('ID of the RHC(Yggdrasil) daemon'))
24
+ setting('insights_minimal_data_collection', type: :boolean, default: false, full_name: N_('Minimal data collection'), description: N_('Only include the minimum required data in inventory reports for uploading to Red Hat cloud. When this is true, installed packages are excluded from the report regardless of the exclude_installed_packages setting, and host names and IPv4 addresses are excluded from the report regardless of obfuscation settings.'))
25
25
  end
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '12.2.12'.freeze
2
+ VERSION = '13.0.0'.freeze
3
3
  end