mirror of https://github.com/codevalet/codevalet
Move user-specific instances to their own subdomains to avoid issues with Let's Encrypt
This commit is contained in:
parent
2de5a6b918
commit
0e89b71ece
|
@ -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/")
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue