foreman_theme_satellite 13.1.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 (84) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +619 -0
  3. data/README.md +482 -0
  4. data/Rakefile +47 -0
  5. data/app/assets/images/foreman_theme_satellite/favicon.ico +0 -0
  6. data/app/assets/images/foreman_theme_satellite/header_logo.svg +836 -0
  7. data/app/assets/images/foreman_theme_satellite/login_bg.svg +384 -0
  8. data/app/assets/images/foreman_theme_satellite/login_logo.svg +840 -0
  9. data/app/assets/javascripts/foreman_theme_satellite/locale/en/foreman_theme_satellite.js +124 -0
  10. data/app/assets/javascripts/foreman_theme_satellite/theme_dashboard.js +17 -0
  11. data/app/assets/javascripts/foreman_theme_satellite/theme_ng_page_title.js +15 -0
  12. data/app/assets/stylesheets/foreman_theme_satellite/application_colors.css +12 -0
  13. data/app/assets/stylesheets/foreman_theme_satellite/bastion.scss +5 -0
  14. data/app/assets/stylesheets/foreman_theme_satellite/external_logout.scss +13 -0
  15. data/app/assets/stylesheets/foreman_theme_satellite/foreman_theme_satellite.css +1 -0
  16. data/app/assets/stylesheets/foreman_theme_satellite/login.scss +32 -0
  17. data/app/assets/stylesheets/foreman_theme_satellite/patternfly_and_overrides.scss +7 -0
  18. data/app/assets/stylesheets/foreman_theme_satellite/provisioning_templates.scss +3 -0
  19. data/app/assets/stylesheets/foreman_theme_satellite/theme.scss +14 -0
  20. data/app/assets/stylesheets/foreman_theme_satellite/topbar.scss +11 -0
  21. data/app/assets/stylesheets/foreman_theme_satellite/wizard.scss +14 -0
  22. data/app/controllers/concerns/documentation_controller_branding.rb +33 -0
  23. data/app/controllers/concerns/provisioning_templates_controller_branding.rb +94 -0
  24. data/app/helpers/provisioning_templates_helper_branding.rb +12 -0
  25. data/app/helpers/rhev_helper.rb +10 -0
  26. data/app/helpers/theme_application_helper.rb +17 -0
  27. data/app/helpers/theme_css_class_helper.rb +8 -0
  28. data/app/helpers/theme_discovery_helper.rb +10 -0
  29. data/app/helpers/theme_external_logout_helper.rb +10 -0
  30. data/app/helpers/theme_layout_helper.rb +18 -0
  31. data/app/helpers/theme_login_helper.rb +10 -0
  32. data/app/models/concerns/branch_info_branding.rb +9 -0
  33. data/app/models/concerns/deprecation_notification.rb +23 -0
  34. data/app/models/concerns/distributor_version.rb +7 -0
  35. data/app/models/concerns/gce.rb +7 -0
  36. data/app/models/concerns/openstack.rb +8 -0
  37. data/app/models/concerns/ovirt.rb +8 -0
  38. data/app/models/concerns/provisioning.rb +21 -0
  39. data/app/models/concerns/realm_theme.rb +18 -0
  40. data/app/models/concerns/satellite_packages.rb +8 -0
  41. data/app/models/concerns/setting_branding.rb +17 -0
  42. data/app/models/concerns/upstream_only_settings.rb +6 -0
  43. data/app/overrides/bootdisk_help_page.rb +44 -0
  44. data/app/overrides/layouts/base/theme_react_root.html.erb.deface +7 -0
  45. data/app/overrides/layouts/base/theme_resources.html.erb.deface +7 -0
  46. data/app/overrides/layouts/base/theme_style_resources.html.erb.deface +3 -0
  47. data/app/overrides/rhev.rb +14 -0
  48. data/app/overrides/satellite_name_override.rb +83 -0
  49. data/app/services/concerns/setting_registry_branding.rb +20 -0
  50. data/app/services/foreman_theme_satellite/renderer_methods.rb +22 -0
  51. data/app/views/api/v2/home/status_extensions.json.rabl +1 -0
  52. data/app/views/foreman_theme_satellite/_theme_client_side_branding.js.erb +63 -0
  53. data/app/views/foreman_theme_satellite/rhev/_form.erb +8 -0
  54. data/app/views/foreman_theme_satellite/rhev/_show.html.erb +6 -0
  55. data/db/migrate/20160404130619_remove_satellite_from_notification_name.rb +8 -0
  56. data/db/migrate/20161220092005_remove_satellite_from_notification_name_spell_correction.rb +24 -0
  57. data/db/migrate/20180516103339_update_idm_params.rb +19 -0
  58. data/db/migrate/20180605150932_deprecate_satellite_templates.rb +52 -0
  59. data/db/migrate/20181108171732_change_blog_url.rb +13 -0
  60. data/db/migrate/20201118090534_insights_param.rb +9 -0
  61. data/db/seeds.d/069-provisioning_templates_defaults.rb +24 -0
  62. data/db/seeds.d/850-global_parameters.rb +15 -0
  63. data/lib/foreman_theme_satellite/branded_words.rb +58 -0
  64. data/lib/foreman_theme_satellite/deprecated_templates.rb +9 -0
  65. data/lib/foreman_theme_satellite/documentation.rb +76 -0
  66. data/lib/foreman_theme_satellite/engine.rb +155 -0
  67. data/lib/foreman_theme_satellite/pry_rack.rb +12 -0
  68. data/lib/foreman_theme_satellite/replacer_repository.rb +57 -0
  69. data/lib/foreman_theme_satellite/rss_checker_branding.rb +11 -0
  70. data/lib/foreman_theme_satellite/version.rb +3 -0
  71. data/lib/foreman_theme_satellite.rb +4 -0
  72. data/lib/generators/foreman_theme_satellite/color_diff_generator.rb +32 -0
  73. data/lib/generators/foreman_theme_satellite/lib/color_changer.rb +25 -0
  74. data/lib/generators/foreman_theme_satellite/lib/css_compare.rb +85 -0
  75. data/lib/tasks/foreman_theme_satellite_tasks.rake +48 -0
  76. data/locale/Makefile +65 -0
  77. data/locale/en/foreman_theme_satellite.edit.po +152 -0
  78. data/locale/en/foreman_theme_satellite.po +286 -0
  79. data/locale/en/foreman_theme_satellite.po.time_stamp +0 -0
  80. data/locale/foreman_theme_satellite.pot +387 -0
  81. data/locale/gemspec.rb +2 -0
  82. data/package.json +31 -0
  83. data/webpack/index.js +5 -0
  84. metadata +226 -0
