forked from sgithens/OAE-Builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.rake
72 lines (65 loc) · 2.25 KB
/
conf.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require "nakamura/osgiconf"
include OSGIConf
@oconf = Conf.new(@sling)
namespace :conf do
desc "Configure nakamura"
task :config do
FileUtils.mkdir_p("./sling/config/org/sakaiproject/nakamura/proxy")
FileUtils.mkdir_p("./sling/config/org/sakaiproject/nakamura/http/usercontent")
FileUtils.mkdir_p("./sling/config/org/sakaiproject/nakamura/lite/storage/jdbc")
class TrustedLogin < Mustache
end
tl = TrustedLogin.new
tl["httpd_port"] = @cle["port"]
File.open("./sling/config/org/sakaiproject/nakamura/proxy/TrustedLoginTokenProxyPreProcessor.config", 'w') do |f|
f.write(tl.render())
end
class ServerProtection < Mustache
end
sp = ServerProtection.new
sp["server"] = @hostname
sp["httpd_port"] = @nakamura["port"]
File.open("./sling/config/org/sakaiproject/nakamura/http/usercontent/ServerProtectionServiceImpl.config", 'w') do |f|
f.write(sp.render())
end
if @db["driver"] == "mysql"
class StoragePool < Mustache
end
stp = StoragePool.new
stp["dbuser"] = @db["user"]
stp["dbpass"] = @db["password"]
File.open("./sling/config/org/sakaiproject/nakamura/lite/storage/jdbc/JDBCStorageClientPool.config", 'w') do |f|
f.write(stp.render())
end
end
end
namespace :fsresource do
# ==================
# = Set FSResource =
# ==================
def setFsResource(slingpath, fspath)
@logger.info "Setting fsresource #{slingpath} -> #{fspath}"
fsProviderPid = "org.apache.sling.fsprovider.internal.FsResourceProvider"
props = {
"provider.roots" => slingpath,
"provider.file" => fspath,
"provider.checkinterval" => 1000
}
@logger.info @oconf.setProperties(fsProviderPid, props)
end
desc "Set the FSResource configs to use the UI files on disk."
task :set do
uiabspath = File.expand_path(@ui["path"])
@fsresources.each do |dir|
setFsResource(dir, "#{uiabspath}#{dir}")
end
end
desc "Set fsresource just for the UI config"
task :uiconf do
unless Dir.exists?("./ui-conf")
FileUtils.cp_r("#{@ui["path"]}/dev/configuration/", "./ui-conf")
end
setFsResource("/dev/configuration", "#{@oaebuilder_dir}/ui-conf")
end
end
end