Changeset 93
- Timestamp:
- 06/21/07 14:52:16 (2 years ago)
- Files:
-
- branches/1-7-stable/lib/deprec/recipes/trac.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1-7-stable/lib/deprec/recipes/trac.rb
r87 r93 1 1 Capistrano.configuration(:must_exist).load do 2 2 3 set :trac_path, lambda { deploy_to ? "#{deploy_to}/trac" : Capistrano::CLI.password_prompt('path to trac config: ') } 4 3 set (:trac_path) do 4 deploy_to ? "#{deploy_to}/trac" : Capistrano::CLI.prompt('path to trac config: ') 5 end 6 set (:trac_account) do 7 Capistrano::CLI.prompt('account name: ') 8 end 9 set :trac_passwordfile_exists, true # hack - should check on remote system instead 10 5 11 task :trac_install, :roles => :scm do 6 12 version = 'trac-0.10.4' … … 22 28 trac_init 23 29 trac_config 30 set :trac_account, user 31 set :trac_passwordfile_exists, false # hack - should check on remote system instead 32 trac_user_add 33 trac_disable_anon 24 34 end 25 35 26 36 task :trac_init, :roles => :scm do 27 puts trac_path + 'foo'28 37 sudo "trac-admin #{trac_path} initenv #{application} sqlite:db/trac.db svn #{repos_root} /usr/local/share/trac/templates" 29 38 end … … 35 44 task :trac_start, :roles => :scm do 36 45 # XXX enable this for cap2 37 # XXX run "echo point your browser to http://$CAPISTRANO:HOST$:8000/trac" 38 sudo "tracd --port 8000 #{trac_path}" 46 # XXX run "echo point your browser to http://$CAPISTRANO:HOST$:8000/trac" 47 auth_string = "--auth=*,#{trac_path}/conf/users.htdigest,#{application}" 48 sudo "tracd #{auth_string} --port 8000 #{trac_path}" 49 end 50 51 desc "create a trac user" 52 task :trac_user_add, :roles => :scm do 53 create_file = trac_passwordfile_exists ? '' : ' -c ' 54 htdigest = '/usr/local/apache2/bin/htdigest' 55 # XXX check if htdigest file exists and add '-c' option if not 56 # sudo "test -f #{trac_path/conf/users.htdigest} 57 create_file = trac_passwordfile_exists ? '' : ' -c ' 58 sudo_with_input("#{htdigest} #{create_file} #{trac_path}/conf/users.htdigest #{application} #{trac_account}", /password:/) 59 sudo "trac-admin #{trac_path} permission add anonymous '*'" 60 sudo "trac-admin #{trac_path} permission add authenticated TRAC_ADMIN" 61 end 62 63 desc "list trac users" 64 task :trac_list_users, :roles => :scm do 65 sudo "cat #{trac_path}/conf/users.htdigest" 66 end 67 68 desc "disable anonymous access to everything" 69 task :trac_disable_anon, :roles => :scm do 70 sudo "trac-admin #{trac_path} permission remove anonymous '*'" 39 71 end 40 72
