synapse-rubycas-server 1.1.4 → 1.1.5.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +21 -2
- data/Rakefile +6 -0
- data/bin/cap +16 -0
- data/bin/capify +16 -0
- data/bin/foreman +16 -0
- data/bin/lessc +16 -0
- data/bin/rackup +16 -0
- data/bin/rake2thor +16 -0
- data/bin/rubycas-server +12 -26
- data/bin/therubyracer +16 -0
- data/bin/thor +16 -0
- data/bin/tilt +16 -0
- data/bin/unicorn +16 -0
- data/bin/unicorn_rails +16 -0
- data/config.ru +2 -1
- data/config/deploy.rb +36 -0
- data/config/deploy/production.rb +4 -0
- data/config/deploy/staging.rb +4 -0
- data/config/recipes/base.rb +8 -0
- data/config/recipes/git.rb +10 -0
- data/config/recipes/nginx.rb +28 -0
- data/config/recipes/puma.rb +38 -0
- data/config/recipes/rubycas.rb +11 -0
- data/config/recipes/templates/nginx.erb +43 -0
- data/config/recipes/templates/puma.erb +13 -0
- data/config/recipes/templates/rubycas.erb +114 -0
- data/config/unicorn/development.rb +14 -0
- data/config/unicorn/production.rb +14 -0
- data/config/unicorn/staging.rb +14 -0
- data/lib/casserver.rb +2 -1
- data/lib/casserver/cas.rb +330 -4
- data/lib/casserver/server.rb +4 -8
- data/lib/casserver/views/_login_form.erb +15 -36
- data/lib/casserver/views/layout.erb +40 -4
- data/lib/casserver/views/login.erb +13 -27
- data/locales/en.yml +17 -3
- data/public/app.css +9641 -0
- data/public/assets/fontawesome-webfont.eot +0 -0
- data/public/assets/fontawesome-webfont.svg +255 -0
- data/public/assets/fontawesome-webfont.ttf +0 -0
- data/public/assets/fontawesome-webfont.woff +0 -0
- data/public/assets/gothamhtf-black-webfont.eot +0 -0
- data/public/assets/gothamhtf-black-webfont.svg +241 -0
- data/public/assets/gothamhtf-black-webfont.ttf +0 -0
- data/public/assets/gothamhtf-black-webfont.woff +0 -0
- data/public/assets/gothamhtf-blackitalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-blackitalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-blackitalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-blackitalic-webfont.woff +0 -0
- data/public/assets/gothamhtf-bold-webfont.eot +0 -0
- data/public/assets/gothamhtf-bold-webfont.svg +241 -0
- data/public/assets/gothamhtf-bold-webfont.ttf +0 -0
- data/public/assets/gothamhtf-bold-webfont.woff +0 -0
- data/public/assets/gothamhtf-bolditalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-bolditalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-bolditalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-bolditalic-webfont.woff +0 -0
- data/public/assets/gothamhtf-book-webfont.eot +0 -0
- data/public/assets/gothamhtf-book-webfont.svg +241 -0
- data/public/assets/gothamhtf-book-webfont.ttf +0 -0
- data/public/assets/gothamhtf-book-webfont.woff +0 -0
- data/public/assets/gothamhtf-bookitalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-bookitalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-bookitalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-bookitalic-webfont.woff +0 -0
- data/public/assets/gothamhtf-light-webfont.eot +0 -0
- data/public/assets/gothamhtf-light-webfont.svg +241 -0
- data/public/assets/gothamhtf-light-webfont.ttf +0 -0
- data/public/assets/gothamhtf-light-webfont.woff +0 -0
- data/public/assets/gothamhtf-lightitalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-lightitalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-lightitalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-lightitalic-webfont.woff +0 -0
- data/public/assets/gothamhtf-medium-webfont.eot +0 -0
- data/public/assets/gothamhtf-medium-webfont.svg +241 -0
- data/public/assets/gothamhtf-medium-webfont.ttf +0 -0
- data/public/assets/gothamhtf-medium-webfont.woff +0 -0
- data/public/assets/gothamhtf-thin-webfont.eot +0 -0
- data/public/assets/gothamhtf-thin-webfont.svg +241 -0
- data/public/assets/gothamhtf-thin-webfont.ttf +0 -0
- data/public/assets/gothamhtf-thin-webfont.woff +0 -0
- data/public/assets/gothamhtf-thinitalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-thinitalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-thinitalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-thinitalic-webfont.woff +0 -0
- data/public/assets/gothamhtf-ultra-webfont.eot +0 -0
- data/public/assets/gothamhtf-ultra-webfont.svg +241 -0
- data/public/assets/gothamhtf-ultra-webfont.ttf +0 -0
- data/public/assets/gothamhtf-ultra-webfont.woff +0 -0
- data/public/assets/gothamhtf-ultraitalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-ultraitalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-ultraitalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-ultraitalic-webfont.woff +0 -0
- data/public/assets/gothamhtf-xlight-webfont.eot +0 -0
- data/public/assets/gothamhtf-xlight-webfont.svg +241 -0
- data/public/assets/gothamhtf-xlight-webfont.ttf +0 -0
- data/public/assets/gothamhtf-xlight-webfont.woff +0 -0
- data/public/assets/gothamhtf-xlightitalic-webfont.eot +0 -0
- data/public/assets/gothamhtf-xlightitalic-webfont.svg +241 -0
- data/public/assets/gothamhtf-xlightitalic-webfont.ttf +0 -0
- data/public/assets/gothamhtf-xlightitalic-webfont.woff +0 -0
- data/public/css/app.css +190 -0
- data/public/css/bootstrap-responsive.min.css +9 -0
- data/public/css/bootstrap.min.css +9 -0
- data/public/img/glyphicons-halflings-white.png +0 -0
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/js/app.js +0 -0
- data/public/js/bootstrap.min.js +6 -0
- data/public/js/jquery-1.8.0.js +9227 -0
- data/public/themes/app.css +4652 -0
- data/public/themes/cas.css +2 -0
- data/rubycas-server.gemspec +62 -0
- data/spec/casserver_spec.rb +1 -1
- data/spec/config/default_config.yml +1 -1
- metadata +146 -12
- checksums.yaml +0 -15
- data/config/unicorn.rb +0 -88
- data/public/themes/simple/theme.css +0 -28
data/Gemfile
CHANGED
@@ -1,10 +1,29 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
gemspec
|
3
2
|
|
3
|
+
gem 'appraisal'
|
4
|
+
gem 'synapse-rubycas-server'
|
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
|
-
|
26
|
+
gem "net-ldap", "~> 0.1.1"
|
8
27
|
end
|
9
28
|
|
10
29
|
group :active_resource do
|
data/Rakefile
CHANGED
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
|
-
|
4
|
-
|
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
|
-
|
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
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,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
|