xolo-server 1.0.0 → 1.0.1
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/README.md +42 -4
- data/bin/xoloserver +3 -0
- data/data/client/xolo +1160 -0
- data/lib/optimist_with_insert_blanks.rb +1216 -0
- data/lib/xolo/core/base_classes/configuration.rb +238 -0
- data/lib/xolo/core/base_classes/server_object.rb +112 -0
- data/lib/xolo/core/base_classes/title.rb +648 -0
- data/lib/xolo/core/base_classes/version.rb +601 -0
- data/lib/xolo/core/constants.rb +81 -0
- data/lib/xolo/core/exceptions.rb +52 -0
- data/lib/xolo/core/json_wrappers.rb +43 -0
- data/lib/xolo/core/loading.rb +59 -0
- data/lib/xolo/core/output.rb +292 -0
- data/lib/xolo/core/version.rb +21 -0
- data/lib/xolo/core.rb +46 -0
- data/lib/xolo/server/configuration.rb +1 -2
- data/lib/xolo/server/helpers/jamf_pro.rb +1 -0
- data/lib/xolo/server/mixins/title_jamf_access.rb +7 -12
- data/lib/xolo/server/mixins/title_ted_access.rb +21 -5
- data/lib/xolo/server/mixins/version_jamf_access.rb +23 -17
- data/lib/xolo/server/mixins/version_ted_access.rb +9 -4
- data/lib/xolo/server/routes.rb +6 -23
- data/lib/xolo/server/version.rb +1 -3
- metadata +21 -10
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
# Copyright 2025 Pixar
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the terms set forth in the LICENSE.txt file available at
|
|
4
|
+
# at the root of this project.
|
|
5
|
+
#
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# frozen_string_literal: true
|
|
9
|
+
|
|
10
|
+
# main module
|
|
11
|
+
module Xolo
|
|
12
|
+
|
|
13
|
+
module Core
|
|
14
|
+
|
|
15
|
+
module BaseClasses
|
|
16
|
+
|
|
17
|
+
# The base class for dealing with Versions/Patches in the
|
|
18
|
+
# Xolo Server, Admin, and Client modules.
|
|
19
|
+
#
|
|
20
|
+
# This class holds the common aspects of Xolo Versinos as used
|
|
21
|
+
# on the Xolo server, in the Xolo Admin CLI app 'xadm', and the
|
|
22
|
+
# client app 'xolo' - most importately it defines which data they
|
|
23
|
+
# exchange.
|
|
24
|
+
#
|
|
25
|
+
############################
|
|
26
|
+
class Version < Xolo::Core::BaseClasses::ServerObject
|
|
27
|
+
|
|
28
|
+
# Mixins
|
|
29
|
+
#############################
|
|
30
|
+
#############################
|
|
31
|
+
|
|
32
|
+
# Constants
|
|
33
|
+
#############################
|
|
34
|
+
#############################
|
|
35
|
+
|
|
36
|
+
# The title editor requires a value for min os, so use this
|
|
37
|
+
# as the default if not specified in the server config
|
|
38
|
+
DEFAULT_MIN_OS = '10.9'
|
|
39
|
+
|
|
40
|
+
# when this is provided as a killapp, the killapp will
|
|
41
|
+
# be defined by the app_name and app_bundle_id used in the
|
|
42
|
+
# title.
|
|
43
|
+
USE_TITLE_FOR_KILLAPP = 'use-title'
|
|
44
|
+
|
|
45
|
+
# Has been created in Xolo, but not yet made available
|
|
46
|
+
# for installation
|
|
47
|
+
STATUS_PENDING = 'pending'
|
|
48
|
+
|
|
49
|
+
# Has been released from the Title Editor, but is only
|
|
50
|
+
# available for piloting in Xolo. Will be auto-installed
|
|
51
|
+
# on non-excluded members of the pilot groups
|
|
52
|
+
STATUS_PILOT = 'pilot'
|
|
53
|
+
|
|
54
|
+
# Has been fully released in Xolo, this is the currently
|
|
55
|
+
# 'live' version. Will be auto-installed
|
|
56
|
+
# on non-excluded members of the release groups
|
|
57
|
+
STATUS_RELEASED = 'released'
|
|
58
|
+
|
|
59
|
+
# Was pending or pilot, but was never released in Xolo,
|
|
60
|
+
# and now a newer version has been released
|
|
61
|
+
STATUS_SKIPPED = 'skipped'
|
|
62
|
+
|
|
63
|
+
# Was released in Xolo, but now a newer version has been
|
|
64
|
+
# released
|
|
65
|
+
STATUS_DEPRECATED = 'deprecated'
|
|
66
|
+
|
|
67
|
+
# Attributes
|
|
68
|
+
######################
|
|
69
|
+
######################
|
|
70
|
+
|
|
71
|
+
# Attributes of Versions
|
|
72
|
+
# See the definition for {Xolo::Core::BaseClasses::Title::ATTRIBUTES}
|
|
73
|
+
ATTRIBUTES = {
|
|
74
|
+
|
|
75
|
+
# @!attribute title
|
|
76
|
+
# @return [String] The title to which this version belongs
|
|
77
|
+
title: {
|
|
78
|
+
label: 'Title',
|
|
79
|
+
read_only: true,
|
|
80
|
+
immutable: true,
|
|
81
|
+
cli: false,
|
|
82
|
+
type: :string,
|
|
83
|
+
validate: true,
|
|
84
|
+
invalid_msg: 'Not a valid version! Cannot already exist in this title.',
|
|
85
|
+
desc: <<~ENDDESC
|
|
86
|
+
A unique version string identifying this version in this title, e.g. '12.34.5'.
|
|
87
|
+
ENDDESC
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
# @!attribute version
|
|
91
|
+
# @return [String] The version-string for this version.
|
|
92
|
+
version: {
|
|
93
|
+
label: 'Version',
|
|
94
|
+
required: true,
|
|
95
|
+
immutable: true,
|
|
96
|
+
do_not_inherit: true,
|
|
97
|
+
cli: false,
|
|
98
|
+
type: :string,
|
|
99
|
+
validate: true,
|
|
100
|
+
invalid_msg: 'Not a valid version! Cannot already exist in this title.',
|
|
101
|
+
ted_attribute: :version,
|
|
102
|
+
desc: <<~ENDDESC
|
|
103
|
+
A unique version string identifying this version in this title, e.g. '12.34.5'.
|
|
104
|
+
ENDDESC
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
# @!attribute publish_date
|
|
108
|
+
# @return [Time] When the publisher released this version. Defaults to today.
|
|
109
|
+
publish_date: {
|
|
110
|
+
label: 'Publish Date',
|
|
111
|
+
type: :time,
|
|
112
|
+
default: -> { Time.now.to_s },
|
|
113
|
+
do_not_inherit: true,
|
|
114
|
+
cli: :d,
|
|
115
|
+
validate: true,
|
|
116
|
+
changelog: true,
|
|
117
|
+
ted_attribute: :releaseDate,
|
|
118
|
+
invalid_msg: 'Not a valid date!',
|
|
119
|
+
desc: <<~ENDDESC
|
|
120
|
+
The date this version was released by the publisher.
|
|
121
|
+
Default is today.
|
|
122
|
+
ENDDESC
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
# @!attribute min_os = required to create the Title Editor Patch
|
|
126
|
+
# @return [String] The minimum OS version that this version can be installed on.
|
|
127
|
+
min_os: {
|
|
128
|
+
label: 'Minimum OS',
|
|
129
|
+
cli: :o,
|
|
130
|
+
type: :string,
|
|
131
|
+
required: false,
|
|
132
|
+
validate: true,
|
|
133
|
+
default: DEFAULT_MIN_OS,
|
|
134
|
+
changelog: true,
|
|
135
|
+
ted_attribute: :minimumOperatingSystem,
|
|
136
|
+
invalid_msg: "Not a valid OS version! Must be XX[.YY[.ZZ]] format, e.g. '10.9' or '11.0.1'.",
|
|
137
|
+
desc: <<~ENDDESC
|
|
138
|
+
The lowest version of macOS able to run this version of this title. Defaults to a value set in the server config, or #{DEFAULT_MIN_OS}.
|
|
139
|
+
ENDDESC
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
# @!attribute max_os
|
|
143
|
+
# @return [String] The maximum OS version that this version can be installed on.
|
|
144
|
+
max_os: {
|
|
145
|
+
label: 'Maximum OS',
|
|
146
|
+
cli: :O,
|
|
147
|
+
type: :string,
|
|
148
|
+
validate: true,
|
|
149
|
+
changelog: true,
|
|
150
|
+
# default: Xolo::NONE,
|
|
151
|
+
invalid_msg: "Not a valid OS version! Must be XX[.YY[.ZZ]] format, e.g. '10.9' or '11.0.1'.",
|
|
152
|
+
desc: <<~ENDDESC
|
|
153
|
+
The highest version of macOS able to run this version of this title.
|
|
154
|
+
ENDDESC
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
# @!attribute reboot
|
|
158
|
+
# @return [Boolean] Does this version need a reboot after installing?
|
|
159
|
+
reboot: {
|
|
160
|
+
label: 'Reboot',
|
|
161
|
+
cli: :r,
|
|
162
|
+
type: :boolean,
|
|
163
|
+
validate: :validate_boolean,
|
|
164
|
+
ted_attribute: :reboot,
|
|
165
|
+
default: false,
|
|
166
|
+
changelog: true,
|
|
167
|
+
desc: <<~ENDDESC
|
|
168
|
+
The installation of this version requires the computer to reboot. Users will be notified before installation.
|
|
169
|
+
ENDDESC
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
# @!attribute standalone
|
|
173
|
+
# @return [Boolean] Is this version a full installer? (if not, its an incremental patch)
|
|
174
|
+
standalone: {
|
|
175
|
+
label: 'Standalone',
|
|
176
|
+
cli: :s,
|
|
177
|
+
type: :boolean,
|
|
178
|
+
validate: :validate_boolean,
|
|
179
|
+
default: true,
|
|
180
|
+
ted_attribute: :standalone,
|
|
181
|
+
changelog: true,
|
|
182
|
+
desc: <<~ENDDESC
|
|
183
|
+
The installer for this version is a full installer, not an incremental patch that must be installed on top of an earlier version.
|
|
184
|
+
ENDDESC
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
# @!attribute killapps
|
|
188
|
+
# @return [Array<String>] The apps that cannot be running when this version is installed
|
|
189
|
+
killapps: {
|
|
190
|
+
label: 'KillApps',
|
|
191
|
+
cli: :k,
|
|
192
|
+
type: :string,
|
|
193
|
+
multi: true,
|
|
194
|
+
validate: true,
|
|
195
|
+
changelog: true,
|
|
196
|
+
# default: Xolo::NONE,
|
|
197
|
+
invalid_msg: 'Not a valid killapp!',
|
|
198
|
+
desc: <<~ENDDESC
|
|
199
|
+
A killapp is an application that cannot be running while this version is installed.
|
|
200
|
+
If running, installation is delayed, and users are notified to quit.
|
|
201
|
+
|
|
202
|
+
Killapps are defined by an app name e.g. 'Google Chrome.app', and the app's Bundle ID
|
|
203
|
+
e.g. 'com.google.chrome'.
|
|
204
|
+
|
|
205
|
+
Specify them together separated by a semi-colon, e.g.
|
|
206
|
+
'Google Chrome.app;com.google.chrome'
|
|
207
|
+
|
|
208
|
+
If the title for this version has a defined --app-name and --app-bundle-id, you can
|
|
209
|
+
use them as a killapp by specifying '#{USE_TITLE_FOR_KILLAPP}'
|
|
210
|
+
|
|
211
|
+
If not using --walkthru you can use --killapps multiple times
|
|
212
|
+
ENDDESC
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
# @!attribute pilot_groups
|
|
216
|
+
# @return [Array<String>] Jamf groups that will automatically get this version installed or
|
|
217
|
+
# updated for piloting
|
|
218
|
+
pilot_groups: {
|
|
219
|
+
label: 'Pilot Computer Groups',
|
|
220
|
+
# default: Xolo::NONE,
|
|
221
|
+
cli: :p,
|
|
222
|
+
validate: true,
|
|
223
|
+
type: :string,
|
|
224
|
+
multi: true,
|
|
225
|
+
changelog: true,
|
|
226
|
+
readline_prompt: 'Group Name',
|
|
227
|
+
readline: :jamf_computer_group_names,
|
|
228
|
+
invalid_msg: "Invalid group. Must be an existing Jamf Computer Group, or '#{Xolo::NONE}'.",
|
|
229
|
+
desc: <<~ENDDESC
|
|
230
|
+
One or more Jamf Computer Groups whose members will automatically have this version installed or updated for testing before it is released.
|
|
231
|
+
|
|
232
|
+
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.
|
|
233
|
+
|
|
234
|
+
When this version is released, the computers in the release_groups defined in the title will automatically have this version installed - and any computers with an older version will have it updated.
|
|
235
|
+
|
|
236
|
+
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
|
+
|
|
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 new version have no pilot groups use '#{Xolo::NONE}'.
|
|
239
|
+
|
|
240
|
+
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
|
+
ENDDESC
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
# @!attribute jamf_pkg
|
|
245
|
+
# @return [String] The file name of the installer for the Jamf Package object that
|
|
246
|
+
# installs this version. 'xolo-<title>-<version>.pkg' (or .zip)
|
|
247
|
+
pkg_to_upload: {
|
|
248
|
+
label: 'Upload Package',
|
|
249
|
+
type: :string,
|
|
250
|
+
required: true,
|
|
251
|
+
cli: :u,
|
|
252
|
+
validate: true,
|
|
253
|
+
readline: :get_files,
|
|
254
|
+
do_not_inherit: true,
|
|
255
|
+
hide_from_info: true,
|
|
256
|
+
invalid_msg: 'Invalid installer pkg. Must exist locally and be a .pkg file, or a .zip compressed old-style bundle package.',
|
|
257
|
+
desc: <<~ENDDESC
|
|
258
|
+
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
|
+
|
|
260
|
+
Must be a flat .pkg file, or a .zip compressed old-style bundle package.
|
|
261
|
+
|
|
262
|
+
It will be renamed to 'xolo-<title>-<version>.pkg' (or .zip).
|
|
263
|
+
If your Xolo server is confiured to sign unsigned packages, it will do so along the way.
|
|
264
|
+
ENDDESC
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
# @!attribute status
|
|
268
|
+
# @return [String] One of: STATUS_PENDING, STATUS_PILOT, STATUS_RELEASED,
|
|
269
|
+
# STATUS_SKIPPED, or STATUS_DEPRECATED
|
|
270
|
+
status: {
|
|
271
|
+
label: 'Status',
|
|
272
|
+
type: :symbol,
|
|
273
|
+
do_not_inherit: true,
|
|
274
|
+
cli: false,
|
|
275
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
276
|
+
desc: <<~ENDDESC
|
|
277
|
+
The status of this version in Xolo:
|
|
278
|
+
- pending: Not yet available for installation.
|
|
279
|
+
- pilot: Can be installed for piloting, will auto install on any pilot-groups.
|
|
280
|
+
- released: This is the current version, generally available, will auto-install on target groups.
|
|
281
|
+
- skipped: Was created, and maybe piloted, but never released.
|
|
282
|
+
- deprecated: Was released, but a newer version has since been released.
|
|
283
|
+
ENDDESC
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
# @!attribute created_by
|
|
287
|
+
# @return [String] The login of the admin who created this version.
|
|
288
|
+
created_by: {
|
|
289
|
+
label: 'Created By',
|
|
290
|
+
type: :string,
|
|
291
|
+
do_not_inherit: true,
|
|
292
|
+
cli: false,
|
|
293
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
294
|
+
desc: <<~ENDDESC
|
|
295
|
+
The login of the admin who created this version.
|
|
296
|
+
ENDDESC
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
# @!attribute creation_date
|
|
300
|
+
# @return [Time] The date this version was created.
|
|
301
|
+
creation_date: {
|
|
302
|
+
label: 'Creation Date',
|
|
303
|
+
type: :time,
|
|
304
|
+
do_not_inherit: true,
|
|
305
|
+
cli: false,
|
|
306
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
307
|
+
desc: <<~ENDDESC
|
|
308
|
+
When this version was created.
|
|
309
|
+
ENDDESC
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
# @!attribute modified_by
|
|
313
|
+
# @return [String] The login of the admin who last modified this version.
|
|
314
|
+
modified_by: {
|
|
315
|
+
label: 'Modified By',
|
|
316
|
+
type: :string,
|
|
317
|
+
cli: false,
|
|
318
|
+
do_not_inherit: true,
|
|
319
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
320
|
+
desc: <<~ENDDESC
|
|
321
|
+
The login of the admin who last modified this version.
|
|
322
|
+
ENDDESC
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
# @!attribute modification_date
|
|
326
|
+
# @return [Time] The date this version was last modified.
|
|
327
|
+
modification_date: {
|
|
328
|
+
label: 'Modification Date',
|
|
329
|
+
type: :time,
|
|
330
|
+
cli: false,
|
|
331
|
+
do_not_inherit: true,
|
|
332
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
333
|
+
desc: <<~ENDDESC
|
|
334
|
+
When this version was last modified.
|
|
335
|
+
ENDDESC
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
# @!attribute deployed_by
|
|
339
|
+
# @return [String] The login of the admin who released this version in Xolo.
|
|
340
|
+
# This is when the Xolo sets the status of this version to 'released', making it
|
|
341
|
+
# no longer 'in pilot' and the one to be installed or updated by default.
|
|
342
|
+
released_by: {
|
|
343
|
+
label: 'Released By',
|
|
344
|
+
type: :string,
|
|
345
|
+
cli: false,
|
|
346
|
+
do_not_inherit: true,
|
|
347
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
348
|
+
desc: <<~ENDDESC
|
|
349
|
+
The login of the admin who released this version in Xolo.
|
|
350
|
+
This is when the Xolo sets the status of this version to 'released', making it
|
|
351
|
+
no longer 'in pilot' and the one to be installed or updated by default.
|
|
352
|
+
ENDDESC
|
|
353
|
+
},
|
|
354
|
+
|
|
355
|
+
# @!attribute release_date
|
|
356
|
+
# @return [Time] The timestamp this version was released in Xolo.
|
|
357
|
+
# This is when the Xolo sets the status of this version to 'released', making it
|
|
358
|
+
# no longer 'in pilot' and the one to be installed or updated by default.
|
|
359
|
+
release_date: {
|
|
360
|
+
label: 'Release Date',
|
|
361
|
+
type: :time,
|
|
362
|
+
cli: false,
|
|
363
|
+
do_not_inherit: true,
|
|
364
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
365
|
+
desc: <<~ENDDESC
|
|
366
|
+
When this version was released in Xolo.
|
|
367
|
+
This is when the Xolo sets the status of this version to 'released', making it
|
|
368
|
+
no longer 'in pilot' and the one to be installed or updated by default.
|
|
369
|
+
ENDDESC
|
|
370
|
+
},
|
|
371
|
+
|
|
372
|
+
# @!attribute deprecated_by
|
|
373
|
+
# @return [String] The login of the admin who deprecated this version in Xolo by releasing
|
|
374
|
+
# a newer version.
|
|
375
|
+
deprecated_by: {
|
|
376
|
+
label: 'Deprecated By',
|
|
377
|
+
type: :string,
|
|
378
|
+
cli: false,
|
|
379
|
+
do_not_inherit: true,
|
|
380
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
381
|
+
desc: <<~ENDDESC
|
|
382
|
+
The login of the admin who deprecated this version in Xolo by releasing a newer version.
|
|
383
|
+
ENDDESC
|
|
384
|
+
},
|
|
385
|
+
|
|
386
|
+
# @!attribute deprecation_date
|
|
387
|
+
# @return [Time] The timestamp this version was deprecated in Xolo.
|
|
388
|
+
# This is when the Xolo sets the status of this version to 'deprecated', meaning
|
|
389
|
+
# it was released, but a newer version has since been released.
|
|
390
|
+
deprecation_date: {
|
|
391
|
+
label: 'Deprecation Date',
|
|
392
|
+
type: :time,
|
|
393
|
+
cli: false,
|
|
394
|
+
do_not_inherit: true,
|
|
395
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
396
|
+
desc: <<~ENDDESC
|
|
397
|
+
When this version was deprecated in Xolo.
|
|
398
|
+
This is when the Xolo sets the status of this version to 'deprecated', which is when a newer version has been released.
|
|
399
|
+
It will still be available for manual installation until it is deleted.
|
|
400
|
+
Deletion is automatic after a period of time, unless the server is configured otherwise.
|
|
401
|
+
ENDDESC
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
# @!attribute skipped_by
|
|
405
|
+
# @return [String] The login of the admin who skipped this version in Xolo by releasing
|
|
406
|
+
# a newer version.
|
|
407
|
+
skipped_by: {
|
|
408
|
+
label: 'Skipped By',
|
|
409
|
+
type: :string,
|
|
410
|
+
cli: false,
|
|
411
|
+
do_not_inherit: true,
|
|
412
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
413
|
+
desc: <<~ENDDESC
|
|
414
|
+
The login of the admin who skipped this version in Xolo by releasing a newer version.
|
|
415
|
+
ENDDESC
|
|
416
|
+
},
|
|
417
|
+
|
|
418
|
+
# @!attribute skipped_date
|
|
419
|
+
# @return [Time] The timestamp this version was skipped in Xolo.
|
|
420
|
+
# This is when the Xolo sets the status of this version to 'skipped', meaning
|
|
421
|
+
# it was never released in Xolo, and now a newer version has been released.
|
|
422
|
+
skipped_date: {
|
|
423
|
+
label: 'Skipped Date',
|
|
424
|
+
type: :time,
|
|
425
|
+
cli: false,
|
|
426
|
+
do_not_inherit: true,
|
|
427
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
428
|
+
desc: <<~ENDDESC
|
|
429
|
+
When this version was skipped in Xolo.
|
|
430
|
+
This is when the Xolo sets the status of this version to 'skipped', meaning it was never released in Xolo, and now a newer version has been released.
|
|
431
|
+
It will be automatically deleted at the next nightly cleanup, unless the server is configured otherwise.
|
|
432
|
+
ENDDESC
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
# @!attribute jamf_pkg_name
|
|
436
|
+
# @return [String] The display name of the Jamf Package object that installs this version.
|
|
437
|
+
# 'xolo-<title>-<version>'
|
|
438
|
+
jamf_pkg_name: {
|
|
439
|
+
label: 'Jamf Package Name',
|
|
440
|
+
type: :string,
|
|
441
|
+
do_not_inherit: true,
|
|
442
|
+
cli: false,
|
|
443
|
+
desc: <<~ENDDESC
|
|
444
|
+
The display name of the Jamf Package object that installs this version. 'xolo-<title>-<version>'
|
|
445
|
+
ENDDESC
|
|
446
|
+
},
|
|
447
|
+
|
|
448
|
+
# @!attribute jamf_pkg_id
|
|
449
|
+
# @return [String] The id of the Jamf Package object that installs this version.
|
|
450
|
+
# This is an integer in a string, as are all IDs in the Jamf Pro API.
|
|
451
|
+
jamf_pkg_id: {
|
|
452
|
+
label: 'Jamf Package ID',
|
|
453
|
+
type: :string,
|
|
454
|
+
read_only: true,
|
|
455
|
+
do_not_inherit: true,
|
|
456
|
+
cli: false,
|
|
457
|
+
desc: <<~ENDDESC
|
|
458
|
+
The id of the Jamf Package object that installs this version. 'xolo-<title>-<version>'
|
|
459
|
+
ENDDESC
|
|
460
|
+
},
|
|
461
|
+
|
|
462
|
+
# @!attribute jamf_pkg_file
|
|
463
|
+
# @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' (or .zip)
|
|
465
|
+
jamf_pkg_file: {
|
|
466
|
+
label: 'Jamf Package File',
|
|
467
|
+
type: :string,
|
|
468
|
+
do_not_inherit: true,
|
|
469
|
+
cli: false,
|
|
470
|
+
desc: <<~ENDDESC
|
|
471
|
+
The installer filename of the Jamf Package object that installs this version: 'xolo-<title>-<version>.pkg' (or .zip).
|
|
472
|
+
ENDDESC
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
# @!attribute upload_date
|
|
476
|
+
# @return [Time] Timestamp of the original pkg upload
|
|
477
|
+
upload_date: {
|
|
478
|
+
label: 'Original Pkg Upload Date',
|
|
479
|
+
type: :time,
|
|
480
|
+
do_not_inherit: true,
|
|
481
|
+
cli: false,
|
|
482
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
483
|
+
desc: <<~ENDDESC
|
|
484
|
+
The time the first .pkg for this version was uploaded.
|
|
485
|
+
ENDDESC
|
|
486
|
+
},
|
|
487
|
+
|
|
488
|
+
# @!attribute uploaded_by
|
|
489
|
+
# @return [String] The login of the admin who uploaded the original pkg
|
|
490
|
+
uploaded_by: {
|
|
491
|
+
label: 'Original Pkg Uploaded By',
|
|
492
|
+
type: :string,
|
|
493
|
+
cli: false,
|
|
494
|
+
do_not_inherit: true,
|
|
495
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
496
|
+
desc: <<~ENDDESC
|
|
497
|
+
The login of the admin who last uploaded the first .pkg for this version.
|
|
498
|
+
ENDDESC
|
|
499
|
+
},
|
|
500
|
+
|
|
501
|
+
# @!attribute reupload_date
|
|
502
|
+
# @return [Time] Timestamp of the latest pkg reupload
|
|
503
|
+
reupload_date: {
|
|
504
|
+
label: 'Latest Pkg Re-Upload Date',
|
|
505
|
+
type: :time,
|
|
506
|
+
do_not_inherit: true,
|
|
507
|
+
cli: false,
|
|
508
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
509
|
+
desc: <<~ENDDESC
|
|
510
|
+
The last time the .pkg for this version was re-uploaded, after the initial upload.
|
|
511
|
+
ENDDESC
|
|
512
|
+
},
|
|
513
|
+
|
|
514
|
+
# @!attribute reuploaded_by
|
|
515
|
+
# @return [String] The login of the admin who reuploaded the latest pkg
|
|
516
|
+
reuploaded_by: {
|
|
517
|
+
label: 'Latest Pkg Re-Uploaded By',
|
|
518
|
+
type: :string,
|
|
519
|
+
cli: false,
|
|
520
|
+
do_not_inherit: true,
|
|
521
|
+
read_only: true, # maintained by the server, not editable by xadm TODO: same as cli: false??
|
|
522
|
+
desc: <<~ENDDESC
|
|
523
|
+
The login of the admin who last re-uploaded the .pkg for this version, after the initial upload.
|
|
524
|
+
ENDDESC
|
|
525
|
+
},
|
|
526
|
+
|
|
527
|
+
# @!attribute dist_pkg
|
|
528
|
+
# @return [Boolean] Is the most recently uploaded package a Distribution package? If so it can be used
|
|
529
|
+
# for MDM deployment.
|
|
530
|
+
dist_pkg: {
|
|
531
|
+
label: 'Distribution Package',
|
|
532
|
+
type: :boolean,
|
|
533
|
+
do_not_inherit: true,
|
|
534
|
+
cli: false,
|
|
535
|
+
desc: <<~ENDDESC
|
|
536
|
+
If true, the most recently uploaded .pkg file is a flat Distribution package, and can be deployed via MDM using the 'xadm deploy' command. Nil if no pkg was ever uploaded via xolo. Uploading a different .pkg file via other means will not change this value, and may cause the pkg to fail to deploy via MDM.
|
|
537
|
+
This value is set by the server when the pkg is uploaded.
|
|
538
|
+
ENDDESC
|
|
539
|
+
},
|
|
540
|
+
|
|
541
|
+
# @!attribute sha_512
|
|
542
|
+
# @return [String] The SHA512 checksum of the most recently uploaded package
|
|
543
|
+
sha_512: {
|
|
544
|
+
label: 'Package Checksum',
|
|
545
|
+
type: :string,
|
|
546
|
+
do_not_inherit: true,
|
|
547
|
+
cli: false,
|
|
548
|
+
desc: <<~ENDDESC
|
|
549
|
+
The SHA512 checksum of the most recently uploaded package.
|
|
550
|
+
NOTE: The Jamf Server may use an MD5 checksum in the package object.
|
|
551
|
+
This value is set by the server when the pkg is uploaded.
|
|
552
|
+
ENDDESC
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
}.freeze
|
|
556
|
+
|
|
557
|
+
ATTRIBUTES.each_key do |attr|
|
|
558
|
+
attr_accessor attr
|
|
559
|
+
attr_accessor "new_#{attr}"
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
# Constructor
|
|
563
|
+
######################
|
|
564
|
+
######################
|
|
565
|
+
|
|
566
|
+
# Instance Methods
|
|
567
|
+
######################
|
|
568
|
+
######################
|
|
569
|
+
|
|
570
|
+
######################
|
|
571
|
+
def pilot?
|
|
572
|
+
status == STATUS_PILOT || status.nil?
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
######################
|
|
576
|
+
def released?
|
|
577
|
+
status == STATUS_RELEASED
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
######################
|
|
581
|
+
def skipped?
|
|
582
|
+
status == STATUS_SKIPPED
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
######################
|
|
586
|
+
def deprecated?
|
|
587
|
+
status == STATUS_DEPRECATED
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
######################
|
|
591
|
+
def pending?
|
|
592
|
+
status == STATUS_PENDING
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
end # class Title
|
|
596
|
+
|
|
597
|
+
end # module BaseClasses
|
|
598
|
+
|
|
599
|
+
end # module Core
|
|
600
|
+
|
|
601
|
+
end # module Xolo
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Copyright 2025 Pixar
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the terms set forth in the LICENSE.txt file available at
|
|
4
|
+
# at the root of this project.
|
|
5
|
+
|
|
6
|
+
# frozen_string_literal: true
|
|
7
|
+
|
|
8
|
+
module Xolo
|
|
9
|
+
|
|
10
|
+
module Core
|
|
11
|
+
|
|
12
|
+
# Constants useful throughout Xolo
|
|
13
|
+
#####################################
|
|
14
|
+
module Constants
|
|
15
|
+
|
|
16
|
+
# Empty strings are used in various places
|
|
17
|
+
BLANK = ''
|
|
18
|
+
|
|
19
|
+
# The value to use when unsetting an option
|
|
20
|
+
NONE = 'none'
|
|
21
|
+
|
|
22
|
+
OK = 'OK'
|
|
23
|
+
|
|
24
|
+
ERROR = 'ERROR'
|
|
25
|
+
|
|
26
|
+
# Several things use x
|
|
27
|
+
X = 'x'
|
|
28
|
+
|
|
29
|
+
# CLI options and other things use dashes
|
|
30
|
+
DASH = '-'
|
|
31
|
+
|
|
32
|
+
# Several things use dots
|
|
33
|
+
DOT = '.'
|
|
34
|
+
|
|
35
|
+
# Cancelling is often an option
|
|
36
|
+
CANCEL = 'Cancel'
|
|
37
|
+
|
|
38
|
+
# and we check for things ending with .app
|
|
39
|
+
DOTAPP = '.app'
|
|
40
|
+
|
|
41
|
+
DOTJSON = '.json'
|
|
42
|
+
|
|
43
|
+
# These are handy for testing values without making new arrays, strings, etc every time.
|
|
44
|
+
TRUE_FALSE = [true, false].freeze
|
|
45
|
+
|
|
46
|
+
# lots of things get split on commmas
|
|
47
|
+
COMMA_SEP_RE = /\s*,\s*/.freeze
|
|
48
|
+
|
|
49
|
+
# lots of things get joined with commas
|
|
50
|
+
COMMA_JOIN = ', '
|
|
51
|
+
|
|
52
|
+
# Some things get split on semicolons
|
|
53
|
+
SEMICOLON_SEP_RE = /\s*;\s*/.freeze
|
|
54
|
+
|
|
55
|
+
# Once a thing has been uploaded and saved, this
|
|
56
|
+
# is what the server returns as the attr value
|
|
57
|
+
ITEM_UPLOADED = 'uploaded'
|
|
58
|
+
|
|
59
|
+
DOT_PKG = '.pkg'
|
|
60
|
+
|
|
61
|
+
DOT_ZIP = '.zip'
|
|
62
|
+
|
|
63
|
+
UNKNOWN = 'unknown'
|
|
64
|
+
|
|
65
|
+
# Installer packages must have one of these extensions
|
|
66
|
+
OK_PKG_EXTS = [DOT_PKG, DOT_ZIP]
|
|
67
|
+
|
|
68
|
+
# The value to use when all computers are the release-targets
|
|
69
|
+
# and for all manual-install policies
|
|
70
|
+
TARGET_ALL = 'all'
|
|
71
|
+
|
|
72
|
+
# when this module is included
|
|
73
|
+
def self.included(includer)
|
|
74
|
+
Xolo.verbose_include includer, self
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end # module constants
|
|
78
|
+
|
|
79
|
+
end # module core
|
|
80
|
+
|
|
81
|
+
end # module Xolo
|