stackfu 0.1.1 → 0.1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/Manifest +36 -4
- data/Rakefile +1 -1
- data/autotest/discover.rb +1 -0
- data/firewall/config/01-controls.yml +5 -0
- data/firewall/config/02-requirements.yml +4 -0
- data/firewall/config/03-executions.yml +6 -0
- data/firewall/config/03-scripts.yml +6 -0
- data/firewall/config/04-validations.yml +4 -0
- data/firewall/executables/configure_ufw.sh.erb +9 -0
- data/firewall/executables/install_ufw.sh.erb +7 -0
- data/firewall/script/configure_ufw.sh.erb +9 -0
- data/firewall/script/install_ufw.sh.erb +7 -0
- data/firewall/script.yml +8 -0
- data/lib/stackfu/api_hooks.rb +2 -2
- data/lib/stackfu/app.rb +5 -5
- data/lib/stackfu/commands/command.rb +7 -3
- data/lib/stackfu/commands/config_command.rb +1 -1
- data/lib/stackfu/commands/deploy_command.rb +53 -61
- data/lib/stackfu/commands/dump_command.rb +46 -40
- data/lib/stackfu/commands/generate_command.rb +10 -12
- data/lib/stackfu/commands/help_command.rb +1 -1
- data/lib/stackfu/commands/list_command.rb +76 -22
- data/lib/stackfu/commands/publish_command.rb +35 -18
- data/lib/stackfu/commands/server_command.rb +124 -124
- data/lib/stackfu/date_helper.rb +111 -0
- data/lib/stackfu.rb +4 -2
- data/spec/fixtures/scripts/all.json +11 -0
- data/spec/fixtures/scripts/create.json +10 -0
- data/spec/fixtures/scripts/delete.json +10 -0
- data/spec/fixtures/scripts/firewall.json +12 -0
- data/spec/fixtures/scripts/none.json +12 -0
- data/spec/fixtures/scripts/not_found.json +11 -0
- data/spec/fixtures/scripts/script_not_found.json +11 -0
- data/spec/fixtures/servers/all.json +12 -0
- data/spec/fixtures/servers/cannot_deploy.json +0 -0
- data/spec/fixtures/servers/deploy.json +290 -0
- data/spec/fixtures/servers/none.json +12 -0
- data/spec/fixtures/servers/not_found.json +11 -0
- data/spec/fixtures/servers/webbynode/deploy.json +12 -0
- data/spec/fixtures/servers/webbynode.json +12 -0
- data/spec/spec_helper.rb +191 -0
- data/spec/stackfu/api_hooks_spec.rb +7 -0
- data/spec/stackfu/commands/deploy_command_spec.rb +65 -0
- data/spec/stackfu/commands/dump_command_spec.rb +47 -0
- data/spec/stackfu/commands/generate_command_spec.rb +90 -0
- data/spec/stackfu/commands/list_command_spec.rb +53 -0
- data/spec/stackfu/commands/publish_command_spec.rb +67 -0
- data/stackfu.gemspec +4 -4
- data/templates/02-requirements.yml.erb +8 -10
- data/templates/{03-scripts.yml.erb → 03-executions.yml.erb} +3 -3
- data/templates/04-validations.yml.erb +1 -2
- data/templates/stack.yml.erb +4 -13
- data/test/support/fixtures.rb +1 -1
- data/test/unit/commands/test_server_command.rb +259 -259
- metadata +42 -7
- data/test/stack.yml +0 -26
- /data/stackfu-installer/config/{03-scripts.yml → 03-executions.yml} +0 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Etag: "b9e3a93cd52f06d0b7cf83233796e8a6"
|
3
|
+
Connection: Keep-Alive
|
4
|
+
Content-Type: application/json; charset=utf-8
|
5
|
+
Date: Sat, 04 Sep 2010 16:59:55 GMT
|
6
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-12-24)
|
7
|
+
X-Runtime: 0.323121
|
8
|
+
Content-Length: 1522
|
9
|
+
Cache-Control: max-age=0, private, must-revalidate
|
10
|
+
Set-Cookie: _stackfu_session=BAh7ByIPc2Vzc2lvbl9pZCIlMThjNWIzN2IyNmVmYzIxZWQ1NjE2MDY2ODQ5NWE2OTMiGXdhcmRlbi51c2VyLnVzZXIua2V5WwciCVVzZXJvOhNCU09OOjpPYmplY3RJRAY6CkBkYXRhWxFpUWkBgml%2BaXNpAdRpAYlpAehpM2kBwWkAaQBpCA%3D%3D--cf9903a5a7a8da8f8ca044431cb5a249b9e2a60e; path=/; HttpOnly
|
11
|
+
|
12
|
+
{"slug":"firewall","name":"firewall","controls":[{"name":"Ports","label":"Ports","_id":"4c82796ed489e82ec1000005","_type":"Textbox","type":"Textbox","hint":"separate by comma's"}],"created_at":"2010-09-04T13:53:02-03:00","updated_at":"2010-09-04T13:53:02-03:00","_id":"4c82796ed489e82ec1000008","validations":[{"body":"test -x ufw","_id":"4c82796ed489e82ec1000002","_type":"ExecutableExists","params":{"data":"ufw"},"description":"File ufw exists and is executable"}],"user_id":"4c82796ed489e82ec1000003","requirements":[{"body":"test -x apt-get","_id":"4c82796ed489e82ec1000001","_type":"ExecutableExists","params":{"data":"apt-get"},"description":"File apt-get exists and is executable"}],"executions":[{"body":" # \n # configure_ufw.sh\n # Tue Dec 01 15:06:48 -0200 2009\n #\n\n apt-get update\n apt-get install -y ufw\n","_id":"4c82796ed489e82ec1000006","description":"Install Ufw","watching_user_ids":[]},{"body":" # \n # install_ufw.sh\n # Tue Dec 01 15:06:48 -0200 2009\n #\n\n ufw default deny\n <% ports.split(\",\").each do |port| %>\n ufw allow <%= port %> \n <% end %>\n","_id":"4c82796ed489e82ec1000007","description":"Configure Ufw","watching_user_ids":[]}],"description":"Set up a firewall for your server to improve security.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Praesent eget erat libero, id malesuada tortor.\n Donec pharetra sapien et nulla ultricies ac pharetra neque vulputate.","watching_user_ids":[]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Etag: "d751713988987e9331980363e24189ce"
|
3
|
+
Connection: Keep-Alive
|
4
|
+
Content-Type: application/json; charset=utf-8
|
5
|
+
Date: Sat, 04 Sep 2010 00:56:09 GMT
|
6
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-12-24)
|
7
|
+
X-Runtime: 0.273961
|
8
|
+
Content-Length: 2
|
9
|
+
Cache-Control: max-age=0, private, must-revalidate
|
10
|
+
Set-Cookie: _stackfu_session=BAh7ByIPc2Vzc2lvbl9pZCIlOGM0YTQ1YWVkYmVmNWVjZjM3YmRlNzRkZTZiNGMyYzUiGXdhcmRlbi51c2VyLnVzZXIua2V5WwciCVVzZXJvOhNCU09OOjpPYmplY3RJRAY6CkBkYXRhWxFpUWkBgWkBmGk9aQHUaQGJaQHoaQGlaWxpAGkAaQg%3D--f442f0eef2e4cee067a9b48f75fab269c294d489; path=/; HttpOnly
|
11
|
+
|
12
|
+
[]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
HTTP/1.1 404 Not Found
|
2
|
+
Connection: Keep-Alive
|
3
|
+
Content-Type: application/json; charset=utf-8
|
4
|
+
Date: Mon, 06 Sep 2010 15:02:21 GMT
|
5
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-12-24)
|
6
|
+
X-Runtime: 0.358780
|
7
|
+
Content-Length: 9
|
8
|
+
Cache-Control: no-cache
|
9
|
+
Set-Cookie: _stackfu_session=BAh7ByIPc2Vzc2lvbl9pZCIlYzRmNDY3MjI0NjJkNjM5ZGVlZDg4Yzk4NTY0Nzk4ZDciGXdhcmRlbi51c2VyLnVzZXIua2V5WwciCVVzZXJvOhNCU09OOjpPYmplY3RJRAY6CkBkYXRhWxFpUWkBg2kB%2FmkkaQHUaQGJaQHoaQGTaQGPaQBpAGkJ--186aa5e17490d4aee303988159a88721906c47b2; path=/; HttpOnly
|
10
|
+
|
11
|
+
Not found
|
@@ -0,0 +1,11 @@
|
|
1
|
+
HTTP/1.1 404 Not Found
|
2
|
+
Connection: Keep-Alive
|
3
|
+
Content-Type: application/json; charset=utf-8
|
4
|
+
Date: Fri, 03 Sep 2010 18:30:56 GMT
|
5
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-12-24)
|
6
|
+
X-Runtime: 0.447237
|
7
|
+
Content-Length: 9
|
8
|
+
Cache-Control: no-cache
|
9
|
+
Set-Cookie: _stackfu_session=BAh7ByIPc2Vzc2lvbl9pZCIlYjMyODkwZDM4MWQ2YjgxYzQxN2ZmZTJlMzhiNmRhM2EiGXdhcmRlbi51c2VyLnVzZXIua2V5WwciCVVzZXJvOhNCU09OOjpPYmplY3RJRAY6CkBkYXRhWxFpUWkBf2kB0mkKaQHUaQGJaQHoaQHQaQGBaQBpAGkI--1cf1c7a6d92f4662e81d8261dd2ed3719ce310ee; path=/; HttpOnly
|
10
|
+
|
11
|
+
Not found
|
@@ -0,0 +1,12 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Etag: "b68cbf1eec558ebda6d5489e18e4c5c7"
|
3
|
+
Connection: Keep-Alive
|
4
|
+
Content-Type: application/json; charset=utf-8
|
5
|
+
Date: Mon, 06 Sep 2010 18:44:12 GMT
|
6
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-12-24)
|
7
|
+
X-Runtime: 0.587104
|
8
|
+
Content-Length: 1055
|
9
|
+
Cache-Control: max-age=0, private, must-revalidate
|
10
|
+
Set-Cookie: _stackfu_session=BAh7ByIPc2Vzc2lvbl9pZCIlZDE4NTAwMmE4ZGQ3OWZiNDE4Nzg4NDU3ZmUzMGUwYWMiGXdhcmRlbi51c2VyLnVzZXIua2V5WwciCVVzZXJvOhNCU09OOjpPYmplY3RJRAY6CkBkYXRhWxFpUWkBg2kB%2FmkkaQHUaQGJaQHoaQGTaQGPaQBpAGkI--770ce6221b6798c4f1bd8903b1e8b1f2b767ba48; path=/; HttpOnly
|
11
|
+
|
12
|
+
[{"slug":"webbynode","name":"Webbynode","created_at":"2010-09-05T17:31:27-03:00","updated_at":"2010-09-06T15:43:43-03:00","_id":"4c83fe1fd489e8938f000017","provider_name":"Linnode","user_id":"4c83fe1fd489e8938f000003","ip":"123.45.678.90","last_checked_in":"2010-09-06T15:43:43-03:00","description":"Nunc hendrerit blandit ultrices. Cras pellentesque turpis et dolo\n molestie vitae lacinia nisi iaculis. Pellentesque vitae quam enim. Vivamus dui quam,\n aliquet in condimentum vel, placerat sit amet quam. Aliquam ac sollicitudin dui."},{"slug":"mydog","name":"MyDog","created_at":"2010-09-05T17:31:27-03:00","updated_at":"2010-09-06T15:43:43-03:00","_id":"4c83fe1fd489e8938f000018","provider_name":"Rackspace","user_id":"4c83fe1fd489e8938f000003","ip":"123.45.678.91","last_checked_in":"2010-09-06T15:43:43-03:00","description":"Nulla gravida lacus nec sapien ornare ullamcorper varius ipsum venenatis.\n Duis sit amet turpis risus, id venenatis neque. Vestibulum ultrices condimentum mi ac elementum.\n Sed vitae velit dui. Integer ac urna erat."}]
|
File without changes
|