
The current code creates a ServerAliases line even if the variable is nil. Correct that. Also, fix a missed cgit:: scope reference. Create distinct log files for each vhost, and also separate out http/https logs. Change-Id: Id03c72ece93350b26586490757cd50dd3d791c0d
84 lines
2.6 KiB
Plaintext
84 lines
2.6 KiB
Plaintext
<VirtualHost *:<%= @http_port %>>
|
|
ServerName <%= @cgit_vhost_name %>
|
|
ServerAdmin <%= @serveradmin %>
|
|
|
|
<% unless ['', nil, :undef].include?@serveraliases %>
|
|
<% if @serveraliases.is_a? Array -%>
|
|
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
|
<% elsif @serveraliases != '' -%>
|
|
<%= " ServerAlias #{@serveraliases}" -%>
|
|
<% end -%>
|
|
<% end -%>
|
|
|
|
Alias /cgit-data /usr/share/cgit
|
|
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
|
Alias /static <%= @staticfiles %>
|
|
RewriteEngine On
|
|
RewriteRule ^/$ /cgit [R]
|
|
|
|
SetEnv GIT_PROJECT_ROOT <%= @local_git_dir %>
|
|
SetEnv GIT_HTTP_EXPORT_ALL
|
|
SetEnv GIT_NOTES_DISPLAY_REF refs/notes/*
|
|
SetEnv CGIT_CONFIG <%= @cgitrc_path %>
|
|
|
|
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ <%= @local_git_dir %>/$1
|
|
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ <%= @local_git_dir %>/$1
|
|
ScriptAlias / /usr/libexec/git-core/git-http-backend/
|
|
|
|
ErrorLog /var/log/httpd/<%= @cgit_vhost_name %>-error.log
|
|
|
|
<% if @cgit_timeout.is_a? Integer %>
|
|
Timeout <%= @cgit_timeout %>
|
|
<% end %>
|
|
|
|
LogLevel warn
|
|
|
|
CustomLog /var/log/httpd/<%= @cgit_vhost_name %>-access.log combined
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:<%= @https_port %>>
|
|
ServerName <%= @cgit_vhost_name %>
|
|
ServerAdmin <%= @serveradmin %>
|
|
|
|
<% unless ['', nil, :undef].include?@serveraliases %>
|
|
<% if @serveraliases.is_a? Array -%>
|
|
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
|
<% elsif @serveraliases != '' -%>
|
|
<%= " ServerAlias #{@serveraliases}" -%>
|
|
<% end -%>
|
|
<% end -%>
|
|
|
|
Alias /cgit-data /usr/share/cgit
|
|
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
|
Alias /static <%= @staticfiles %>
|
|
RewriteEngine On
|
|
RewriteRule ^/$ /cgit [R]
|
|
|
|
SetEnv GIT_PROJECT_ROOT <%= @local_git_dir %>
|
|
SetEnv GIT_HTTP_EXPORT_ALL
|
|
SetEnv GIT_NOTES_DISPLAY_REF refs/notes/*
|
|
SetEnv CGIT_CONFIG <%= @cgitrc_path %>
|
|
|
|
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ <%= @local_git_dir %>/$1
|
|
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ <%= @local_git_dir %>/$1
|
|
ScriptAlias / /usr/libexec/git-core/git-http-backend/
|
|
|
|
ErrorLog /var/log/httpd/<%= @cgit_vhost_name %>-ssl-error.log
|
|
|
|
LogLevel warn
|
|
|
|
CustomLog /var/log/httpd/<%= @cgit_vhost_name %>-ssl-access.log combined
|
|
|
|
SSLEngine on
|
|
SSLProtocol All -SSLv2 -SSLv3
|
|
|
|
SSLCertificateFile <%= @ssl_cert_file %>
|
|
SSLCertificateKeyFile <%= @ssl_key_file %>
|
|
<%# The original default was '' -%>
|
|
<%# scope.lookupvar returns nil for an undefined variable in puppet 4 -%>
|
|
<%# scope.lookupvar returns :undef for an undefined variable in puppet 3 -%>
|
|
<% unless ['', nil, :undef].include?@ssl_chain_file %>
|
|
SSLCertificateChainFile <%= @ssl_chain_file %>
|
|
<% end %>
|
|
</VirtualHost>
|