basic-auth

This commit is contained in:
ari committed 2026-02-16 16:22:45 -05:00
1 parent 0cbc11a949
commit 0a5301aba8
6 files changed
+52 -22

No files matched your search

+9 -3
View File
@@ -17,12 +17,12 @@ kubectl config use-context homelab
function run-new-chart() { function run-new-chart() {
: Create a new helm chart : Create a new helm chart
: dev new-chart {path-to-chart} : dev new-chart {path-to-chart}
full_path=$ROOT_FOLDER/charts/apps/${1} full_path=$ROOT_FOLDER/charts/apps/${1}
app=$(basename $full_path) app=$(basename $full_path)
location=$(dirname $full_path) location=$(dirname $full_path)
typeofapp=$(basename $location) typeofapp=$(basename $location)
mkdir -p $full_path/templates mkdir -p $full_path/templates
touch $full_path/values.yaml touch $full_path/values.yaml
cat <<EOT >> $full_path/Chart.yaml cat <<EOT >> $full_path/Chart.yaml
@@ -86,4 +86,10 @@ function run-template-compose-app() {
# echo $out | bat -l yaml # echo $out | bat -l yaml
} }
start_cli $@ function run-htpasswd() {
: Generates htpasswd file
: dev htpasswd
openssl passwd -apr1 ${@}
}
start_cli $@
@@ -19,3 +19,4 @@ ingress:
service: smartboi service: smartboi
port: 8000 port: 8000
useSecondaryDomain: true useSecondaryDomain: true
middleware: basic-auth-smartboi
@@ -0,0 +1,21 @@
{{ range $user, $pass := .Values.users }}
---
apiVersion: v1
kind: Secret
metadata:
name: "secret-basic-auth-{{$user}}"
type: kubernetes.io/basic-auth
stringData:
username: {{ $user }}
password: {{ $pass }}
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: "basic-auth-{{$user}}"
spec:
redirectScheme:
scheme: https
basicAuth:
secret: "secret-basic-auth-{{$user}}"
{{ end }}
+6 -8
View File
@@ -1,9 +1,7 @@
reverseProxy: reverseProxy:
home: home:
port: "8123" port: "8123"
ip: "192.168.0.20" ip: "192.168.0.20"
yellow: yellow:
port: "8123" port: "8123"
ip: "192.168.0.23" ip: "192.168.0.23"
+14 -11
View File
@@ -1,17 +1,20 @@
global: global:
dns: dns:
internalPrefix: k3s.internal internalPrefix: k3s.internal
primary: primary:
domain: "internal" domain: "internal"
root: "k3s" root: "k3s"
secondary: secondary:
domain: "local" domain: "local"
root: "k3s" root: "k3s"
tls: tls:
enabled: false enabled: false
reverseProxy: {} reverseProxy: {}
services: [] services: []
tailScaleServices: [] tailScaleServices: []
ns: ns:
argocd: plugin-argo-cd argocd: plugin-argo-cd
users:
smartboi: "makingmoney"
+1
View File
@@ -25,6 +25,7 @@
yq yq
bat bat
jq jq
openssl
# k8s # k8s
kubectx kubectx
k3d k3d