diff --git a/app/views/settings/_display_access.html.erb b/app/views/settings/_display_access.html.erb index e0acbac9c..46bf107b7 100644 --- a/app/views/settings/_display_access.html.erb +++ b/app/views/settings/_display_access.html.erb @@ -3,17 +3,14 @@ <%= l(:display_access_setup) %>:

- <%= "~#{@settings['gitUser']}/#{@settings['gitRepositoryBasePath']}#{@settings['gitRedmineSubdir']}#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git" - %> + <%= "~#{@settings['gitUser']}/#{@settings['gitRepositoryBasePath']}#{@settings['gitRedmineSubdir']}" %><%="#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git" %>
<% gitSHP = Setting.plugin_redmine_git_hosting['gitServer'].match(/:\d+$/) %> - <%= "#{gitSHP ? 'ssh://' : ''}#{@settings['gitUser']}@#{@settings['gitServer']}#{gitSHP ? '/' : ':'}#{@settings['gitRedmineSubdir']}#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git" - %> + <%= "#{gitSHP ? 'ssh://' : ''}#{@settings['gitUser']}@#{@settings['gitServer']}#{gitSHP ? '/' : ':'}#{@settings['gitRedmineSubdir']}" %><%="#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git" %>
- <%= "http://redmine-user@#{GitHosting.my_root_url}/#{GitHosting.http_server_subdir}#{(GitHosting.repository_hierarchy)?'project1/project2/':''}project3.git" - %> + http://redmine-user<%="@#{GitHosting.my_root_url}/#{GitHosting.http_server_subdir}"%>

<%= l(:display_access_emphasis) %> <%= @settings['gitRepositoryHierarchy']=='true' ? l(:display_access_hierarchical) : l(:display_access_flat) %> diff --git a/app/views/settings/_redmine_git_hosting.html.erb b/app/views/settings/_redmine_git_hosting.html.erb index 2e7cec64e..d7c1ee2aa 100644 --- a/app/views/settings/_redmine_git_hosting.html.erb +++ b/app/views/settings/_redmine_git_hosting.html.erb @@ -3,186 +3,187 @@ <%= render :partial => "display_access" %>
-

<%= l(:label_basic_settings)%>

-

- - <%= text_field_tag("settings[gitLockWaitTime]", @settings['gitLockWaitTime'], :size => 10) %> - -

-

- - <%= text_field_tag("settings[gitTempDataDir]", @settings['gitTempDataDir'], :size => 60) %> - -

-

- - <% stripped = (@settings['gitScriptDir'] || "").lstrip.rstrip - norm = File.expand_path(stripped,"/") - reldir = ((stripped[0,1] != "/")?".":"") + norm + ((norm[-1,1] != "/")?"/":"")%> - <%= text_field_tag("settings[gitScriptDir]", reldir, :size => 60) %> - -

-

- - <%= text_field_tag("settings[gitUser]", @settings['gitUser'].split(/[\r\n\t ,;]+/).join("\n"), :size => 60) %> - -

- -

- - <%= text_field_tag("settings[gitoliteIdentityFile]", @settings['gitoliteIdentityFile'], :size => 60) %> - -

-

- - <%= text_field_tag("settings[gitoliteIdentityPublicKeyFile]", @settings['gitoliteIdentityPublicKeyFile'], :size => 60) %> - -

- - - -

<%= l(:label_gitolite_repository_settings)%>

-

- - <%= text_field_tag("settings[gitRepositoryBasePath]", "./#{@settings['gitRepositoryBasePath']}", :size => 60) %> - -

-

- - <%= text_field_tag("settings[gitRedmineSubdir]", "./#{@settings['gitRedmineSubdir']}", :size => 60) %> - -

-

- - <%= select_tag("settings[gitRepositoryHierarchy]", options_for_select([[l(:label_hierarchical), 'true'], [l(:label_flat), 'false']], @settings['gitRepositoryHierarchy'])) %> - -

-

