mirror of https://github.com/codevalet/codevalet
Starting to refactor the webapp to be a bit more modular and perhaps testable
This commit is contained in:
parent
b01b105619
commit
e1ae017762
|
@ -33,7 +33,10 @@ ENV BUNDLE_DISABLE_SHARED_GEMS=true
|
|||
ADD app.rb ${APP_DIR}/
|
||||
ADD monkeys.txt ${APP_DIR}/
|
||||
ADD config.ru ${APP_DIR}/
|
||||
ADD views ${APP_DIR}/views/
|
||||
ADD assets ${APP_DIR}/assets/
|
||||
ADD lib ${APP_DIR}/
|
||||
ADD views ${APP_DIR}/
|
||||
ADD assets ${APP_DIR}/
|
||||
|
||||
ADD plugins.yaml ${APP_DIR}/
|
||||
|
||||
CMD bundle exec puma
|
||||
|
|
|
@ -9,20 +9,11 @@ require 'rack/session/dalli'
|
|||
require 'sinatra/base'
|
||||
require 'warden/github'
|
||||
|
||||
require 'codevalet/webapp/authfailure'
|
||||
|
||||
Haml::TempleEngine.disable_option_validator!
|
||||
|
||||
module CodeValet
|
||||
class AuthFailre < Sinatra::Base
|
||||
get '/unauthenticated' do
|
||||
status 403
|
||||
<<-EOS
|
||||
<h2>Unable to authenticate, sorry bud.</h2>
|
||||
<p>#{env['warden'].message}</p>
|
||||
<p>#{ENV['REDIRECT_URI']}</p>
|
||||
<p>#{ENV['GITHUB_CLIENT_ID']}</p>
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
class App < Sinatra::Base
|
||||
include Warden::GitHub::SSO
|
||||
|
@ -47,7 +38,7 @@ module CodeValet
|
|||
end
|
||||
|
||||
use Warden::Manager do |config|
|
||||
config.failure_app = AuthFailre
|
||||
config.failure_app = CodeValet::WebApp::AuthFailure
|
||||
config.default_strategies :github
|
||||
config.scope_defaults :default, :config => {
|
||||
:scope => 'read:public_repo,user:email',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
ENV['RACK_ENV'] ||= 'development'
|
||||
|
||||
$LOAD_PATH << File.dirname(__FILE__)
|
||||
$LOAD_PATH << File.expand_path(File.dirname(__FILE__) + '/lib/')
|
||||
|
||||
require 'app'
|
||||
require 'raven'
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
require 'sinatra/base'
|
||||
|
||||
module CodeValet
|
||||
module WebApp
|
||||
# Simple Sinatra application for enumerating a complete authentication
|
||||
# failure with Warden
|
||||
class AuthFailre < Sinatra::Base
|
||||
get '/unauthenticated' do
|
||||
status 403
|
||||
<<-EOS
|
||||
<h2>Unable to authenticate, sorry bud.</h2>
|
||||
<p>#{env['warden'].message}</p>
|
||||
<p>#{ENV['REDIRECT_URI']}</p>
|
||||
<p>#{ENV['GITHUB_CLIENT_ID']}</p>
|
||||
EOS
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
# List of plugins which should be considered for the Jenkins Developer
|
||||
# Dashbaord, see https://github.com/CodeValet/codevalet/milestone/3
|
||||
essential:
|
||||
azure-vm-agents:
|
||||
repo: 'https://github.com/jenkinsci/azure-vm-agents-plugin'
|
||||
ref: 'master'
|
||||
blueocean:
|
||||
repo: 'https://github.com/jenkinsci/blueocean-plugin'
|
||||
ref: 'master'
|
||||
datadog:
|
||||
repo: 'https://github.com/datadog/jenkins-datadog-plugin.git'
|
||||
ref: 'master'
|
||||
declarative:
|
||||
repo: 'https://github.com/jenkinsci/pipeline-model-definition-plugin'
|
||||
ref: 'master'
|
||||
embeddable-status:
|
||||
repo: 'https://github.com/jenkinsci/embeddable-build-status-plugin'
|
||||
ref: 'master'
|
||||
git:
|
||||
repo: 'https://github.com/jenkinsci/git-plugin'
|
||||
ref: 'master'
|
||||
git-client:
|
||||
repo: 'https://github.com/jenkinsci/git-client-plugin'
|
||||
ref: 'master'
|
||||
github-oauth:
|
||||
repo: 'https://github.com/jenkinsci/github-oauth-plugin'
|
||||
ref: 'master'
|
||||
matrix-auth:
|
||||
repo: 'https://github.com/jenkinsci/matrix-auth-plugin'
|
||||
ref: 'master'
|
||||
pipeline:
|
||||
repo: 'https://github.com/jenkinsci/workflow-aggregator-plugin'
|
||||
ref: 'master'
|
||||
restricted-declarative:
|
||||
repo: 'https://github.com/abayer/restricted-declarative-plugin'
|
||||
ref: 'master'
|
||||
sentry:
|
||||
repo: 'https://github.com/jenkinsci/sentry-plugin'
|
||||
ref: 'master'
|
||||
|
||||
inessential:
|
|
@ -0,0 +1,7 @@
|
|||
require 'rspec'
|
||||
|
||||
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
||||
|
||||
RSpec.configure do |c|
|
||||
c.order = :random
|
||||
end
|
Loading…
Reference in New Issue