synapse-rubycas-server 1.1.3.pre → 1.1.4.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/Gemfile +21 -4
  2. data/Rakefile +2 -1
  3. data/bin/cap +16 -0
  4. data/bin/capify +16 -0
  5. data/bin/foreman +16 -0
  6. data/bin/lessc +16 -0
  7. data/bin/rackup +16 -0
  8. data/bin/rake2thor +16 -0
  9. data/bin/rubycas-server +12 -26
  10. data/bin/therubyracer +16 -0
  11. data/bin/thor +16 -0
  12. data/bin/tilt +16 -0
  13. data/bin/unicorn +16 -0
  14. data/bin/unicorn_rails +16 -0
  15. data/config.ru +2 -1
  16. data/config/deploy.rb +36 -0
  17. data/config/deploy/production.rb +4 -0
  18. data/config/deploy/staging.rb +4 -0
  19. data/config/recipes/base.rb +8 -0
  20. data/config/recipes/git.rb +10 -0
  21. data/config/recipes/nginx.rb +28 -0
  22. data/config/recipes/puma.rb +38 -0
  23. data/config/recipes/rubycas.rb +11 -0
  24. data/config/recipes/templates/nginx.erb +43 -0
  25. data/config/recipes/templates/puma.erb +13 -0
  26. data/config/recipes/templates/rubycas.erb +114 -0
  27. data/config/unicorn/development.rb +14 -0
  28. data/config/unicorn/production.rb +14 -0
  29. data/config/unicorn/staging.rb +14 -0
  30. data/lib/casserver.rb +2 -1
  31. data/lib/casserver/cas.rb +330 -4
  32. data/lib/casserver/core_ext/directory_user.rb +3 -2
  33. data/lib/casserver/server.rb +4 -8
  34. data/lib/casserver/views/_login_form.erb +15 -36
  35. data/lib/casserver/views/layout.erb +40 -4
  36. data/lib/casserver/views/login.erb +13 -27
  37. data/locales/en.yml +17 -3
  38. data/public/app.css +9641 -0
  39. data/public/assets/fontawesome-webfont.eot +0 -0
  40. data/public/assets/fontawesome-webfont.svg +255 -0
  41. data/public/assets/fontawesome-webfont.ttf +0 -0
  42. data/public/assets/fontawesome-webfont.woff +0 -0
  43. data/public/assets/gothamhtf-black-webfont.eot +0 -0
  44. data/public/assets/gothamhtf-black-webfont.svg +241 -0
  45. data/public/assets/gothamhtf-black-webfont.ttf +0 -0
  46. data/public/assets/gothamhtf-black-webfont.woff +0 -0
  47. data/public/assets/gothamhtf-blackitalic-webfont.eot +0 -0
  48. data/public/assets/gothamhtf-blackitalic-webfont.svg +241 -0
  49. data/public/assets/gothamhtf-blackitalic-webfont.ttf +0 -0
  50. data/public/assets/gothamhtf-blackitalic-webfont.woff +0 -0
  51. data/public/assets/gothamhtf-bold-webfont.eot +0 -0
  52. data/public/assets/gothamhtf-bold-webfont.svg +241 -0
  53. data/public/assets/gothamhtf-bold-webfont.ttf +0 -0
  54. data/public/assets/gothamhtf-bold-webfont.woff +0 -0
  55. data/public/assets/gothamhtf-bolditalic-webfont.eot +0 -0
  56. data/public/assets/gothamhtf-bolditalic-webfont.svg +241 -0
  57. data/public/assets/gothamhtf-bolditalic-webfont.ttf +0 -0
  58. data/public/assets/gothamhtf-bolditalic-webfont.woff +0 -0
  59. data/public/assets/gothamhtf-book-webfont.eot +0 -0
  60. data/public/assets/gothamhtf-book-webfont.svg +241 -0
  61. data/public/assets/gothamhtf-book-webfont.ttf +0 -0
  62. data/public/assets/gothamhtf-book-webfont.woff +0 -0
  63. data/public/assets/gothamhtf-bookitalic-webfont.eot +0 -0
  64. data/public/assets/gothamhtf-bookitalic-webfont.svg +241 -0
  65. data/public/assets/gothamhtf-bookitalic-webfont.ttf +0 -0
  66. data/public/assets/gothamhtf-bookitalic-webfont.woff +0 -0
  67. data/public/assets/gothamhtf-light-webfont.eot +0 -0
  68. data/public/assets/gothamhtf-light-webfont.svg +241 -0
  69. data/public/assets/gothamhtf-light-webfont.ttf +0 -0
  70. data/public/assets/gothamhtf-light-webfont.woff +0 -0
  71. data/public/assets/gothamhtf-lightitalic-webfont.eot +0 -0
  72. data/public/assets/gothamhtf-lightitalic-webfont.svg +241 -0
  73. data/public/assets/gothamhtf-lightitalic-webfont.ttf +0 -0
  74. data/public/assets/gothamhtf-lightitalic-webfont.woff +0 -0
  75. data/public/assets/gothamhtf-medium-webfont.eot +0 -0
  76. data/public/assets/gothamhtf-medium-webfont.svg +241 -0
  77. data/public/assets/gothamhtf-medium-webfont.ttf +0 -0
  78. data/public/assets/gothamhtf-medium-webfont.woff +0 -0
  79. data/public/assets/gothamhtf-thin-webfont.eot +0 -0
  80. data/public/assets/gothamhtf-thin-webfont.svg +241 -0
  81. data/public/assets/gothamhtf-thin-webfont.ttf +0 -0
  82. data/public/assets/gothamhtf-thin-webfont.woff +0 -0
  83. data/public/assets/gothamhtf-thinitalic-webfont.eot +0 -0
  84. data/public/assets/gothamhtf-thinitalic-webfont.svg +241 -0
  85. data/public/assets/gothamhtf-thinitalic-webfont.ttf +0 -0
  86. data/public/assets/gothamhtf-thinitalic-webfont.woff +0 -0
  87. data/public/assets/gothamhtf-ultra-webfont.eot +0 -0
  88. data/public/assets/gothamhtf-ultra-webfont.svg +241 -0
  89. data/public/assets/gothamhtf-ultra-webfont.ttf +0 -0
  90. data/public/assets/gothamhtf-ultra-webfont.woff +0 -0
  91. data/public/assets/gothamhtf-ultraitalic-webfont.eot +0 -0
  92. data/public/assets/gothamhtf-ultraitalic-webfont.svg +241 -0
  93. data/public/assets/gothamhtf-ultraitalic-webfont.ttf +0 -0
  94. data/public/assets/gothamhtf-ultraitalic-webfont.woff +0 -0
  95. data/public/assets/gothamhtf-xlight-webfont.eot +0 -0
  96. data/public/assets/gothamhtf-xlight-webfont.svg +241 -0
  97. data/public/assets/gothamhtf-xlight-webfont.ttf +0 -0
  98. data/public/assets/gothamhtf-xlight-webfont.woff +0 -0
  99. data/public/assets/gothamhtf-xlightitalic-webfont.eot +0 -0
  100. data/public/assets/gothamhtf-xlightitalic-webfont.svg +241 -0
  101. data/public/assets/gothamhtf-xlightitalic-webfont.ttf +0 -0
  102. data/public/assets/gothamhtf-xlightitalic-webfont.woff +0 -0
  103. data/public/css/app.css +190 -0
  104. data/public/css/bootstrap-responsive.min.css +9 -0
  105. data/public/css/bootstrap.min.css +9 -0
  106. data/public/img/glyphicons-halflings-white.png +0 -0
  107. data/public/img/glyphicons-halflings.png +0 -0
  108. data/public/js/app.js +0 -0
  109. data/public/js/bootstrap.min.js +6 -0
  110. data/public/js/jquery-1.8.0.js +9227 -0
  111. data/public/themes/app.css +4652 -0
  112. data/public/themes/cas.css +2 -0
  113. data/rubycas-server.gemspec +2 -2
  114. data/spec/casserver_spec.rb +1 -1
  115. data/spec/config/default_config.yml +1 -1
  116. metadata +141 -8
  117. checksums.yaml +0 -15
  118. data/config/unicorn.rb +0 -88
  119. data/public/themes/simple/theme.css +0 -28
