ktec-subtrac 0.1.49 → 0.1.50
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/subtrac/apache/vhost.conf.erb +1 -1
- data/lib/subtrac/apache.rb +4 -4
- data/lib/subtrac/config/config.yml +1 -0
- data/lib/subtrac/config.rb +4 -0
- data/lib/subtrac/template.rb +2 -2
- data/lib/subtrac/trac/common.trac.ini.erb +1 -1
- data/lib/subtrac.rb +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/subtrac/apache.rb
CHANGED
@@ -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
|
-
|
18
|
-
|
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
|
data/lib/subtrac/config.rb
CHANGED
@@ -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
|
data/lib/subtrac/template.rb
CHANGED
@@ -5,7 +5,7 @@ module Subtrac
|
|
5
5
|
@template = template
|
6
6
|
end
|
7
7
|
def render
|
8
|
-
puts "
|
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 =
|
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.
|
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
|