opscode-pushy-client 2.3.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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +88 -0
- data/Gemfile +20 -0
- data/Gemfile.lock +242 -0
- data/LICENSE +201 -0
- data/README.md +43 -0
- data/RELEASE_PROCESS.md +105 -0
- data/Rakefile +42 -0
- data/bin/print_execution_environment +18 -0
- data/bin/push-apply +47 -0
- data/bin/pushy-client +8 -0
- data/bin/pushy-service-manager +19 -0
- data/jenkins/jenkins_run_tests.sh +9 -0
- data/keys/client_private.pem +27 -0
- data/keys/server_public.pem +9 -0
- data/lib/pushy_client.rb +268 -0
- data/lib/pushy_client/cli.rb +168 -0
- data/lib/pushy_client/heartbeater.rb +153 -0
- data/lib/pushy_client/job_runner.rb +316 -0
- data/lib/pushy_client/periodic_reconfigurer.rb +62 -0
- data/lib/pushy_client/protocol_handler.rb +508 -0
- data/lib/pushy_client/version.rb +23 -0
- data/lib/pushy_client/whitelist.rb +66 -0
- data/lib/pushy_client/win32.rb +27 -0
- data/lib/pushy_client/windows_service.rb +253 -0
- data/omnibus/Berksfile +12 -0
- data/omnibus/Gemfile +15 -0
- data/omnibus/Gemfile.lock +232 -0
- data/omnibus/LICENSE +201 -0
- data/omnibus/README.md +141 -0
- data/omnibus/acceptance/Berksfile +6 -0
- data/omnibus/acceptance/Berksfile.lock +35 -0
- data/omnibus/acceptance/Makefile +13 -0
- data/omnibus/acceptance/README.md +29 -0
- data/omnibus/acceptance/metadata.rb +12 -0
- data/omnibus/acceptance/recipes/chef-server-user-org.rb +31 -0
- data/omnibus/config/projects/push-jobs-client.rb +83 -0
- data/omnibus/config/software/opscode-pushy-client.rb +78 -0
- data/omnibus/files/mapfiles/solaris +18 -0
- data/omnibus/files/openssl-customization/windows/ssl_env_hack.rb +34 -0
- data/omnibus/omnibus.rb +54 -0
- data/omnibus/package-scripts/push-jobs-client/postinst +55 -0
- data/omnibus/package-scripts/push-jobs-client/postrm +39 -0
- data/omnibus/resources/push-jobs-client/dmg/background.png +0 -0
- data/omnibus/resources/push-jobs-client/dmg/icon.png +0 -0
- data/omnibus/resources/push-jobs-client/msi/assets/LICENSE.rtf +197 -0
- data/omnibus/resources/push-jobs-client/msi/assets/banner_background.bmp +0 -0
- data/omnibus/resources/push-jobs-client/msi/assets/dialog_background.bmp +0 -0
- data/omnibus/resources/push-jobs-client/msi/assets/oc.ico +0 -0
- data/omnibus/resources/push-jobs-client/msi/assets/oc_16x16.ico +0 -0
- data/omnibus/resources/push-jobs-client/msi/assets/oc_32x32.ico +0 -0
- data/omnibus/resources/push-jobs-client/msi/localization-en-us.wxl.erb +26 -0
- data/omnibus/resources/push-jobs-client/msi/parameters.wxi.erb +9 -0
- data/omnibus/resources/push-jobs-client/msi/source.wxs.erb +138 -0
- data/omnibus/resources/push-jobs-client/pkg/background.png +0 -0
- data/omnibus/resources/push-jobs-client/pkg/license.html.erb +202 -0
- data/omnibus/resources/push-jobs-client/pkg/welcome.html.erb +5 -0
- data/opscode-pushy-client.gemspec +28 -0
- data/pkg/opscode-pushy-client-2.3.0.gem +0 -0
- data/spec/pushy_client/protocol_handler_spec.rb +48 -0
- data/spec/pushy_client/whitelist_spec.rb +70 -0
- data/spec/spec_helper.rb +12 -0
- metadata +235 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
3
|
+
<!-- http://wix.codeplex.com/SourceControl/changeset/view/792e101c5cf7#src%2fext%2fUIExtension%2fwixlib%2fWixUI_en-us.wxl -->
|
4
|
+
<String Id="LANG">1033</String>
|
5
|
+
<String Id="ProductName"><%= friendly_name %></String>
|
6
|
+
<String Id="ManufacturerName">Chef Software, Inc.</String>
|
7
|
+
<String Id="WelcomeDlgTitle">{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard</String>
|
8
|
+
|
9
|
+
<String Id="LicenseAgreementDlgTitle">{\WixUI_Font_Title_White}End-User License Agreement</String>
|
10
|
+
<String Id="LicenseAgreementDlgDescription">{\WixUI_Font_Normal_White}Please read the following license agreement carefully</String>
|
11
|
+
|
12
|
+
<String Id="InstallDirDlgTitle">{\WixUI_Font_Title_White}Destination Folder</String>
|
13
|
+
<String Id="InstallDirDlgDescription">{\WixUI_Font_Normal_White}Click Next to install to the default folder or click Change to choose another.</String>
|
14
|
+
|
15
|
+
<String Id="ProgressDlgTitleInstalling">{\WixUI_Font_Title_White}Installing [ProductName]</String>
|
16
|
+
|
17
|
+
<String Id="VerifyReadyDlgInstallTitle">{\WixUI_Font_Title_White}Ready to install [ProductName]</String>
|
18
|
+
|
19
|
+
<!-- Service -->
|
20
|
+
<!-- Keep these in sync with the name and description in chef-service-manager -->
|
21
|
+
<String Id="ServiceDisplayName"><%= friendly_name %> Service</String>
|
22
|
+
<String Id="ServiceDescription">Runs <%= friendly_name %> on regular, configurable intervals.</String>
|
23
|
+
<String Id="FeatureMainName"><%= friendly_name %></String>
|
24
|
+
<String Id="FeatureServiceName"><%= friendly_name %> Service</String>
|
25
|
+
<String Id="FileExtractionProgress">Extracting files, please wait...</String>
|
26
|
+
</WixLocalization>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<Include>
|
3
|
+
<?define VersionNumber="<%= version %>" ?>
|
4
|
+
<?define DisplayVersionNumber="<%= display_version %>" ?>
|
5
|
+
<?define UpgradeCode="<%= upgrade_code %>" ?>
|
6
|
+
<% parameters.each do |key, value| -%>
|
7
|
+
<?define <%= key %>="<%= value %>" ?>
|
8
|
+
<% end -%>
|
9
|
+
</Include>
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<?xml version='1.0'?>
|
2
|
+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
3
|
+
|
4
|
+
<!-- This is how we include wxi files -->
|
5
|
+
<?include "parameters.wxi" ?>
|
6
|
+
|
7
|
+
<!--
|
8
|
+
Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build.
|
9
|
+
Name is made of localized product name and version number.
|
10
|
+
-->
|
11
|
+
<Product Id="*" Name="!(loc.ProductName) v$(var.DisplayVersionNumber)" Language="!(loc.LANG)"
|
12
|
+
Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)">
|
13
|
+
|
14
|
+
<!--
|
15
|
+
Define the minimum supported installer version (2.0).
|
16
|
+
The install should be done for the whole machine not just the current user
|
17
|
+
-->
|
18
|
+
<Package InstallerVersion="200" InstallPrivileges="elevated"
|
19
|
+
Compressed="yes" InstallScope="perMachine" />
|
20
|
+
|
21
|
+
<Media Id="1" Cabinet="PushJobsClient.cab" EmbedCab="yes" CompressionLevel="high" />
|
22
|
+
|
23
|
+
<!-- Major upgrade -->
|
24
|
+
<Upgrade Id="$(var.UpgradeCode)">
|
25
|
+
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" IncludeMinimum="no" Property="NEWERVERSIONDETECTED" />
|
26
|
+
<UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="$(var.VersionNumber)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
|
27
|
+
</Upgrade>
|
28
|
+
|
29
|
+
<InstallExecuteSequence>
|
30
|
+
<RemoveExistingProducts After="InstallValidate" />
|
31
|
+
</InstallExecuteSequence>
|
32
|
+
|
33
|
+
<!--
|
34
|
+
If fastmsi is set, custom actions will be invoked during install to unzip
|
35
|
+
project files, and during uninstall to remove the project folder
|
36
|
+
-->
|
37
|
+
<% if fastmsi %>
|
38
|
+
<SetProperty Id="FastUnzip"
|
39
|
+
Value="FASTZIPDIR=[INSTALLLOCATION];FASTZIPAPPNAME=$(var.ProjectLocationDir)"
|
40
|
+
Sequence="execute"
|
41
|
+
Before="FastUnzip" />
|
42
|
+
|
43
|
+
<CustomAction Id="FastUnzip"
|
44
|
+
BinaryKey="CustomActionFastMsiDLL"
|
45
|
+
DllEntry="FastUnzip"
|
46
|
+
Execute="deferred"
|
47
|
+
Impersonate="no"
|
48
|
+
Return="check" />
|
49
|
+
|
50
|
+
<Binary Id="CustomActionFastMsiDLL"
|
51
|
+
SourceFile="CustomActionFastMsi.CA.dll" />
|
52
|
+
|
53
|
+
<CustomAction Id="Cleanup"
|
54
|
+
Directory="INSTALLLOCATION"
|
55
|
+
ExeCommand="cmd /C "rd /S /Q $(var.ProjectLocationDir)""
|
56
|
+
Execute="deferred"
|
57
|
+
Impersonate="no"
|
58
|
+
Return="ignore" />
|
59
|
+
|
60
|
+
<InstallExecuteSequence>
|
61
|
+
<Custom Action="FastUnzip" After="InstallFiles">NOT Installed</Custom>
|
62
|
+
<Custom Action="Cleanup" After="RemoveFiles">REMOVE~="ALL"</Custom>
|
63
|
+
</InstallExecuteSequence>
|
64
|
+
|
65
|
+
<UI>
|
66
|
+
<ProgressText Action="FastUnzip">!(loc.FileExtractionProgress)</ProgressText>
|
67
|
+
</UI>
|
68
|
+
<% end %>
|
69
|
+
|
70
|
+
<Directory Id="TARGETDIR" Name="SourceDir">
|
71
|
+
<Directory Id="WindowsVolume">
|
72
|
+
<!-- Service needs chef directory to be present. -->
|
73
|
+
<Directory Id="CONFIGLOCATION" Name="chef">
|
74
|
+
<Component Id="CONFIGLOCATIONDIR" Guid="{F66F6394-51A4-4C5D-908B-E55584473436}" >
|
75
|
+
<CreateFolder Directory="CONFIGLOCATION" />
|
76
|
+
</Component>
|
77
|
+
</Directory>
|
78
|
+
<Directory Id="INSTALLLOCATION" Name="opscode">
|
79
|
+
<Directory Id="PROJECTLOCATION" Name="$(var.ProjectLocationDir)" >
|
80
|
+
<Directory Id="EMBEDDED" Name="embedded" >
|
81
|
+
<Directory Id="EMBEDDEDBIN" Name="bin" >
|
82
|
+
<Component Id="PushJobsClientPath" Guid="{0F9F9EE6-CC96-463E-BE6C-1AA33266FD9F}" >
|
83
|
+
<Environment Id="Environment"
|
84
|
+
Name="PATH" Action="set" Part="last" System="yes" Value="[PROJECTLOCATION]bin" />
|
85
|
+
</Component>
|
86
|
+
<Component Id="PushJobsClientService" Guid="{1E9F8C22-25A7-4084-9FD9-F1B4C10E62F9}" >
|
87
|
+
<File Id="RubyExecutable" Source="$(var.ProjectSourceDir)\embedded\bin\ruby.exe" KeyPath="yes" />
|
88
|
+
<!-- The first start of this service is expected to fail - there is no config file yet. -->
|
89
|
+
<ServiceInstall Name="push-jobs-client" Type="ownProcess"
|
90
|
+
Start="auto" Vital="no" ErrorControl="ignore"
|
91
|
+
Arguments="[PROJECTLOCATION]$(var.PushJobsGemPath)\lib\pushy_client\windows_service.rb"
|
92
|
+
DisplayName="!(loc.ServiceDisplayName)"
|
93
|
+
Description="!(loc.ServiceDescription)" />
|
94
|
+
<ServiceControl Id="ControlPushJobsClientService" Name="push-jobs-client"
|
95
|
+
Remove="both" Start="install" Stop="both" Wait="no" />
|
96
|
+
</Component>
|
97
|
+
</Directory>
|
98
|
+
</Directory>
|
99
|
+
</Directory>
|
100
|
+
</Directory>
|
101
|
+
</Directory>
|
102
|
+
</Directory>
|
103
|
+
|
104
|
+
<!-- Set the components defined in our fragment files that will be used for our feature -->
|
105
|
+
<Feature Id="PushJobsClientFeature" Title="!(loc.ProductName)" Level="1">
|
106
|
+
<ComponentGroupRef Id="ProjectDir" />
|
107
|
+
<ComponentRef Id="PushJobsClientPath" />
|
108
|
+
<ComponentRef Id="CONFIGLOCATIONDIR" />
|
109
|
+
<ComponentRef Id="PushJobsClientService" />
|
110
|
+
</Feature>
|
111
|
+
|
112
|
+
<!--
|
113
|
+
UI Stuff
|
114
|
+
-->
|
115
|
+
<Icon Id="oc.ico" SourceFile="Resources\assets\oc_16x16.ico"/>
|
116
|
+
<Property Id="ARPPRODUCTICON" Value="oc.ico" />
|
117
|
+
<Property Id="ARPHELPLINK" Value="http://www.getchef.com/support/" />
|
118
|
+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
|
119
|
+
|
120
|
+
<UIRef Id="PushJobsClientUI_InstallDir"/>
|
121
|
+
<UI Id="PushJobsClientUI_InstallDir">
|
122
|
+
<UIRef Id="WixUI_FeatureTree"/>
|
123
|
+
<TextStyle Id="WixUI_Font_Normal_White" FaceName="Tahoma" Size="8" Red="255" Green="255" Blue="255" />
|
124
|
+
<TextStyle Id="WixUI_Font_Bigger_White" FaceName="Tahoma" Size="12" Red="255" Green="255" Blue="255" />
|
125
|
+
<TextStyle Id="WixUI_Font_Title_White" FaceName="Tahoma" Size="9" Bold="yes" Red="255" Green="255" Blue="255" />
|
126
|
+
</UI>
|
127
|
+
|
128
|
+
<WixVariable Id="WixUILicenseRtf" Value="Resources\assets\LICENSE.rtf" />
|
129
|
+
<WixVariable Id="WixUIDialogBmp" Value="Resources\assets\dialog_background.bmp" />
|
130
|
+
<WixVariable Id="WixUIBannerBmp" Value="Resources\assets\banner_background.bmp" />
|
131
|
+
|
132
|
+
<WixVariable Id="WixUIExclamationIco" Value="Resources\assets\oc_32x32.ico" />
|
133
|
+
<WixVariable Id="WixUIInfoIco" Value="Resources\assets\oc_32x32.ico" />
|
134
|
+
<WixVariable Id="WixUINewIco" Value="Resources\assets\oc_16x16.ico" />
|
135
|
+
<WixVariable Id="WixUIUpIco" Value="Resources\assets\oc_16x16.ico" />
|
136
|
+
|
137
|
+
</Product>
|
138
|
+
</Wix>
|
Binary file
|
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright <%= Time.new.year %> Chef Software Inc.
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/pushy_client/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Mark Anderson"]
|
6
|
+
gem.email = ["mark@chef.io"]
|
7
|
+
gem.description = %q{Client for Chef push jobs server}
|
8
|
+
gem.summary = %q{Client for Chef push jobs server}
|
9
|
+
gem.homepage = "https://github.com/chef/opscode-pushy-client"
|
10
|
+
|
11
|
+
gem.executables = Dir.glob('bin/**/*').map{|f| File.basename(f)}
|
12
|
+
gem.files = Dir.glob('**/*').reject{|f| File.directory?(f)}
|
13
|
+
gem.test_files = Dir.glob('{test,spec,features}/**/*')
|
14
|
+
gem.name = "opscode-pushy-client"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = PushyClient::VERSION
|
17
|
+
|
18
|
+
gem.required_ruby_version = '>= 2.2'
|
19
|
+
|
20
|
+
gem.add_dependency "chef", ">= 12.19", "< 14.0"
|
21
|
+
gem.add_dependency "ohai", ">= 8.23", "< 14.0"
|
22
|
+
gem.add_dependency "ffi-rzmq"
|
23
|
+
gem.add_dependency "uuidtools"
|
24
|
+
|
25
|
+
%w(rake rdoc rspec rspec_junit_formatter).each do |dep|
|
26
|
+
gem.add_development_dependency dep
|
27
|
+
end
|
28
|
+
end
|
Binary file
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "chef/log"
|
3
|
+
require "pushy_client/protocol_handler"
|
4
|
+
|
5
|
+
describe PushyClient::ProtocolHandler do
|
6
|
+
describe "#send_command" do
|
7
|
+
let(:client) { double("client") }
|
8
|
+
let(:protocol_handler) { described_class.new(client) }
|
9
|
+
let(:params) { {} }
|
10
|
+
|
11
|
+
subject(:send_command) do
|
12
|
+
protocol_handler.send_command(:succeeded, 0, params)
|
13
|
+
end
|
14
|
+
|
15
|
+
before :each do
|
16
|
+
allow(client).to receive(:on_server_availability_change)
|
17
|
+
allow(client).to receive(:node_name)
|
18
|
+
allow(client).to receive(:hostname)
|
19
|
+
allow(client).to receive(:org_name)
|
20
|
+
allow(client).to receive(:incarnation_id)
|
21
|
+
allow_any_instance_of(described_class).to receive(:send_signed_json_command)
|
22
|
+
allow(Chef::Log).to receive(:warn)
|
23
|
+
end
|
24
|
+
|
25
|
+
context "when the message exceeds the MAX_BODY_SIZE" do
|
26
|
+
let(:params) do
|
27
|
+
{
|
28
|
+
stdout: Array.new(32000, "x").join,
|
29
|
+
stderr: Array.new(32000, "x").join,
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
it "logs a warning" do
|
34
|
+
expect(Chef::Log).to receive(:warn).with(
|
35
|
+
"Command output too long. Will not be sent to server."
|
36
|
+
)
|
37
|
+
send_command
|
38
|
+
end
|
39
|
+
|
40
|
+
it "drops stderr and stdout" do
|
41
|
+
expect(protocol_handler).to receive(:send_signed_json_command).with(
|
42
|
+
:hmac_sha256, hash_excluding(:stdout, :stderr)
|
43
|
+
)
|
44
|
+
send_command
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|