xolo-server 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52595d7268e2f989402fd60e3c8c992b993a1342d4a5f4436953a025493d2409
4
- data.tar.gz: 39ecea967112210302c3242d7c0f9f53da34ffa8a803c71cf4edced97b26113a
3
+ metadata.gz: 6b12ee4495ec1ef8ad6ff15963a47b8c5c960fbfc66c447355d9205a821945d5
4
+ data.tar.gz: b5223966d5f2d32298cbd74fceb3bc9bd86377249f05cf7ff0cdcee7d892a0ef
5
5
  SHA512:
6
- metadata.gz: be740aa47014789519e5d167bda8fa19d517331945c6e5520403e59643620cf660a09f142031e65e385a254b427362b9e78c459dfde20b1ecf3c0835e6fc030b
7
- data.tar.gz: 7c4792d23e49b5d486c3f24aab9b51d35f510d303597d5d1ce84b7eb5dfb4723a5bf07b357d1429b6c99c0d85737df75c04b3cd6f70967277088faa40db76145
6
+ metadata.gz: 6891dc7666891af24efb6c3b2842154dedc0fb94652203ac7cdbce21b2f5cbf38e69dbbd54630f7c5c4f5dabdc3b717ade26c26ce1fcfbb94fc318669a2704c7
7
+ data.tar.gz: faf5eb9e5a6ce4e63989070bece99e9916fe44fe14a40d6e25a04a16ddeabd5d45641cf6cce380827fa0d06901bccfc345a99ea5983b2f2509223eaf816467b6
@@ -759,7 +759,7 @@ module Xolo
759
759
 
760
760
  By default this is false, Patch Policies for versions will be set to 'Install Automatically'.
761
761
 
762
- If set to true, Patch Policies for versions will be set to 'Make Available in Self Service' and the version will appear in the Updates section when available. The update won't happen until the user clicks a button, or the 7-day deadline passes. Notifications will be displayed daily.
762
+ If set to true, Patch Policies for versions will be set to 'Make Available in Self Service' and the version will appear in the Updates section when available. The update won't happen until the user clicks a button, or the 7-day deadline passes. Notifications will be displayed daily. For these titles, 'xolo update' will not apply the update, but 'xolo install <title>' will update/install the current release.
763
763
 
764
764
  When installing automatically, or the deadline passes, the update will happen at the checkin after the next recon. If the version has any KillApps, the user will be prompted to quit them, with a grace period of 15 minutes before the update starts.
765
765
 
@@ -12,7 +12,7 @@ module Xolo
12
12
 
13
13
  module Version
14
14
 
15
- VERSION = '2.2.2'.freeze
15
+ VERSION = '2.2.3'.freeze
16
16
 
17
17
  end
18
18
 
@@ -160,15 +160,24 @@ module Xolo
160
160
  #
161
161
  # This process is protected by a mutex to prevent multiple updates at the same time.
162
162
  #
163
+ # @param post_maint [Boolean] Are we being called at the end of the run_maint method?
164
+ #
163
165
  # @return [void]
164
166
  #####################
165
- def update_client_data
167
+ def update_client_data(post_maint: false)
166
168
  # don't do anything if we are in developer/test mode
167
169
  if Xolo::Server.config.developer_mode?
168
170
  log_debug 'Jamf: Skipping client-data update in developer mode'
169
171
  return
170
172
  end
171
173
 
174
+ # don't do anything if maintenance is running,
175
+ # the main process will call this method once at the end
176
+ if Xolo::Server::Helpers::Maintenance.maint_running? && !post_maint
177
+ log_debug 'Jamf: Skipping client-data update while maintenance is running'
178
+ return
179
+ end
180
+
172
181
  log_info 'Jamf: Updating client-data package'
173
182
 
174
183
  # TODO: Use Concurrent Ruby instead of Mutex
@@ -123,6 +123,12 @@ module Xolo
123
123
  @last_maint = time
124
124
  end
125
125
 
126
+ # @return [Time] Is maintenance running right now? true if the mutex is locked
127
+ ######################################
128
+ def self.maint_running?
129
+ maint_mutex.locked?
130
+ end
131
+
126
132
  # post to the server to start the maint process
127
133
  # This is done so that the maint can run in the context of a request,
128
134
  # having access to Title and Version instantiation.
@@ -136,12 +142,14 @@ module Xolo
136
142
  return
137
143
  end
138
144
 
145
+ now = Time.now
146
+
139
147
  # only run the maintenance if it's during the MAINT_HOUR
140
148
  # and the last one was more than MAINT_MAX_FREQ_SECS ago
141
149
  if force
142
150
  Xolo::Server.logger.info 'Maint: Starting now due to force'
143
151
 
144
- elsif Time.now.hour == MAINT_HOUR && (Time.now - last_maint) > MAINT_MAX_FREQ_SECS
152
+ elsif now.hour == MAINT_HOUR && (now - last_maint) > MAINT_MAX_FREQ_SECS
145
153
  Xolo::Server.logger.info 'Maint: Starting nightly run now'
