Kouhei Sutou
null+****@clear*****
Mon May 19 23:37:33 JST 2014
Kouhei Sutou 2014-05-19 23:37:33 +0900 (Mon, 19 May 2014) New Revision: 02889cfa0bbb5b8a59e6c5cd81a97ad4262a7d40 https://github.com/groonga/heroku-buildpack-groonga/commit/02889cfa0bbb5b8a59e6c5cd81a97ad4262a7d40 Message: release: generate groonga-httpd.conf Modified files: bin/release Modified: bin/release (+48 -3) =================================================================== --- bin/release 2014-05-19 23:29:38 +0900 (e92b6f1) +++ bin/release 2014-05-19 23:37:33 +0900 (dde081f) @@ -4,17 +4,20 @@ require "yaml" build_dir = ARGV.first +database_path = File.join(build_dir, "groonga", "database") +groonga_dir = File.join(build_dir, "vendor", "groonga") + release = {} release["addons"] = [] paths = [ - File.join(build_dir, "vendor", "local", "bin"), - File.join(build_dir, "vendor", "local", "sbin"), + File.join(groonga_dir, "bin"), + File.join(groonga_dir, "sbin"), ENV["PATH"], ] ld_library_paths = [ - File.join(build_dir, "vendor", "local", "lib"), + File.join(groonga_dir, "lib"), ENV["LD_LIBRARY_PATH"], ] release["config_vars"] = { @@ -26,4 +29,46 @@ release["default_process_types"] = { "web" => "groonga-httpd", } +groonga_httpd_conf_dir = File.join(groonga_dir, "etc", "groonga", "httpd") +groonga_httpd_conf = File.join(groonga_httpd_conf_dir, "groonga-httpd.conf") +File.open(groonga_httpd_conf, "w") do |conf| + conf.puts(<<-CONF) +worker_processes 1; + +daemon off; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + groonga_database #{database_path}; + + server { + listen #{ENV["PORT"]}; + server_name localhost; + + location /d/ { + groonga on; + } + + location / { + root #{File.join(groonga_httpd_conf_dir, "admin")}; + index index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} + CONF +end + puts(release.to_yaml) -------------- next part -------------- HTML����������������������������...Download