data/Gemfile CHANGED
@@ -1,14 +1,31 @@
1
1
  source "http://rubygems.org"
2
- gemspec
3
2
 
3
+ gem 'appraisal'
4
+ gem 'synapse-rubycas-server', "1.1.4"
5
+ gem "mysql2"
6
+ gem 'activerecord-mysql2-adapter'
7
+ gem "activerecord"
8
+ gem "activesupport"
9
+ gem "sinatra"
10
+ gem "sinatra-r18n"
11
+ gem 'puma', "~> 2.1.1"
12
+ gem "newrelic_rpm"
13
+ gem "rake", "~> 10.0.4"
14
+
15
+ group :development do
16
+ gem 'capistrano-ext'
17
+ gem 'capistrano_colors'
18
+ gem 'capistrano-rbenv'
19
+ gem 'capistrano-unicorn', :require => false
20
+ gem 'foreman'
21
+ gem 'hipchat'
22
+ end
4
23
 
5
24
  # Gems for authenticators
6
25
  group :ldap do
7
- gem "net-ldap", "~> 0.1.1"
26
+ gem "net-ldap", "~> 0.1.1"
8
27
  end
9
28
 
10
29
  group :active_resource do
11
30
  gem "activeresource", ">= 2.3.12", "< 4.0"
