zonesync 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zonesync/cli.rb +2 -17
- data/lib/zonesync/rake.rb +5 -0
- data/lib/zonesync/version.rb +1 -1
- data/lib/zonesync.rb +13 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00751af08d69afada768a779c3e2344b3e728e0b3ee9162436f82f936737bcab
|
4
|
+
data.tar.gz: 772a439ddfd4f9e9cd96bffeade456ba7023732e221a81ef48c39595f0e2328d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 896d74bfd34d5f4609c5e4ab9d79bcad73b812b694941ab24f3807f6d3a08f9d25c28b13dc73201a6e6ed318ae475e43f641f7c9376c8b4af612ea0ba0c3d78d
|
7
|
+
data.tar.gz: a6568612418b311a6c3c89bf8a8e680214336d0075e05373aad7ca7ad32938e000175ed72c198d230dc3d9c7ecfbfcc6ce37b4125c14cf3376d83834ba9e9b4b
|
data/lib/zonesync/cli.rb
CHANGED
@@ -2,28 +2,13 @@ require "thor"
|
|
2
2
|
|
3
3
|
module Zonesync
|
4
4
|
class CLI < Thor
|
5
|
-
def self.exit_on_failure?
|
6
|
-
true
|
7
|
-
end
|
8
|
-
|
9
5
|
default_command :sync
|
10
6
|
desc "sync", "syncs the contents of Zonefile to the DNS server configured in Rails.application.credentials.zonesync"
|
11
7
|
method_option :dry_run, type: :boolean, default: false, aliases: :n, desc: "log operations to STDOUT but don't perform the sync"
|
12
8
|
def sync
|
13
|
-
Zonesync.call
|
9
|
+
Zonesync.call dry_run: options[:dry_run]
|
14
10
|
end
|
15
11
|
|
16
|
-
|
17
|
-
|
18
|
-
def default_credentials
|
19
|
-
if defined?(Rails.application.credentials)
|
20
|
-
Rails.application.credentials.zonesync
|
21
|
-
else
|
22
|
-
require "active_support/encrypted_configuration"
|
23
|
-
require "active_support/core_ext/hash/keys"
|
24
|
-
credentials = ActiveSupport::EncryptedConfiguration.new(config_path: "config/credentials.yml.enc", key_path: "config/master.key", raise_if_missing_key: true, env_key: "RAILS_MASTER_KEY")
|
25
|
-
credentials.zonesync
|
26
|
-
end
|
27
|
-
end
|
12
|
+
def self.exit_on_failure? = true
|
28
13
|
end
|
29
14
|
end
|
data/lib/zonesync/version.rb
CHANGED
data/lib/zonesync.rb
CHANGED
@@ -2,12 +2,24 @@ require "zonesync/provider"
|
|
2
2
|
require "zonesync/diff"
|
3
3
|
require "zonesync/logger"
|
4
4
|
require "zonesync/cli"
|
5
|
+
require "zonesync/rake"
|
5
6
|
|
6
7
|
module Zonesync
|
7
|
-
def self.call zonefile: "Zonefile", credentials
|
8
|
+
def self.call zonefile: "Zonefile", credentials: default_credentials, dry_run: false
|
8
9
|
Sync.new({ provider: "Filesystem", path: zonefile }, credentials).call(dry_run: dry_run)
|
9
10
|
end
|
10
11
|
|
12
|
+
def self.default_credentials
|
13
|
+
require "active_support/encrypted_configuration"
|
14
|
+
require "active_support/core_ext/hash/keys"
|
15
|
+
ActiveSupport::EncryptedConfiguration.new(
|
16
|
+
config_path: "config/credentials.yml.enc",
|
17
|
+
key_path: "config/master.key",
|
18
|
+
env_key: "RAILS_MASTER_KEY",
|
19
|
+
raise_if_missing_key: true,
|
20
|
+
).zonesync
|
21
|
+
end
|
22
|
+
|
11
23
|
class Sync < Struct.new(:source, :destination)
|
12
24
|
def call dry_run: false
|
13
25
|
source = Provider.from(self.source)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zonesync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-01-
|
12
|
+
date: 2024-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dns-zonefile
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/zonesync/http.rb
|
119
119
|
- lib/zonesync/logger.rb
|
120
120
|
- lib/zonesync/provider.rb
|
121
|
+
- lib/zonesync/rake.rb
|
121
122
|
- lib/zonesync/record.rb
|
122
123
|
- lib/zonesync/version.rb
|
123
124
|
- log/.keep
|