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
|
@@ -489,14 +489,18 @@ module Xolo
|
|
|
489
489
|
# @return [Jamf::Policy] The auto-install-policy for this version, if it exists
|
|
490
490
|
##########################
|
|
491
491
|
def jamf_auto_install_policy
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
Jamf::Policy.fetch(name: jamf_auto_install_policy_name, cnx: jamf_cnx)
|
|
495
|
-
else
|
|
496
|
-
return if deleting?
|
|
492
|
+
# This is imporant to avoid infinite recursion
|
|
493
|
+
return @jamf_auto_install_policy if @jamf_auto_install_policy
|
|
497
494
|
|
|
498
|
-
|
|
499
|
-
|
|
495
|
+
if jamf_auto_install_policy_exist?
|
|
496
|
+
@jamf_auto_install_policy = Jamf::Policy.fetch(name: jamf_auto_install_policy_name, cnx: jamf_cnx)
|
|
497
|
+
else
|
|
498
|
+
return if deleting?
|
|
499
|
+
|
|
500
|
+
# this sets @jamf_auto_install_policy
|
|
501
|
+
create_jamf_auto_install_policy
|
|
502
|
+
end
|
|
503
|
+
@jamf_auto_install_policy
|
|
500
504
|
end
|
|
501
505
|
|
|
502
506
|
# The auto install policy is triggered by checkin
|
|
@@ -505,32 +509,34 @@ module Xolo
|
|
|
505
509
|
# Before release, the targets are those defined in #pilot_groups_to_use
|
|
506
510
|
#
|
|
507
511
|
# After release, the targets are changed to those
|
|
508
|
-
# in title_object#
|
|
512
|
+
# in title_object#release_groups
|
|
509
513
|
#
|
|
510
514
|
# This policy is never in self service
|
|
511
515
|
# @return [Jamf::Policy] the auto install policy for this version
|
|
512
516
|
#########################
|
|
513
517
|
def create_jamf_auto_install_policy
|
|
514
518
|
progress "Jamf: Creating Auto Install Policy: #{jamf_auto_install_policy_name}", log: :debug
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
+
|
|
520
|
+
@jamf_auto_install_policy = Jamf::Policy.create name: jamf_auto_install_policy_name, cnx: jamf_cnx
|
|
521
|
+
|
|
522
|
+
configure_jamf_auto_install_policy
|
|
523
|
+
@jamf_auto_install_policy.save
|
|
519
524
|
end
|
|
520
525
|
|
|
521
526
|
# repair the auto-install policy only
|
|
522
527
|
#############################
|
|
523
528
|
def repair_jamf_auto_install_policy
|
|
524
529
|
progress "Jamf: Repairing Auto Install Policy '#{jamf_auto_install_policy_name}'", log: :info
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
pol.save
|
|
530
|
+
configure_jamf_auto_install_policy
|
|
531
|
+
jamf_auto_install_policy.save
|
|
528
532
|
end
|
|
529
533
|
|
|
530
534
|
# Configure the given policy as the auto-install policy for this version
|
|
531
535
|
# @param pol [Jamf::Policy] the policy to configure
|
|
532
536
|
################################
|
|
533
|
-
def configure_jamf_auto_install_policy(pol)
|
|
537
|
+
def configure_jamf_auto_install_policy(pol = nil)
|
|
538
|
+
pol ||= jamf_auto_install_policy
|
|
539
|
+
|
|
534
540
|
pol.category = Xolo::Server::JAMF_XOLO_CATEGORY
|
|
535
541
|
pol.set_trigger_event :checkin, true
|
|
536
542
|
pol.set_trigger_event :custom, Xolo::BLANK
|
|
@@ -553,7 +559,7 @@ module Xolo
|
|
|
553
559
|
end
|
|
554
560
|
|
|
555
561
|
# enable or disable based on status
|
|
556
|
-
if pilot? || released?
|
|
562
|
+
if pilot? || released? || releasing?
|
|
557
563
|
pol.enable
|
|
558
564
|
else
|
|
559
565
|
pol.disable
|
|
@@ -62,6 +62,9 @@ module Xolo
|
|
|
62
62
|
set_patch_capabilites
|
|
63
63
|
set_ted_patch_component_criteria ttl_obj: title_object
|
|
64
64
|
|
|
65
|
+
enable_ted_patch
|
|
66
|
+
title_object.enable_ted_title
|
|
67
|
+
|
|
65
68
|
self.ted_id_number = new_patch.patchId
|
|
66
69
|
end
|
|
67
70
|
|
|
@@ -94,6 +97,9 @@ module Xolo
|
|
|
94
97
|
# those are handled by the title object calling the same method
|
|
95
98
|
#
|
|
96
99
|
# set_ted_patch_component_criteria ttl_obj: title_object
|
|
100
|
+
|
|
101
|
+
enable_ted_patch
|
|
102
|
+
title_object.enable_ted_title
|
|
97
103
|
end
|
|
98
104
|
|
|
99
105
|
# Set any killapps for this version in the title editor.
|
|
@@ -235,9 +241,6 @@ module Xolo
|
|
|
235
241
|
comp = ted_patch.component
|
|
236
242
|
|
|
237
243
|
ea_name ? set_ea_component(comp, ea_name) : set_app_component(comp, app_name, app_bundle_id)
|
|
238
|
-
|
|
239
|
-
# SHouldn't be needed here, is called in both create and update
|
|
240
|
-
# enable_ted_patch
|
|
241
244
|
end
|
|
242
245
|
|
|
243
246
|
# get the param values for patch component criteria from the title object,
|
|
@@ -361,7 +364,9 @@ module Xolo
|
|
|
361
364
|
set_patch_killapps
|
|
362
365
|
set_patch_capabilites
|
|
363
366
|
set_ted_patch_component_criteria ttl_obj: title_object
|
|
364
|
-
enable_ted_patch
|
|
367
|
+
enable_ted_patch
|
|
368
|
+
|
|
369
|
+
title_object.enable_ted_title
|
|
365
370
|
end
|
|
366
371
|
|
|
367
372
|
end # VersionTedAccess
|
data/lib/xolo/server/routes.rb
CHANGED
|
@@ -71,15 +71,12 @@ module Xolo
|
|
|
71
71
|
##############
|
|
72
72
|
after do
|
|
73
73
|
# log a stack trace if the response status is 4xx or 5xx, or if there's a sinatra.error
|
|
74
|
-
if response.status >= 400
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
log_error 'Xolo Stack trace:'
|
|
81
|
-
caller.each { |line| log_error "..#{line}" }
|
|
82
|
-
end
|
|
74
|
+
log_debug "Response status #{response.status} for #{request.request_method} #{request.path}" if response.status >= 400
|
|
75
|
+
|
|
76
|
+
sinatra_error = env['sinatra.error']
|
|
77
|
+
if sinatra_error
|
|
78
|
+
log_error "Sinatra Error message: #{sinatra_error.message}"
|
|
79
|
+
sinatra_error.backtrace.each { |line| log_error "..#{line}" }
|
|
83
80
|
end
|
|
84
81
|
|
|
85
82
|
if @no_json
|
|
@@ -99,7 +96,6 @@ module Xolo
|
|
|
99
96
|
# from ruby-jss and windoo api connections?
|
|
100
97
|
# perhaps a callback to when a Sinatra server instance
|
|
101
98
|
# 'finishes'?
|
|
102
|
-
# can't
|
|
103
99
|
end
|
|
104
100
|
|
|
105
101
|
# Ping
|
|
@@ -135,19 +131,6 @@ module Xolo
|
|
|
135
131
|
# test
|
|
136
132
|
##########
|
|
137
133
|
get '/test' do
|
|
138
|
-
# Xolo::Server::Helpers::Maintenance.post_to_start_cleanup force: true
|
|
139
|
-
# result = { result: 'posted to start cleanup' }
|
|
140
|
-
|
|
141
|
-
# send_email(
|
|
142
|
-
# to: 'xolo@pixar.com',
|
|
143
|
-
# subject: 'Test Email from Xolo Server',
|
|
144
|
-
# msg: 'This is a test email from the Xolo Server'
|
|
145
|
-
# )
|
|
146
|
-
# result = { result: 'message sent' }
|
|
147
|
-
|
|
148
|
-
# client_data_testing
|
|
149
|
-
# update_client_data
|
|
150
|
-
|
|
151
134
|
result = { result: 'test' }
|
|
152
135
|
|
|
153
136
|
body result
|
data/lib/xolo/server/version.rb
CHANGED
|
@@ -560,8 +560,6 @@ module Xolo
|
|
|
560
560
|
save_local_data
|
|
561
561
|
|
|
562
562
|
create_patch_in_ted
|
|
563
|
-
enable_ted_patch
|
|
564
|
-
title_object.enable_ted_title
|
|
565
563
|
|
|
566
564
|
create_in_jamf
|
|
567
565
|
|
|
@@ -608,7 +606,6 @@ module Xolo
|
|
|
608
606
|
|
|
609
607
|
# update ted before jamf
|
|
610
608
|
update_patch_in_ted
|
|
611
|
-
enable_ted_patch
|
|
612
609
|
update_version_in_jamf
|
|
613
610
|
update_local_instance_values
|
|
614
611
|
save_local_data
|
|
@@ -689,6 +686,7 @@ module Xolo
|
|
|
689
686
|
progress msg, log: :info
|
|
690
687
|
pol = jamf_auto_install_policy
|
|
691
688
|
set_policy_release_groups pol
|
|
689
|
+
pol.enable
|
|
692
690
|
pol.save
|
|
693
691
|
|
|
694
692
|
# set scope targets of patch policy to all (in patch pols, 'all' means 'all eligible')
|
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: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Lasell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -154,14 +154,12 @@ description: |
|
|
|
154
154
|
== Xolo
|
|
155
155
|
Xolo (sorta pronounced 'show-low') is an HTTPS server and set of command-line tools for macOS that provide automatable access to the software deployment and patch management aspects of {Jamf Pro}[https://www.jamf.com/products/jamf-pro/] and the {Jamf Title Editor}[https://learn.jamf.com/en-US/bundle/title-editor/page/About_Title_Editor.html]. It enhances Jamf Pro's abilities in many ways:
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"Xolo" is the short name for the Mexican hairless dog breed {'xoloitzcuintle'}[https://en.wikipedia.org/wiki/Xoloitzcuintle] (show-low-itz-kwint-leh), as personified by Dante in the 2017 Pixar film _Coco_.
|
|
157
|
+
* Management of titles and versions/patches is scriptable and automatable, allowing developers and admins to integrate with CI/CD workflows.
|
|
158
|
+
* Simplifies and standardizes the complex, multistep manual process of managing titles and patches using the Title Editor and Patch Management web interfaces.
|
|
159
|
+
* Client installs can be performed by remotely via ssh and/or MDM
|
|
160
|
+
* Automated pre-release piloting of new versions/patches
|
|
161
|
+
* Titles can be expired (auto-uninstalled) after a period of disuse, reclaiming unused licenses.
|
|
162
|
+
* And more!
|
|
165
163
|
|
|
166
164
|
The xolo-server gem packages the code needed to run `xoloserver`, the sinatra-based HTTPS server at the heart of Xolo.
|
|
167
165
|
email: xolo@pixar.com
|
|
@@ -175,9 +173,22 @@ files:
|
|
|
175
173
|
- LICENSE.txt
|
|
176
174
|
- README.md
|
|
177
175
|
- bin/xoloserver
|
|
176
|
+
- data/client/xolo
|
|
178
177
|
- data/com.pixar.xoloserver.plist
|
|
179
178
|
- data/uninstall-pkgs-by-id.zsh
|
|
179
|
+
- lib/optimist_with_insert_blanks.rb
|
|
180
180
|
- lib/xolo-server.rb
|
|
181
|
+
- lib/xolo/core.rb
|
|
182
|
+
- lib/xolo/core/base_classes/configuration.rb
|
|
183
|
+
- lib/xolo/core/base_classes/server_object.rb
|
|
184
|
+
- lib/xolo/core/base_classes/title.rb
|
|
185
|
+
- lib/xolo/core/base_classes/version.rb
|
|
186
|
+
- lib/xolo/core/constants.rb
|
|
187
|
+
- lib/xolo/core/exceptions.rb
|
|
188
|
+
- lib/xolo/core/json_wrappers.rb
|
|
189
|
+
- lib/xolo/core/loading.rb
|
|
190
|
+
- lib/xolo/core/output.rb
|
|
191
|
+
- lib/xolo/core/version.rb
|
|
181
192
|
- lib/xolo/server.rb
|
|
182
193
|
- lib/xolo/server/app.rb
|
|
183
194
|
- lib/xolo/server/command_line.rb
|