@@ -0,0 +1,6 @@
1
+ # Settings to hide in downstream (will return nil for all values)
2
+ module UpstreamOnlySettings
3
+ SETTINGS = %w[
4
+ allow_multiple_content_views
5
+ ].freeze
6
+ end
@@ -0,0 +1,44 @@
1
+ # File that covers update of bootdisk help page. Bootdisk plugin allows four types of bootdisk. Satellite supports only
2
+ # two of them.
3
+
4
+ # removing Host image from bootdisk help page
5
+
6
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
7
+ :name => "remove header for host image",
8
+ :replace => "div#welcome h3:nth-of-type(1)",
9
+ :text => '')
10
+
11
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
12
+ :name => "remove first paragraph of host image",
13
+ :replace => "div#welcome p:nth-of-type(4)",
14
+ :text => '')
15
+
16
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
17
+ :name => "remove second paragraph of host image",
18
+ :replace => "div#welcome p:nth-of-type(4)",
19
+ :text => '')
20
+
21
+
22
+ # removing Generic image from bootdisk help page
23
+
24
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
25
+ :name => "remove header of generic image",
26
+ :replace => "div#welcome h3:nth-of-type(2)",
27
+ :text => '')
28
+
29
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
30
+ :name => "remove first paragraph of generic image",
31
+ :replace => "div#welcome p:nth-of-type(6)",
32
+ :text => '')
33
+
34
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
35
+ :name => "remove second paragraph of generic image",
36
+ :replace => "div#welcome p:nth-of-type(6)",
37
+ :text => '')
38
+
39
+ # removing note about disabled bootdisk types
40
+
41
+ Deface::Override.new(:virtual_path => "foreman_bootdisk/disks/help",
42
+ :name => "remove * note",
43
+ :replace => "div#welcome p:nth-of-type(8)",
44
+ :text => '')
@@ -0,0 +1,7 @@
1
+ <!-- insert_after 'body script:last' -->
2
+ <%= react_component(
3
+ 'Helmet',
4
+ titleTemplate: 'Red Hat Satellite - %s',
5
+ defaultTitle: 'Red Hat Satellite'
6
+ )
7
+ %>
@@ -0,0 +1,7 @@
1
+ <!-- insert_after 'body script:last' -->
2
+ <%= javascript_include_tag('foreman_theme_satellite/theme_dashboard') %>
3
+ <%= javascript_include_tag('foreman_theme_satellite/theme_ng_page_title') %>
4
+ <%= webpacked_plugins_js_for :'foreman_theme_satellite' %>
5
+ <%= javascript_tag do %>
6
+ <%= render("foreman_theme_satellite/theme_client_side_branding.js") %>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <!-- insert_bottom 'head' -->
2
+ <%= favicon_link_tag "foreman_theme_satellite/favicon.ico"%>
3
+ <%= stylesheet_link_tag('foreman_theme_satellite/foreman_theme_satellite') %>
@@ -0,0 +1,14 @@
1
+ Deface::Override.new(virtual_path: 'compute_resources/form/_ovirt',
2
+ name: 'rhev_new',
3
+ insert_before: "erb[loud]:contains(':url')",
4
+ partial: 'foreman_theme_satellite/rhev/form')
5
+
6
+ Deface::Override.new(virtual_path: 'compute_resources/show/_ovirt',
7
+ name: 'rhev_show',
8
+ insert_after: 'tr:nth-child(4)',
9
+ partial: 'foreman_theme_satellite/rhev/show')
10
+
11
+ Deface::Override.new(virtual_path: 'compute_resources_vms/form/ovirt/_base',
12
+ name: 'rhev_vm',
13
+ insert_after: "erb[loud]:contains(':keyboard_layout')",
14
+ partial: 'foreman_theme_satellite/rhev/form')
@@ -0,0 +1,83 @@
1
+ # Add in the localizatione below to make sure they are extracted.
2
+ N_("Version %{version}")
3
+ N_("Support")
4
+ N_("Customer portal")
5
+ N_("Documentation")
6
+ N_('Administering Red Hat Satellite')
7
+ N_('Transitioning from Red Hat Satellite 5 to Red Hat Satellite 6')
8
+ N_("API Guide")
9
+ N_("Blog")
10
+ N_('Red Hat Satellite Blog')
11
+ N_("IRC")
12
+ N_("You can find us on %{liberachat} (irc.libera.chat) in #redhat-satellite.")
13
+ N_("Version %{version} © %{year} Red Hat Inc.")
14
+ N_("Includes %{system} © 2009-%{year} Paul Kelly and Ohad Levy")
15
+ N_("If you feel this is an error with Satellite 6 itself, please open a new issue with")
16
+ N_("Satellite ticketing system")
17
+ N_("You would probably need to attach the")
18
+ N_("Full trace")
19
+ N_("and relevant log entries.")
20
+ N_("(build: %{version})")
21
+
22
+
23
+ Deface::Override.new(:virtual_path => "home/_topbar",
24
+ :name => "remove foreman name from topbar",
25
+ :replace => "erb[loud]:contains('link_to')",
26
+ :text => "")
27
+
28
+ Deface::Override.new(:virtual_path => "home/_topbar",
29
+ :name => "add link to home",
30
+ :surround => "erb[loud]:contains('image_tag')",
31
+ :text => "<%= link_to main_app.root_path do%><%= render_original %><% end %>")
32
+
33
+ Deface::Override.new(:virtual_path => "about/index",
34
+ :name => "change about page content",
35
+ # div#support
36
+ :replace => "div.col-md-5 div.stats-well:nth-child(1)",
37
+ :text => " <div class=\"stats-well\"><h4><%= _(\"Support\") %></h4> <p>Visit the <%= link_to _('Customer Portal'), \"https://access.redhat.com/\",
38
+ :rel => \"external\" %> to get support, find solutions to common questions, and more.</p><h6><%= _(\"Documentation\") %></h6>
39
+ <ul>
40
+ <li><%= link_to _('Complete Product Documentation for Red Hat Satellite'),\"https://access.redhat.com/documentation/en/red_hat_satellite/#{ForemanThemeSatellite::SATELLITE_SHORT_VERSION}\", :rel => \"external\" %></li>
41
+ <li><%= link_to _('API Resources'), apipie_apipie_path, :title => _('Automate Satellite via a simple and powerful API') %></li>
42
+ <li><%= link_to _('Templates DSL'), apipie_dsl_apipie_dsl_path, :title => _('Get DSL reference for templates writing') %></li>
43
+ </ul>
44
+ <h6><%= _(\"Blog\") %></h6>
45
+ <ul>
46
+ <li><%= link_to _('Red Hat Satellite Blog'), \"https://www.redhat.com/en/blog/channel/red-hat-satellite\", :rel => \"external\" %></li>
47
+ </ul>
48
+ <h6><%= _(\"IRC\") %></h6>
49
+ <p><%= (_(\"You can find us on %{liberachat} (irc.libera.chat) in #redhat-satellite.\") % {:liberachat => link_to(\"libera.chat\", \"https://libera.chat\", :rel => \"external\")}).html_safe %></p>
50
+ </div>")
51
+
52
+ Deface::Override.new(:virtual_path => "about/index",
53
+ :name => "add satellite version for about page",
54
+ :insert_before => "p#copyright-p",
55
+ :text => '<p id="sat-copyright-p">Red Hat Satellite <%= (_("(build: %{version})") % {:version => ForemanThemeSatellite::SATELLITE_VERSION}).html_safe %><br/><%= (_("Version %{version} © %{year} Red Hat Inc.") % {:version => ForemanThemeSatellite::SATELLITE_SHORT_VERSION, :year=>DateTime.now.year}).html_safe %></p>')
56
+
57
+ Deface::Override.new(:virtual_path => "about/index",
58
+ :name => "change version text for about page",
59
+ :replace => "p#copyright-p",
60
+ :text => '<p id="copyright-p"><%= (_("Includes %{system} © 2009-%{year} Paul Kelly and Ohad Levy") % {:system => "Foreman", :year => DateTime.now.year}).html_safe %></p>')
61
+
62
+ Deface::Override.new(:virtual_path => "about/index",
63
+ :name => "remove links to upstream plugins",
64
+ :replace => "#plugins table tbody tr td:first-of-type",
65
+ :text => '<td><%= plugin.name %></td>')
66
+
67
+ Deface::Override.new(:virtual_path => "common/500",
68
+ :name => "change 500 page content",
69
+ # p#message
70
+ :replace => "p",
71
+ :text => "<p id=\"message\">
72
+ <%= _(\"If you feel this is an error with Satellite itself, please open a new issue with\") %>
73
+ <%= link_to _(\"Satellite ticketing system\"), \"https://access.redhat.com/support/cases/#/case/new\", :rel => \"external\" %>,
74
+ <% if Foreman::Logging.config[:type] == \"file\" %>
75
+ <%= _(\"Please include in your report the full error log that can be acquired by running: \") %>
76
+ <strong> foreman-rake errors:fetch_log request_id=<%= request_id %></strong>
77
+ <% else %>
78
+ <%= _('Search your logs for request-id') %> <%= request_id %>.
79
+ <%= _('When using external logging, search for request UUID') %> <%= full_request_id %>
80
+ <% end %>
81
+ <%= _(\" and it is highly recommended to also attach the sosreport output.\") %>
82
+ </p>
83
+ ")
@@ -0,0 +1,20 @@
1
+ # Responsible for silently overwriting setting's default value.
2
+ module SettingRegistryBranding
3
+ def branded_settings
4
+ domain = SETTINGS[:domain]
5
+ @branded_settings ||= {
6
+ 'email_reply_address' => "satellite-noreply@#{domain}",
7
+ 'email_subject_prefix' => '[satellite]',
8
+
9
+ 'rss_url' => 'https://www.redhat.com/en/rss/blog/channel/red-hat-satellite',
10
+ 'foreman_tasks_troubleshooting_url' => 'https://access.redhat.com/solutions/satellite6-tasks#%{label}',
11
+ 'bootdisk_allowed_types' => ['subnet','full_host'],
12
+ 'template_sync_commit_msg' => 'Templates export made by a Satellite user'
13
+ }.freeze
14
+ end
15
+
16
+ def _add(name, default:, **rest)
17
+ branded_default = branded_settings.fetch(name.to_s, default)
18
+ super(name, default: branded_default, **rest) unless UpstreamOnlySettings::SETTINGS.include?(name.to_s)
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ForemanThemeSatellite
4
+ module RendererMethods
5
+ extend ActiveSupport::Concern
6
+ extend ApipieDSL::Module
7
+
8
+ apipie :class, 'Macros related to Satellite branding' do
9
+ name 'Foreman Theme Satellite'
10
+ sections only: %w[all jobs]
11
+ end
12
+
13
+ apipie :method, 'Returns a short version of Satellite' do
14
+ desc 'Returns a string representing the short version (X.Y) of Satellite'
15
+ returns String
16
+ example 'product_short_version # => "6.12"'
17
+ end
18
+ def product_short_version
19
+ ForemanThemeSatellite::SATELLITE_SHORT_VERSION
20
+ end
21
+ end
22
+ end
@@ -0,0 +1 @@
1
+ node(:satellite_version) { ForemanThemeSatellite::SATELLITE_VERSION }
@@ -0,0 +1,63 @@
1
+ <% require_relative '../../../lib/foreman_theme_satellite/branded_words' %>
2
+
3
+ var branded_words = []
4
+ <% ForemanThemeSatellite::FOREMAN_BRAND.map do |exp, replace| %>
5
+ branded_words.push([new RegExp("<%= exp.source.gsub('\\', '\\\\\\') %>", "g"), "<%= replace %>"]);
6
+ <% end %>
7
+
8
+ function brand_string(string){
9
+ result = string;
10
+ branded_words.some(function(tuple){
11
+ var regex = tuple[0];
12
+ var value = tuple[1];
13
+
14
+ parts = string.split(regex)
15
+ if (parts.length > 1) {
16
+ parts = parts.map(function(part) {
17
+ return brand_string(part)
18
+ })
19
+ result = parts.join(value)
20
+ }
21
+ return parts.length > 1;
22
+ });
23
+ return result;
24
+ }
25
+
26
+ tfm.i18n.jed.original_dcnp = tfm.i18n.jed.dcnpgettext
27
+
28
+ tfm.i18n.jed.dcnpgettext = function( domain, context, singular_key, plural_key, val ) {
29
+ translated = tfm.i18n.jed.original_dcnp( domain, context, singular_key, plural_key, val );
30
+
31
+ return brand_string(translated);
32
+ }
33
+
34
+ if (typeof(angular) !== 'undefined') {
35
+ angular.module('Bastion.i18n').config([ '$provide', function($provide) {
36
+ $provide.decorator('translate', [
37
+ '$delegate',
38
+ function ($delegate) {
39
+ var originalTranslate = $delegate;
40
+ return function(str) {
41
+ originalStr = originalTranslate(str);
42
+ return brand_string(originalStr);
43
+ }
44
+ }
45
+ ]);
46
+ }]);
47
+ }
48
+
49
+ if (typeof(angular) !== 'undefined') {
50
+ angular.module('gettext').config([ '$provide', function($provide) {
51
+ $provide.decorator('gettextCatalog', [
52
+ '$delegate',
53
+ function ($delegate) {
54
+ var originalTranslate = $delegate.getString;
55
+ $delegate.getString = function(str) {
56
+ originalStr = originalTranslate.apply($delegate, [str]);
57
+ return brand_string(originalStr);
58
+ }
59
+ return $delegate;
60
+ }
61
+ ]);
62
+ }]);
63
+ }
@@ -0,0 +1,8 @@
1
+ <div class="clearfix">
2
+ <div class="form-group ">
3
+ <label class="col-md-2 control-label">&nbsp;</label>
4
+ <div class="col-md-8">
5
+ <%= rhev_deprecation_alert %>
6
+ </div>
7
+ </div>
8
+ </div>
@@ -0,0 +1,6 @@
1
+ <tr>
2
+ <td>&nbsp;</td>
3
+ <td colspan="2">
4
+ <%= rhev_deprecation_alert %>
5
+ </td>
6
+ </tr>
@@ -0,0 +1,8 @@
1
+ class RemoveSatelliteFromNotificationName < ActiveRecord::Migration[4.2]
2
+ def up
3
+ # historical placeholder
4
+ # only required on setups before https://projects.theforeman.org/issues/14459
5
+ # we can safely assume that fresh installs have the above change already
6
+ # and existing install had this migration applied back in 2016
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ class RemoveSatelliteFromNotificationNameSpellCorrection < ActiveRecord::Migration[4.2]
2
+ class FakeMailNotification < ActiveRecord::Base
3
+ self.table_name = 'mail_notifications'
4
+
5
+ has_many :user_mail_notifications, :dependent => :destroy, :class_name => 'FakeUserMailNotification', :foreign_key => 'mail_notification_id'
6
+ end
7
+
8
+ class FakeUserMailNotification < ActiveRecord::Base
9
+ self.table_name = 'user_mail_notifications'
10
+ end
11
+
12
+ def up
13
+ sync_errata_notification = FakeMailNotification.where(name: 'sync_errata').first
14
+ satellite_sync_errata_notification = FakeMailNotification.where(name: 'satellite_sync_errata').first
15
+
16
+ if sync_errata_notification && satellite_sync_errata_notification && FakeUserMailNotification.where(:mail_notification_id => sync_errata_notification.id).empty?
17
+ satellite_sync_errata_notification.user_mail_notifications.each do |user_mail_notification|
18
+ FakeUserMailNotification.create(:user_id => user_mail_notification.user_id, :mail_notification_id => sync_errata_notification.id)
19
+ end
20
+ end
21
+
22
+ satellite_sync_errata_notification.destroy if satellite_sync_errata_notification.present?
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ class UpdateIdmParams < ActiveRecord::Migration[5.1]
2
+ def up
3
+ Parameter.unscoped.where("name like 'idm_%'").each do |param|
4
+ param.name.gsub!('idm_', 'freeipa_')
5
+ param.without_auditing do
6
+ param.save!(:validate => false)
7
+ end
8
+ end
9
+ end
10
+
11
+ def down
12
+ Parameter.unscoped.where("name like 'freeipa_%'").each do |param|
13
+ param.name.gsub!('freeipa_', 'idm_')
14
+ param.without_auditing do
15
+ param.save!(:validate => false)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,52 @@
1
+ require_relative '../../lib/foreman_theme_satellite/deprecated_templates'
2
+
3
+ class DeprecateSatelliteTemplates < ActiveRecord::Migration[5.1]
4
+ def up
5
+ ForemanThemeSatellite::DEPRECATED_TEMPLATES.each do |old_name, new_name|
6
+ old_template = ProvisioningTemplate.unscoped.find_by(name: old_name)
7
+ new_template = ProvisioningTemplate.unscoped.find_by(name: new_name)
8
+
9
+ next unless old_template
10
+ old_template.name = 'DEPRECATED ' + old_name
11
+
12
+ if new_template
13
+ copy_os_default_associations(old_template, new_template)
14
+ copy_template_combinations(old_template, new_template)
15
+ copy_operatingsystems(old_template, new_template)
16
+ new_template.without_auditing do
17
+ new_template.save!
18
+ end
19
+ else
20
+ # prepare for seeding the template
21
+ remove_old_audits(new_name)
22
+ end
23
+
24
+ old_template.save!
25
+ end
26
+ end
27
+
28
+ def remove_old_audits(destination)
29
+ Audit.where(:auditable_type => 'ProvisioningTemplate', :auditable_name => destination).delete_all
30
+ end
31
+
32
+ def copy_os_default_associations(source, destination)
33
+ source.os_default_templates.update_all(provisioning_template_id: destination.id)
34
+ destination.reload
35
+ end
36
+
37
+ def copy_template_combinations(source, destination)
38
+ dest_associations = destination.template_combinations.all
39
+ source.template_combinations.each do |old|
40
+ next if dest_associations.select { |assoc| assoc.environment_id = old.environment_id && assoc.hostgroup_id == old.hostgroup_id }.any?
41
+
42
+ destination.template_combinations.build(
43
+ environment_id: old.environment_id,
44
+ hostgroup_id: old.hostgroup_id
45
+ )
46
+ end
47
+ end
48
+
49
+ def copy_operatingsystems(source, destination)
50
+ destination.operatingsystem_ids = (destination.operatingsystem_ids + source.operatingsystem_ids).uniq
51
+ end
52
+ end
@@ -0,0 +1,13 @@
1
+ class ChangeBlogUrl < ActiveRecord::Migration[5.1]
2
+ def up
3
+ if Setting[:rss_url] == 'https://access.redhat.com/blogs/1169563/feed'
4
+ Setting[:rss_url] = 'https://www.redhat.com/en/rss/blog/channel/red-hat-satellite'
5
+ end
6
+ end
7
+
8
+ def down
9
+ if Setting[:rss_url] == 'https://www.redhat.com/en/rss/blog/channel/red-hat-satellite'
10
+ Setting[:rss_url] = 'https://access.redhat.com/blogs/1169563/feed'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class InsightsParam < ActiveRecord::Migration[6.0]
2
+ def up
3
+ CommonParameter.reset_column_information
4
+
5
+ param = CommonParameter.find_or_initialize_by(name: 'host_registration_insights', key_type: 'boolean')
6
+ param.value = true
7
+ param.save
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ require_relative '../migrate/20180605150932_deprecate_satellite_templates'
2
+
3
+ module ProvisioningTemplateSeedExtensions
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ after_create :move_deprecated_defaults
8
+ end
9
+
10
+ def move_deprecated_defaults
11
+ return unless (old_name = ForemanThemeSatellite::DEPRECATED_TEMPLATES.key(name))
12
+
13
+ old_template = ProvisioningTemplate.unscoped.find_by(name: 'DEPRECATED ' + old_name)
14
+ return unless old_template
15
+ old_template.os_default_templates.update_all(provisioning_template_id: id)
16
+
17
+ migration = DeprecateSatelliteTemplates.new
18
+ migration.copy_template_combinations(old_template, self)
19
+ migration.copy_operatingsystems(old_template, self)
20
+ save!
21
+ end
22
+ end
23
+
24
+ ProvisioningTemplate.include ProvisioningTemplateSeedExtensions
@@ -0,0 +1,15 @@
1
+ class CommonParameterSeedHelper
2
+ def self.set_default_global_parameter(name, value)
3
+ param = CommonParameter.find_by_name(name)
4
+ if param.nil?
5
+ CommonParameter.create!(:name => name, :value => value)
6
+ end
7
+ end
8
+ end
9
+
10
+ CommonParameter.without_auditing do
11
+ CommonParameter.skip_permission_check do
12
+ CommonParameterSeedHelper.set_default_global_parameter('enable-epel', 'false')
13
+ CommonParameterSeedHelper.set_default_global_parameter('enable-puppet5', 'true')
14
+ end
15
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ForemanThemeSatellite
4
+ # This list is used for substitution of branded words by both client and server.
5
+ # The server just uses the list as is.
6
+ # The client is consuming it by generated .js.erb file: app/assets/javascripts/theme_client_side_branding.js.erb.
7
+ # For now, modifiers are not supported by the generator.
8
+ # Make sure the regexp works both with Ruby and JavaScript.
9
+ # Entries are processed in order and first wins.
10
+ FOREMAN_BRAND = {
11
+ /%{proxy}/ => '%{proxy}',
12
+ /%{foreman}/ => '%{foreman}',
13
+ /\b[Hh][Tt][Tt][Pp] [Pp]roxy\b(?!-)/ => 'HTTP Proxy',
14
+ /\b[Hh][Tt][Tt][Pp] [Pp]roxies\b(?!-)/ => 'HTTP Proxies',
15
+ /\bHTTP\(S\) proxy\b(?!-)/ => 'HTTP(S) proxy',
16
+ /\bIgnore Proxy\b(?!-)/ => 'Ignore Proxy',
17
+ /\bIgnore proxy\b(?!-)/ => 'Ignore Proxy',
18
+ /\bSystem-wide proxies\b(?!-)/ => 'System-wide proxies',
19
+ /\bLeave this blank if no proxy is used\b(?!-)/ => 'Leave this blank if no proxy is used',
20
+ /\bbypass proxy settings\b(?!-)/ => 'bypass proxy settings',
21
+ /\bURL of the proxy\b(?!-)/ => 'URL of the proxy',
22
+ %r{\bhttps://proxy.example.com:8080\b(?!-)} => 'https://proxy.example.com:8080',
23
+ /\bproxy for all outgoing HTTP connections\b(?!-)/ => 'proxy for all outgoing HTTP connections',
24
+ /\bperform various actions through those proxies\b(?!-)/ => 'perform various actions through those proxies',
25
+ /\bForeman\b(?!-)/ => 'Satellite',
26
+ /\bforeman\b(?!-)/ => 'satellite',
27
+ /\bsmart-proxy\b(?!-)/ => 'capsule',
28
+ /\bSmart-proxy\b(?!-)/ => 'Capsule',
29
+ /\bsmart proxies\b(?!-)/ => 'capsules',
30
+ /\bSmart proxies\b(?!-)/ => 'Capsules',
31
+ /\bsmart-proxies\b(?!-)/ => 'capsules',
32
+ /\bSmart-proxies\b(?!-)/ => 'Capsules',
33
+ /\bSmart Proxies\b(?!-)/ => 'Capsules',
34
+ /\bSmart Proxy\(ies\)(?!-)/ => 'Capsule(s)',
35
+ /\bSmart Proxy\b(?!-)/ => 'Capsule',
36
+ /\bsmart proxy\b(?!-)/ => 'capsule',
37
+ /\bSmart-Proxies\b(?!-)/ => 'Capsules',
38
+ /\bSmart proxy\b(?!-)/ => 'Capsule',
39
+ /\bSmart-Proxy\b(?!-)/ => 'Capsule',
40
+ /\boVirt\b(?!-)/ => 'RHEV',
41
+ /\bovirt\b(?!-)/ => 'RHEV',
42
+ /\bOvirt\b(?!-)/ => 'RHEV',
43
+ /\bFreeIPA\b(?!-)/ => 'Red Hat Identity Management',
44
+ /\bOpenStack\b(?!-)/ => 'RHEL OpenStack Platform',
45
+ /\bopenstack\b(?!-)/ => 'RHEL OpenStack Platform',
46
+ /\bOpenstack\b(?!-)/ => 'RHEL OpenStack Platform',
47
+ /\bProxy\b(?!-)/ => 'Capsule',
48
+ /\bproxy\b(?!-)/ => 'Capsule',
49
+ /\bProxies\b(?!-)/ => 'Capsules',
50
+ /\bproxies\b(?!-)/ => 'Capsules',
51
+ /\b[Kk]atello 4.0\b(?!-)/ => 'Satellite 6.11',
52
+ /\b[Kk]atello 4.10\b(?!-)/ => 'Satellite 6.15',
53
+ /\b[Kk]atello 4.11\b(?!-)/ => 'Satellite 6.15',
54
+ /\b[Kk]atello 4.12\b(?!-)/ => 'Satellite 6.16',
55
+ /\b[Kk]atello 4.13\b(?!-)/ => 'Satellite 6.16',
56
+ %r{https://theforeman.org/plugins/katello/(?!-)} => "https://access.redhat.com/documentation/en-us/red_hat_satellite/#{ForemanThemeSatellite::SATELLITE_SHORT_VERSION}/html/managing_hosts/registering_hosts#registering-a-host-to-satellite-using-the-bootstrap-script"
57
+ }.freeze
58
+ end
@@ -0,0 +1,9 @@
1
+ module ForemanThemeSatellite
2
+ DEPRECATED_TEMPLATES = {
3
+ 'Satellite Kickstart Default' => 'Kickstart default',
4
+ 'Satellite Kickstart Default User Data' => 'Kickstart default user data',
5
+ 'Satellite Kickstart Default Finish' => 'Kickstart default finish',
6
+ 'idm_register' => 'freeipa_register',
7
+ 'Satellite Atomic Kickstart Default' => 'Atomic Kickstart default'
8
+ }.freeze
9
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Metrics/LineLength
4
+ module ForemanThemeSatellite
5
+ module Documentation
6
+ USER_GUIDE_DICTIONARY = {
7
+ # Ansible
8
+ 'ImportingRoles' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_ansible_integration_in_red_hat_satellite/getting_started_with_ansible_in_satellite_ansible#Importing_Ansible_Roles_and_Variables_ansible",
9
+ 'Variables' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_ansible_integration_in_red_hat_satellite/getting_started_with_ansible_in_satellite_ansible#Overriding_Ansible_Variables_in_satellite_ansible",
10
+
11
+ # Managing Hosts
12
+ 'ForemanRemoteExecution' => "#{ForemanThemeSatellite.documentation_root}/managing_hosts/configuring_and_setting_up_remote_jobs_managing-hosts",
13
+ 'ExecutingaJob' => "#{ForemanThemeSatellite.documentation_root}/managing_hosts/configuring_and_setting_up_remote_jobs_managing-hosts#configuring-the-global-smartproxy-remote-execution-setting_managing-hosts",
14
+ 'JobTemplates' => "#{ForemanThemeSatellite.documentation_root}/managing_hosts/configuring_and_setting_up_remote_jobs_managing-hosts#setting-up-job-templates_managing-hosts",
15
+ 'ReportTemplates' => "#{ForemanThemeSatellite.documentation_root}/managing_hosts/using_report_templates_to_monitor_hosts_managing-hosts",
16
+ 'Reports' => "#{ForemanThemeSatellite.documentation_root}/managing_hosts/using_report_templates_to_monitor_hosts_managing-hosts",
17
+
18
+ # Provisioning Hosts
19
+ 'Architectures' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#creating-architectures_provisioning",
20
+ 'Provisioning' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/",
21
+ 'InstallationMedia' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#adding-installation-media_provisioning",
22
+ 'PartitionTables' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#creating-partition-tables_provisioning",
23
+ 'ProvisioningTemplates' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#provisioning-templates_provisioning",
24
+ 'OperatingSystems' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#creating-operating-systems_provisioning",
25
+ 'UsingComputeProfiles' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#creating-compute-profiles_provisioning",
26
+ 'ComputeResources' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/",
27
+ 'NoVNC' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_provisioning_resources_provisioning#using-novnc-to-access-virtual-machines_provisioning",
28
+ 'VMwareNotes' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_virtual_machines_in_vmware_vmware-provisioning",
29
+ 'RHEVNotes' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_virtual_machines_on_ovirt_rhv-provisioning",
30
+ 'OpenStackNotes' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_cloud_instances_openstack_openstack-provisioning",
31
+ 'LibvirtNote' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_virtual_machines_on_kvm_kvm-provisioning",
32
+ 'EC2' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_cloud_instances_in_amazon_ec2_ec2-provisioning",
33
+ 'GoogleComputeEngineNotes' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_cloud_instances_on_google_compute_engine_gce-provisioning",
34
+ 'Networking' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_networking_provisioning#Adding_a_Subnet_to_Server_provisioning",
35
+
36
+ # Puppet Guide
37
+ 'FactsandtheENC' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_puppet_integration_in_red_hat_satellite/introducing-configuration-management-using-puppet_managing-configurations-puppet#performing-configuration-management_managing-configurations-puppet",
38
+ 'using-config-groups' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_puppet_integration_in_red_hat_satellite/creating-a-puppet-config-group_managing-configurations-puppet",
39
+ 'SmartMatchers' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_puppet_integration_in_red_hat_satellite/configuring_puppet_smart_class_parameters_managing-configurations-puppet",
40
+ 'Parameters' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_puppet_integration_in_red_hat_satellite/configuring_puppet_smart_class_parameters_managing-configurations-puppet",
41
+ 'Classes' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_puppet_integration_in_red_hat_satellite/importing_puppet_classes_and_environments_managing-configurations-puppet",
42
+ 'Environments' => "#{ForemanThemeSatellite.documentation_root}/managing_configurations_using_puppet_integration_in_red_hat_satellite/creating_a_custom_puppet_environment_managing-configurations-puppet",
43
+
44
+ # Administering
45
+ 'ConfigurationOptions' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/",
46
+ 'PuppetReports' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/monitoring_resources_admin#Using_the_Project_Content_Dashboard_admin",
47
+ 'Mail_Notifications' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/configuring_email_notifications_admin",
48
+ 'Realm' => "#{ForemanThemeSatellite.documentation_root}/installing_satellite_server_in_a_connected_network_environment/configuring_external_authentication_satellite#External_Authentication_for_Provisioned_Hosts_satellite",
49
+ 'Searching' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/searching_and_bookmarking_admin",
50
+ 'RolesandPermissions' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/managing_users_and_roles_admin",
51
+ 'LDAPAuthentication' => "#{ForemanThemeSatellite.documentation_root}/installing_satellite_server_in_a_connected_network_environment/configuring_external_authentication_satellite#Using_LDAP_satellite",
52
+ 'Bookmarks' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/searching_and_bookmarking_admin",
53
+ 'Policydeploymentoptions' => "#{ForemanThemeSatellite.documentation_root}/managing_security_compliance#Managing_Compliance_Policies_security-compliance",
54
+ 'CreatingSCAPcontent' => "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite/managing_security_compliance_admin#running-a-security-compliance-scan-on-demand_admin",
55
+
56
+ # Planning
57
+ 'SmartProxies' => "#{ForemanThemeSatellite.documentation_root}/satellite_overview_concepts_and_deployment_considerations/chap-documentation-architecture_guide-capsule_server_overview",
58
+ 'Auditing' => "#{ForemanThemeSatellite.documentation_root}/satellite_overview_concepts_and_deployment_considerations/appe-architecture_guide-glossary_of_terms#varl-Glossary_of_Terms-Audits",
59
+
60
+ # Install
61
+ 'HTTP(S)Proxy' => "#{ForemanThemeSatellite.documentation_root}//installing_satellite_server_in_a_connected_network_environment/performing-additional-configuration#Configuring_Server_with_an_HTTP_Proxy_satellite",
62
+
63
+ # Misc
64
+ 'GettingHelp' => "https://access.redhat.com/products/red-hat-satellite/#support",
65
+ }.freeze
66
+
67
+ PLUGINS_DOCUMENTATION = {
68
+ 'foreman_azure' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/provisioning_cloud_instances_on_microsoft_azure_resource_manager_azure-provisioning",
69
+ 'foreman_discovery' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/configuring_the_discovery_service_provisioning",
70
+ }.freeze
71
+
72
+ SPECIAL_LINKS = [
73
+ [/docs\.theforeman\.org\/.*?\/Managing_Hosts\/.*?registering-a-host.*?managing-hosts/i, "#{ForemanThemeSatellite.documentation_root}/managing_hosts/registering_hosts_to_server_managing-hosts#Registering_Hosts_managing-hosts"],
74
+ ]
75
+ end
76
+ end