Commit be6f1ae61fc69cb75bcf9fb8c077c50e34326f45

Authored by Macartur Carvalho
1 parent 70f60701

adicionando pg_hba,routes e unicorn

arquivos/postgres/pg_hba.conf 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +# TYPE DATABASE USER ADDRESS METHOD
  2 +
  3 +# "local" is for Unix domain socket connections only
  4 + local redmine redmine md5
  5 + local all postgres peer
  6 +# IPv4 local connections:
  7 + host redmine redmine 127.0.0.1/32 md5
  8 + host all postgres 127.0.0.1/32 ident
  9 +# IPv6 local connections:
  10 + host redmine redmine ::1/128 md5
  11 + host all postgres ::1/128 ident
... ...
arquivos/redmine/routes.rb 0 → 100644
... ... @@ -0,0 +1,358 @@
  1 +# Redmine - project management software
  2 +# Copyright (C) 2006-2013 Jean-Philippe Lang
  3 +#
  4 +# This program is free software; you can redistribute it and/or
  5 +# modify it under the terms of the GNU General Public License
  6 +# as published by the Free Software Foundation; either version 2
  7 +# of the License, or (at your option) any later version.
  8 +#
  9 +# This program is distributed in the hope that it will be useful,
  10 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 +# GNU General Public License for more details.
  13 +#
  14 +# You should have received a copy of the GNU General Public License
  15 +# along with this program; if not, write to the Free Software
  16 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17 +Redmine::Utils::relative_url_root = "/redmine"
  18 +
  19 +RedmineApp::Application.routes.draw do
  20 + scope Redmine::Utils::relative_url_root do
  21 + root :to => 'welcome#index', :as => 'home'
  22 +
  23 + match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
  24 + match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
  25 + match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
  26 + match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
  27 + match 'account/activate', :to => 'account#activate', :via => :get
  28 +
  29 + match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put]
  30 + match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put]
  31 + match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put]
  32 + match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put]
  33 +
  34 + match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
  35 + match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
  36 +
  37 + match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
  38 + get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
  39 + match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
  40 + get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
  41 +
  42 + post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
  43 + post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
  44 + post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
  45 + post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
  46 +
  47 + # Misc issue routes. TODO: move into resources
  48 + match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
  49 + match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
  50 + match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
  51 + match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
  52 +
  53 + match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
  54 + match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
  55 +
  56 + get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
  57 + get '/issues/gantt', :to => 'gantts#show'
  58 +
  59 + get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
  60 + get '/issues/calendar', :to => 'calendars#show'
  61 +
  62 + get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
  63 + get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
  64 +
  65 + match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
  66 + match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
  67 + match 'my/page', :controller => 'my', :action => 'page', :via => :get
  68 + match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
  69 + match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
  70 + match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
  71 + match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
  72 + match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
  73 + match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
  74 + match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
  75 + match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
  76 +
  77 + resources :users
  78 + match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
  79 + match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
  80 + match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
  81 +
  82 + post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
  83 + delete 'watchers/watch', :to => 'watchers#unwatch'
  84 + get 'watchers/new', :to => 'watchers#new'
  85 + post 'watchers', :to => 'watchers#create'
  86 + post 'watchers/append', :to => 'watchers#append'
  87 + delete 'watchers', :to => 'watchers#destroy'
  88 + get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
  89 + # Specific routes for issue watchers API
  90 + post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
  91 + delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
  92 +
  93 + resources :projects do
  94 + member do
  95 + get 'settings(/:tab)', :action => 'settings', :as => 'settings'
  96 + post 'modules'
  97 + post 'archive'
  98 + post 'unarchive'
  99 + post 'close'
  100 + post 'reopen'
  101 + match 'copy', :via => [:get, :post]
  102 + end
  103 +
  104 + shallow do
  105 + resources :memberships, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
  106 + collection do
  107 + get 'autocomplete'
  108 + end
  109 + end
  110 + end
  111 +
  112 + resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
  113 +
  114 + get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
  115 + resources :issues, :only => [:index, :new, :create] do
  116 + resources :time_entries, :controller => 'timelog' do
  117 + collection do
  118 + get 'report'
  119 + end
  120 + end
  121 + end
  122 + # issue form update
  123 + match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form'
  124 +
  125 + resources :files, :only => [:index, :new, :create]
  126 +
  127 + resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
  128 + collection do
  129 + put 'close_completed'
  130 + end
  131 + end
  132 + get 'versions.:format', :to => 'versions#index'
  133 + get 'roadmap', :to => 'versions#index', :format => false
  134 + get 'versions', :to => 'versions#index'
  135 +
  136 + resources :news, :except => [:show, :edit, :update, :destroy]
  137 + resources :time_entries, :controller => 'timelog' do
  138 + get 'report', :on => :collection
  139 + end
  140 + resources :queries, :only => [:new, :create]
  141 + shallow do
  142 + resources :issue_categories
  143 + end
  144 + resources :documents, :except => [:show, :edit, :update, :destroy]
  145 + resources :boards
  146 + shallow do
  147 + resources :repositories, :except => [:index, :show] do
  148 + member do
  149 + match 'committers', :via => [:get, :post]
  150 + end
  151 + end
  152 + end
  153 +
  154 + match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
  155 + resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
  156 + member do
  157 + get 'rename'
  158 + post 'rename'
  159 + get 'history'
  160 + get 'diff'
  161 + match 'preview', :via => [:post, :put]
  162 + post 'protect'
  163 + post 'add_attachment'
  164 + end
  165 + collection do
  166 + get 'export'
  167 + get 'date_index'
  168 + end
  169 + end
  170 + match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
  171 + get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
  172 + delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
  173 + get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
  174 + get 'wiki/:id/:version/diff', :to => 'wiki#diff'
  175 + end
  176 +
  177 + resources :issues do
  178 + collection do
  179 + match 'bulk_edit', :via => [:get, :post]
  180 + post 'bulk_update'
  181 + end
  182 + resources :time_entries, :controller => 'timelog' do
  183 + collection do
  184 + get 'report'
  185 + end
  186 + end
  187 + shallow do
  188 + resources :relations, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
  189 + end
  190 + end
  191 + match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
  192 +
  193 + resources :queries, :except => [:show]
  194 +
  195 + resources :news, :only => [:index, :show, :edit, :update, :destroy]
  196 + match '/news/:id/comments', :to => 'comments#create', :via => :post
  197 + match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
  198 +
  199 + resources :versions, :only => [:show, :edit, :update, :destroy] do
  200 + post 'status_by', :on => :member
  201 + end
  202 +
  203 + resources :documents, :only => [:show, :edit, :update, :destroy] do
  204 + post 'add_attachment', :on => :member
  205 + end
  206 +
  207 + match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
  208 +
  209 + resources :time_entries, :controller => 'timelog', :except => :destroy do
  210 + collection do
  211 + get 'report'
  212 + get 'bulk_edit'
  213 + post 'bulk_update'
  214 + end
  215 + end
  216 + match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
  217 + # TODO: delete /time_entries for bulk deletion
  218 + match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
  219 +
  220 + get 'projects/:id/activity', :to => 'activities#index'
  221 + get 'projects/:id/activity.:format', :to => 'activities#index'
  222 + get 'activity', :to => 'activities#index'
  223 +
  224 + # repositories routes
  225 + get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
  226 + get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
  227 +
  228 + get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))',
  229 + :to => 'repositories#changes'
  230 +
  231 + get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
  232 + get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
  233 + post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
  234 + delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
  235 + get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
  236 + get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
  237 + :controller => 'repositories',
  238 + :format => false,
  239 + :constraints => {
  240 + :action => /(browse|show|entry|raw|annotate|diff)/,
  241 + :rev => /[a-z0-9\.\-_]+/
  242 + }
  243 +
  244 + get 'projects/:id/repository/statistics', :to => 'repositories#stats'
  245 + get 'projects/:id/repository/graph', :to => 'repositories#graph'
  246 +
  247 + get 'projects/:id/repository/changes(/*path(.:ext))',
  248 + :to => 'repositories#changes'
  249 +
  250 + get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
  251 + get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
  252 + get 'projects/:id/repository/revision', :to => 'repositories#revision'
  253 + post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
  254 + delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
  255 + get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
  256 + :controller => 'repositories',
  257 + :format => false,
  258 + :constraints => {
  259 + :action => /(browse|show|entry|raw|annotate|diff)/,
  260 + :rev => /[a-z0-9\.\-_]+/
  261 + }
  262 + get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
  263 + :controller => 'repositories',
  264 + :action => /(browse|show|entry|raw|changes|annotate|diff)/
  265 + get 'projects/:id/repository/:action(/*path(.:ext))',
  266 + :controller => 'repositories',
  267 + :action => /(browse|show|entry|raw|changes|annotate|diff)/
  268 +
  269 + get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
  270 + get 'projects/:id/repository', :to => 'repositories#show', :path => nil
  271 +
  272 + # additional routes for having the file name at the end of url
  273 + get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
  274 + get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
  275 + get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
  276 + get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
  277 + resources :attachments, :only => [:show, :destroy]
  278 +
  279 + resources :groups do
  280 + member do
  281 + get 'autocomplete_for_user'
  282 + end
  283 + end
  284 +
  285 + match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
  286 + match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
  287 + match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
  288 + match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
  289 +
  290 + resources :trackers, :except => :show do
  291 + collection do
  292 + match 'fields', :via => [:get, :post]
  293 + end
  294 + end
  295 + resources :issue_statuses, :except => :show do
  296 + collection do
  297 + post 'update_issue_done_ratio'
  298 + end
  299 + end
  300 + resources :custom_fields, :except => :show
  301 + resources :roles do
  302 + collection do
  303 + match 'permissions', :via => [:get, :post]
  304 + end
  305 + end
  306 + resources :enumerations, :except => :show
  307 + match 'enumerations/:type', :to => 'enumerations#index', :via => :get
  308 +
  309 + get 'projects/:id/search', :controller => 'search', :action => 'index'
  310 + get 'search', :controller => 'search', :action => 'index'
  311 +
  312 + match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
  313 +
  314 + match 'admin', :controller => 'admin', :action => 'index', :via => :get
  315 + match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
  316 + match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
  317 + match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
  318 + match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
  319 + match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
  320 +
  321 + resources :auth_sources do
  322 + member do
  323 + get 'test_connection', :as => 'try_connection'
  324 + end
  325 + collection do
  326 + get 'autocomplete_for_new_user'
  327 + end
  328 + end
  329 +
  330 + match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
  331 + match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
  332 + match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
  333 + match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
  334 + match 'settings', :controller => 'settings', :action => 'index', :via => :get
  335 + match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
  336 + match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
  337 +
  338 + match 'sys/projects', :to => 'sys#projects', :via => :get
  339 + match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
  340 + match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
  341 +
  342 + match 'uploads', :to => 'attachments#upload', :via => :post
  343 +
  344 + get 'robots.txt', :to => 'welcome#robots'
  345 +
  346 + Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
  347 + file = File.join(plugin_dir, "config/routes.rb")
  348 + if File.exists?(file)
  349 + begin
  350 + instance_eval File.read(file)
  351 + rescue Exception => e
  352 + puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
  353 + exit 1
  354 + end
  355 + end
  356 + end
  357 +end
  358 +end
... ...
arquivos/redmine/unicorn.rb 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +# Set the working application directory
  2 +# working_directory "/path/to/your/app"
  3 +working_directory "/opt/redmine"
  4 +
  5 +# Unicorn PID file location
  6 +# pid "/path/to/pids/unicorn.pid"
  7 +pid "/opt/redmine/pids/unicorn.pid"
  8 +
  9 +# Path to logs
  10 +# stderr_path "/path/to/log/unicorn.log"
  11 +# stdout_path "/path/to/log/unicorn.log"
  12 +stderr_path "/opt/redmine/log/unicorn.log"
  13 +stdout_path "/opt/redmine/log/unicorn.log"
  14 +
  15 +# Unicorn socket
  16 +#listen "/tmp/unicorn.redmine.sock"
  17 +listen "/tmp/unicorn.redmine.sock"
  18 +
  19 +# Number of processes
  20 +# worker_processes 4
  21 +worker_processes 2
  22 +
  23 +# Time-out
  24 +timeout 30
  25 +
... ...