smart_proxy_shellhooks 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b2c88465e5cf570a7ac3caef625e845080138ac6ec5620a8022cd8f4313e054
4
- data.tar.gz: 266f82a068b1036ca4bb2ceaf1c5224069992b0c0a98af78ae632a76b4774e5c
3
+ metadata.gz: 1e061eb911543192bd2bbe883ec1cd187c6fa4959caad88fed0b262e9eff07fb
4
+ data.tar.gz: f8ceeacfd512558776ae6b8f5599e8e3142e4484970dfafef67ce788ddf3fac8
5
5
  SHA512:
6
- metadata.gz: 9db0fdd198401f0251d49b084f31c389e410fe21b2eccc4a8c16a106358c14993b66437b241836e7e5f08f7e1b8ab1a69b7635136f7906b336e08cd50d77054e
7
- data.tar.gz: 635a2716f4d2ec5c5eaa21989a1560c61704b8d9a45f1362438adb3aca030fcb54c3e5dea82aa585a1f8f12148ec6f7e0f71e90db2554549abebfa44be3812a1
6
+ metadata.gz: 79088ea74e01d619f1841345f0da3e0decddcd570a2b2458902be94a6a03c520c2868240908bf7a38d6284a0598a1ba62e7e3ff3b8574628204af3511be04a6c
7
+ data.tar.gz: 800ebeef19985c96fd2101328a2f1953090baedf9397d74922ba65fc3239ef069a6971949c547147cfe87b878121e94ad4dcfea002f8e3d7ec408dabd2a3aa9c
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # Smart Proxy Shell Hooks
2
2
 
3
- Provides an endpoint for foreman_webhooks plugin executing binaries (shell scripts, python scripts, anything). Remember CGI? :-)
3
+ Provides an endpoint for foreman_webhooks plugin executing binaries (shell scripts, python scripts, anything).
4
4
 
5
5
  ## Installation
6
6
 
7
- Install the plugin using the foreman-installer. Never enable this service via HTTP endpoint, only HTTPS with authentication using client certificate should be used.
7
+ Install the plugin using the foreman-installer. Never enable this service via HTTP endpoint, only HTTPS with authentication using client certificate and with trusted hosts should be used.
8
8
 
9
- Open up `/var/lib/foreman/shellhooks` to see some examples, these are harmless stubs that does nothing.
9
+ Open up `/var/lib/foreman-proxy/shellhooks` to see some examples, these are harmless stubs that do nothing as a starting point.
10
10
 
11
11
  ## Writing scripts
12
12
 
13
- Script must be placed in `/var/lib/foreman/shellhooks` having a name consisting of alphanums, dash or underscore. The file must be executable. To see list of availble and valid scripts matching the requirements, perform:
13
+ Script must be placed in `/var/lib/foreman-proxy/shellhooks` having a name consisting of alphanums, dash or underscore. The file must be executable. To see list of availble and valid scripts matching the requirements, perform:
14
14
 
15
15
  $ curl -s https://localhost:9090/shellhook/ | jq
16
16
  {
@@ -34,7 +34,7 @@ To execute an example script which prints input back to output (smart-proxy log)
34
34
 
35
35
  To find out if the script was executed, open up smart-proxy log:
36
36
 
37
- 2020-08-27T12:23:37 eabe1a74 [I] Started POST /shellhook/print_body
37
+ 2020-08-27T12:23:37 eabe1a74 [I] Started POST /shellhook/print_body
38
38
  2020-08-27T12:23:37 eabe1a74 [D] Headers: {"HTTP_HOST"=>"localhost:9090", "HTTP_USER_AGENT"=>"curl/7.69.1", "HTTP_ACCEPT"=>"*/*", "HTTP_VERSION"=>"HTTP/1.1"}
39
39
  2020-08-27T12:23:37 eabe1a74 [D] Body: This is a test
40
40
  2020-08-27T12:23:37 eabe1a74 [I] Finished POST /shellhook/print_body with 200 (0.68 ms)
@@ -66,5 +66,5 @@ This can be useful for passing database ID or other simple fields so standard JS
66
66
  * The return (exit) value is only logged into the smart-proxy logger.
67
67
  * Optionally HTTP headers X-Shellhook-Arg-1 to N are passed as arguments.
68
68
  * HTTP return code is 200 when script was executed (not output) or non-200 when the plugin failed (not script).
69
- * Keep in mind all the input is usafe, clean every individual data element or argument to prevent security vulnerability.
69
+ * Keep in mind all the input is unsafe, clean every individual data element or argument to prevent security vulnerability.
70
70
  * Example templates are shipped with foreman_webhooks plugin and few scripts with this plugin.
data/examples/print_args CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/bin/sh
2
2
  #
3
- # Prints all arguments
3
+ # Prints all arguments to stderr
4
4
  #
5
- echo "$@"
5
+ echo "$@" >&2
@@ -6,7 +6,6 @@ module Proxy::ShellHooks
6
6
 
7
7
  default_settings :directory => '/var/lib/foreman/shellhooks'
8
8
 
9
- http_rackup_path File.expand_path('shellhooks_http_config.ru', File.expand_path('../', __FILE__))
10
- https_rackup_path File.expand_path('shellhooks_http_config.ru', File.expand_path('../', __FILE__))
9
+ rackup_path File.expand_path('shellhooks_http_config.ru', __dir__)
11
10
  end
12
11
  end
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  module ShellHooks
3
- VERSION = '0.9.2'
3
+ VERSION = '0.9.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_shellhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Zapletal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides easy integration with 3rd parties for Foreman
14
14
  email: lzap+spam@redhat.com
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubygems_version: 3.1.4
53
+ rubygems_version: 3.5.9
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: Run shell scripts via Foreman webhooks