xolo-server 1.0.1 → 2.0.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 +4 -4
- data/data/client/xolo +182 -82
- data/lib/xolo/core/base_classes/title.rb +261 -20
- data/lib/xolo/core/base_classes/version.rb +53 -8
- data/lib/xolo/core/constants.rb +7 -3
- data/lib/xolo/core/security_cmd.rb +128 -0
- data/lib/xolo/core/version.rb +1 -1
- data/lib/xolo/core.rb +1 -0
- data/lib/xolo/server/app.rb +7 -0
- data/lib/xolo/server/configuration.rb +243 -37
- data/lib/xolo/server/constants.rb +10 -0
- data/lib/xolo/server/helpers/auth.rb +19 -2
- data/lib/xolo/server/helpers/autopkg.rb +170 -0
- data/lib/xolo/server/helpers/client_data.rb +91 -61
- data/lib/xolo/server/helpers/file_transfers.rb +412 -82
- data/lib/xolo/server/helpers/jamf_pro.rb +30 -7
- data/lib/xolo/server/helpers/log.rb +2 -0
- data/lib/xolo/server/helpers/maintenance.rb +1 -0
- data/lib/xolo/server/helpers/notification.rb +4 -3
- data/lib/xolo/server/helpers/pkg_signing.rb +16 -12
- data/lib/xolo/server/helpers/progress_streaming.rb +9 -12
- data/lib/xolo/server/helpers/subscriptions.rb +119 -0
- data/lib/xolo/server/helpers/titles.rb +27 -3
- data/lib/xolo/server/helpers/versions.rb +23 -11
- data/lib/xolo/server/mixins/changelog.rb +9 -16
- data/lib/xolo/server/mixins/title_jamf_access.rb +395 -383
- data/lib/xolo/server/mixins/title_ted_access.rb +29 -3
- data/lib/xolo/server/mixins/version_jamf_access.rb +185 -159
- data/lib/xolo/server/mixins/version_ted_access.rb +25 -0
- data/lib/xolo/server/object_locks.rb +2 -1
- data/lib/xolo/server/routes/auth.rb +2 -2
- data/lib/xolo/server/routes/jamf_pro.rb +11 -1
- data/lib/xolo/server/routes/maint.rb +2 -1
- data/lib/xolo/server/routes/subscriptions.rb +126 -0
- data/lib/xolo/server/routes/title_editor.rb +1 -1
- data/lib/xolo/server/routes/titles.rb +30 -17
- data/lib/xolo/server/routes/uploads.rb +0 -14
- data/lib/xolo/server/routes/versions.rb +22 -17
- data/lib/xolo/server/routes.rb +9 -0
- data/lib/xolo/server/title.rb +107 -78
- data/lib/xolo/server/tmp_overrides.rb +38 -0
- data/lib/xolo/server/version.rb +193 -15
- data/lib/xolo/server.rb +12 -0
- metadata +8 -9
|
@@ -74,6 +74,10 @@ module Xolo
|
|
|
74
74
|
# - immutable: [Boolean] This value can only be set when creatimg a new title.
|
|
75
75
|
# When editing an existing title, it cannot be changed.
|
|
76
76
|
#
|
|
77
|
+
# - title_type: [Symbol, nil] If set to :managed or :subscribed, this option
|
|
78
|
+
# is required, and only available, when the title is of that type. If nil or not set,
|
|
79
|
+
# the option is available for all title types.
|
|
80
|
+
#
|
|
77
81
|
# - cli: [Symbol, false] What is the 'short' option flag for this option?
|
|
78
82
|
# The long option flag is the key, preceded with '--' and with underscores
|
|
79
83
|
# changed to '-', so display_name is set using the cli option '--display-name'.
|
|
@@ -146,6 +150,12 @@ module Xolo
|
|
|
146
150
|
# - read_only: [Boolean] defaults to false. When true, the server maintains this value, and
|
|
147
151
|
# its only readable via xadm.
|
|
148
152
|
#
|
|
153
|
+
# - add_only: [Boolean] This option is only used when creating a new title, it is not
|
|
154
|
+
# available when editing an existing title.
|
|
155
|
+
#
|
|
156
|
+
# - edit_only: [Boolean] This option is only used when editing an existing title, it is not
|
|
157
|
+
# available when creating a new title.
|
|
158
|
+
#
|
|
149
159
|
# - hide_from_info: [Boolean] when true, do not show this attribute in the 'info' xadm output
|
|
150
160
|
# NOTE: it will still be available when --json is given with the info command.
|
|
151
161
|
#
|
|
@@ -172,20 +182,40 @@ module Xolo
|
|
|
172
182
|
ENDDESC
|
|
173
183
|
},
|
|
174
184
|
|
|
175
|
-
# @!attribute
|
|
176
|
-
# @return [
|
|
177
|
-
|
|
178
|
-
label: '
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
validate: :
|
|
184
|
-
|
|
185
|
+
# @!attribute subscribed
|
|
186
|
+
# @return [Boolean] is this title subscribed via a Jamf Patch Source?
|
|
187
|
+
subscribed: {
|
|
188
|
+
label: 'Subscribed?',
|
|
189
|
+
cli: :B,
|
|
190
|
+
type: :boolean,
|
|
191
|
+
immutable: true,
|
|
192
|
+
add_only: true,
|
|
193
|
+
validate: :validate_boolean,
|
|
194
|
+
default: false,
|
|
185
195
|
changelog: true,
|
|
186
196
|
desc: <<~ENDDESC
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
Is this title subscribed via a Jamf Patch Source? If not, it is managed by Xolo. By default titles are managed. Once created, titles cannot be changed between managed and subscribed.
|
|
198
|
+
|
|
199
|
+
Managed titles have their entire definition, versions and updates managed by Xolo; xadm is used to provide basic details about the title, such as a the display name, publisher, the mechanism by which Jamf Pro knows which version is installed on a Mac. Versions of managed titles are also added and maintained via xadm, setting values such as killapps, OS restrictions, and so on.
|
|
200
|
+
|
|
201
|
+
Subscribed titles and their version definitions are maintained by a Patch Source configrued in Jamf Pro. The source defines some aspects of the title and its versions, including the display name, publisher, and mechanism for determining installed versions. New versions are also managed by the Patch Source, including killapps, OS restrictions, and other settings. When they appear, Xolo will at least inform someone (notify the contact email) that a new version is available and needs a .pkg, but can also use autopkg to automatically fetch .pkgs and add new versions for piloting.
|
|
202
|
+
|
|
203
|
+
When a title is subscribed, these options are required:
|
|
204
|
+
--patch-source
|
|
205
|
+
--title-id
|
|
206
|
+
|
|
207
|
+
and these are not available, since the patch source manages them:
|
|
208
|
+
--display-name
|
|
209
|
+
--publisher
|
|
210
|
+
--app-name
|
|
211
|
+
--app-bundle-id
|
|
212
|
+
--version-script
|
|
213
|
+
|
|
214
|
+
When a subscribed title is added, a Xolo Version is automatically added for the most recent version available from the Patch Source.
|
|
215
|
+
|
|
216
|
+
Once created as subscribed or managed, a title cannot be changed to the other type. If you need to change the type, you must delete and re-create the title. Also once created, the patch source and title id for a subscribed title cannot be changed.
|
|
217
|
+
|
|
218
|
+
In all cases, a .pkg must be provided for each version known to Xolo, either by uploading it via xadm or configuring the server and the title to use AutoPkg to acquire it.
|
|
189
219
|
ENDDESC
|
|
190
220
|
},
|
|
191
221
|
|
|
@@ -202,12 +232,12 @@ module Xolo
|
|
|
202
232
|
invalid_msg: <<~ENDINV,
|
|
203
233
|
Not a valid description, must be at least #{MIN_TITLE_DESC_LENGTH} characters.
|
|
204
234
|
|
|
205
|
-
Provide a useful dscription of what the software does, URLs, developer names, etc.
|
|
235
|
+
Provide a useful dscription of what the software does, why it's in Xolo, URLs, developer names, etc.
|
|
206
236
|
|
|
207
237
|
DO NOT USE, e.g. 'Installs Some App', because we know that already and it isn't helpful.
|
|
208
238
|
ENDINV
|
|
209
239
|
desc: <<~ENDDESC
|
|
210
|
-
A useful dscription of what the software installed by this title does. You can also include URLs, developer names, support info, etc.
|
|
240
|
+
A useful dscription of what the software installed by this title does or why it's in Xolo. You can also include URLs, developer names, support info, etc.
|
|
211
241
|
|
|
212
242
|
DO NOT use, e.g. 'Installs Some App', because we know that already and it isn't helpful.
|
|
213
243
|
|
|
@@ -217,19 +247,44 @@ module Xolo
|
|
|
217
247
|
ENDDESC
|
|
218
248
|
},
|
|
219
249
|
|
|
250
|
+
# @!attribute display_name
|
|
251
|
+
# @return [String] The display-name for this title
|
|
252
|
+
display_name: {
|
|
253
|
+
label: 'Display Name',
|
|
254
|
+
ted_attribute: :name,
|
|
255
|
+
title_type: Xolo::MANAGED,
|
|
256
|
+
# required: true, # only required if not subscribed
|
|
257
|
+
cli: :n,
|
|
258
|
+
type: :string,
|
|
259
|
+
validate: :validate_title_display_name,
|
|
260
|
+
walkthru_na: :display_name_na,
|
|
261
|
+
invalid_msg: 'Not a valid display name, must be at least three characters long.',
|
|
262
|
+
changelog: true,
|
|
263
|
+
desc: <<~ENDDESC
|
|
264
|
+
A human-friendly name for the Software Title, e.g. 'Google Chrome', or 'NFS Menubar'.
|
|
265
|
+
Must be at least three characters long.
|
|
266
|
+
|
|
267
|
+
Cannot be used for subscribed titles, since the Patch Source defines the display name for those.
|
|
268
|
+
ENDDESC
|
|
269
|
+
},
|
|
270
|
+
|
|
220
271
|
# @!attribute publisher
|
|
221
272
|
# @return [String] The entity that publishes this title
|
|
222
273
|
publisher: {
|
|
223
274
|
label: 'Publisher',
|
|
224
275
|
ted_attribute: :publisher,
|
|
225
|
-
required: true,
|
|
276
|
+
# required: true, # only required if not subscribed
|
|
277
|
+
title_type: Xolo::MANAGED,
|
|
226
278
|
cli: :P,
|
|
227
279
|
type: :string,
|
|
280
|
+
walkthru_na: :publisher_na,
|
|
228
281
|
validate: true,
|
|
229
282
|
changelog: true,
|
|
230
283
|
invalid_msg: '"Not a valid Publisher, must be at least three characters.',
|
|
231
284
|
desc: <<~ENDDESC
|
|
232
285
|
The company or entity that publishes this title, e.g. 'Apple, Inc.' or 'Pixar Animation Studios'.
|
|
286
|
+
|
|
287
|
+
Cannot be used for subscribed titles, since the Patch Source defines the publisher for those.
|
|
233
288
|
ENDDESC
|
|
234
289
|
},
|
|
235
290
|
|
|
@@ -238,6 +293,7 @@ module Xolo
|
|
|
238
293
|
app_name: {
|
|
239
294
|
label: 'App Name',
|
|
240
295
|
ted_attribute: :appName,
|
|
296
|
+
title_type: Xolo::MANAGED,
|
|
241
297
|
cli: :a,
|
|
242
298
|
validate: true,
|
|
243
299
|
type: :string,
|
|
@@ -251,6 +307,8 @@ module Xolo
|
|
|
251
307
|
|
|
252
308
|
If the title does not install a .app bundle, leave this blank, and provide a --version-script.
|
|
253
309
|
|
|
310
|
+
Cannot be used for subscribed titles, since the Patch Source defines the app name for those.
|
|
311
|
+
|
|
254
312
|
REQUIRED if --app-bundle-id is used.
|
|
255
313
|
ENDDESC
|
|
256
314
|
},
|
|
@@ -260,6 +318,7 @@ module Xolo
|
|
|
260
318
|
app_bundle_id: {
|
|
261
319
|
label: 'App Bundle ID',
|
|
262
320
|
ted_attribute: :bundleId,
|
|
321
|
+
title_type: Xolo::MANAGED,
|
|
263
322
|
cli: :b,
|
|
264
323
|
validate: true,
|
|
265
324
|
type: :string,
|
|
@@ -273,6 +332,8 @@ module Xolo
|
|
|
273
332
|
|
|
274
333
|
If the title does not install a .app bundle, or if the .app doesn't provide its version via the bundle id (e.g. Firefox) leave this blank, and provide a --version-script.
|
|
275
334
|
|
|
335
|
+
Cannot be used for subscribed titles, since the Patch Source defines the bundle ID for those.
|
|
336
|
+
|
|
276
337
|
REQUIRED if --app-name is used.
|
|
277
338
|
ENDDESC
|
|
278
339
|
},
|
|
@@ -282,6 +343,7 @@ module Xolo
|
|
|
282
343
|
# title on a client mac
|
|
283
344
|
version_script: {
|
|
284
345
|
label: 'Version Script',
|
|
346
|
+
title_type: Xolo::MANAGED,
|
|
285
347
|
cli: :v,
|
|
286
348
|
# while the script is stored in the Title Editor as the extension attribute
|
|
287
349
|
# its handled differently, so we don't specify a ted_attribute here.
|
|
@@ -299,7 +361,132 @@ module Xolo
|
|
|
299
361
|
and if no version of the title is installed, it should output:
|
|
300
362
|
<result></result>
|
|
301
363
|
|
|
302
|
-
|
|
364
|
+
Cannot be used for subscribed titles, since the Patch Source defines the version script for those.
|
|
365
|
+
|
|
366
|
+
REQUIRED unless --app-name and --app-bundle-id are used.
|
|
367
|
+
ENDDESC
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
# @!attribute patch_source
|
|
371
|
+
# @return [String] The name of the Jamf Patch Source that provides this title via subscription
|
|
372
|
+
patch_source: {
|
|
373
|
+
label: 'Subscription Patch Source',
|
|
374
|
+
title_type: Xolo::SUBSCRIBED,
|
|
375
|
+
cli: :S,
|
|
376
|
+
type: :string,
|
|
377
|
+
immutable: true,
|
|
378
|
+
validate: true,
|
|
379
|
+
add_only: true,
|
|
380
|
+
walkthru_na: :patch_source_na,
|
|
381
|
+
readline: :jamf_patch_sources_with_available_titles,
|
|
382
|
+
invalid_msg: 'Invalid Patch Source. Unknown Patch Source Name, or it has no available titles.',
|
|
383
|
+
desc: <<~ENDDESC
|
|
384
|
+
The name of the Jamf Patch Source that provides this title via subscription.
|
|
385
|
+
|
|
386
|
+
This value and --title-id are required for 'subscribed' titles.
|
|
387
|
+
|
|
388
|
+
To see a list of titles available for subscription, with their Patch Sources and IDs, use `xadm list-available`.
|
|
389
|
+
|
|
390
|
+
Can only be used when adding a new title, not when editing an existing one.
|
|
391
|
+
ENDDESC
|
|
392
|
+
|
|
393
|
+
},
|
|
394
|
+
|
|
395
|
+
# @!attribute title_id
|
|
396
|
+
# @return [String] The TitleID of the title on the specified Patch Source
|
|
397
|
+
title_id: {
|
|
398
|
+
label: 'Subscription Title ID',
|
|
399
|
+
title_type: Xolo::SUBSCRIBED,
|
|
400
|
+
cli: :T,
|
|
401
|
+
type: :string,
|
|
402
|
+
immutable: true,
|
|
403
|
+
add_only: true,
|
|
404
|
+
walkthru_na: :title_id_na,
|
|
405
|
+
validate: true,
|
|
406
|
+
invalid_msg: 'Invalid Title ID. Not available in any Patch Source.',
|
|
407
|
+
desc: <<~ENDDESC
|
|
408
|
+
The TitleID of the title on the specified Patch Source.
|
|
409
|
+
|
|
410
|
+
This is the unique identifier for each title on a patch source, it is a sometimes-meaningless string of alphanumeric characters.
|
|
411
|
+
|
|
412
|
+
To find the TitleID of a title available for subscription, use `xadm list-available`
|
|
413
|
+
|
|
414
|
+
Can only be used when adding a new title, not when editing an existing one.
|
|
415
|
+
ENDDESC
|
|
416
|
+
|
|
417
|
+
},
|
|
418
|
+
|
|
419
|
+
# TODO: Add validation?
|
|
420
|
+
# @!attribute autopkg_recipe
|
|
421
|
+
# @return [String] The autopkg recipe to run when new versions are added to this title
|
|
422
|
+
autopkg_recipe: {
|
|
423
|
+
label: 'AutoPkg Recipe',
|
|
424
|
+
cli: :R,
|
|
425
|
+
validate: false,
|
|
426
|
+
type: :string,
|
|
427
|
+
changelog: true,
|
|
428
|
+
invalid_msg: "Unknown autopkg recipe. Use one that is configured on the server, or '#{Xolo::NONE}'.",
|
|
429
|
+
desc: <<~ENDDESC
|
|
430
|
+
The name of an autopkg recipe to run when a new version is added to this title. It is expected that the version being added is the latest available and will match the .pkg acquired by a run of the recipe.
|
|
431
|
+
|
|
432
|
+
AutoPkg, and the recipe, must be installed and configured on the xoloserver host.
|
|
433
|
+
|
|
434
|
+
When using this, --autopkg-dir must also be provided
|
|
435
|
+
|
|
436
|
+
To unset, use '#{Xolo::NONE}'
|
|
437
|
+
ENDDESC
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
# TODO: Add validation?
|
|
441
|
+
# @!attribute autopkg_dir
|
|
442
|
+
# @return [String] The path containg the .pkg acquired by the --autopkg-recipe
|
|
443
|
+
autopkg_dir: {
|
|
444
|
+
label: 'AutoPkg Output Directory',
|
|
445
|
+
cli: :D,
|
|
446
|
+
validate: false,
|
|
447
|
+
type: :string,
|
|
448
|
+
changelog: true,
|
|
449
|
+
invalid_msg: "Must be an absolute path starting with / and containing at least one more /, or '#{Xolo::NONE}'.",
|
|
450
|
+
desc: <<~ENDDESC
|
|
451
|
+
The path to the directory where the --autopkg-recipe will store the acquired .pkg.
|
|
452
|
+
|
|
453
|
+
After running the recipe, xoloserver will look for the newest .pkg file in this directory and upload it to the Jamf distribution servers, as with any other pkg.
|
|
454
|
+
|
|
455
|
+
Required when using --autopkg-recipe
|
|
456
|
+
|
|
457
|
+
To unset, use '#{Xolo::NONE}'
|
|
458
|
+
ENDDESC
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
# @!attribute pilot_groups
|
|
462
|
+
# @return [Array<String>] Jamf groups that will automatically get new versions installed or
|
|
463
|
+
# updated when added, for piloting
|
|
464
|
+
pilot_groups: {
|
|
465
|
+
label: 'Pilot Computer Groups',
|
|
466
|
+
cli: :p,
|
|
467
|
+
validate: true,
|
|
468
|
+
type: :string,
|
|
469
|
+
multi: true,
|
|
470
|
+
changelog: true,
|
|
471
|
+
readline_prompt: 'Group Name',
|
|
472
|
+
readline: :jamf_computer_group_names,
|
|
473
|
+
invalid_msg: "Invalid group. Must be an existing Jamf Computer Group, or '#{Xolo::NONE}'.",
|
|
474
|
+
desc: <<~ENDDESC
|
|
475
|
+
One or more Jamf Computer Groups whose members will automatically have new versions installed or updated for testing before it is released.
|
|
476
|
+
|
|
477
|
+
These groups affect both the initial installation of and updates to a title when a version is added, before it is released.
|
|
478
|
+
|
|
479
|
+
These computers will be used for testing not just the software, but the installation process itself. Exclusions win, so computers that are also in an excluded group for the title will not be used as pilots.
|
|
480
|
+
|
|
481
|
+
Pilot groups can also be defined per version, in which case these will be ignored. Defining them in the title is useful for subscribed titles, where new versions are created automatically.
|
|
482
|
+
|
|
483
|
+
When a version is released, the computers in the release_groups defined in the title will automatically have this version installed - and any non-frozen computers with an older version will have it updated.
|
|
484
|
+
|
|
485
|
+
When using the --pilot-groups CLI option, you can specify more than one group by using the option more than once, or by providing a single option value with the groups separated by commas.
|
|
486
|
+
|
|
487
|
+
When adding a new version, the pilot groups from the previous version will be inherited if you don't specify any. To make the new version have no pilot groups, and fall back to these defined in the title, use '#{Xolo::NONE}'
|
|
488
|
+
|
|
489
|
+
NOTE: Any non-excluded computer can be used for piloting at any time by manually installing the yet-to-be-released version using `sudo xolo install` or `xadm deploy`. The members of the pilot groups are just the ones that will have it auto-installed.
|
|
303
490
|
ENDDESC
|
|
304
491
|
},
|
|
305
492
|
|
|
@@ -320,7 +507,9 @@ module Xolo
|
|
|
320
507
|
readline: :jamf_computer_group_names,
|
|
321
508
|
invalid_msg: 'Invalid release group(s). Must exist in Jamf and not be excluded.',
|
|
322
509
|
desc: <<~ENDDESC
|
|
323
|
-
One or more Jamf Computer Groups whose members will automatically have this title installed
|
|
510
|
+
One or more Jamf Computer Groups whose members will automatically have this title installed.
|
|
511
|
+
|
|
512
|
+
These groups affect the _initial_ installation of a title when a version is released. Any Mac with the title installed, will get updates (if not excluded) regardless of the release-groups.
|
|
324
513
|
|
|
325
514
|
If your Xolo administrators allow it, you can use '#{Xolo::TARGET_ALL}' to auto-install on all computers that aren't excluded. If not, you'll be told how to request setting release groups to '#{Xolo::TARGET_ALL}'.
|
|
326
515
|
|
|
@@ -349,7 +538,7 @@ module Xolo
|
|
|
349
538
|
desc: <<~ENDDESC
|
|
350
539
|
One or more Jamf Computer Groups whose members are not allowed to install this title.
|
|
351
540
|
|
|
352
|
-
When a computer is in one of these groups, the title is not available even if the computer is in a pilot or release group.
|
|
541
|
+
When a computer is in one of these groups, the title is not available at all, for installation or updates, even if the computer is in a pilot or release group.
|
|
353
542
|
|
|
354
543
|
When using the --excluded-groups CLI option, you can specify more than one group by using the option more than once, or by providing a single option value with the groups separated by commas.
|
|
355
544
|
|
|
@@ -478,6 +667,7 @@ module Xolo
|
|
|
478
667
|
It will never be available to excluded computers.
|
|
479
668
|
|
|
480
669
|
Self Service is not available for titles with the release_group 'all'.
|
|
670
|
+
To remove the self-service option, use --no-self-service.
|
|
481
671
|
ENDDESC
|
|
482
672
|
},
|
|
483
673
|
|
|
@@ -609,12 +799,50 @@ module Xolo
|
|
|
609
799
|
desc: <<~ENDDESC
|
|
610
800
|
The currently released version
|
|
611
801
|
ENDDESC
|
|
802
|
+
},
|
|
803
|
+
|
|
804
|
+
# @!attribute ted_id_number
|
|
805
|
+
# @return [Integer] The Windoo::SoftwareTitle#softwareTitleId
|
|
806
|
+
ted_id_number: {
|
|
807
|
+
label: 'Title Editor ID',
|
|
808
|
+
type: :integer,
|
|
809
|
+
cli: false,
|
|
810
|
+
changelog: false,
|
|
811
|
+
read_only: true, # maintained by the server, not editable by xadm
|
|
812
|
+
desc: <<~ENDDESC
|
|
813
|
+
The id number of the matching Software Title in the Title Editor
|
|
814
|
+
ENDDESC
|
|
815
|
+
},
|
|
816
|
+
|
|
817
|
+
# @!attribute jamf_patch_title_id
|
|
818
|
+
# @return [Integer] The Windoo::SoftwareTitle#softwareTitleId
|
|
819
|
+
jamf_patch_title_id: {
|
|
820
|
+
label: 'Jamf Patch Title ID',
|
|
821
|
+
type: :integer,
|
|
822
|
+
cli: false,
|
|
823
|
+
changelog: false,
|
|
824
|
+
read_only: true, # maintained by the server, not editable by xadm
|
|
825
|
+
desc: <<~ENDDESC
|
|
826
|
+
The id number of the matching Patch Title in the Jamf Pro
|
|
827
|
+
ENDDESC
|
|
612
828
|
}
|
|
613
829
|
|
|
614
830
|
}.freeze
|
|
615
831
|
|
|
616
|
-
ATTRIBUTES.
|
|
832
|
+
ATTRIBUTES.each do |attr, deets|
|
|
617
833
|
attr_accessor attr
|
|
834
|
+
|
|
835
|
+
# boolean attrs get a ? method
|
|
836
|
+
alias_method "#{attr}?", attr if deets[:type] == :boolean
|
|
837
|
+
|
|
838
|
+
next unless deets[:multi]
|
|
839
|
+
|
|
840
|
+
# ensure that multi value attrs return an empty array if nil
|
|
841
|
+
define_method attr do
|
|
842
|
+
iv = "@#{attr}"
|
|
843
|
+
instance_variable_set(iv, []) if instance_variable_get(iv).nil?
|
|
844
|
+
instance_variable_get(iv)
|
|
845
|
+
end
|
|
618
846
|
end
|
|
619
847
|
|
|
620
848
|
# Constructor
|
|
@@ -632,13 +860,26 @@ module Xolo
|
|
|
632
860
|
######################
|
|
633
861
|
|
|
634
862
|
# the latest version of this title in Xolo
|
|
635
|
-
# @param cnx [Faraday::Connection] The connection to use, must be logged in already
|
|
636
863
|
# @return [String]
|
|
637
864
|
####################
|
|
638
865
|
def latest_version
|
|
639
866
|
version_order&.first
|
|
640
867
|
end
|
|
641
868
|
|
|
869
|
+
# Is this a managed title?
|
|
870
|
+
# @return [Boolean]
|
|
871
|
+
#######################
|
|
872
|
+
def managed?
|
|
873
|
+
!subscribed?
|
|
874
|
+
end
|
|
875
|
+
|
|
876
|
+
# Does this title get its pkgs from AutoPkg?
|
|
877
|
+
# @return [Boolean]
|
|
878
|
+
############################
|
|
879
|
+
def autopkg_enabled?
|
|
880
|
+
autopkg_recipe && autopkg_dir
|
|
881
|
+
end
|
|
882
|
+
|
|
642
883
|
end # class Title
|
|
643
884
|
|
|
644
885
|
end # module BaseClasses
|
|
@@ -110,6 +110,7 @@ module Xolo
|
|
|
110
110
|
label: 'Publish Date',
|
|
111
111
|
type: :time,
|
|
112
112
|
default: -> { Time.now.to_s },
|
|
113
|
+
title_type: Xolo::MANAGED,
|
|
113
114
|
do_not_inherit: true,
|
|
114
115
|
cli: :d,
|
|
115
116
|
validate: true,
|
|
@@ -128,6 +129,7 @@ module Xolo
|
|
|
128
129
|
label: 'Minimum OS',
|
|
129
130
|
cli: :o,
|
|
130
131
|
type: :string,
|
|
132
|
+
title_type: Xolo::MANAGED,
|
|
131
133
|
required: false,
|
|
132
134
|
validate: true,
|
|
133
135
|
default: DEFAULT_MIN_OS,
|
|
@@ -145,6 +147,7 @@ module Xolo
|
|
|
145
147
|
label: 'Maximum OS',
|
|
146
148
|
cli: :O,
|
|
147
149
|
type: :string,
|
|
150
|
+
title_type: Xolo::MANAGED,
|
|
148
151
|
validate: true,
|
|
149
152
|
changelog: true,
|
|
150
153
|
# default: Xolo::NONE,
|
|
@@ -160,12 +163,14 @@ module Xolo
|
|
|
160
163
|
label: 'Reboot',
|
|
161
164
|
cli: :r,
|
|
162
165
|
type: :boolean,
|
|
166
|
+
title_type: Xolo::MANAGED,
|
|
163
167
|
validate: :validate_boolean,
|
|
164
168
|
ted_attribute: :reboot,
|
|
165
169
|
default: false,
|
|
166
170
|
changelog: true,
|
|
167
171
|
desc: <<~ENDDESC
|
|
168
172
|
The installation of this version requires the computer to reboot. Users will be notified before installation.
|
|
173
|
+
To remove the reboot option, use --no-reboot.
|
|
169
174
|
ENDDESC
|
|
170
175
|
},
|
|
171
176
|
|
|
@@ -175,12 +180,14 @@ module Xolo
|
|
|
175
180
|
label: 'Standalone',
|
|
176
181
|
cli: :s,
|
|
177
182
|
type: :boolean,
|
|
183
|
+
title_type: Xolo::MANAGED,
|
|
178
184
|
validate: :validate_boolean,
|
|
179
185
|
default: true,
|
|
180
186
|
ted_attribute: :standalone,
|
|
181
187
|
changelog: true,
|
|
182
188
|
desc: <<~ENDDESC
|
|
183
189
|
The installer for this version is a full installer, not an incremental patch that must be installed on top of an earlier version.
|
|
190
|
+
To remove the standalone option, use --no-standalone.
|
|
184
191
|
ENDDESC
|
|
185
192
|
},
|
|
186
193
|
|
|
@@ -190,7 +197,10 @@ module Xolo
|
|
|
190
197
|
label: 'KillApps',
|
|
191
198
|
cli: :k,
|
|
192
199
|
type: :string,
|
|
200
|
+
title_type: Xolo::MANAGED,
|
|
193
201
|
multi: true,
|
|
202
|
+
readline: true,
|
|
203
|
+
readline_prompt: 'KillApp',
|
|
194
204
|
validate: true,
|
|
195
205
|
changelog: true,
|
|
196
206
|
# default: Xolo::NONE,
|
|
@@ -209,6 +219,29 @@ module Xolo
|
|
|
209
219
|
use them as a killapp by specifying '#{USE_TITLE_FOR_KILLAPP}'
|
|
210
220
|
|
|
211
221
|
If not using --walkthru you can use --killapps multiple times
|
|
222
|
+
To remove all killapps, use '#{Xolo::NONE}'.
|
|
223
|
+
ENDDESC
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
# @!attribute patch_unknown
|
|
227
|
+
# @return [Boolean] Should 'unknown' versions of this title be updated to this version automatically?
|
|
228
|
+
patch_unknown: {
|
|
229
|
+
label: 'Patch Unknown Versions',
|
|
230
|
+
cli: :U,
|
|
231
|
+
type: :boolean,
|
|
232
|
+
validate: :validate_boolean,
|
|
233
|
+
default: false,
|
|
234
|
+
changelog: true,
|
|
235
|
+
desc: <<~ENDDESC
|
|
236
|
+
Should 'unknown' versions of this title be updated to this version automatically by Jamf Patch Management?
|
|
237
|
+
|
|
238
|
+
When Jamf Patch determines that a title is installed on a computer, but version reported is not among those known to Jamf Patch, it marks the version as 'unknown'. Setting this option to true will cause Jamf Patch to automatically install the pkg for this version on those Macs with 'unknown' versions.
|
|
239
|
+
|
|
240
|
+
This can cause problems if that unknown version is actually newer than this version, e.g. a beta or pre-release version, or when the app has a 'self-update' mechanism that installs newer versions outside of Jamf Patch before it is aware of them.
|
|
241
|
+
|
|
242
|
+
But sometimes it may be desirable to have all unknown versions updated to this version, e.g. when the title is a helper app that is not regularly updated, or when the title is being newly managed by Xolo/Jamf Patch and you want to get all existing installations onto this version.
|
|
243
|
+
|
|
244
|
+
To remove the patch-unknown option, use --no-patch-unknown.
|
|
212
245
|
ENDDESC
|
|
213
246
|
},
|
|
214
247
|
|
|
@@ -217,7 +250,6 @@ module Xolo
|
|
|
217
250
|
# updated for piloting
|
|
218
251
|
pilot_groups: {
|
|
219
252
|
label: 'Pilot Computer Groups',
|
|
220
|
-
# default: Xolo::NONE,
|
|
221
253
|
cli: :p,
|
|
222
254
|
validate: true,
|
|
223
255
|
type: :string,
|
|
@@ -235,7 +267,7 @@ module Xolo
|
|
|
235
267
|
|
|
236
268
|
When using the --pilot-groups CLI option, you can specify more than one group by using the option more than once, or by providing a single option value with the groups separated by commas.
|
|
237
269
|
|
|
238
|
-
When adding a new version, the pilot groups from the previous version will be inherited if you don't specify any. To make the
|
|
270
|
+
When adding a new version, the pilot groups from the previous version will be inherited if you don't specify any. To make the version have no pilot groups use '#{Xolo::NONE}'.
|
|
239
271
|
|
|
240
272
|
NOTE: Any non-excluded computer can be used for piloting at any time by manually installing the yet-to-be-released version using `sudo xolo install <title> <version>`. The members of the pilot groups are just the ones that will have it auto-installed.
|
|
241
273
|
ENDDESC
|
|
@@ -247,13 +279,12 @@ module Xolo
|
|
|
247
279
|
pkg_to_upload: {
|
|
248
280
|
label: 'Upload Package',
|
|
249
281
|
type: :string,
|
|
250
|
-
required: true,
|
|
251
282
|
cli: :u,
|
|
252
283
|
validate: true,
|
|
253
284
|
readline: :get_files,
|
|
254
285
|
do_not_inherit: true,
|
|
255
286
|
hide_from_info: true,
|
|
256
|
-
invalid_msg: 'Invalid installer pkg. Must exist locally and be a .pkg file
|
|
287
|
+
invalid_msg: 'Invalid installer pkg. Must exist locally and be a flat .pkg file',
|
|
257
288
|
desc: <<~ENDDESC
|
|
258
289
|
The path to a local copy of the installer package for this version. Will be uploaded to Xolo and then Jamf Pro distribution point(s), replacing any previously uploaded.
|
|
259
290
|
|
|
@@ -261,6 +292,8 @@ module Xolo
|
|
|
261
292
|
|
|
262
293
|
It will be renamed to 'xolo-<title>-<version>.pkg' (or .zip).
|
|
263
294
|
If your Xolo server is confiured to sign unsigned packages, it will do so along the way.
|
|
295
|
+
|
|
296
|
+
Required when creating a new version unless the title is configrued to use autopkg.
|
|
264
297
|
ENDDESC
|
|
265
298
|
},
|
|
266
299
|
|
|
@@ -448,6 +481,7 @@ module Xolo
|
|
|
448
481
|
# @!attribute jamf_pkg_id
|
|
449
482
|
# @return [String] The id of the Jamf Package object that installs this version.
|
|
450
483
|
# This is an integer in a string, as are all IDs in the Jamf Pro API.
|
|
484
|
+
# TODO: Stop using pkgID - or any jamf ID, use names for accessing all jamf objects
|
|
451
485
|
jamf_pkg_id: {
|
|
452
486
|
label: 'Jamf Package ID',
|
|
453
487
|
type: :string,
|
|
@@ -461,7 +495,7 @@ module Xolo
|
|
|
461
495
|
|
|
462
496
|
# @!attribute jamf_pkg_file
|
|
463
497
|
# @return [String] The file name of the installer.pkg file used by the Jamf Package object to
|
|
464
|
-
# installs this version. 'xolo-<title>-<version>.pkg'
|
|
498
|
+
# installs this version. 'xolo-<title>-<version>.pkg'
|
|
465
499
|
jamf_pkg_file: {
|
|
466
500
|
label: 'Jamf Package File',
|
|
467
501
|
type: :string,
|
|
@@ -541,7 +575,7 @@ module Xolo
|
|
|
541
575
|
# @!attribute sha_512
|
|
542
576
|
# @return [String] The SHA512 checksum of the most recently uploaded package
|
|
543
577
|
sha_512: {
|
|
544
|
-
label: 'Package Checksum',
|
|
578
|
+
label: 'Package Checksum (SHA512)',
|
|
545
579
|
type: :string,
|
|
546
580
|
do_not_inherit: true,
|
|
547
581
|
cli: false,
|
|
@@ -554,9 +588,20 @@ module Xolo
|
|
|
554
588
|
|
|
555
589
|
}.freeze
|
|
556
590
|
|
|
557
|
-
ATTRIBUTES.
|
|
591
|
+
ATTRIBUTES.each do |attr, deets|
|
|
558
592
|
attr_accessor attr
|
|
559
|
-
|
|
593
|
+
|
|
594
|
+
# boolean attrs get a ? method
|
|
595
|
+
alias_method "#{attr}?", attr if deets[:type] == :boolean
|
|
596
|
+
|
|
597
|
+
next unless deets[:multi]
|
|
598
|
+
|
|
599
|
+
# ensure that multi value attrs return an empty array if nil
|
|
600
|
+
define_method attr do
|
|
601
|
+
ivar_name = "@#{attr}"
|
|
602
|
+
instance_variable_set(ivar_name, []) if instance_variable_get(ivar_name).nil?
|
|
603
|
+
instance_variable_get(ivar_name)
|
|
604
|
+
end
|
|
560
605
|
end
|
|
561
606
|
|
|
562
607
|
# Constructor
|
data/lib/xolo/core/constants.rb
CHANGED
|
@@ -58,17 +58,21 @@ module Xolo
|
|
|
58
58
|
|
|
59
59
|
DOT_PKG = '.pkg'
|
|
60
60
|
|
|
61
|
-
DOT_ZIP = '.zip'
|
|
62
|
-
|
|
63
61
|
UNKNOWN = 'unknown'
|
|
64
62
|
|
|
65
63
|
# Installer packages must have one of these extensions
|
|
66
|
-
OK_PKG_EXTS = [DOT_PKG
|
|
64
|
+
OK_PKG_EXTS = [DOT_PKG]
|
|
67
65
|
|
|
68
66
|
# The value to use when all computers are the release-targets
|
|
69
67
|
# and for all manual-install policies
|
|
70
68
|
TARGET_ALL = 'all'
|
|
71
69
|
|
|
70
|
+
# Title Types
|
|
71
|
+
MANAGED = :managed
|
|
72
|
+
SUBSCRIBED = :subscribed
|
|
73
|
+
TITLE_TYPES = [MANAGED, SUBSCRIBED].freeze
|
|
74
|
+
DEFAULT_TITLE_TYPE = :managed
|
|
75
|
+
|
|
72
76
|
# when this module is included
|
|
73
77
|
def self.included(includer)
|
|
74
78
|
Xolo.verbose_include includer, self
|