Changed syncthing access and auth scheme
Some checks failed
Update Kubernetes Services Wiki / Generate and Update K8s Wiki (push) Successful in 40s
Check with kubeconform / lint (push) Has been cancelled

This commit is contained in:
AB from home.homenet
2025-10-12 13:02:32 +03:00
parent 5a33337aa1
commit 95e12df43d
4 changed files with 201 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: syncthing-ingressroute
namespace: syncthing
spec:
entryPoints:
- websecure
routes:
- match: Host(`ss.hexor.cy`)
kind: Rule
services:
- name: syncthing-landing
port: 80
middlewares:
- name: authentik-forward-auth
namespace: syncthing
- match: Host(`ss.hexor.cy`) && PathPrefix(`/nas`)
kind: Rule
services:
- name: syncthing-nas
port: 8384
middlewares:
- name: authentik-forward-auth
namespace: syncthing
- name: strip-prefix-nas
namespace: syncthing
- match: Host(`ss.hexor.cy`) && PathPrefix(`/master`)
kind: Rule
services:
- name: syncthing-master
port: 8384
middlewares:
- name: authentik-forward-auth
namespace: syncthing
- name: strip-prefix-master
namespace: syncthing
- match: Host(`ss.hexor.cy`) && PathPrefix(`/iris`)
kind: Rule
services:
- name: syncthing-khv
port: 8384
middlewares:
- name: authentik-forward-auth
namespace: syncthing
- name: strip-prefix-iris
namespace: syncthing
tls:
secretName: syncthing-tls

View File

@@ -4,6 +4,9 @@ kind: Kustomization
resources: resources:
- app.yaml - app.yaml
- ingress-route.yaml
- middleware.yaml
- landing-page.yaml
helmCharts: helmCharts:
- name: syncthing - name: syncthing

View File

@@ -0,0 +1,103 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: syncthing-landing-html
namespace: syncthing
data:
index.html: |
<!DOCTYPE html>
<html>
<head>
<title>Syncthing Instances</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.container {
text-align: center;
background: white;
padding: 40px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #333;
margin-bottom: 30px;
}
.links {
display: flex;
flex-direction: column;
gap: 15px;
}
a {
display: inline-block;
padding: 15px 30px;
background-color: #0078e7;
color: white;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s;
}
a:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h1>Syncthing Instances</h1>
<div class="links">
<a href="/nas">NAS Instance</a>
<a href="/master">Master Instance</a>
<a href="/iris">Iris Instance</a>
</div>
</div>
</body>
</html>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: syncthing-landing
namespace: syncthing
spec:
replicas: 1
selector:
matchLabels:
app: syncthing-landing
template:
metadata:
labels:
app: syncthing-landing
spec:
containers:
- name: nginx
image: nginx:alpine
ports:
- containerPort: 80
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
volumes:
- name: html
configMap:
name: syncthing-landing-html
---
apiVersion: v1
kind: Service
metadata:
name: syncthing-landing
namespace: syncthing
spec:
selector:
app: syncthing-landing
ports:
- protocol: TCP
port: 80
targetPort: 80

View File

@@ -0,0 +1,46 @@
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: authentik-forward-auth
namespace: syncthing
spec:
forwardAuth:
address: http://authentik-server.authentik.svc.cluster.local/outpost.goauthentik.io/auth/traefik
trustForwardHeader: true
authResponseHeaders:
- X-authentik-username
- X-authentik-groups
- X-authentik-email
- X-authentik-name
- X-authentik-uid
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: strip-prefix-nas
namespace: syncthing
spec:
stripPrefix:
prefixes:
- /nas
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: strip-prefix-master
namespace: syncthing
spec:
stripPrefix:
prefixes:
- /master
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: strip-prefix-iris
namespace: syncthing
spec:
stripPrefix:
prefixes:
- /iris