146
154
 
147
155
  else
@@ -179,19 +187,25 @@ module Xolo
179
187
  return
180
188
  end
181
189
  mutex.lock
190
+
182
191
  log_info 'Maint: starting'
183
192
 
184
193
  # instantiate all the titles once now, rather than in all the task methods
185
- title_objects_for_maint = Xolo::Server::Title.all_titles.map { |t| instantiate_title t }
194
+ title_objects_for_maint = all_title_objects refresh: true
186
195
 
187
196
  # add new maintenance tasks/methods here
197
+ ######
188
198
  accept_title_editor_eas title_objects_for_maint
189
199
  auto_release_versions title_objects_for_maint
190
200
  cleanup_versions title_objects_for_maint
191
201
  notify_admins_of_unreleased_pilots title_objects_for_maint
192
202
 
203
+ # make note of the time.
193
204
  Xolo::Server::Helpers::Maintenance.last_maint = Time.now
194
205
  log_info 'Maint: complete'
206
+
207
+ log_debug 'Maint: running update_client_data after all tasks'
208
+ update_client_data post_maint: true
195
209
  ensure
196
210
  mutex&.unlock
197
211
  end
@@ -279,6 +293,9 @@ module Xolo
279
293
  title_obj.release vobj_to_release.version
280
294
 
281
295
  log_info "Maint: Auto-released version '#{vobj_to_release.version}' of '#{title}' which came out #{vobj_to_release.creation_date}", alert: true
296
+
297
+ # pause for server to catch up
298
+ sleep 60
282
299
  end # each title
283
300
 
284
301
  log_debug 'Maint: Done auto-releasing'
@@ -1716,7 +1716,9 @@ module Xolo
1716
1716
  def add_title_to_self_service(pol = nil)
1717
1717
  pol ||= jamf_manual_install_released_policy
1718
1718
 
1719
- unless pol.in_self_service?
1719
+ if pol.in_self_service?
1720
+ progress "Jamf: Manual Install Policy '#{pol.name}' already in Self Service."
1721
+ else
1720
1722
  msg = "Jamf: Adding Manual Install Policy '#{pol.name}' to Self Service."
1721
1723
  progress msg, log: :info
1722
1724
  pol.add_to_self_service
@@ -939,14 +939,22 @@ module Xolo
939
939
  # explicit false
940
940
  ppol.patch_unknown = patch_unknown ? true : false
941
941
 
942
+ # Patch Pol. Scope Targets:
942
943
  # when first creating a patch policy, its status is always
943
944
  # 'pilot' so the scope targets are the pilot groups, if any.
945
+ #
944
946
  # When the version is released, the patch policy will be
945
- # rescoped to all targets (limited by eligibility)
946
- if pilot?
947
+ # rescoped to all computers (limited by eligibility)
948
+ #
949
+ # Any other state should have no scope targets
950
+ if pilot? || creating?
947
951
  set_policy_pilot_groups ppol
948
- else
952
+ elsif released? || releasing?
953
+ log_debug "Setting Patch Policy Scope for Version '#{version}' of Title '#{title}' to all comptuers, for release"
949
954
  ppol.scope.set_all_targets
955
+ else
956
+ log_debug "Setting Patch Policy Scope for Version '#{version}' of Title '#{title}' to no targets: not in pilot or released"
957
+ ppol.scope.set_targets :computer_groups, []
950
958
  end
951
959
 
952
960
  # exclusions are for always
@@ -1016,9 +1024,11 @@ module Xolo
1016
1024
  ppol.self_service_reminder_frequency = PATCH_POL_SSVC_REMINDER_FREQ_HRS
1017
1025
  ppol.deadline = PATCH_POL_SSVC_DEADLINE_DAYS
1018
1026
 
1019
- return unless title_object.ssvc_icon_id
1027
+ icon_id =
1028
+ title_object.ssvc_icon_id || title_object.jamf_manual_install_released_policy.self_service_icon.id
1029
+ return unless icon_id
1020
1030
 
1021
- set_patch_policy_ssvc_icon ppol, title_object.ssvc_icon_id
1031
+ set_patch_policy_ssvc_icon ppol, icon_id
1022
1032
 
1023
1033
  # Automatic deployment
1024
1034
  else
@@ -1130,6 +1130,7 @@ module Xolo
1130
1130
  repair_ted_title
1131
1131
  set_subscribed_display_name_and_publisher
1132
1132
  repair_jamf_title_objects
1133
+ self.ssvc_icon_id = jamf_manual_install_released_policy.self_service_icon.id
1133
1134
  save_local_data
1134
1135
  return unless repair_versions
1135
1136
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xolo-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lasell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-15 00:00:00.000000000 Z
11
+ date: 2026-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday