5 Commits

Author SHA1 Message Date
41de38613c Switch to authelia-controller
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 8m6s
2025-04-18 03:45:47 +02:00
e0812f28aa Output json logs except when running through cargo
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m25s
2025-04-17 16:54:37 +02:00
62a85230a9 Fixed conflict with service links
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m31s
2025-04-17 15:59:03 +02:00
13f27ef878 Improved error message when failing to parse ports
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m28s
2025-04-17 15:04:53 +02:00
6d70187560 Manifests latest tag now tracks latest tagged release instead of latest build 2025-04-17 14:32:56 +02:00
8 changed files with 30 additions and 24 deletions

View File

@@ -76,11 +76,11 @@ jobs:
- name: Push manifests - name: Push manifests
run: | run: |
flux push artifact oci://$OCI_REPO/manifests:latest \ flux push artifact oci://$OCI_REPO/manifests:${{ gitea.head_ref || gitea.ref_name }} \
--path="./manifests.yaml" \ --path="./manifests.yaml" \
--source="$(git config --get remote.origin.url)" \ --source="$(git config --get remote.origin.url)" \
--revision="$(git rev-parse HEAD)" \ --revision="$(git rev-parse HEAD)" \
$(echo "${{ steps.meta.outputs.labels }}" | sed -e 's/^/-a /') $(echo "${{ steps.meta.outputs.labels }}" | sed -e 's/^/-a /')
flux tag artifact oci://$OCI_REPO/manifests:latest \ flux tag artifact oci://$OCI_REPO/manifests:${{ gitea.head_ref || gitea.ref_name }} \
$(echo "${{ steps.meta.outputs.tags }}" | sed -e 's/^.*:/--tag /') $(echo "${{ steps.meta.outputs.tags }}" | sed -e 's/^.*:/--tag /')

View File

@@ -0,0 +1,7 @@
apiVersion: authelia.huizinga.dev/v1
kind: AccessControlRule
metadata:
name: tunnel
spec:
domain: "*.tunnel.${domain}"
policy: one_factor

View File

@@ -1,10 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: authelia-acl
annotations:
config.huizinga.dev/fragment: authelia-acl
data:
rules: |
- domain: "*.tunnel.${domain}"
policy: one_factor

View File

@@ -17,6 +17,8 @@ spec:
annotations: annotations:
kubectl.kubernetes.io/default-container: siranga kubectl.kubernetes.io/default-container: siranga
spec: spec:
# Service links cause issues with the HTTP_PORT and SSH_PORT env variables
enableServiceLinks: false
containers: containers:
- name: siranga - name: siranga
image: git.huizinga.dev/dreaded_x/siranga@${DIGEST} image: git.huizinga.dev/dreaded_x/siranga@${DIGEST}

View File

@@ -10,6 +10,6 @@ spec:
kind: Rule kind: Rule
services: services:
- name: http - name: http
port: 3000 port: http
tls: tls:
secretName: tunnel-tls secretName: tunnel-tls

View File

@@ -9,4 +9,4 @@ resources:
- ./service.yaml - ./service.yaml
- ./certificate.yaml - ./certificate.yaml
- ./ingress-route.yaml - ./ingress-route.yaml
- ./config-map-authelia-acl.yaml - ./access-control-rule.yaml

View File

@@ -4,9 +4,8 @@ metadata:
name: http name: http
spec: spec:
ports: ports:
- name: "3000" - name: http
port: 3000 port: 3000
targetPort: 3000
selector: selector:
app: siranga app: siranga
--- ---
@@ -19,7 +18,7 @@ metadata:
spec: spec:
type: LoadBalancer type: LoadBalancer
ports: ports:
- name: "2222" - name: ssh
port: 22 port: 22
targetPort: 2222 targetPort: 2222
selector: selector:

View File

@@ -24,11 +24,19 @@ async fn main() -> color_eyre::Result<()> {
let env_filter = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?; let env_filter = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?;
if std::env::var("CARGO").is_ok() {
let logger = tracing_subscriber::fmt::layer().compact(); let logger = tracing_subscriber::fmt::layer().compact();
tracing_subscriber::Registry::default() tracing_subscriber::Registry::default()
.with(logger) .with(logger)
.with(env_filter) .with(env_filter)
.init(); .init();
} else {
let logger = tracing_subscriber::fmt::layer().json();
tracing_subscriber::Registry::default()
.with(logger)
.with(env_filter)
.init();
}
info!( info!(
"Starting {} ({})", "Starting {} ({})",
@@ -45,10 +53,10 @@ async fn main() -> color_eyre::Result<()> {
}; };
let http_port = std::env::var("HTTP_PORT") let http_port = std::env::var("HTTP_PORT")
.map(|port| port.parse()) .map(|port| port.parse().wrap_err_with(|| format!("HTTP_PORT={port}")))
.unwrap_or(Ok(3000))?; .unwrap_or(Ok(3000))?;
let ssh_port = std::env::var("SSH_PORT") let ssh_port = std::env::var("SSH_PORT")
.map(|port| port.parse()) .map(|port| port.parse().wrap_err_with(|| format!("SSH_PORT={port}")))
.unwrap_or(Ok(2222))?; .unwrap_or(Ok(2222))?;
let domain = let domain =