pdns 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/pdns/application_record.rb +11 -0
- data/app/models/pdns/domain.rb +2 -0
- data/app/models/pdns/record.rb +2 -0
- data/db/schema.rb +65 -25
- data/lib/pdns/version.rb +1 -1
- data/lib/pdns.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 534df87960852275d6c803b259465e949b664806
|
4
|
+
data.tar.gz: 63af97e3363bc09fa1f423c779db35867679c556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5d439453e314c371a92552f89609780edf4711e914fbb8f91ea7867f2f5bfa606a47e6dd0a7e4b5a4aaaafb031d6f57af6aad8479f11a590127e2710998f18e
|
7
|
+
data.tar.gz: 11697e54b9c684076c74a419dd01c43bb864785ea71015cd041ef957c25568e9f445f971735fc89a9e32e938708431e41b95bbcda9f1eb14c995a77c59cf97af
|
@@ -2,5 +2,16 @@ module PDNS
|
|
2
2
|
class ApplicationRecord < ActiveRecord::Base
|
3
3
|
self.abstract_class = true
|
4
4
|
establish_connection PDNS.db_conf[Rails.env.to_s]
|
5
|
+
|
6
|
+
def as_json(options = nil)
|
7
|
+
resource = self.class.name.split('::').last
|
8
|
+
method = :"#{resource}_as_json"
|
9
|
+
|
10
|
+
if PDNS.respond_to?(method) && PDNS.send(method).present?
|
11
|
+
PDNS.send(method).call(attributes, options)
|
12
|
+
else
|
13
|
+
super
|
14
|
+
end
|
15
|
+
end
|
5
16
|
end
|
6
17
|
end
|
data/app/models/pdns/domain.rb
CHANGED
data/app/models/pdns/record.rb
CHANGED
data/db/schema.rb
CHANGED
@@ -11,36 +11,76 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20160711000000) do
|
15
15
|
create_table 'domains', force: true do |t|
|
16
|
-
t.string
|
17
|
-
t.string
|
18
|
-
t.integer
|
19
|
-
t.string
|
20
|
-
t.integer
|
21
|
-
t.string
|
22
|
-
t.integer 'ttl', default: 86400
|
23
|
-
t.datetime 'created_at', null: false
|
24
|
-
t.datetime 'updated_at', null: false
|
25
|
-
t.integer 'user_id'
|
26
|
-
t.text 'notes'
|
16
|
+
t.string 'name', null: false, limit: 255
|
17
|
+
t.string 'master', limit: 128
|
18
|
+
t.integer 'last_check'
|
19
|
+
t.string 'type', null: false, limit: 6
|
20
|
+
t.integer 'notified_serial'
|
21
|
+
t.string 'account', limit: 40
|
27
22
|
end
|
28
23
|
|
29
|
-
add_index 'domains', %w(name),
|
24
|
+
add_index 'domains', %w(name), unique: true
|
30
25
|
|
31
26
|
create_table 'records', force: true do |t|
|
32
|
-
t.integer
|
33
|
-
t.string
|
34
|
-
t.string
|
35
|
-
t.
|
36
|
-
t.integer
|
37
|
-
t.integer
|
38
|
-
t.integer
|
39
|
-
t.
|
40
|
-
t.
|
27
|
+
t.integer 'domain_id'
|
28
|
+
t.string 'name', limit: 255
|
29
|
+
t.string 'type', limit: 10
|
30
|
+
t.text 'content', limit: 64000
|
31
|
+
t.integer 'ttl'
|
32
|
+
t.integer 'prio'
|
33
|
+
t.integer 'change_date'
|
34
|
+
t.boolean 'disabled', default: 0
|
35
|
+
t.binary 'ordername', limit: 255
|
36
|
+
t.boolean 'auth', default: 1
|
41
37
|
end
|
42
38
|
|
43
|
-
add_index 'records', %w(
|
44
|
-
add_index 'records', %w(
|
45
|
-
add_index 'records', %w(
|
39
|
+
add_index 'records', %w(name type)
|
40
|
+
add_index 'records', %w(domain_id)
|
41
|
+
add_index 'records', %w(domain_id ordername)
|
42
|
+
|
43
|
+
create_table 'supermasters', force: true do |t|
|
44
|
+
t.string 'ip', limit: 64, null: false
|
45
|
+
t.string 'nameserver', limit: 255, null: false
|
46
|
+
t.string 'account', limit: 40, null: false
|
47
|
+
end
|
48
|
+
|
49
|
+
create_table 'comments', force: true do |t|
|
50
|
+
t.integer 'domain_id', null: false
|
51
|
+
t.string 'name', null: false, limit: 255
|
52
|
+
t.string 'type', null: false, limit: 10
|
53
|
+
t.integer 'modified_at', null: false
|
54
|
+
t.string 'account', null: false, limit: 40
|
55
|
+
t.text 'comment', null: false, limit: 64000
|
56
|
+
end
|
57
|
+
|
58
|
+
add_index 'comments', %w(domain_id)
|
59
|
+
add_index 'comments', %w(name type)
|
60
|
+
add_index 'comments', %w(domain_id modified_at)
|
61
|
+
|
62
|
+
create_table 'domainmetadata', force: true do |t|
|
63
|
+
t.integer 'domain_id', null: false
|
64
|
+
t.string 'kind', null: false, limit: 32
|
65
|
+
t.text 'content'
|
66
|
+
end
|
67
|
+
|
68
|
+
add_index 'domainmetadata', %w(domain_id kind)
|
69
|
+
|
70
|
+
create_table 'cryptokeys', force: true do |t|
|
71
|
+
t.integer 'domain_id', null: false
|
72
|
+
t.integer 'flags', null: false
|
73
|
+
t.boolean 'active'
|
74
|
+
t.text 'content'
|
75
|
+
end
|
76
|
+
|
77
|
+
add_index 'cryptokeys', %w(domain_id)
|
78
|
+
|
79
|
+
create_table 'tsigkeys', force: true do |t|
|
80
|
+
t.string 'name', limit: 255
|
81
|
+
t.string 'algorithm', limit: 50
|
82
|
+
t.string 'secret', limit: 255
|
83
|
+
end
|
84
|
+
|
85
|
+
add_index 'tsigkeys', %w(name algorithm), unique: true
|
46
86
|
end
|
data/lib/pdns/version.rb
CHANGED
data/lib/pdns.rb
CHANGED
@@ -16,6 +16,12 @@ module PDNS
|
|
16
16
|
mattr_accessor :db_dir_path
|
17
17
|
self.db_dir_path = File.expand_path('../../db', __FILE__)
|
18
18
|
|
19
|
+
mattr_accessor :domain_as_json
|
20
|
+
self.domain_as_json = nil
|
21
|
+
|
22
|
+
mattr_accessor :record_as_json
|
23
|
+
self.record_as_json = nil
|
24
|
+
|
19
25
|
class << self
|
20
26
|
def setup
|
21
27
|
yield self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linyows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|