arec53 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/arec53.gemspec +29 -0
- data/bin/arec53 +4 -0
- data/lib/arec53/cli.rb +65 -0
- data/lib/arec53/version.rb +3 -0
- data/lib/arec53.rb +6 -0
- metadata +139 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f06d63917d66b45c8020f08f4ccb3df85e29aee0
|
4
|
+
data.tar.gz: 0d212778d56f0196aa5d460cdbf334217c278b95
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6bc79af7967f4a36cb485ca05c9331912a9c899bf8b857439dfc037c0549033f7f7e2565b5eaf51111f8b1c67412a480c8e22c3b7aefc760ff43f6f20cdfc8e5
|
7
|
+
data.tar.gz: 35acd3d59f1fa79aa66928b4f66205f2e7fbdbc0be78089cc5e7e7da9a11eeb914732b5d229d364bbd4b9d2b129a29eaac9dc3277e0acc1bc9f8dd2472223d5d
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 y13i
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Arec53
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'arec53'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install arec53
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/arec53/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/arec53.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'arec53/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "arec53"
|
8
|
+
spec.version = Arec53::VERSION
|
9
|
+
spec.authors = ["y13i"]
|
10
|
+
spec.email = ["email@y13i.com"]
|
11
|
+
spec.summary = %q(Dynamic DNS tool for Route 53.)
|
12
|
+
spec.description = %q(Registeres executer's public IP address to Route 53 record set.)
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
|
24
|
+
spec.add_development_dependency "pry"
|
25
|
+
spec.add_development_dependency "awesome_print"
|
26
|
+
|
27
|
+
spec.add_dependency "aws-sdk-core"
|
28
|
+
spec.add_dependency "thor"
|
29
|
+
end
|
data/bin/arec53
ADDED
data/lib/arec53/cli.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "aws-sdk-core"
|
3
|
+
require "net/http"
|
4
|
+
|
5
|
+
class Arec53::CLI < Thor
|
6
|
+
DEFAULT_REGION = "ap-northeast-1"
|
7
|
+
|
8
|
+
class_option :access_key_id, aliases: [:k]
|
9
|
+
class_option :secret_access_key, aliases: [:s]
|
10
|
+
class_option :region, aliases: [:r]
|
11
|
+
class_option :profile
|
12
|
+
|
13
|
+
desc "version", "Show arec53 gem version."
|
14
|
+
def version
|
15
|
+
puts Arec53::VERSION
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "update HOSTED_ZONE_ID RECORD_SET_NAME IP_ADDRESS", "Update specified record set with IP address."
|
19
|
+
def update hosted_zone_id, record_set_name, ip_address = my_ip, ttl = 300
|
20
|
+
begin
|
21
|
+
response = client.change_resource_record_sets(
|
22
|
+
hosted_zone_id: hosted_zone_id,
|
23
|
+
|
24
|
+
change_batch: {
|
25
|
+
changes: [
|
26
|
+
{
|
27
|
+
action: "UPSERT",
|
28
|
+
|
29
|
+
resource_record_set: {
|
30
|
+
name: record_set_name,
|
31
|
+
type: "A",
|
32
|
+
ttl: ttl,
|
33
|
+
|
34
|
+
resource_records: [
|
35
|
+
{
|
36
|
+
value: ip_address,
|
37
|
+
},
|
38
|
+
],
|
39
|
+
},
|
40
|
+
},
|
41
|
+
],
|
42
|
+
},
|
43
|
+
)
|
44
|
+
|
45
|
+
fail unless response.successful?
|
46
|
+
puts "Success"
|
47
|
+
rescue => ex
|
48
|
+
require "pry"
|
49
|
+
binding.pry
|
50
|
+
puts "Failed?"
|
51
|
+
p ex
|
52
|
+
puts ex.backtrace
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def my_ip
|
59
|
+
Net::HTTP.get("checkip.amazonaws.com", "/").chomp
|
60
|
+
end
|
61
|
+
|
62
|
+
def client
|
63
|
+
@client ||= Aws::Route53::Client.new region: (options[:region] || DEFAULT_REGION)
|
64
|
+
end
|
65
|
+
end
|
data/lib/arec53.rb
ADDED
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: arec53
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.10
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- y13i
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: awesome_print
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aws-sdk-core
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: thor
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Registeres executer's public IP address to Route 53 record set.
|
98
|
+
email:
|
99
|
+
- email@y13i.com
|
100
|
+
executables:
|
101
|
+
- arec53
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".gitignore"
|
106
|
+
- Gemfile
|
107
|
+
- LICENSE.txt
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- arec53.gemspec
|
111
|
+
- bin/arec53
|
112
|
+
- lib/arec53.rb
|
113
|
+
- lib/arec53/cli.rb
|
114
|
+
- lib/arec53/version.rb
|
115
|
+
homepage: ''
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
metadata: {}
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
requirements: []
|
134
|
+
rubyforge_project:
|
135
|
+
rubygems_version: 2.2.2
|
136
|
+
signing_key:
|
137
|
+
specification_version: 4
|
138
|
+
summary: Dynamic DNS tool for Route 53.
|
139
|
+
test_files: []
|