ktec-subtrac 0.1.49 → 0.1.50

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.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 49
4
+ :patch: 50
@@ -13,7 +13,7 @@
13
13
  <location />
14
14
  AuthType Basic
15
15
  AuthName '<%= server_name %>'
16
- AuthUserFile <%= install_dir %>/.passwd
16
+ AuthUserFile <%= auth_dir %>/.passwd
17
17
  Require valid-user
18
18
  AuthBasicProvider file
19
19
  <% if enable_ldap then %>
@@ -14,12 +14,10 @@ module Subtrac
14
14
  puts "\n==== Creating new virtual host ===="
15
15
  # TODO: Place a file in apache2 conf with Include directive which points to our conf folder
16
16
  template = get_template("vhost.conf.erb")
17
- template.write(File.join(Config.apache_conf_dir,Config.server_hostname))
18
- puts("template written")
17
+ file_name = File.join(Config.apache_conf_dir,Config.server_hostname)
18
+ template.write(file_name)
19
19
  enable_site()
20
- puts("enabled site")
21
20
  force_reload()
22
- puts("apache reloaded")
23
21
  end
24
22
  # creates the files necessary for a new client
25
23
  def create_client(client)
@@ -33,10 +31,12 @@ module Subtrac
33
31
  def force_reload
34
32
  # reload apache configuration
35
33
  `/etc/init.d/apache2 force-reload` if SUBTRAC_ENV != 'test'
34
+ puts("Apache reloaded...")
36
35
  end
37
36
  def enable_site
38
37
  # tell apache enable site
39
38
  `a2ensite #{Config.server_hostname}` if SUBTRAC_ENV != 'test'
39
+ puts("Apache site enabled...")
40
40
  end
41
41
  def create_project(project)
42
42
  # we dont need to do anything for each project, but we do need to ensure a client location exists
@@ -42,6 +42,7 @@ development: &non_production_settings
42
42
  :conf: conf
43
43
  :locations: locations
44
44
  :temp: tmp
45
+ :auth: auth
45
46
 
46
47
  test:
47
48
  <<: *non_production_settings
@@ -174,6 +174,10 @@ module Subtrac
174
174
  @log_dir ||= File.join(install_dir,@data[:dirs][:log])
175
175
  end
176
176
 
177
+ def auth_dir
178
+ @auth_dir ||= File.join(install_dir,@data[:dirs][:auth])
179
+ end
180
+
177
181
  def locations_dir
178
182
  @locations_dir ||= File.join(install_dir,@data[:dirs][:locations])
179
183
  end
@@ -5,7 +5,7 @@ module Subtrac
5
5
  @template = template
6
6
  end
7
7
  def render
8
- puts "Template rendering #{@template}"
8
+ puts "Rendering template: #{File.basename(@template)}"
9
9
  b = Config.get_binding
10
10
  ERB.new(IO.read(@template)).result(b)
11
11
  end
@@ -13,8 +13,8 @@ module Subtrac
13
13
  file = File.open(outfile, 'w+')
14
14
  if file
15
15
  file_output = render()
16
- #puts file_output
17
16
  file.syswrite(file_output)
17
+ puts("Template written: #{File.basename(outfile)}")
18
18
  else
19
19
  raise "Unable to open file for writing. file #{outfile}"
20
20
  end
@@ -185,7 +185,7 @@ password_format = htpasswd
185
185
  ; the file where user accounts are stored
186
186
  ; the webserver will need write permissions to this file
187
187
  ; and its parent folder
188
- password_file = /var/subtrac/.passwd
188
+ password_file = <%= auth_dir %>/.passwd
189
189
 
190
190
  [theme]
191
191
  theme = CrystalX
data/lib/subtrac.rb CHANGED
@@ -169,7 +169,7 @@ module Subtrac
169
169
  admin_pass = ask("New password: ") { |q| q.echo = "*" }
170
170
  admin_pass_confirm = ask("Re-type new password: ") { |q| q.echo = "*" }
171
171
  if (admin_pass == admin_pass_confirm) then
172
- passwd_file = File.join(Config.install_dir, ".passwd")
172
+ passwd_file = File.join(Config.auth_dir, ".passwd")
173
173
  `htpasswd -c -b #{passwd_file} #{admin_user} #{admin_pass}`
174
174
  Config.data[:admin_user] = admin_user
175
175
  Config.data[:admin_pass] = admin_pass
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ktec-subtrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.49
4
+ version: 0.1.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Salisbury