Compare commits

..

1 Commits

Author SHA1 Message Date
1fd3d4d3a9 chore: Update dependencies
Some checks failed
Build and deploy / build (push) Failing after 13m11s
2025-12-22 23:36:58 +01:00
10 changed files with 17 additions and 85 deletions

View File

@@ -9,7 +9,8 @@ on:
jobs: jobs:
build: build:
uses: infra/workflows/.gitea/workflows/docker.yaml@956337b9bd5e72a93d3a57513cd421e7554dd61d uses: dreaded_x/workflows/.gitea/workflows/rust-kubernetes.yaml@66ab50c3ac239dbdd1e42e6276ec2e65b6a79379
secrets: inherit secrets: inherit
with: with:
generate_crds: true
webhook_url: ${{ secrets.WEBHOOK_URL }} webhook_url: ${{ secrets.WEBHOOK_URL }}

View File

@@ -1,7 +1,7 @@
FROM rust:1.92 AS base FROM rust:1.92 AS base
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo install cargo-chef --locked --version 0.1.73 && \ RUN cargo install cargo-chef --locked --version 0.1.71 && \
cargo install cargo-auditable --locked --version 0.7.2 cargo install cargo-auditable --locked --version 0.6.6
WORKDIR /app WORKDIR /app
FROM base AS planner FROM base AS planner
@@ -15,11 +15,9 @@ RUN cargo chef cook --release --recipe-path recipe.json
COPY . . COPY . .
ARG RELEASE_VERSION ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION} ENV RELEASE_VERSION=${RELEASE_VERSION}
RUN cargo auditable build --release && /app/target/release/crdgen > /crds.yaml RUN cargo auditable build --release
FROM scratch AS manifests
COPY --from=builder /crds.yaml /
FROM gcr.io/distroless/cc-debian13:nonroot AS runtime FROM gcr.io/distroless/cc-debian13:nonroot AS runtime
COPY --from=builder /app/target/release/authelia-controller /authelia-controller COPY --from=builder /app/target/release/authelia-controller /authelia-controller
COPY --from=builder /app/target/release/crdgen /crdgen
CMD ["/authelia-controller"] CMD ["/authelia-controller"]

View File

@@ -1,38 +0,0 @@
variable "TAG_BASE" {}
variable "RELEASE_VERSION" {}
group "default" {
targets = ["authelia-controller", "manifests"]
}
target "docker-metadata-action" {}
target "cache" {
cache-from = [
{
type = "gha",
}
]
cache-to = [
{
type = "gha",
mode = "max"
}
]
}
target "authelia-controller" {
inherits = ["docker-metadata-action", "cache"]
context = "./"
dockerfile = "Dockerfile"
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}:${tag}"]
target = "runtime"
}
target "manifests" {
inherits = ["cache"]
context = "./"
dockerfile = "Dockerfile"
target = "manifests"
output = [{ type = "cacheonly" }, "manifests"]
}

View File

@@ -2,11 +2,9 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
name: authelia-controller name: authelia-controller
namespace: authelia
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: authelia-controller name: authelia-controller
namespace: authelia
roleRef: roleRef:
kind: ClusterRole kind: ClusterRole
name: authelia-controller name: authelia-controller

View File

@@ -2,7 +2,6 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
name: authelia-controller name: authelia-controller
namespace: authelia
rules: rules:
- apiGroups: - apiGroups:
- authelia.huizinga.dev - authelia.huizinga.dev

View File

@@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: authelia-controller name: authelia-controller
namespace: authelia
labels: labels:
app: authelia-controller app: authelia-controller
app.kubernetes.io/name: authelia-controller app.kubernetes.io/name: authelia-controller
@@ -19,17 +18,12 @@ spec:
kubectl.kubernetes.io/default-container: authelia-controller kubectl.kubernetes.io/default-container: authelia-controller
spec: spec:
serviceAccountName: authelia-controller serviceAccountName: authelia-controller
securityContext: securityContext: {}
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers: containers:
- name: authelia-controller - name: authelia-controller
image: '{{ index .images "authelia-controller" }}' image: git.huizinga.dev/dreaded_x/authelia-controller@${DIGEST}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: {}
resources: resources:
limits: limits:
cpu: 200m cpu: 200m
@@ -40,9 +34,3 @@ spec:
env: env:
- name: RUST_LOG - name: RUST_LOG
value: info,authelia_controller=debug value: info,authelia_controller=debug
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- ALL

View File

@@ -1,9 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: authelia
resources: resources:
- namespace.yaml - ./crds.yaml
- crds.yaml - ./service-account.yaml
- service-account.yaml - ./cluster-role.yaml
- cluster-role.yaml - ./cluster-role-binding.yaml
- cluster-role-binding.yaml - ./deployment.yaml
- deployment.yaml

View File

@@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: authelia

View File

@@ -2,7 +2,6 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: authelia-controller name: authelia-controller
namespace: authelia
labels: labels:
app: authelia-controller app: authelia-controller
app.kubernetes.io/name: authelia-controller app.kubernetes.io/name: authelia-controller

View File

@@ -45,7 +45,6 @@ pub struct AccessControlRuleSpec {
#[derive(Serialize, Deserialize, Clone, Debug, Hash)] #[derive(Serialize, Deserialize, Clone, Debug, Hash)]
struct AccessControl { struct AccessControl {
rules: Vec<AccessControlRuleSpec>, rules: Vec<AccessControlRuleSpec>,
default_policy: AccessPolicy,
} }
#[derive(Serialize, Deserialize, Clone, Debug, Hash)] #[derive(Serialize, Deserialize, Clone, Debug, Hash)]
@@ -61,22 +60,14 @@ impl AccessControlRule {
debug!("Updating acl"); debug!("Updating acl");
rules.sort_by_cached_key(|rule| rule.name_any()); rules.sort_by_cached_key(|rule| rule.name_any());
let rules: Vec<_> = rules let rules = rules
.iter() .iter()
.inspect(|rule| trace!(name = rule.name_any(), "Rule found")) .inspect(|rule| trace!(name = rule.name_any(), "Rule found"))
.map(|rule| rule.spec.clone()) .map(|rule| rule.spec.clone())
.collect(); .collect();
let top = TopLevel { let top = TopLevel {
access_control: AccessControl { access_control: AccessControl { rules },
// TODO: Make sure configurable?
default_policy: if rules.is_empty() {
AccessPolicy::OneFactor
} else {
AccessPolicy::Deny
},
rules,
},
}; };
let contents = BTreeMap::from([( let contents = BTreeMap::from([(