Compare commits
1 Commits
main
...
feature/bs
| Author | SHA1 | Date | |
|---|---|---|---|
| 951eb0f892 |
@ -13,14 +13,14 @@ spec:
|
|||||||
git:
|
git:
|
||||||
checkout:
|
checkout:
|
||||||
ref:
|
ref:
|
||||||
branch: main
|
branch: feature/bstein-dev-home
|
||||||
commit:
|
commit:
|
||||||
author:
|
author:
|
||||||
email: ops@bstein.dev
|
email: ops@bstein.dev
|
||||||
name: flux-bot
|
name: flux-bot
|
||||||
messageTemplate: "chore(bstein-dev-home): update images to {{range .Updated.Images}}{{.}}{{end}}"
|
messageTemplate: "chore(bstein-dev-home): update images to {{range .Updated.Images}}{{.}}{{end}}"
|
||||||
push:
|
push:
|
||||||
branch: main
|
branch: feature/bstein-dev-home
|
||||||
update:
|
update:
|
||||||
strategy: Setters
|
strategy: Setters
|
||||||
path: services/bstein-dev-home
|
path: services/bstein-dev-home
|
||||||
|
|||||||
@ -18,7 +18,7 @@ spec:
|
|||||||
author:
|
author:
|
||||||
email: ops@bstein.dev
|
email: ops@bstein.dev
|
||||||
name: flux-bot
|
name: flux-bot
|
||||||
messageTemplate: "chore(ci-demo): apply image updates"
|
messageTemplate: "chore(ci-demo): update image to {{range .Updated.Images}}{{.}}{{end}}"
|
||||||
push:
|
push:
|
||||||
branch: feature/ci-gitops
|
branch: feature/ci-gitops
|
||||||
update:
|
update:
|
||||||
|
|||||||
@ -12,6 +12,8 @@ spec:
|
|||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
name: flux-system
|
name: flux-system
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
|
targetNamespace: ci-demo
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: core
|
- name: core
|
||||||
wait: false
|
wait: false
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ spec:
|
|||||||
author:
|
author:
|
||||||
email: ops@bstein.dev
|
email: ops@bstein.dev
|
||||||
name: flux-bot
|
name: flux-bot
|
||||||
messageTemplate: "chore(harbor): apply image updates"
|
messageTemplate: "chore(harbor): update images to {{range .Updated.Images}}{{.}}{{end}}"
|
||||||
push:
|
push:
|
||||||
branch: feature/ci-gitops
|
branch: feature/ci-gitops
|
||||||
update:
|
update:
|
||||||
|
|||||||
@ -18,7 +18,7 @@ spec:
|
|||||||
author:
|
author:
|
||||||
email: ops@bstein.dev
|
email: ops@bstein.dev
|
||||||
name: flux-bot
|
name: flux-bot
|
||||||
messageTemplate: "chore(pegasus): apply image updates"
|
messageTemplate: "chore(pegasus): update image to {{range .Updated.Images}}{{.}}{{end}}"
|
||||||
push:
|
push:
|
||||||
branch: feature/ci-gitops
|
branch: feature/ci-gitops
|
||||||
update:
|
update:
|
||||||
|
|||||||
@ -4478,7 +4478,7 @@ spec:
|
|||||||
- args:
|
- args:
|
||||||
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local./
|
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local./
|
||||||
- --watch-all-namespaces=true
|
- --watch-all-namespaces=true
|
||||||
- --log-level=info
|
- --log-level=debug
|
||||||
- --log-encoding=json
|
- --log-encoding=json
|
||||||
- --enable-leader-election
|
- --enable-leader-election
|
||||||
- --storage-path=/data
|
- --storage-path=/data
|
||||||
@ -5965,7 +5965,7 @@ spec:
|
|||||||
- args:
|
- args:
|
||||||
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local./
|
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local./
|
||||||
- --watch-all-namespaces=true
|
- --watch-all-namespaces=true
|
||||||
- --log-level=info
|
- --log-level=debug
|
||||||
- --log-encoding=json
|
- --log-encoding=json
|
||||||
- --enable-leader-election
|
- --enable-leader-election
|
||||||
env:
|
env:
|
||||||
@ -12379,7 +12379,7 @@ spec:
|
|||||||
- args:
|
- args:
|
||||||
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local./
|
- --events-addr=http://notification-controller.$(RUNTIME_NAMESPACE).svc.cluster.local./
|
||||||
- --watch-all-namespaces=true
|
- --watch-all-namespaces=true
|
||||||
- --log-level=info
|
- --log-level=debug
|
||||||
- --log-encoding=json
|
- --log-encoding=json
|
||||||
- --enable-leader-election
|
- --enable-leader-election
|
||||||
env:
|
env:
|
||||||
|
|||||||
@ -8,7 +8,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
interval: 1m0s
|
interval: 1m0s
|
||||||
ref:
|
ref:
|
||||||
branch: main
|
branch: feature/bstein-dev-home
|
||||||
secretRef:
|
secretRef:
|
||||||
name: flux-system-gitea
|
name: flux-system-gitea
|
||||||
url: ssh://git@scm.bstein.dev:2242/bstein/titan-iac.git
|
url: ssh://git@scm.bstein.dev:2242/bstein/titan-iac.git
|
||||||
|
|||||||
@ -12,6 +12,6 @@ resources:
|
|||||||
- ingress.yaml
|
- ingress.yaml
|
||||||
images:
|
images:
|
||||||
- name: registry.bstein.dev/bstein/bstein-dev-home-frontend
|
- name: registry.bstein.dev/bstein/bstein-dev-home-frontend
|
||||||
newTag: 0.1.1-0 # {"$imagepolicy": "bstein-dev-home:bstein-dev-home-frontend"}
|
newTag: 0.1.0-11 # {"$imagepolicy": "bstein-dev-home:bstein-dev-home-frontend"}
|
||||||
- name: registry.bstein.dev/bstein/bstein-dev-home-backend
|
- name: registry.bstein.dev/bstein/bstein-dev-home-backend
|
||||||
newTag: 0.1.1-0 # {"$imagepolicy": "bstein-dev-home:bstein-dev-home-backend"}
|
newTag: 0.1.0-11 # {"$imagepolicy": "bstein-dev-home:bstein-dev-home-backend"}
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
# services/ci-demo/image.yaml
|
# services/ci-demo/image.yaml
|
||||||
apiVersion: image.toolkit.fluxcd.io/v1
|
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||||
kind: ImageRepository
|
kind: ImageRepository
|
||||||
metadata:
|
metadata:
|
||||||
name: ci-demo
|
name: ci-demo
|
||||||
namespace: flux-system
|
namespace: ci-demo
|
||||||
spec:
|
spec:
|
||||||
image: registry.bstein.dev/infra/ci-demo
|
image: registry.bstein.dev/infra/ci-demo
|
||||||
interval: 1m0s
|
interval: 1m0s
|
||||||
---
|
---
|
||||||
apiVersion: image.toolkit.fluxcd.io/v1
|
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||||
kind: ImagePolicy
|
kind: ImagePolicy
|
||||||
metadata:
|
metadata:
|
||||||
name: ci-demo
|
name: ci-demo
|
||||||
namespace: flux-system
|
namespace: ci-demo
|
||||||
spec:
|
spec:
|
||||||
imageRepositoryRef:
|
imageRepositoryRef:
|
||||||
name: ci-demo
|
name: ci-demo
|
||||||
|
|||||||
@ -8,4 +8,4 @@ resources:
|
|||||||
- service.yaml
|
- service.yaml
|
||||||
images:
|
images:
|
||||||
- name: registry.bstein.dev/infra/ci-demo
|
- name: registry.bstein.dev/infra/ci-demo
|
||||||
newTag: registry.bstein.dev/infra/ci-demo:v0.0.0-3 # {"$imagepolicy": "flux-system:ci-demo"}
|
newTag: v0.0.0-2 # {"$imagepolicy": "ci-demo:ci-demo:tag"}
|
||||||
|
|||||||
@ -156,54 +156,6 @@ spec:
|
|||||||
- name: jenkins-home
|
- name: jenkins-home
|
||||||
mountPath: /var/jenkins_home
|
mountPath: /var/jenkins_home
|
||||||
initScripts:
|
initScripts:
|
||||||
oidc.groovy: |
|
|
||||||
import hudson.util.Secret
|
|
||||||
import jenkins.model.IdStrategy
|
|
||||||
import jenkins.model.Jenkins
|
|
||||||
import org.jenkinsci.plugins.oic.OicSecurityRealm
|
|
||||||
import org.jenkinsci.plugins.oic.OicServerWellKnownConfiguration
|
|
||||||
import hudson.security.FullControlOnceLoggedInAuthorizationStrategy
|
|
||||||
def env = System.getenv()
|
|
||||||
if (!(env['ENABLE_OIDC'] ?: 'false').toBoolean()) {
|
|
||||||
println("OIDC disabled (ENABLE_OIDC=false); keeping default security realm")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
def required = ['OIDC_CLIENT_ID','OIDC_CLIENT_SECRET','OIDC_ISSUER']
|
|
||||||
if (!required.every { env[it] }) {
|
|
||||||
throw new IllegalStateException("OIDC enabled but missing vars: ${required.findAll { !env[it] }}")
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
def wellKnown = "${env['OIDC_ISSUER']}/.well-known/openid-configuration"
|
|
||||||
def serverCfg = new OicServerWellKnownConfiguration(wellKnown)
|
|
||||||
serverCfg.setScopesOverride('openid profile email')
|
|
||||||
def realm = new OicSecurityRealm(
|
|
||||||
env['OIDC_CLIENT_ID'],
|
|
||||||
Secret.fromString(env['OIDC_CLIENT_SECRET']),
|
|
||||||
serverCfg,
|
|
||||||
false,
|
|
||||||
IdStrategy.CASE_INSENSITIVE,
|
|
||||||
IdStrategy.CASE_INSENSITIVE
|
|
||||||
)
|
|
||||||
realm.createProxyAwareResourceRetriver()
|
|
||||||
realm.setLogoutFromOpenidProvider(true)
|
|
||||||
realm.setPostLogoutRedirectUrl('https://ci.bstein.dev')
|
|
||||||
realm.setUserNameField('preferred_username')
|
|
||||||
realm.setFullNameFieldName('name')
|
|
||||||
realm.setEmailFieldName('email')
|
|
||||||
realm.setGroupsFieldName('groups')
|
|
||||||
realm.setRootURLFromRequest(true)
|
|
||||||
realm.setSendScopesInTokenRequest(true)
|
|
||||||
def j = Jenkins.get()
|
|
||||||
j.setSecurityRealm(realm)
|
|
||||||
def auth = new FullControlOnceLoggedInAuthorizationStrategy()
|
|
||||||
auth.setAllowAnonymousRead(false)
|
|
||||||
j.setAuthorizationStrategy(auth)
|
|
||||||
j.save()
|
|
||||||
println("Configured OIDC realm from init script (well-known)")
|
|
||||||
} catch (Exception e) {
|
|
||||||
println("Failed to configure OIDC realm: ${e}")
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
theme.groovy: |
|
theme.groovy: |
|
||||||
import jenkins.model.Jenkins
|
import jenkins.model.Jenkins
|
||||||
import org.codefirst.SimpleThemeDecorator
|
import org.codefirst.SimpleThemeDecorator
|
||||||
@ -223,8 +175,26 @@ spec:
|
|||||||
}
|
}
|
||||||
JCasC:
|
JCasC:
|
||||||
defaultConfig: false
|
defaultConfig: false
|
||||||
securityRealm: ""
|
securityRealm: |
|
||||||
authorizationStrategy: ""
|
oic:
|
||||||
|
clientId: "${OIDC_CLIENT_ID}"
|
||||||
|
clientSecret: "${OIDC_CLIENT_SECRET}"
|
||||||
|
tokenServerUrl: "${OIDC_TOKEN_URL}"
|
||||||
|
authorizationServerUrl: "${OIDC_AUTH_URL}"
|
||||||
|
userInfoUrl: "${OIDC_USERINFO_URL}"
|
||||||
|
logoutFromOpenIdProvider: true
|
||||||
|
postLogoutRedirectUrl: "https://ci.bstein.dev"
|
||||||
|
scopes: "openid profile email"
|
||||||
|
rootURLFromRequest: true
|
||||||
|
userNameField: "preferred_username"
|
||||||
|
fullNameFieldName: "name"
|
||||||
|
emailFieldName: "email"
|
||||||
|
groupsFieldName: "groups"
|
||||||
|
escapeHatchEnabled: false
|
||||||
|
maxClockSkew: 120
|
||||||
|
authorizationStrategy: |
|
||||||
|
loggedInUsersCanDoAnything:
|
||||||
|
allowAnonymousRead: false
|
||||||
configScripts:
|
configScripts:
|
||||||
base.yaml: |
|
base.yaml: |
|
||||||
jenkins:
|
jenkins:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user