dns_one 0.4.14 → 0.4.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dns_one/setup.rb +17 -1
- data/lib/dns_one/version.rb +1 -1
- data/lib/dns_one.rb +1 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 303a748db4425c8e485e8df8da7d9f0ed74b5417
|
4
|
+
data.tar.gz: '08d82b4b05a13a7dc1ab3d73bc1376d28257ffb2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 040dc7b5e7c852eee9135e93c58c41c8925baec933126fd16a3f8ce6ddebc2985c7694d345b0c448bcfa4ca1da05ba0c4cd3fb17856b811b8385608a6c7d074b
|
7
|
+
data.tar.gz: 97bf69421cf5a236c243d3e00c4b2f4c9b6bebfa6ce22272aa999c67d19b1cf42b32be95cf63a292f97b97829ad6817176fe00d0d1d7c6335158ae43fc17fe66
|
data/lib/dns_one/setup.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
module DnsOne; class Setup
|
2
|
+
# Currently tested version
|
3
|
+
# TODO: flexibilize version and make checks/prompts/warnings during install
|
4
|
+
REQUIRED_RUBY_VERSION = '2.3.3'
|
5
|
+
|
2
6
|
SYSTEMD_SERVICES_DIR = "/lib/systemd/system/"
|
3
7
|
SERVICE_NAME = 'dns_one'
|
4
8
|
SYSTEMD_SERVICE_FILE = "#{SYSTEMD_SERVICES_DIR}/#{SERVICE_NAME}.service"
|
5
9
|
|
10
|
+
|
6
11
|
def initialize
|
7
12
|
@thisdir = File.join File.dirname(__FILE__)
|
8
13
|
end
|
@@ -14,7 +19,9 @@ module DnsOne; class Setup
|
|
14
19
|
exit 1
|
15
20
|
end
|
16
21
|
mkdirs
|
22
|
+
set_ruby_version
|
17
23
|
copy_sample_conf
|
24
|
+
add_user
|
18
25
|
install_systemd_service
|
19
26
|
setup_finished_msg
|
20
27
|
end
|
@@ -26,12 +33,21 @@ module DnsOne; class Setup
|
|
26
33
|
Util.run "systemctl disable #{SERVICE_NAME}"
|
27
34
|
File.delete SYSTEMD_SERVICE_FILE
|
28
35
|
end
|
29
|
-
FileUtils.rm_rf DnsOne::
|
36
|
+
FileUtils.rm_rf DnsOne::WORK_DIR
|
30
37
|
puts "Uninstall complete."
|
31
38
|
end
|
32
39
|
|
33
40
|
private
|
34
41
|
|
42
|
+
def add_user
|
43
|
+
# TODO: prompt user
|
44
|
+
system "adduser --system --no-create-home #{DnsOne::Server::DEFAULT_RUN_AS}"
|
45
|
+
end
|
46
|
+
|
47
|
+
def set_ruby_version
|
48
|
+
File.write "#{WORK_DIR}/.ruby-version", REQUIRED_RUBY_VERSION
|
49
|
+
end
|
50
|
+
|
35
51
|
def mkdirs
|
36
52
|
FileUtils.mkdir_p DnsOne::CONF_DIR
|
37
53
|
FileUtils.mkdir_p DnsOne::WORK_DIR
|
data/lib/dns_one/version.rb
CHANGED
data/lib/dns_one.rb
CHANGED
@@ -101,11 +101,7 @@ end
|
|
101
101
|
conf_stat = File.stat conf_file
|
102
102
|
|
103
103
|
unless conf_stat.mode.to_s(8) =~ /0600$/
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
unless Util.match_root conf_stat
|
108
|
-
# Util.die "Conf file #{conf_file} must have uid/gid set to root. Aborting."
|
104
|
+
Util.die "Conf file #{conf_file} must have mode 0600. Aborting."
|
109
105
|
end
|
110
106
|
end
|
111
107
|
|