Browse files

[COOK-2303] Made export_all optional and added syslog on ubuntu

  • Loading branch information...
1 parent 2b08e47 commit e7621b8c739972bf71e964eb64b6e6f6858c71ca @rgeyer rgeyer committed Jan 30, 2013
Showing with 11 additions and 3 deletions.
  1. +2 −1 attributes/default.rb
  2. +7 −0 metadata.rb
  3. +1 −1 templates/default/git-xinetd.d.erb
  4. +1 −1 templates/default/sv-git-daemon-run.erb
View
3 attributes/default.rb
@@ -36,4 +36,5 @@
default['git']['checksum'] = "24f1895fa74a23b3d9233fa89a9ef04d83a1cd952d659720d6ea231bbd0c973c"
end
-default['git']['server']['base_path'] = "/srv/git"
+default['git']['server']['base_path'] = "/srv/git"
+default['git']['server']['export_all'] = "true"
View
7 metadata.rb
@@ -25,4 +25,11 @@
:display_name => "Git Daemon Base Path",
:description => "A directory containing git repositories to be exposed by the git-daemon",
:default => "/srv/git",
+ :recipes => ["git::server"]
+
+attribute "git/server/export_all",
+ :display_name => "Git Daemon Export All",
+ :description => "Adds the --export-all option to the git-daemon parameters, making all repositories publicly readable even if they lack the \"git-daemon-export-ok\" file",
+ :choice => ["true", "false"],
+ :default => "true",
:recipes => ["git::server"]
View
2 templates/default/git-xinetd.d.erb
@@ -9,6 +9,6 @@ service git
wait = no
user = nobody
server = /usr/libexec/git-core/git-daemon
- server_args = --base-path=<%= node["git"]["server"]["base_path"] %> --export-all --syslog --inetd --verbose
+ server_args = --base-path=<%= node["git"]["server"]["base_path"] %> <% if node["git"]["server"]["export_all"] == "true" %>--export-all <% end %>--syslog --inetd --verbose
log_on_failure += USERID
}
View
2 templates/default/sv-git-daemon-run.erb
@@ -1,3 +1,3 @@
#!/bin/sh
exec 2>&1
-exec /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=<%= node["git"]["server"]["base_path"] %> <%= node["git"]["server"]["base_path"] %>
+exec /usr/bin/git daemon <% if node["git"]["server"]["export_all"] == "true" %>--export-all <% end %>--user=nobody --group=daemon --syslog --base-path=<%= node["git"]["server"]["base_path"] %> <%= node["git"]["server"]["base_path"] %>

0 comments on commit e7621b8

Please sign in to comment.