Move user-specific instances to their own subdomains to avoid issues with Let's Encrypt

This commit is contained in:
R. Tyler Croy 2017-12-11 15:47:59 -08:00
parent 2de5a6b918
commit 0e89b71ece
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
4 changed files with 12 additions and 13 deletions

View File

@ -5,5 +5,5 @@
import jenkins.model.*
if (System.env.get('GITHUB_USER')) {
JenkinsLocationConfiguration.get().setUrl("https://codevalet.io/u/${System.env.get('GITHUB_USER')}/")
JenkinsLocationConfiguration.get().setUrl("https://${System.env.get('GITHUB_USER'}.codevalet.io/")
}

View File

@ -39,13 +39,13 @@ items:
spec:
tls:
- hosts:
- codevalet.io
- '@@USER@@.codevalet.io'
secretName: ingress-tls
rules:
- host: codevalet.io
- host: '@@USER@@.codevalet.io'
http:
paths:
- path: '/u/@@USER@@'
- path: '/'
backend:
serviceName: 'jenkins-@@USER@@'
servicePort: 80
@ -133,7 +133,7 @@ items:
- name: SENTRY_PUBLIC_DSN
value: 'https://6879decf237b4307ad697c8dc56731c3@sentry.io/206607'
- name: JENKINS_OPTS
value: '--prefix=/u/@@USER@@'
value: ''
- name: DATADOG_API_KEY
valueFrom:
secretKeyRef:

View File

@ -86,7 +86,6 @@ module CodeValet
end
get '/github/authenticate' do
puts request.inspect
env['warden'].authenticate!
if session[:jenkins] && env['warden'].user
@ -99,7 +98,7 @@ module CodeValet
login = session[:admin_instance]
session[:admin_instance] = nil
end
href = "https://codevalet.io/u/#{login}/#{redirect_path}"
href = "https://#{login}.codevalet.io/#{redirect_path}"
end
redirect to(href)
end
@ -119,7 +118,7 @@ module CodeValet
login = params['instance']
session[:admin_instance] = login
end
href = "https://codevalet.io/u/#{login}/#{redirect_path}"
href = "https://#{login}.codevalet.io/#{redirect_path}"
end
redirect to(href)
end