dynamic_dns 0.1.0 → 0.1.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/Gemfile +3 -0
- data/Makefile +1 -1
- data/README.md +3 -3
- data/default.nix +27 -0
- data/dynamic_dns.gemspec +1 -1
- data/lib/dynamic_dns/daemon.rb +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ebecac4dba5ba181a6fb5d4d4792c8610a51656
|
4
|
+
data.tar.gz: e06e00e7069cab32b8e655230e3d0c8138c311bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6337929f5b7147a60726c4aebbb30d120c9f1045f02ec443b25bd125b79dd25003227cf945b788707726964378e385e48bb23b3d2a0d633acd44ee8229b1a2ed
|
7
|
+
data.tar.gz: 3925aef826e5355944291ee50dce2331adee9fc9d09f56c5546931e2ef017e5054c952931965a6cd8aa35606ad08c4e5243e86ae2952d44cf21b8f85ad2efde1
|
data/Gemfile
CHANGED
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ This gem is useful as a command-line executable, and as a library.
|
|
9
9
|
|
10
10
|
The following usage examples will configure the daemon to run every 10 minutes, updating the hosted zone for `foo.com` in Route53 to have an `A` record that points `ssh.foo.com` to the computer's public IPv4 address. See the *Configuration* section below for more information on the environment variables used to configure the daemon.
|
11
11
|
|
12
|
-
Ensure you have installed this gem to use the command-line tool. You must have Ruby 2.4
|
12
|
+
Ensure you have installed this gem to use the command-line tool. You must have Ruby 2.4, or greater, installed.
|
13
13
|
|
14
14
|
```bash
|
15
15
|
$ gem install dynamic_dns
|
@@ -25,7 +25,7 @@ $ DYNAMIC_DNS_DOMAIN=foo.com DYNAMIC_DNS_SUBDOMAIN=ssh DYNAMIC_DNS_INTERVAL=600
|
|
25
25
|
```
|
26
26
|
|
27
27
|
|
28
|
-
### `systemd` Start-
|
28
|
+
### `systemd` Start-up Script
|
29
29
|
|
30
30
|
If you are using `rvm` with `systemd`, ensure that `rvm` was installed using `sudo`, then install this gem.
|
31
31
|
|
@@ -69,7 +69,7 @@ It is possible to configure this daemon using environment variables.
|
|
69
69
|
| `DYNAMIC_DNS_DOMAIN` | Y | N/A | `foo.com` | This domain's hosted zone will be updated. It must already have an existing hosted zone in Route53 prior to running the daemon. |
|
70
70
|
| `DYNAMIC_DNS_SUBDOMAIN` | Y | N/A | `ssh` | The name of the A record that will point to the public IP address discovered by the daemon. |
|
71
71
|
| `DYNAMIC_DNS_INTERVAL` | N | `60` | `60` | The interval in seconds that the daemon should query for the public IPv4 address. |
|
72
|
-
| `AWS_ACCESS_KEY_ID` | Y | N/A | `abc123` | Your AWS access key ID. It must have permissions to manage Route53. This requirement is defined by the `aws-sdk` gem ([link](https://github.com/aws/aws-sdk-ruby)). An alternative method to providnig your AWS credentials to create an `~/.aws/credentials` file. |
|
72
|
+
| `AWS_ACCESS_KEY_ID` | Y | N/A | `abc123` | Your AWS access key ID. It must have permissions to manage Route53. This requirement is defined by the `aws-sdk` gem ([link](https://github.com/aws/aws-sdk-ruby)). An alternative method to providnig your AWS credentials is to create an `~/.aws/credentials` file. |
|
73
73
|
| `AWS_SECRET_ACCESS_KEY` | Y | N/A | `abc123` | Your AWS secret access key. See above for notes on AWS credentials. |
|
74
74
|
|
75
75
|
|
data/default.nix
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
{ pkgs ? import <nixpkgs> {} }:
|
2
|
+
|
3
|
+
with pkgs;
|
4
|
+
|
5
|
+
stdenv.mkDerivation {
|
6
|
+
name = "anzsco_crawler";
|
7
|
+
buildInputs = [
|
8
|
+
ruby_2_4
|
9
|
+
stdenv
|
10
|
+
];
|
11
|
+
shellHook = ''
|
12
|
+
#ensure local gem dir exists
|
13
|
+
mkdir -p .gem
|
14
|
+
#update env
|
15
|
+
export GEM_HOME="$PWD/.gem"
|
16
|
+
export GEM_PATH="$GEM_HOME"
|
17
|
+
export PATH="$PATH:$GEM_HOME/bin"
|
18
|
+
#install bundler
|
19
|
+
${ruby_2_4}/bin/gem install --install-dir $GEM_HOME bundler
|
20
|
+
#configure bundler
|
21
|
+
export BUNDLE_IGNORE_CONFIG="1"
|
22
|
+
export BUNDLE_PATH="vendor/bundle"
|
23
|
+
#install depnedencies
|
24
|
+
bundle install
|
25
|
+
'';
|
26
|
+
}
|
27
|
+
|
data/dynamic_dns.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'dynamic_dns'
|
3
|
-
gem.version = '0.1.
|
3
|
+
gem.version = '0.1.1'
|
4
4
|
gem.date = '2017-07-17'
|
5
5
|
gem.summary = 'Dynamic DNS'
|
6
6
|
gem.description = 'Daemon to update an Amazon Route53 A record with a computer\'s dynamic IPv4 address.'
|
data/lib/dynamic_dns/daemon.rb
CHANGED
@@ -28,7 +28,9 @@ module DynamicDns
|
|
28
28
|
# returns a string represents the ip address
|
29
29
|
def fetch_ip
|
30
30
|
log 'fetching ip'
|
31
|
-
Net::HTTP.
|
31
|
+
request = Net::HTTP::Get.new @@GET_IP_URI
|
32
|
+
response = Net::HTTP.start(@@GET_IP_URI.host, @@GET_IP_URI.port, :use_ssl => true) { |http| http.request request }
|
33
|
+
response.body.strip!
|
32
34
|
end
|
33
35
|
|
34
36
|
def start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dhruv Dang
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- Makefile
|
44
44
|
- README.md
|
45
45
|
- bin/dynamic-dns
|
46
|
+
- default.nix
|
46
47
|
- dynamic_dns.gemspec
|
47
48
|
- lib/dynamic_dns.rb
|
48
49
|
- lib/dynamic_dns/daemon.rb
|
@@ -67,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
68
|
version: '0'
|
68
69
|
requirements: []
|
69
70
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.6.
|
71
|
+
rubygems_version: 2.6.8
|
71
72
|
signing_key:
|
72
73
|
specification_version: 4
|
73
74
|
summary: Dynamic DNS
|