12
31
  end
13
-
14
- gem "mysql2"
data/Rakefile CHANGED
@@ -2,7 +2,8 @@ require 'appraisal'
2
2
  Dir['tasks/**/*.rake'].each { |rake| load rake }
3
3
  task :default => :spec
4
4
 
5
+
5
6
  desc "Open an irb session preloaded with this library"
6
7
  task :console do
7
8
  sh "irb -rubygems -I lib -r casserver.rb"
8
- end
9
+ end
data/bin/cap ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'cap' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('capistrano', 'cap')
data/bin/capify ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'capify' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('capistrano', 'capify')
data/bin/foreman ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'foreman' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('foreman', 'foreman')
data/bin/lessc ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'lessc' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('less', 'lessc')
data/bin/rackup ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rackup' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rack', 'rackup')
data/bin/rake2thor ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake2thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('thor', 'rake2thor')
data/bin/rubycas-server CHANGED
@@ -1,30 +1,16 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rubycas-server' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
2
8
 
3
- # Enables UTF-8 compatibility in ruby 1.8.
4
- $KCODE = 'u' if RUBY_VERSION < '1.9'
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
5
12
 
6
13
  require 'rubygems'
14
+ require 'bundler/setup'
7
15
 
8
- $:.unshift File.dirname(__FILE__) + "/../lib"
9
-
10
- if ARGV.join.match('--debugger')
11
- require 'ruby-debug'
12
- puts
13
- puts "=> Debugger Enabled"
14
- end
15
-
16
- if ARGV.join.match('-c')
17
- c = ARGV.join.match(/-c\s*([^\s]+)/)
18
- if (c && c[1])
19
- ENV['CONFIG_FILE'] = c[1]
20
- puts
21
- puts "=> Using custom config file #{ENV['CONFIG_FILE'].inspect}"
22
- else
23
- $stderr.puts("To specify a custom config file use `rubycas-server -c path/to/config_file_name.yml`.")
24
- exit
25
- end
26
- end
27
-
28
- require 'casserver'
29
-
30
- CASServer::Server.run!
16
+ load Gem.bin_path('rubycas-server', 'rubycas-server')
data/bin/therubyracer ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'therubyracer' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('therubyracer', 'therubyracer')
data/bin/thor ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('thor', 'thor')
data/bin/tilt ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'tilt' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('tilt', 'tilt')
data/bin/unicorn ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'unicorn' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('unicorn', 'unicorn')
data/bin/unicorn_rails ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby-local-exec
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'unicorn_rails' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('unicorn', 'unicorn_rails')
data/config.ru CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
- require 'bundler/setup'
2
+ require 'bundler'
3
+ Bundler.require
3
4
 
4
5
  $:.unshift "#{File.dirname(__FILE__)}/lib"
5
6
  require "casserver"
