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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50cf0e24bbf380a428f8409061da2bc49087d2e4
4
- data.tar.gz: 39660c4fb96db37f8f1d392a35860ed7a5c571ee
3
+ metadata.gz: 303a748db4425c8e485e8df8da7d9f0ed74b5417
4
+ data.tar.gz: '08d82b4b05a13a7dc1ab3d73bc1376d28257ffb2'
5
5
  SHA512:
6
- metadata.gz: 3726f0e434e47ec467ee7f3e777faca6fe7826c74eec36c4aa8b43b7b0c0209abeac38bf3b224b35f7aea0818193ed80a913068449021bcddff49468ca4bfa73
7
- data.tar.gz: 78aaeca54c29ae2a8824b9fa7ad426cc766a242cf4837d4f72afb293cc147b2fef71658eebee5136fa5ae54df9644f87be45ac28245c9c27885740fe6c4da723
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::WORKING_DIR
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
@@ -1,3 +1,3 @@
1
1
  module DnsOne
2
- VERSION = "0.4.14"
2
+ VERSION = "0.4.15"
3
3
  end
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
- # Util.die "Conf file #{conf_file} must have mode 0600. Aborting."
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.14
4
+ version: 0.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lobato