- - <%= select_tag("settings[allProjectsUseGit]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['allProjectsUseGit'])) %> - -

-

- - <%= select_tag("settings[gitDaemonDefault]", options_for_select([ [l(:label_disabled), "0"], [l(:label_enabled), "1"]], @settings['gitDaemonDefault']))%> - -

-

- - <%= select_tag("settings[gitHttpDefault]", options_for_select([ [l(:label_disabled), "0"], [l(:label_https_only), "1"], [l(:label_https_and_http), "2"] ], @settings['gitHttpDefault'])) %> - -

-

- - <%= select_tag("settings[gitNotifyCIADefault]", options_for_select([ [l(:label_disabled), "0"], [l(:label_enabled), "1"]], @settings['gitNotifyCIADefault']))%> - -

-

- - <%= select_tag("settings[deleteGitRepositories]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['deleteGitRepositories'])) %> - -

-

- - <%= text_field_tag("settings[gitRecycleBasePath]", "./#{@settings['gitRecycleBasePath']}", :size => 60) %> - -

- -

- - <%= text_field_tag("settings[gitRecycleExpireTime]", @settings['gitRecycleExpireTime'], :size => 10) %> - -

- - - -

<%= l(:label_gitolite_access_URLs)%>

-

- - <%= text_field_tag("settings[gitServer]", @settings['gitServer'].split(/[\r\n\t ,;]+/).join("\n"), :size => 60) %> - -

-

- - <%= text_field_tag("settings[httpServer]", @settings['httpServer'].split(/[\r\n\t ,;]+/).join("\n"), :size => 60) %> - -

-

- - <%= text_field_tag("settings[httpServerSubdir]", "./#{@settings['httpServerSubdir']}", :size => 60) %> - -

-

- - <%= select_tag("settings[gitRepositoriesShowUrl]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitRepositoriesShowUrl'])) %> - -

- - -

<%= l(:label_git_cache_parameters)%>

-

- - <%= text_field_tag("settings[gitCacheMaxElements]", @settings['gitCacheMaxElements'], :size => 20) %> - -

-

- - <%= text_field_tag("settings[gitCacheMaxSize]", @settings['gitCacheMaxSize'], :size => 20) %> MB - -

-

- - <%= select_tag("settings[gitCacheMaxTime]", options_for_select([["until next commit", "-1"], ["1 minute or until next commit", "60"], ["15 minutes or until next commit", "900"], ["1 hour or until next commit", "3600"], ["1 day or until next commit", "86400"]], @settings['gitCacheMaxTime'] )) %> - -

- - - -

<%= l(:label_git_hook_header)%>

- -

- - <%= select_tag("settings[gitHooksAreAsynchronous]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitHooksAreAsynchronous'])) %> - -

- -

- - <%= select_tag("settings[gitHooksDebug]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitHooksDebug'])) %> - -

- -

- - <%= select_tag("settings[gitForceHooksUpdate]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitForceHooksUpdate'])) %> -
-

- -

- - <%= image_tag((GitHosting.check_hooks_installed==true ? 'true.png' : 'exclamation.png'), :style => "vertical-align:bottom;") %> - <%= (GitHosting.check_hooks_installed==true ? '' : GitHosting.check_hooks_installed) %> - -

- -
- -

<%= l(:label_permissions_header)%>

-

- - <%= image_tag((GitHosting.sudo_git_to_web_user==true ? 'true.png' : 'exclamation.png'), :style => "vertical-align:bottom;") %> - <%= (GitHosting.sudo_git_to_web_user==true ? '' : GitHosting.sudo_git_to_web_user) %> - -

-

- - <%= image_tag((GitHosting.sudo_web_to_git_user==true ? 'true.png' : 'exclamation.png'), :style => "vertical-align:bottom;") %> - <%= (GitHosting.sudo_web_to_git_user==true ? '' : GitHosting.sudo_web_to_git_user) %> - -

-

- - <%= (ENV['PATH']).gsub(/:/, "
") %> -
-

+

<%= l(:label_basic_settings)%>

+

+ + <%= text_field_tag("settings[gitLockWaitTime]", @settings['gitLockWaitTime'], :size => 10) %> + +

+

+ + <%= text_field_tag("settings[gitTempDataDir]", @settings['gitTempDataDir'], :size => 60) %> + +

+

+ + <% stripped = (@settings['gitScriptDir'] || "").lstrip.rstrip + # norm = File.expand_path(stripped,"/") + # reldir = ((stripped[0,1] != "/")?".":"") + norm + ((norm[-1,1] != "/")?"/":"") + reldir = stripped%> + <%= text_field_tag("settings[gitScriptDir]", reldir, :size => 60) %> + +

+

+ + <%= text_field_tag("settings[gitUser]", @settings['gitUser'].split(/[\r\n\t ,;]+/).join("\n"), :size => 60) %> + +

+ +

+ + <%= text_field_tag("settings[gitoliteIdentityFile]", @settings['gitoliteIdentityFile'], :size => 60) %> + +

+

+ + <%= text_field_tag("settings[gitoliteIdentityPublicKeyFile]", @settings['gitoliteIdentityPublicKeyFile'], :size => 60) %> + +

+ + + +

<%= l(:label_gitolite_repository_settings)%>

+

+ + <%= text_field_tag("settings[gitRepositoryBasePath]", "#{@settings['gitRepositoryBasePath']}", :size => 60) %> + +

+

+ + <%= text_field_tag("settings[gitRedmineSubdir]", "#{@settings['gitRedmineSubdir']}", :size => 60) %> + +

+

+ + <%= select_tag("settings[gitRepositoryHierarchy]", options_for_select([[l(:label_hierarchical), 'true'], [l(:label_flat), 'false']], @settings['gitRepositoryHierarchy'])) %> + +

+

+ + <%= select_tag("settings[allProjectsUseGit]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['allProjectsUseGit'])) %> + +

+

+ + <%= select_tag("settings[gitDaemonDefault]", options_for_select([ [l(:label_disabled), "0"], [l(:label_enabled), "1"]], @settings['gitDaemonDefault']))%> + +

+

+ + <%= select_tag("settings[gitHttpDefault]", options_for_select([ [l(:label_disabled), "0"], [l(:label_https_only), "1"], [l(:label_https_and_http), "2"] ], @settings['gitHttpDefault'])) %> + +

+

+ + <%= select_tag("settings[gitNotifyCIADefault]", options_for_select([ [l(:label_disabled), "0"], [l(:label_enabled), "1"]], @settings['gitNotifyCIADefault']))%> + +

+

+ + <%= select_tag("settings[deleteGitRepositories]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['deleteGitRepositories'])) %> + +

+

+ + <%= text_field_tag("settings[gitRecycleBasePath]", "#{@settings['gitRecycleBasePath']}", :size => 60) %> + +

+ +

+ + <%= text_field_tag("settings[gitRecycleExpireTime]", @settings['gitRecycleExpireTime'], :size => 10) %> + +

+ + + +

<%= l(:label_gitolite_access_URLs)%>

+

+ + <%= text_field_tag("settings[gitServer]", @settings['gitServer'].split(/[\r\n\t ,;]+/).join("\n"), :size => 60) %> + +

+

+ + <%= text_field_tag("settings[httpServer]", @settings['httpServer'].split(/[\r\n\t ,;]+/).join("\n"), :size => 60) %> + +

+

+ + <%= text_field_tag("settings[httpServerSubdir]", "#{@settings['httpServerSubdir']}", :size => 60) %> + +

+

+ + <%= select_tag("settings[gitRepositoriesShowUrl]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitRepositoriesShowUrl'])) %> + +

+ + +

<%= l(:label_git_cache_parameters)%>

+

+ + <%= text_field_tag("settings[gitCacheMaxElements]", @settings['gitCacheMaxElements'], :size => 20) %> + +

+

+ + <%= text_field_tag("settings[gitCacheMaxSize]", @settings['gitCacheMaxSize'], :size => 20) %> MB + +

+

+ + <%= select_tag("settings[gitCacheMaxTime]", options_for_select([["until next commit", "-1"], ["1 minute or until next commit", "60"], ["15 minutes or until next commit", "900"], ["1 hour or until next commit", "3600"], ["1 day or until next commit", "86400"]], @settings['gitCacheMaxTime'] )) %> + +

+ + + +

<%= l(:label_git_hook_header)%>

+ +

+ + <%= select_tag("settings[gitHooksAreAsynchronous]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitHooksAreAsynchronous'])) %> + +

+ +

+ + <%= select_tag("settings[gitHooksDebug]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitHooksDebug'])) %> + +

+ +

+ + <%= select_tag("settings[gitForceHooksUpdate]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitForceHooksUpdate'])) %> +
+

+ +

+ + <%= image_tag((GitHosting.check_hooks_installed==true ? 'true.png' : 'exclamation.png'), :style => "vertical-align:bottom;") %> + <%= (GitHosting.check_hooks_installed==true ? '' : GitHosting.check_hooks_installed) %> + +

+ +
+ +

<%= l(:label_permissions_header)%>

+

+ + <%= image_tag((GitHosting.sudo_git_to_web_user==true ? 'true.png' : 'exclamation.png'), :style => "vertical-align:bottom;") %> + <%= (GitHosting.sudo_git_to_web_user==true ? '' : GitHosting.sudo_git_to_web_user) %> + +

+

+ + <%= image_tag((GitHosting.sudo_web_to_git_user==true ? 'true.png' : 'exclamation.png'), :style => "vertical-align:bottom;") %> + <%= (GitHosting.sudo_web_to_git_user==true ? '' : GitHosting.sudo_web_to_git_user) %> + +

+

+ + <%= (ENV['PATH']).gsub(/:/, "
") %> +
+

diff --git a/config/locales/en.yml b/config/locales/en.yml index c8a36cb86..a527d5f16 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,19 +1,19 @@ en: label_all_git: Automatically Initialize Git Repositories For New Projects - label_delete_git_repositories: Delete Git Repository When Project Deleted
(will be place in Recycle Bin) + label_delete_git_repositories: Delete Git Repository When Project Deleted (will be place in Recycle Bin) label_git_server: Gitolite Server Domain label_http_server: HTTP Server Domain (for git http urls) label_git_user: Git Username label_gitolite_identity_public_key_file: Gitolite SSH Identity File (Public Key) label_gitolite_identity_file: Gitolite SSH Identity File (Private Key) - label_git_repository_base_path: Git Repository Base Path
(Relative to git user home) - label_git_recycle_base_path: Git Recycle Bin Base Path
(Relative to git user home) - label_git_recycle_expire_time: Expire Time for Repositories in Recycle Bin
(in hours) - label_git_lock_wait_time: Synchronization Lock Wait Time
(in seconds) + label_git_repository_base_path: Git Repository Base Path (Relative to git user home) + label_git_recycle_base_path: Git Recycle Bin Base Path (Relative to git user home) + label_git_recycle_expire_time: Expire Time for Repositories in Recycle Bin (in hours) + label_git_lock_wait_time: Synchronization Lock Wait Time (in seconds) label_cannot_change_selinux: Cannot Change in Current Configuration - label_http_server_subdir: Subdirectory for HTTP access
(Relative to Redmine Root) - label_git_redmine_subdir: Subdirectory for Redmine-managed Repos
(Relative to Git Repository Base Path) - label_git_repository_hierarchy: Directory and URL Structure for
Redmine-managed Repositories + label_http_server_subdir: Subdirectory for HTTP access (Relative to Redmine Root) + label_git_redmine_subdir: Subdirectory for Redmine-managed Repos (Relative to Git Repository Base Path) + label_git_repository_hierarchy: Directory and URL Structure for Redmine-managed Repositories label_basic_settings: Basic Settings label_gitolite_access_URLs: Gitolite Access URL Settings label_gitolite_repository_settings: Gitolite Repository Settings @@ -90,7 +90,7 @@ en: label_update_all_hooks: Update ALL repositories hook settings field_private_key: Private Key - field_private_key_warning: "Do not use your own Private Key!
Please generate a new one and upload it to the mirror server." + field_private_key_warning: "Do not use your own Private Key! Please generate a new one and upload it to the mirror server." label_mirror_create: Create Repository Mirror label_mirror_delete: Delete Repository Mirror label_mirror_edit: Edit Repository Mirror @@ -133,7 +133,7 @@ en: mirror_push_sucess: Success. mirror_push_fail: Failed! - display_access_setup: Assume that project1 is a parent of project2, and project2 is a parent of project3. Given the current configuration, project3's repository has the following properties - display_access_emphasis: In the above patterns, emphasized components represent context-dependent elements. - display_access_hierarchical: Parent projects are included in the URLs, since the repository is in Hierarchical mode. - display_access_flat: Parent projects are not included in the URLs, since the repository is in Flat mode. + display_access_setup: Assume that *project1* is a parent of *project2*, and *project2* is a parent of *project3*. Given the current configuration, *project3*'s repository has the following properties + display_access_emphasis: In the above patterns, *emphasized* components represent context-dependent elements. + display_access_hierarchical: Parent projects are included in the URLs, since the repository is in *Hierarchical* mode. + display_access_flat: Parent projects are not included in the URLs, since the repository is in *Flat* mode. diff --git a/db/migrate/20091119162428_create_git_caches.rb b/db/migrate/20091119162428_create_git_caches.rb index e96d54fef..5b60388ed 100644 --- a/db/migrate/20091119162428_create_git_caches.rb +++ b/db/migrate/20091119162428_create_git_caches.rb @@ -1,7 +1,7 @@ class CreateGitCaches < ActiveRecord::Migration def self.up create_table :git_caches do |t| - t.column :command, :text + t.column :command, :string t.column :command_output, :binary t.column :proj_identifier, :string t.timestamps diff --git a/lib/git_hosting.rb b/lib/git_hosting.rb index 93070496e..d14e87760 100755 --- a/lib/git_hosting.rb +++ b/lib/git_hosting.rb @@ -716,6 +716,9 @@ def self.update_repositories(*args) cur_keynames = active_keys.map{|key| "#{key.identifier}.pub"} (old_keynames - cur_keynames).each do |k| + if k.is_a?(String) + k = [k] + end k.each do |keyname| filename = File.join(keydir,"#{keyname}") logger.warn "Removing gitolite key: #{keyname}" diff --git a/tasks/gitolite.rake b/lib/tasks/gitolite.rake similarity index 100% rename from tasks/gitolite.rake rename to lib/tasks/gitolite.rake diff --git a/tasks/redmine_git_hosting.rake b/lib/tasks/redmine_git_hosting.rake similarity index 100% rename from tasks/redmine_git_hosting.rake rename to lib/tasks/redmine_git_hosting.rake diff --git a/tasks/selinux.rake b/lib/tasks/selinux.rake similarity index 100% rename from tasks/selinux.rake rename to lib/tasks/selinux.rake