data/config/deploy.rb ADDED
@@ -0,0 +1,36 @@
1
+ require "bundler/capistrano"
2
+ require "capistrano/ext/multistage"
3
+ require 'hipchat/capistrano'
4
+
5
+ load "config/recipes/base"
6
+ load "config/recipes/nginx"
7
+ load "config/recipes/puma"
8
+ load "config/recipes/git"
9
+ load "config/recipes/rubycas"
10
+
11
+ set :user, 'deployer'
12
+ set :application, "rubycas"
13
+ set :deploy_to, "/home/#{user}/apps/#{application}"
14
+ set :deploy_via, :remote_cache
15
+ set :use_sudo, false
16
+
17
+ set :bundle_flags, "--deployment --quiet --binstubs"
18
+ set :bundler, "/home/#{user}/.rbenv/shims/bundle"
19
+ set :default_environment, {
20
+ 'PATH' => "/home/#{user}/.rbenv/shims:/home/#{user}/.rbenv/bin:#{current_path}/bin:$PATH"
21
+ }
22
+
23
+ set :repository, "git@gitlab.synapse.com:synapseit/rubycas-server.git"
24
+ set :stages, %w(staging production)
25
+ set :scm, :git
26
+ set :ssh_options, { :forward_agent => true }
27
+ default_run_options[:pty] = true
28
+
29
+ #hipchat
30
+ set :hipchat_token, "513b16064cff1be931093fb28f37c4"
31
+ set :hipchat_room_name, "The Hacker Dojo"
32
+ set :hipchat_announce, true # notify users?
33
+
34
+ #nginx
35
+ set :sudo_user, 'root'
36
+ set :app_port, "80"
@@ -0,0 +1,4 @@
1
+ set :rails_env, "production"
2
+ server 'sso1.synapse.com', :app, :web, :db, :primary => true
3
+ set :branch, current_git_branch
4
+ set :server_name, 'sso1.synapse.com'
@@ -0,0 +1,4 @@
1
+ set :rails_env, "production"
2
+ server 'sso-dev.synapse.com', :app, :web, :db, :primary => true
3
+ set :branch, current_git_branch
4
+ set :server_name, 'sso-dev.synapse.com'
@@ -0,0 +1,8 @@
1
+ def template(from, to)
2
+ erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
3
+ put ERB.new(erb).result(binding), to
4
+ end
5
+
6
+ def set_default(name, *args, &block)
7
+ set(name, *args, &block) unless exists?(name)
8
+ end
@@ -0,0 +1,10 @@
1
+ # Bonus! Colors are pretty!
2
+ def red(str)
3
+ "\e[31m#{str}\e[0m"
4
+ end
5
+
6
+ def current_git_branch
7
+ branch = `git symbolic-ref HEAD 2> /dev/null`.strip.gsub(/^refs\/heads\//, '')
8
+ puts "Deploying branch #{red branch}"
9
+ branch
10
+ end
@@ -0,0 +1,28 @@
1
+ namespace :nginx do
2
+ desc "Install latest stable release of nginx"
3
+ task :install, roles: :web do
4
+ run "#{sudo} add-apt-repository ppa:nginx/stable"
5
+ run "#{sudo} apt-get -y update"
6
+ run "#{sudo} apt-get -y install nginx"
7
+ end
8
+ after "deploy:install", "nginx:install"
9
+
10
+ desc "Setup nginx configuration for this application"
11
+ task :setup, roles: :web do
12
+ template "nginx.erb", "/tmp/nginx_conf"
13
+ run "#{sudo} mv /tmp/nginx_conf /etc/nginx/sites-enabled/#{application}"
14
+ run "#{sudo} rm -f /etc/nginx/sites-enabled/default"
15
+ restart
16
+ end
17
+ after "deploy:setup", "nginx:setup"
18
+
19
+ %w[start stop restart].each do |command|
20
+ desc "#{command} nginx"
21
+ task command, roles: :web do
22
+ run "#{sudo} service nginx #{command}"
23
+ end
24
+ end
25
+ end
26
+
27
+ # NOTE: I found it necessary to manually fix the init script as shown here
28
+ # https://bugs.launchpad.net/nginx/+bug/1033856
@@ -0,0 +1,38 @@
1
+ after 'deploy:stop', 'puma:stop'
2
+ after 'deploy:start', 'puma:start'
3
+ after 'deploy:restart', 'puma:restart'
4
+
5
+ _cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
6
+ _cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
7
+ _cset(:puma_state) { "#{shared_path}/sockets/#{application}-puma.state" }
8
+ _cset(:puma_ctl_sock) { "#{shared_path}/sockets/#{application}-pumactl.sock" }
9
+ _cset(:puma_sock) { "#{shared_path}/sockets/#{application}-puma.sock" }
10
+ _cset(:puma_pid) { "#{shared_path}/pids/puma.pid" }
11
+ _cset(:puma_role) { :app }
12
+
13
+ namespace :puma do
14
+ desc 'Start puma'
15
+ task :start, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
16
+ puma_env = fetch(:rack_env, fetch(:rails_env, 'production'))
17
+ run "cd #{current_path} && #{fetch(:puma_cmd)} --config #{shared_path}/config/puma.rb", :pty => false
18
+ end
19
+
20
+ desc 'Stop puma'
21
+ task :stop, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
22
+ run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} stop"
23
+ end
24
+
25
+ desc 'Restart puma'
26
+ task :restart, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
27
+ run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} restart"
28
+ end
29
+
30
+ desc "Install puma configuration"
31
+ task :setup, roles: :app do
32
+ template "puma.erb", "/tmp/puma_conf"
33
+ run "cd #{shared_path} && mkdir config"
34
+ run "cd #{shared_path} && mkdir sockets"
35
+ run "#{sudo} mv /tmp/puma_conf #{shared_path}/config/puma.rb"
36
+ end
37
+ after "deploy:setup", "puma:setup"
38
+ end
@@ -0,0 +1,11 @@
1
+ namespace :rubycas do
2
+ desc "Setup nginx configuration for this application"
3
+ task :setup, roles: :web do
4
+ template "rubycas.erb", "/tmp/rubycas"
5
+ run "#{sudo} mv /tmp/rubycas /etc/rubycas-server/config.yml"
6
+ end
7
+ after "deploy:setup", "rubycas:setup"
8
+ end
9
+
10
+ # NOTE: I found it necessary to manually fix the init script as shown here
11
+ # https://bugs.launchpad.net/nginx/+bug/1033856