Merge branch 'stable' of github.com:asosnovsky/homelab into stable

This commit is contained in:
Ari committed 2024-02-16 17:09:57 -05:00
commit 8a00bc275f
44 files changed
+804 -830

No files matched your search

+3 -1
View File
@@ -13,4 +13,6 @@ devenv.local.nix
# Terraform
*.tfvars
.terraform
.terraform
os/routers/openwrt-mesh/.env
.DS_Store
-1
View File
@@ -14,5 +14,4 @@
languages.python.enable = true;
languages.python.venv.enable = true;
languages.python.venv.requirements = ./pydeps.requirements;
pre-commit.hooks.shellcheck.enable = true;
}
+1 -1
View File
@@ -10,7 +10,7 @@ metadata:
checksum/users-tfvars: "{{ (print "db_users = " ( .Values.userGeneration.users | toJson )) | sha256sum }}"
checksum/users_dbs-tfvars: "{{ (print "db_users_dbs = " ( .Values.userGeneration.users_dbs | toJson )) | sha256sum }}"
helm.sh/hook: post-install
helm.sh/hook-delete-policy: hook-succeeded
helm.sh/hook-delete-policy: before-hook-creation
spec:
template:
metadata:
+2
View File
@@ -8,11 +8,13 @@ userGeneration:
- prowlarr
- immich
- readarr
- bazarr
users_dbs:
radarr: [log, cache]
sonarr: [log, cache]
prowlarr: [log, cache]
readarr: [log, cache]
bazarr: [log, cache]
postgresSecret: ""
-7
View File
@@ -1,7 +0,0 @@
apiVersion: v2
name: frigate
description: An apps service for homelab
type: application
version: 0.1.0
appVersion: "edge"
dependencies: []
@@ -1,99 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: "frigate"
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
type: Recreate
selector:
matchLabels:
homelab/app: frigate
template:
metadata:
labels:
homelab/app: frigate
spec:
{{- if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8}}
{{- end }}
volumes:
{{- if .Values.persistence.media_path.enabled }}
- name: media-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.media_path.claimName }}
{{- end }}
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.conf_path.claimName }}
{{- end }}
{{- if .Values.coral.enabled }}
- name: coral-dev
hostPath:
path: {{ .Values.coral.hostPath }}
{{- end }}
- name: dshm
emptyDir:
medium: Memory
containers:
- name: frigate
imagePullPolicy: "Always"
securityContext:
privileged: true
image: "{{ .Values.images.frigate.repo }}:{{ .Values.images.frigate.tag | default .Chart.AppVersion }}"
resources:
{{- .Values.resources.frigate | toYaml | nindent 14}}
livenessProbe:
httpGet:
path: /
port: http
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /
port: http
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
startupProbe:
httpGet:
path: /
port: http
scheme: HTTP
failureThreshold: 60
periodSeconds: 15
ports:
- containerPort: 5000
name: http
- containerPort: 8554
name: rtsp
- containerPort: 8555
name: webrtc-tcp
protocol: TCP
- containerPort: 8555
name: webrtc-udp
protocol: UDP
volumeMounts:
{{- if .Values.persistence.media_path.enabled }}
- name: media-path
mountPath: /media/frigate
{{ end }}
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
mountPath: /config
subPath: frigate
{{ end }}
{{- if .Values.coral.enabled }}
- mountPath: {{ .Values.coral.hostPath }}
name: coral-dev
{{- end }}
- mountPath: /dev/shm
name: dshm
@@ -1,72 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: "go2rtc"
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
type: Recreate
selector:
matchLabels:
homelab/app: go2rtc
template:
metadata:
labels:
homelab/app: go2rtc
spec:
volumes:
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.conf_path.claimName }}
{{- end }}
containers:
- name: go2rtc
imagePullPolicy: "Always"
securityContext:
privileged: true
image: "{{ .Values.images.go2rtc.repo }}:{{ .Values.images.go2rtc.tag | default .Chart.AppVersion }}"
resources:
{{- .Values.resources.go2rtc | toYaml | nindent 14}}
livenessProbe:
httpGet:
path: /
port: http
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /
port: http
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
startupProbe:
httpGet:
path: /
port: http
scheme: HTTP
failureThreshold: 60
periodSeconds: 15
ports:
- containerPort: 1984
name: http
- containerPort: 8554
name: rtsp
- containerPort: 8555
name: webrtc-tcp
protocol: TCP
- containerPort: 8555
name: webrtc-udp
protocol: UDP
volumeMounts:
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
mountPath: /config
subPath: go2rtc
{{ end }}
@@ -1,123 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: "scrypted"
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
homelab/app: scrypted
template:
metadata:
labels:
homelab/app: scrypted
spec:
{{- if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 8}}
{{- end }}
volumes:
{{- if .Values.persistence.media_path.enabled }}
- name: media-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.media_path.claimName }}
{{- end }}
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
persistentVolumeClaim:
claimName: {{ .Values.persistence.conf_path.claimName }}
{{- end }}
{{- if .Values.coral.enabledForScrypted }}
- name: coral-dev
hostPath:
path: {{ .Values.coral.hostPath }}
{{- end }}
- name: dshm
emptyDir:
medium: Memory
containers:
- name: scrypted
imagePullPolicy: "Always"
securityContext:
privileged: true
image: "{{ .Values.images.scrypted.repo }}:{{ .Values.images.scrypted.tag | default .Chart.AppVersion }}"
resources:
{{- .Values.resources.scrypted | toYaml | nindent 14}}
livenessProbe:
httpGet:
path: /
port: http
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
readinessProbe:
httpGet:
path: /
port: http
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
startupProbe:
httpGet:
path: /
port: http
scheme: HTTP
failureThreshold: 60
periodSeconds: 15
ports:
- containerPort: 80
name: http
- containerPort: 443
name: https
- containerPort: 8080
name: debug
- containerPort: 554
name: rtsp-tcp
protocol: TCP
- containerPort: 554
name: rtsp-udp
protocol: UDP
- containerPort: 47524
name: homekit
{{ with .Values.scrypted.homekit }}
{{ range $i := (untilStep (int .startPort) (int .endPort) 1) }}
- containerPort: {{$i}}
name: homekit-{{$i}}
{{ end }}
{{ end }}
env:
- name: SCRYPTED_NVR_VOLUME
value: /nvr
- name: SCRYPTED_DISABLE_AUTHENTICATION
value: 'true'
- name: SCRYPTED_INSECURE_PORT
value: '80'
- name: SCRYPTED_SECURE_PORT
value: '443'
- name: SCRYPTED_DEBUG_PORT
value: '8080'
- name: SCRYPTED_DOCKER_AVAHI
value: 'true'
volumeMounts:
{{- if .Values.persistence.media_path.enabled }}
- name: media-path
mountPath: /nvr
subPath: scrypted
{{ end }}
{{- if .Values.persistence.conf_path.enabled }}
- name: conf-path
mountPath: /server/volume
subPath: scrypted
{{ end }}
{{- if .Values.coral.enabledForScrypted }}
- mountPath: {{ .Values.coral.hostPath }}
name: coral-dev
{{- end }}
- mountPath: /dev/shm
name: dshm
-51
View File
@@ -1,51 +0,0 @@
---
kind: Service
apiVersion: v1
metadata:
name: go2rtc-lb
spec:
selector:
homelab/app: go2rtc
type: LoadBalancer
ports:
- port: 8554
targetPort: 8554
name: rtsp
protocol: TCP
- port: 8555
targetPort: 8555
name: webrtc-tcp
protocol: TCP
- port: 8555
targetPort: 8555
name: webrtc-udp
protocol: UDP
- port: 1984
targetPort: 1984
name: http
protocol: TCP
---
kind: Service
apiVersion: v1
metadata:
name: scrypted-lb
spec:
selector:
homelab/app: scrypted
type: LoadBalancer
ports:
- port: 554
targetPort: 554
name: rtsp-tcp
protocol: TCP
- port: 554
targetPort: 554
name: rtsp-udp
protocol: UDP
{{ with .Values.scrypted.homekit }}
{{ range $i := (untilStep (int .startPort) (int .endPort) 1) }}
- port: {{$i}}
targetPort: {{$i}}
name: homekit-{{$i}}
{{ end }}
{{ end }}
-35
View File
@@ -1,35 +0,0 @@
---
kind: Service
apiVersion: v1
metadata:
name: frigate-nodeport
spec:
selector:
homelab/app: frigate
type: NodePort
ports:
- port: 1984
nodePort: 30001
targetPort: 1984
name: go2rtc
protocol: TCP
- port: 5000
nodePort: 30000
targetPort: 5000
name: http
protocol: TCP
- port: 8554
nodePort: 30554
targetPort: 8554
name: rtsp
protocol: TCP
- port: 8555
nodePort: 30555
targetPort: 8555
name: webrtc-tcp
protocol: TCP
- port: 8555
nodePort: 30555
targetPort: 8555
name: webrtc-udp
protocol: UDP
-85
View File
@@ -1,85 +0,0 @@
---
kind: Service
apiVersion: v1
metadata:
name: frigate
spec:
selector:
homelab/app: frigate
type: ClusterIP
ports:
- port: 80
targetPort: 5000
name: http
protocol: TCP
- port: 8554
targetPort: 8554
name: rtsp
protocol: TCP
- port: 8555
targetPort: 8555
name: webrtc-tcp
protocol: TCP
- port: 8555
targetPort: 8555
name: webrtc-udp
protocol: UDP
---
kind: Service
apiVersion: v1
metadata:
name: go2rtc
spec:
selector:
homelab/app: go2rtc
type: ClusterIP
ports:
- port: 8554
targetPort: 8554
name: rtsp
protocol: TCP
- port: 8555
targetPort: 8555
name: webrtc-tcp
protocol: TCP
- port: 8555
targetPort: 8555
name: webrtc-udp
protocol: UDP
- port: 80
targetPort: 1984
name: http
protocol: TCP
---
kind: Service
apiVersion: v1
metadata:
name: scrypted
spec:
selector:
homelab/app: scrypted
type: ClusterIP
ports:
- port: 554
targetPort: 554
name: rtsp-tcp
protocol: TCP
- port: 554
targetPort: 554
name: rtsp-udp
protocol: UDP
- port: 80
targetPort: 80
name: http
protocol: TCP
- port: 443
targetPort: 443
name: https
protocol: TCP
{{ with .Values.scrypted.homekit }}
{{ range $i := (untilStep (int .startPort) (int .endPort) 1) }}
- port: {{$i}}
targetPort: {{$i}}
name: homekit-{{$i}}
{{ end }}
{{ end }}
View File
Whitespace-only changes.
-5
View File
@@ -1,5 +0,0 @@
coral:
enabled: true
nodeSelector:
"homelab.device/coral": "usb"
-46
View File
@@ -1,46 +0,0 @@
images:
frigate:
repo: "ghcr.io/blakeblackshear/frigate"
tag: "stable"
go2rtc:
repo: "alexxit/go2rtc"
tag: "latest"
scrypted:
repo: "ghcr.io/koush/scrypted"
tag: "latest"
persistence:
media_path:
enabled: false
claimName: ""
conf_path:
enabled: false
claimName: ""
affinity: {}
coral:
enabled: false
hostPath: /dev/bus/usb
resources:
frigate:
requests:
memory: "4Gi"
cpu: "2"
limits:
memory: "4Gi"
go2rtc:
requests:
memory: "100Mi"
cpu: "500m"
limits:
memory: "500Mi"
scrypted:
homekit:
startPort: 4000
endPort: 4010
@@ -79,6 +79,8 @@ metadata:
traefik.ingress.kubernetes.io/router.middlewares: {{ .middleware | default "apps-ingresses-https-redirect"}}@kubernetescrd
gethomepage.dev/enabled: "true"
gethomepage.dev/name: "{{.prefix}}@{{.namespace}}"
gethomepage.dev/name: "{{.prefix}}@{{.namespace}}"
gethomepage.dev/siteMonitor: 'http://{{.service}}.{{ .namespace }}.svc.cluster.local:{{.port | default 80}}{{ .path | default "/" }}{{ .health | default "" }}'
# gethomepage.dev/description: {{ .description | default "" }}
gethomepage.dev/group: {{ .group | default "Unassigned" }}
{{ if .icon }}
@@ -10,10 +10,6 @@ subsets:
ports:
- port: {{ $data.port | default 80 }}
protocol: TCP
{{ range $p := ($data.additionalPorts | default [] )}}
- port: "{{ $p.port }}"
protocol: "{{ $p.protocol | default 'TCP' }}"
{{ end }}`
---
apiVersion: v1
kind: Service
@@ -25,12 +21,6 @@ spec:
- port: 80
protocol: TCP
targetPort: {{ $data.port | default 80 }}
{{ range $p := ($data.additionalPorts | default [])}}
- port: "{{ $p.port }}"
protocol: "{{ $p.protocol | default 'TCP' }}"
targetPort: "{{ $p.port }}"
name: "{{ $p.name | default $p.port }}"
{{ end }}`
{{ if (not $data.disableIngress) }}
{{- $ingressDef := (dict "service" (printf "reverse-proxy-%s" $prefix) "prefix" $prefix "global" $.Values.global "namespace" $.Release.Namespace "group" "reverse-proxies" ) -}}
{{- $ingressDef := (merge ($data.overrides | default (dict)) $ingressDef) -}}
+22 -13
View File
@@ -3,32 +3,41 @@ global:
enabled: true
reverseProxy:
castle:
ip: "192.168.0.23"
ip: "10.0.12.1"
port: "80"
overrides:
icon: https://castle.home.sosnovsky.ca/static/icons/favicon.ico
icon: http://10.0.12.1:80/static/icons/favicon.ico
kuma:
ip: "192.168.0.23"
ip: "10.0.12.1"
port: "3001"
overrides:
icon: "https://kuma.home.sosnovsky.ca/apple-touch-icon.png"
basement:
ip: "192.168.1.10"
port: "8123"
ip: "10.0.12.2"
port: "80"
overrides:
icon: https://basement.home.sosnovsky.ca/static/icons/favicon.ico
icon: http://10.0.12.2:80/static/icons/favicon.ico
pitorrent:
ip: "10.0.10.3"
port: "8080"
overrides:
middleware: "apps-ingresses-chain-authentik"
group: "Video Hosting"
esphome:
ip: "10.0.10.4"
port: "6052"
overrides:
middleware: "apps-ingresses-chain-authentik"
scrypted:
disableIngress: true
ip: "192.168.0.200"
port: "11080"
glroutermetrics:
disableIngress: true
ip: "192.168.8.1"
ip: "10.0.10.4"
port: "11080"
overrides:
group: "Cameras"
cloudflare:
enabled: true
@@ -0,0 +1,39 @@
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: "bazarr-db-creds"
spec:
refreshInterval: 24h
secretStoreRef:
kind: ClusterSecretStore
name: chart-database
target:
name: "bazarr-db-creds"
creationPolicy: Owner
template:
engineVersion: v2
data:
POSTGRES_ENABLED: "true"
POSTGRES_HOST: "{{ `{{.host}}` }}"
POSTGRES_PORT: "{{ `{{.port}}` }}"
POSTGRES_DATABASE: "{{ `{{.username}}` }}"
POSTGRES_USERNAME: "{{ `{{.username}}` }}"
POSTGRES_PASSWORD: "{{ `{{.password}}` }}"
data:
- remoteRef:
key: password.pg.bazarr
property: username
secretKey: username
- remoteRef:
key: password.pg.bazarr
property: password
secretKey: password
- remoteRef:
key: password.pg.bazarr
property: port
secretKey: port
- remoteRef:
key: password.pg.bazarr
property: host
secretKey: host
@@ -1,20 +0,0 @@
---
apiVersion: v1
kind: Secret
metadata:
name: openvpn-creds
type: Opaque
data:
_placeholder: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: openvpn-route-script
data:
route-override.sh: |-
#!/bin/sh
VPN_GATEWAY=$(route -n | awk 'NR==3' | awk '{ print $2 }')
ip route del 0.0.0.0/1 via $VPN_GATEWAY
echo "Route Updated"
@@ -92,7 +92,7 @@ spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
targetPort: {{ .port | default 80 }}
name: "http"
- port: 443
targetPort: 443
@@ -117,7 +117,7 @@ spec:
revisionHistoryLimit: 2
updateStrategy:
rollingUpdate:
partition: 0
partition: 1
type: RollingUpdate
volumeClaimTemplates:
- metadata:
@@ -158,7 +158,7 @@ spec:
resources:
{{- $v.podResources | toYaml | nindent 12 }}
ports:
- containerPort: 80
- containerPort: {{ .port | default 80 }}
name: "http"
- containerPort: 443
name: "https"
@@ -93,6 +93,9 @@ spec:
envFrom:
- configMapRef:
name: {{$k}}-envs
{{ range $envFrom := ($v.envFrom | default list) }}
- {{ $envFrom | toJson }}
{{ end }}
resources:
{{- $v.podResources | toYaml | nindent 12 }}
{{ if $v.ports}}
+23 -73
View File
@@ -26,32 +26,9 @@ jellyfin:
memory: "4Gi"
arrs:
sonarr:
repo: lscr.io/linuxserver/bazarr
tag: "latest"
migrateDbFromSqllite:
enabled: false
claimName: config-sonarr-0
usePostgres: true
podResources:
limits:
memory: "8Gi"
requests:
cpu: 250m
memory: "500M"
configVolumesResources:
requests:
storage: 10Gi
limits:
storage: 100Gi
extraConfigXml: |-
<InstanceName>Sosnovsky Sonarr</InstanceName>
<AuthenticationMethod>External</AuthenticationMethod>
<AuthenticationType>DisabledForLocalAddresses</AuthenticationType>
sonarr:
repo: lscr.io/linuxserver/sonarr
tag: "4.0.0-develop"
tag: "4.0.1.929-ls225"
migrateDbFromSqllite:
enabled: false
claimName: config-sonarr-0
@@ -74,7 +51,7 @@ arrs:
radarr:
repo: lscr.io/linuxserver/radarr
tag: "latest"
tag: "5.2.6.8376-ls203"
migrateDbFromSqllite:
enabled: false
claimName: config-radarr-0
@@ -97,7 +74,7 @@ arrs:
readarr:
repo: lscr.io/linuxserver/readarr
tag: "nightly"
tag: "develop-0.3.18.2411-ls88"
migrateDbFromSqllite:
enabled: false
usePostgres: true
@@ -118,7 +95,7 @@ arrs:
prowlarr:
repo: lscr.io/linuxserver/prowlarr
tag: "1.9.4"
tag: "1.13.3.4273-ls53"
migrateDbFromSqllite:
enabled: false
claimName: config-prowlarr-0
@@ -140,6 +117,24 @@ arrs:
<AuthenticationType>DisabledForLocalAddresses</AuthenticationType>
services:
bazarr:
kind: StatefulSet
repo: lscr.io/linuxserver/bazarr
tag: "v1.4.1-ls238"
ports:
tcp:
web: 6767
health: {}
envFrom:
- secretRef:
name: bazarr-db-creds
podResources:
limits:
memory: "8Gi"
requests:
cpu: 250m
memory: "500M"
jellyplex:
kind: Deployment
disableSVC: true
@@ -159,49 +154,4 @@ services:
memory: "500M"
requests:
cpu: 50m
memory: "500M"
jackett:
disabled: true
repo: lscr.io/linuxserver/jackett
tag: "latest"
envVars:
AUTO_UPDATE: "true"
podResources:
limits:
memory: "1Gi"
requests:
cpu: 250m
memory: "500M"
health:
readiness: "/health"
liveness: "/health"
configVolumesResources:
requests:
storage: 10Gi
limits:
storage: 100Gi
ports:
tcp:
web: 9117
qbittorrent:
repo: linuxserver/qbittorrent
tag: libtorrentv1
ports:
tcp:
web: 8080
6881: 6881
udp:
6881: 6881
podResources:
limits:
memory: "6Gi"
requests:
cpu: 800m
memory: "4Gi"
health:
enabled: true
configVolumesResources:
requests:
storage: 10Gi
limits:
storage: 100Gi
memory: "500M"
+25 -1
View File
@@ -9,7 +9,7 @@ spec:
app: {{ $k }}
type: ClusterIP
ports:
{{ range $portName, $portValue := $v.ports.tcp }}
{{- range $portName, $portValue := $v.ports.tcp }}
- port: {{ $portValue }}
targetPort: {{ $portValue }}
name: "{{ $portName }}"
@@ -23,6 +23,24 @@ spec:
protocol: UDP
{{ end }}
{{- end }}
{{ if $v.exposedPorts }}
---
kind: Service
apiVersion: v1
metadata:
name: {{ $k }}-exposed-ports
spec:
selector:
app: {{ $k }}
type: LoadBalancer
ports:
{{- range $exPort, $inPort := $v.exposedPorts }}
- port: {{ $exPort }}
targetPort: {{ $inPort }}
protocol: TCP
{{ end }}
{{ end }}
---
apiVersion: apps/v1
kind: Deployment
@@ -49,6 +67,7 @@ spec:
operator: In
values:
{{ $v.capacity | toYaml | nindent 20 }}
volumes: {{ ($v.volumes | default list) | toJson }}
containers:
- name: {{$k}}
image: "{{ $v.repo }}:{{ $v.tag }}"
@@ -67,6 +86,7 @@ spec:
protocol: UDP
{{ end }}
{{ end }}
{{ if $v.health }}
{{- if $v.health.liveness }}
livenessProbe:
httpGet:
@@ -87,10 +107,14 @@ spec:
failureThreshold: 10
timeoutSeconds: 30
{{ end }}
{{ end }}
startupProbe:
tcpSocket:
port: tcp-web
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
envFrom: {{ ($v.envFrom | default list) | toJson }}
env: {{ ($v.env | default list) | toJson }}
volumeMounts: {{ ($v.volumeMounts | default list) | toJson }}
{{ end }}
+50
View File
@@ -0,0 +1,50 @@
apps:
quirky:
ingress:
middleware: apps-ingresses-https-redirect
repo: ghcr.io/asosnovsky/quirky
tag: "latest"
podResources:
limits:
memory: "250Mi"
requests:
cpu: 250m
memory: "250Mi"
health:
readiness: "/"
liveness: "/"
ports:
tcp:
web: 80
capacity:
- med
- low
ollama:
ingress:
middleware: apps-ingresses-chain-authentik
repo: ollama/ollama
tag: "latest"
podResources:
limits:
memory: "1Gi"
requests:
cpu: 250m
memory: "1Gi"
health:
readiness: "/"
liveness: "/"
exposedPorts:
"1143": 11434
ports:
tcp:
web: 11434
volumes:
- name: config
persistentVolumeClaim:
claimName: pv-ollama
volumeMounts:
- name: config
mountPath: /root/.ollama
capacity:
- med
- high
+7 -27
View File
@@ -30,6 +30,7 @@ services:
middleware: "apps-ingresses-chain-authentik"
group: "Core"
icon: "https://grafana.core.home.sosnovsky.ca/public/img/fav32.png"
health: "healthz"
- prefix: "authentik.core"
service: "authentik"
namespace: "chart-authentik"
@@ -41,7 +42,6 @@ services:
namespace: "apps-ingresses"
middleware: "apps-ingresses-chain-authentik"
group: "Demo"
# icon: "data:image/png;base64,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"
- prefix: "nextcloud"
service: "nextcloud"
namespace: "apps-nextcloud"
@@ -60,29 +60,17 @@ services:
namespace: "apps-videohosting"
port: 8096
group: "Apps"
- prefix: "frigate"
service: "frigate"
namespace: "apps-frigate"
middleware: "apps-ingresses-chain-authentik"
group: "Cameras"
icon: "https://frigate.home.sosnovsky.ca/assets/favicon-92a9ac8b.ico"
- prefix: "scrypted"
service: "scrypted"
namespace: "apps-frigate"
middleware: "apps-ingresses-chain-authentik"
group: "Cameras"
- prefix: "go2rtc"
service: "go2rtc"
namespace: "apps-frigate"
middleware: "apps-ingresses-chain-authentik"
group: "Cameras"
icon: "https://frigate.home.sosnovsky.ca/assets/favicon-92a9ac8b.ico"
- prefix: "main"
service: "homepage"
namespace: "chart-homepage"
middleware: "apps-ingresses-chain-authentik"
port: 3000
group: "Core"
- prefix: "bazarr.vh"
service: "bazarr"
namespace: "apps-videohosting"
middleware: "apps-ingresses-chain-authentik"
group: "Video Hosting"
- prefix: "radarr.vh"
service: "radarr"
namespace: "apps-videohosting"
@@ -97,6 +85,7 @@ services:
service: "prowlarr"
namespace: "apps-videohosting"
middleware: "apps-ingresses-chain-authentik"
group: "Video Hosting"
- prefix: "readarr.vh"
service: "readarr"
namespace: "apps-videohosting"
@@ -107,15 +96,6 @@ services:
# namespace: "apps-photos"
# middleware: "apps-ingresses-chain-authentik"
# group: "Apps"
# vh services
{{- range $k, $v := .Values.videohosting.services }}
- prefix: "{{ $k }}.vh"
service: "{{ $k }}"
namespace: "apps-videohosting"
port: {{ $v.ports.tcp.web }}
middleware: "apps-ingresses-chain-authentik"
group: "Video Hosting"
{{- end }}
# webapp services
{{- $webapps := .Files.Get (printf "apps-values/%s" .Values.apps.webapps.valuesFile) }}
{{- $webapps := tpl $webapps . | fromYaml }}
+57 -1
View File
@@ -18,4 +18,60 @@ apps:
web: 80
capacity:
- med
- low
- low
ollama:
ingress:
middleware: apps-ingresses-chain-authentik
repo: ollama/ollama
tag: "latest"
podResources:
limits:
memory: "16Gi"
requests:
cpu: 1
memory: "4Gi"
exposedPorts:
"11434": "11434"
ports:
tcp:
web: 11434
volumes:
- name: config
persistentVolumeClaim:
claimName: {{ .Values.storage.ollama.name }}
volumeMounts:
- name: config
mountPath: /root/.ollama
capacity:
- med
- high
ollama-web:
ingress:
middleware: apps-ingresses-chain-authentik
repo: ghcr.io/ollama-webui/ollama-webui
tag: "main"
podResources:
limits:
memory: "1Gi"
requests:
cpu: 250m
memory: "1Gi"
health:
readiness: "/"
liveness: "/"
env:
- name: OLLAMA_API_BASE_URL
value: "http://ollama.apps-webapps.svc.cluster.local:11434/api"
ports:
tcp:
web: 8080
volumes:
- name: config
persistentVolumeClaim:
claimName: {{ .Values.storage.ollamaWebGui.name }}
volumeMounts:
- name: config
mountPath: /app/backend/data
capacity:
- med
- low
+28 -10
View File
@@ -1,3 +1,6 @@
image:
repository: ghcr.io/gethomepage/homepage
tag: latest
config:
widgets:
- kubernetes:
@@ -15,18 +18,36 @@ config:
services:
- Local Cameras:
- Korie:
href: http://korie.amc.cam.local/
href: http://korie.cam.internal/
siteMonitor: http://korie.cam.internal/
- Eddie:
href: http://eddie.amc.cam.local/
href: http://eddie.cam.internal/
siteMonitor: http://eddie.cam.internal/
- Living Room:
href: http://lr.tapo.cam.local/
href: http://livingroom.cam.internal/
siteMonitor: http://livingroom.cam.internal/
- Doorbell:
href: 'http://doorbell.cam.internal'
siteMonitor: http://doorbell.cam.internal/
- Garage:
href: 'http://garage.cam.internal'
siteMonitor: http://garage.cam.internal/
- Routers:
- GL Main:
href: http://gl.router.local
href: http://gl.router.internal
siteMonitor: http://gl.router.internal
- GL Basement:
href: http://basement.router.local
- TPlink Main:
href: http://tp.router.local
href: http://gl-basement.router.internal
siteMonitor: http://gl-basement.router.internal
- MainMesh:
href: http://velica-main.router.internal
siteMonitor: http://velica-main.router.internal
- MeshNode1:
href: http://velica-node1.router.internal
siteMonitor: http://velica-node1.router.internal
- MeshNode2:
href: http://velica-node2.router.internal
siteMonitor: http://velica-node2.router.internal
bookmarks: []
kubernetes:
mode: cluster
@@ -37,6 +58,3 @@ serviceAccount:
name: homepage
enableRbac: true
image:
tag: v0.7.1
+1 -1
View File
@@ -66,7 +66,7 @@ prometheus:
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: local-path
storageClassName: {{ .Values.global.nfs.storageClass }}
accessModes: ["ReadWriteOnce"]
resources:
requests:
+13 -13
View File
@@ -25,16 +25,16 @@ secrets:
cloudflare:
name: "cloudflare-apitoken"
infrastructureCharts:
amd-gpu:
repoURL: "https://radeonopencompute.github.io/k8s-device-plugin/"
targetRevision: "0.10.0"
values: |-
namespace: chart-amd-gpu
labeller:
enabled: true
node-feature-discovery:
repoURL: "https://kubernetes-sigs.github.io/node-feature-discovery/charts"
targetRevision: "0.10.0"
values: |-
namespace: chart-node-feature-discovery
# infrastructureCharts:
# amd-gpu:
# repoURL: "https://radeonopencompute.github.io/k8s-device-plugin/"
# targetRevision: "0.10.0"
# values: |-
# namespace: chart-amd-gpu
# labeller:
# enabled: true
# node-feature-discovery:
# repoURL: "https://kubernetes-sigs.github.io/node-feature-discovery/charts"
# targetRevision: "0.10.0"
# values: |-
# namespace: chart-node-feature-discovery
+18 -47
View File
@@ -23,21 +23,7 @@ global:
email: "ariel.sosnovsky@gmail.com"
mqtt:
port: 1883
host: 192.168.0.23
videohosting:
services:
jackett:
ports:
tcp:
web: 9117
qbittorrent:
ports:
tcp:
web: 8080
6881: 6881
udp:
6881: 6881
host: castle.hub.internal
apps:
webapps:
@@ -63,8 +49,7 @@ apps:
server: {{ .Values.global.nfs.server }}
videohosting:
values: |-
{{ .Values.videohosting | toYaml }}
values: ""
nextcloud:
valuesFile: nextcloud.yaml
@@ -87,16 +72,6 @@ apps:
smtp_password_secret: {{ .Values.secrets.smtp.secrets.smtp.name }}
smtp_password_secret_key: password
frigate:
values: |-
persistence:
media_path:
enabled: true
claimName: {{ .Values.storage.frigateMedia.name }}
conf_path:
enabled: true
claimName: {{ .Values.storage.frigateConf.name }}
infrastructureCharts:
cert-manager:
repoURL: "https://charts.jetstack.io"
@@ -189,6 +164,22 @@ storage:
resources:
requests:
storage: 8Gi
ollama:
name: ollama
namespace: apps-webapps
accessModes:
- ReadWriteMany
resources:
requests:
storage: 8Gi
ollamaWebGui:
name: ollama-web-gui
namespace: apps-webapps
accessModes:
- ReadWriteMany
resources:
requests:
storage: 8Gi
nextcloudData:
name: nextcloud-data
namespace: apps-nextcloud
@@ -219,23 +210,3 @@ storage:
storage: 20Gi
requests:
storage: 1Gi
frigateMedia:
name: frigate-media
namespace: apps-frigate
accessModes:
- ReadWriteMany
resources:
limits:
storage: 100Gi
requests:
storage: 10Gi
frigateConf:
name: frigate-conf
namespace: apps-frigate
accessModes:
- ReadWriteMany
resources:
limits:
storage: 1Gi
requests:
storage: 100Mi
+2 -1
View File
@@ -18,9 +18,10 @@
services.nfs.server.enable = true;
services.rpcbind.enable = true;
environment.systemPackages = with pkgs; [
pkgs.k3s
k3s
nfs-utils
git
];
services.k3s.enable = true;
services.k3s.role = "server";
+21 -17
View File
@@ -1,17 +1,17 @@
#!/bin/sh
function update-os {
update_os() {
# Updating
sudo apt-get update -y
sudo apt-get upgrade -y
}
function remove-bad-package {
remove_bad_package() {
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt autoremove -y
}
function instsall-core-package {
instsall_core_package() {
sudo apt install -y \
git \
jq \
@@ -19,7 +19,7 @@ function instsall-core-package {
sh <(curl -L https://nixos.org/nix/install) --daemon
}
function install-docker {
install_docker() {
echo "Add Docker's official GPG key..."
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
@@ -42,45 +42,44 @@ function install-docker {
docker-compose-plugin
}
function install-docker-compose-systemd {
install_docker_compose_systemd() {
sudo mkdir -p /etc/docker/compose/
sudo cp systemd/docker-compose@.service /etc/systemd/system/docker-compose@.service
}
function mount-nfs-torrents {
mount_nfs_torrents() {
sudo cp /etc/fstab /etc/fstab.backup
sudo mkdir -p /torrents
sudo echo "truenas.local:/mnt/EightTerra/DownloadedTorrents /torrents/ nfs auto 0 0" | sudo tee -a /etc/fstab
sudo mount -a
}
function install-qbittorrent {
install_qbittorrent() {
sudo useradd -r -m qbittorrent
sudo usermod -a -G qbittorrent $USER
sudo usermod -a -G qbittorrent "$USER"
sudo apt install -y qbittorrent-nox
sudo cp systemd/qbittorrent.service /etc/systemd/system/qbittorrent.service
sudo systemctl start qbittorrent
sudo systemctl enable qbittorrent
}
function install-speedtest-cli {
mkdir -p $HOME/.local/bin
mkdir -p $HOME/tmp/speedtest
pushd $HOME/tmp/speedtest/
install_speedtest_cli() {
mkdir -p "$HOME"/.local/bin
mkdir -p "$HOME"/tmp/speedtest
pushd "$HOME"/tmp/speedtest/ || exit 1
wget https://github.com/librespeed/speedtest-cli/releases/download/v1.0.10/librespeed-cli_1.0.10_linux_armv7.tar.gz
tar -xvf librespeed-cli_1.0.10_linux_armv7.tar.gz
cp librespeed-cli $HOME/.local/bin/speedtest-cli
popd
rm -rf $HOME/tmp/speedtest
cp librespeed-cli "$HOME"/.local/bin/speedtest-cli
rm -rf "$HOME"/tmp/speedtest
}
function install-transmission {
install_transmission() {
sudo apt-get install transmission-daemon
sudo ufw allow 9091,51413/tcp
}
function set-static-ip() {
set_static_ip() {
ip=${1}
intf=${2:-eth0}
routerip=${3:-192.168.8.1}
@@ -91,4 +90,9 @@ static_routers=$routerip
static ip_address=$ip/24
# <---- AUTOGENERATED --->
" | tee -a /etc/dhcpcd.conf
}
install_openvpn() {
sudo apt install openvpn
sudo cp systemd/openvpn-client.service /etc/systemd/system/openvpn-client.service
}
@@ -0,0 +1,16 @@
[Unit]
Description=OpenVPN Client
After=network.target
[Service]
Type=oneshot
Restart=on-failure
WorkingDirectory=/etc/openvpn
EnvironmentFile=/etc/openvpn/openvpn.service.env
ExecStart=/usr/sbin/openvpn \
--config "${CONFIG_FILE}" \
--auth-user-pass "${AUTH_FILE}"
[Install]
WantedBy=multi-user.target
+61 -3
View File
@@ -1,6 +1,7 @@
lab:
- mac: '3C:7C:3F:1E:B7:A0'
name: 'tnas1'
domain: 'tnas1.lab.local'
- mac: '00:A0:98:3D:7C:C8'
name: 'kubedb'
- mac: 'B8:27:EB:F7:44:4E'
@@ -13,10 +14,10 @@ k3s:
domain: home.sosnovsky.ca
- mac: '68:1D:EF:26:B7:6C'
name: 'terry1'
domain: home.sosnovsky.ca
# domain: home.sosnovsky.ca
- mac: '58:47:CA:71:D8:E6'
name: 'minisf1'
domain: home.sosnovsky.ca
# domain: home.sosnovsky.ca
- mac: '00:A0:98:17:B2:64'
name: 'tnas1'
hub:
@@ -37,6 +38,8 @@ cam:
mac: '48:9E:9D:4A:32:80'
- name: 'livingroom'
mac: '34:60:F9:D7:51:3F'
- name: 'garage'
mac: ''
iot:
- name: 'korie-lamp'
mac: '60:74:F4:4D:B8:C5'
@@ -47,4 +50,59 @@ iot:
- name: 'apollo-eddie'
mac: '30:30:F9:DC:A8:18'
- name: 'apollo-office'
mac: '30:30:F9:DA:C7:A4'
mac: '30:30:F9:DA:C7:A4'
- name: 'apollo-laundry'
mac: '30:30:F9:DC:BE:7C'
- name: 'epl-kitchen'
mac: '64:B7:08:28:52:50'
- name: 'epl-livingroom'
mac: '64:B7:08:28:56:F4'
- name: 'shelly-basement-living'
mac: 'B8:D6:1A:8A:5F:F4'
- name: 'shelly-basement-shared'
mac: 'B8:D6:1A:8C:4C:DC'
- name: 'shelly-laundry-light'
mac: 'C8:2B:96:1D:DA:B4'
apl:
- name: 'hp-print'
mac: '48:9E:BD:CB:07:E3'
- name: 'gm-eddie'
mac: '20:DF:B9:71:55:9C'
justMac: true
- name: 'myq-garage'
mac: 'CC:6A:10:8B:7D:D3'
- name: 'pod-korie'
mac: '04:99:B9:86:2D:AE'
justMac: true
- name: 'pod-livingroom'
mac: '04:99:B9:88:ED:3B'
justMac: true
- name: 'appletv-livingroom'
mac: '48:E1:5C:5B:CB:A3'
- name: 'samsuntv-livingroom'
mac: 'F0:70:4F:54:F3:F0'
- name: 'leviot-humid1'
mac: '3C:E9:0E:62:14:D8'
justMac: true
- name: 'leviot-humid2'
mac: '1C:9D:C2:39:61:F8'
justMac: true
- name: 'amzn-bedroom'
mac: 'D8:BE:65:F2:ED:18'
justMac: true
router:
- name: 'gl-basement'
mac: '94:83:C4:31:D5:CE'
- name: 'velica-main'
mac: '94:83:C4:41:77:BA'
- name: 'velica-node1'
mac: '94:83:C4:41:77:29'
devices:
- name: 'fwlaptop'
mac: '14:AC:60:29:85:4D'
- name: 'sumomac'
mac: 'F8:E4:3B:36:0F:E4'
- name: 'steamdeck'
mac: '34:6F:24:CA:70:57'
- name: 'vitapc'
mac: 'E0:0A:F6:79:C6:E9'
+26 -9
View File
@@ -8,10 +8,12 @@ BASE_PATH = Path(__file__).parent
CONFIG_FILE = BASE_PATH / "config.yaml"
OUTPUT_FOLDER = BASE_PATH / "output"
DNSMASQ_CONF = OUTPUT_FOLDER / "etc/dnsmasq.conf"
ETHERS = OUTPUT_FOLDER / "etc/ethers"
SUMMARY = OUTPUT_FOLDER / "summary.yaml"
shutil.rmtree(OUTPUT_FOLDER)
DNSMASQ_CONF.parent.mkdir(exist_ok=True, parents=True)
ETHERS.parent.mkdir(exist_ok=True, parents=True)
root_domain = "internal"
ip_prefix_map = {
@@ -20,6 +22,14 @@ ip_prefix_map = {
"hub": "10.0.12.",
"cam": "10.0.13.",
"iot": "10.0.14.",
"apl": "10.0.15.",
"router": "10.0.16.",
"devices": "10.0.0.",
}
defaults = {
'devices': {
'justMac': True,
}
}
def cap1_and_join(*args: str) -> str:
@@ -32,21 +42,28 @@ def cap1_and_join(*args: str) -> str:
with CONFIG_FILE.open('r') as fp:
devices = yaml.safe_load(fp)
with DNSMASQ_CONF.open('w') as dfp, SUMMARY.open('w') as sfp:
with DNSMASQ_CONF.open('w') as dfp, SUMMARY.open('w') as sfp, ETHERS.open('w') as efp:
for sub_domain, configs in devices.items():
default_values = defaults.get(sub_domain, {})
ip_prefix = ip_prefix_map[sub_domain]
sfp.write(f'\n{cap1_and_join(sub_domain)}:')
for ip_suffix, dvc in enumerate(configs, start=1):
efp.write(f'#{cap1_and_join(sub_domain)}\n')
ip_suffix = 0
for dvc in configs:
ip_suffix += 1
dvc = {**default_values, **dvc}
mac = dvc['mac']
name = dvc['name']
sfp.write(f'\n {cap1_and_join(name)}:')
ip = f"{ip_prefix}{ip_suffix}"
host = f"{name}.{sub_domain}.{root_domain}"
sfp.write(f'\n ip: "{ip}"')
if not dvc.get('justMac', False):
sfp.write(f'\n ip: "{ip}"')
sfp.write(f'\n host: "{host}"')
dfp.write(f"dhcp-host={mac},{cap1_and_join(sub_domain, name)},{ip},infinite\n")
dfp.write(f"address=/{host}/{ip}\n")
if domain := dvc.get('domain'):
dfp.write(f"address=/{domain}/{ip}\n")
dfp.write(f"address=/.{domain}/{ip}\n")
sfp.write(f'\n domain: "{domain}"')
if not dvc.get('justMac', False):
efp.write(f'{mac} {ip}\n')
if domain := dvc.get('domain'):
dfp.write(f"address=/{domain}/{ip}\n")
dfp.write(f"address=/.{domain}/{ip}\n")
sfp.write(f'\n domain: "{domain}"')
efp.write(f'{mac} {host}\n')
+2 -44
View File
@@ -1,50 +1,8 @@
dhcp-host=3C:7C:3F:1E:B7:A0,LabTnas1,10.0.10.1,infinite
address=/tnas1.lab.internal/10.0.10.1
dhcp-host=00:A0:98:3D:7C:C8,LabKubedb,10.0.10.2,infinite
address=/kubedb.lab.internal/10.0.10.2
dhcp-host=B8:27:EB:F7:44:4E,LabPi1,10.0.10.3,infinite
address=/pi1.lab.internal/10.0.10.3
dhcp-host=9C:BF:0D:00:56:51,LabFws1,10.0.10.4,infinite
address=/fws1.lab.internal/10.0.10.4
dhcp-host=7C:83:34:B8:7B:43,K3sBee1,10.0.11.1,infinite
address=/bee1.k3s.internal/10.0.11.1
address=/tnas1.lab.local/10.0.10.1
address=/.tnas1.lab.local/10.0.10.1
address=/home.sosnovsky.ca/10.0.11.1
address=/.home.sosnovsky.ca/10.0.11.1
dhcp-host=68:1D:EF:26:B7:6C,K3sTerry1,10.0.11.2,infinite
address=/terry1.k3s.internal/10.0.11.2
address=/home.sosnovsky.ca/10.0.11.2
address=/.home.sosnovsky.ca/10.0.11.2
dhcp-host=58:47:CA:71:D8:E6,K3sMinisf1,10.0.11.3,infinite
address=/minisf1.k3s.internal/10.0.11.3
address=/home.sosnovsky.ca/10.0.11.3
address=/.home.sosnovsky.ca/10.0.11.3
dhcp-host=00:A0:98:17:B2:64,K3sTnas1,10.0.11.4,infinite
address=/tnas1.k3s.internal/10.0.11.4
dhcp-host=E4:5F:01:A2:8D:BC,HubCastle,10.0.12.1,infinite
address=/castle.hub.internal/10.0.12.1
address=/castle.home.sosnovsky.ca/10.0.12.1
address=/.castle.home.sosnovsky.ca/10.0.12.1
dhcp-host=DC:A6:32:92:B2:79,HubBasement,10.0.12.2,infinite
address=/basement.hub.internal/10.0.12.2
address=/basement.home.sosnovsky.ca/10.0.12.2
address=/.basement.home.sosnovsky.ca/10.0.12.2
dhcp-host=4E:F6:9C:7C:56:33,HubFlic,10.0.12.3,infinite
address=/flic.hub.internal/10.0.12.3
dhcp-host=9C:8E:CD:25:83:1F,CamKorie,10.0.13.1,infinite
address=/korie.cam.internal/10.0.13.1
dhcp-host=A0:60:32:03:86:8A,CamEddie,10.0.13.2,infinite
address=/eddie.cam.internal/10.0.13.2
dhcp-host=48:9E:9D:4A:32:80,CamDoorbell,10.0.13.3,infinite
address=/doorbell.cam.internal/10.0.13.3
dhcp-host=34:60:F9:D7:51:3F,CamLivingroom,10.0.13.4,infinite
address=/livingroom.cam.internal/10.0.13.4
dhcp-host=60:74:F4:4D:B8:C5,IotKorie-lamp,10.0.14.1,infinite
address=/korie-lamp.iot.internal/10.0.14.1
dhcp-host=DC:4F:22:24:0C:E4,IotOffice-strip,10.0.14.2,infinite
address=/office-strip.iot.internal/10.0.14.2
dhcp-host=44:61:32:FC:10:EC,IotEcobee,10.0.14.3,infinite
address=/ecobee.iot.internal/10.0.14.3
dhcp-host=30:30:F9:DC:A8:18,IotApollo-eddie,10.0.14.4,infinite
address=/apollo-eddie.iot.internal/10.0.14.4
dhcp-host=30:30:F9:DA:C7:A4,IotApollo-office,10.0.14.5,infinite
address=/apollo-office.iot.internal/10.0.14.5
+86
View File
@@ -0,0 +1,86 @@
#Lab
3C:7C:3F:1E:B7:A0 10.0.10.1
3C:7C:3F:1E:B7:A0 tnas1.lab.internal
00:A0:98:3D:7C:C8 10.0.10.2
00:A0:98:3D:7C:C8 kubedb.lab.internal
B8:27:EB:F7:44:4E 10.0.10.3
B8:27:EB:F7:44:4E pi1.lab.internal
9C:BF:0D:00:56:51 10.0.10.4
9C:BF:0D:00:56:51 fws1.lab.internal
#K3s
7C:83:34:B8:7B:43 10.0.11.1
7C:83:34:B8:7B:43 bee1.k3s.internal
68:1D:EF:26:B7:6C 10.0.11.2
68:1D:EF:26:B7:6C terry1.k3s.internal
58:47:CA:71:D8:E6 10.0.11.3
58:47:CA:71:D8:E6 minisf1.k3s.internal
00:A0:98:17:B2:64 10.0.11.4
00:A0:98:17:B2:64 tnas1.k3s.internal
#Hub
E4:5F:01:A2:8D:BC 10.0.12.1
E4:5F:01:A2:8D:BC castle.hub.internal
DC:A6:32:92:B2:79 10.0.12.2
DC:A6:32:92:B2:79 basement.hub.internal
4E:F6:9C:7C:56:33 10.0.12.3
4E:F6:9C:7C:56:33 flic.hub.internal
#Cam
9C:8E:CD:25:83:1F 10.0.13.1
9C:8E:CD:25:83:1F korie.cam.internal
A0:60:32:03:86:8A 10.0.13.2
A0:60:32:03:86:8A eddie.cam.internal
48:9E:9D:4A:32:80 10.0.13.3
48:9E:9D:4A:32:80 doorbell.cam.internal
34:60:F9:D7:51:3F 10.0.13.4
34:60:F9:D7:51:3F livingroom.cam.internal
10.0.13.5
garage.cam.internal
#Iot
60:74:F4:4D:B8:C5 10.0.14.1
60:74:F4:4D:B8:C5 korie-lamp.iot.internal
DC:4F:22:24:0C:E4 10.0.14.2
DC:4F:22:24:0C:E4 office-strip.iot.internal
44:61:32:FC:10:EC 10.0.14.3
44:61:32:FC:10:EC ecobee.iot.internal
30:30:F9:DC:A8:18 10.0.14.4
30:30:F9:DC:A8:18 apollo-eddie.iot.internal
30:30:F9:DA:C7:A4 10.0.14.5
30:30:F9:DA:C7:A4 apollo-office.iot.internal
30:30:F9:DC:BE:7C 10.0.14.6
30:30:F9:DC:BE:7C apollo-laundry.iot.internal
64:B7:08:28:52:50 10.0.14.7
64:B7:08:28:52:50 epl-kitchen.iot.internal
64:B7:08:28:56:F4 10.0.14.8
64:B7:08:28:56:F4 epl-livingroom.iot.internal
B8:D6:1A:8A:5F:F4 10.0.14.9
B8:D6:1A:8A:5F:F4 shelly-basement-living.iot.internal
B8:D6:1A:8C:4C:DC 10.0.14.10
B8:D6:1A:8C:4C:DC shelly-basement-shared.iot.internal
C8:2B:96:1D:DA:B4 10.0.14.11
C8:2B:96:1D:DA:B4 shelly-laundry-light.iot.internal
#Apl
48:9E:BD:CB:07:E3 10.0.15.1
48:9E:BD:CB:07:E3 hp-print.apl.internal
20:DF:B9:71:55:9C gm-eddie.apl.internal
CC:6A:10:8B:7D:D3 10.0.15.3
CC:6A:10:8B:7D:D3 myq-garage.apl.internal
04:99:B9:86:2D:AE pod-korie.apl.internal
04:99:B9:88:ED:3B pod-livingroom.apl.internal
48:E1:5C:5B:CB:A3 10.0.15.6
48:E1:5C:5B:CB:A3 appletv-livingroom.apl.internal
F0:70:4F:54:F3:F0 10.0.15.7
F0:70:4F:54:F3:F0 samsuntv-livingroom.apl.internal
3C:E9:0E:62:14:D8 leviot-humid1.apl.internal
1C:9D:C2:39:61:F8 leviot-humid2.apl.internal
D8:BE:65:F2:ED:18 amzn-bedroom.apl.internal
#Router
94:83:C4:31:D5:CE 10.0.16.1
94:83:C4:31:D5:CE gl-basement.router.internal
94:83:C4:41:77:BA 10.0.16.2
94:83:C4:41:77:BA velica-main.router.internal
94:83:C4:41:77:29 10.0.16.3
94:83:C4:41:77:29 velica-node1.router.internal
#Devices
14:AC:60:29:85:4D fwlaptop.devices.internal
F8:E4:3B:36:0F:E4 sumomac.devices.internal
34:6F:24:CA:70:57 steamdeck.devices.internal
E0:0A:F6:79:C6:E9 vitapc.devices.internal
+67 -3
View File
@@ -3,6 +3,7 @@ Lab:
Tnas1:
ip: "10.0.10.1"
host: "tnas1.lab.internal"
domain: "tnas1.lab.local"
Kubedb:
ip: "10.0.10.2"
host: "kubedb.lab.internal"
@@ -20,11 +21,9 @@ K3s:
Terry1:
ip: "10.0.11.2"
host: "terry1.k3s.internal"
domain: "home.sosnovsky.ca"
Minisf1:
ip: "10.0.11.3"
host: "minisf1.k3s.internal"
domain: "home.sosnovsky.ca"
Tnas1:
ip: "10.0.11.4"
host: "tnas1.k3s.internal"
@@ -53,6 +52,9 @@ Cam:
Livingroom:
ip: "10.0.13.4"
host: "livingroom.cam.internal"
Garage:
ip: "10.0.13.5"
host: "garage.cam.internal"
Iot:
Korie-lamp:
ip: "10.0.14.1"
@@ -68,4 +70,66 @@ Iot:
host: "apollo-eddie.iot.internal"
Apollo-office:
ip: "10.0.14.5"
host: "apollo-office.iot.internal"
host: "apollo-office.iot.internal"
Apollo-laundry:
ip: "10.0.14.6"
host: "apollo-laundry.iot.internal"
Epl-kitchen:
ip: "10.0.14.7"
host: "epl-kitchen.iot.internal"
Epl-livingroom:
ip: "10.0.14.8"
host: "epl-livingroom.iot.internal"
Shelly-basement-living:
ip: "10.0.14.9"
host: "shelly-basement-living.iot.internal"
Shelly-basement-shared:
ip: "10.0.14.10"
host: "shelly-basement-shared.iot.internal"
Shelly-laundry-light:
ip: "10.0.14.11"
host: "shelly-laundry-light.iot.internal"
Apl:
Hp-print:
ip: "10.0.15.1"
host: "hp-print.apl.internal"
Gm-eddie:
host: "gm-eddie.apl.internal"
Myq-garage:
ip: "10.0.15.3"
host: "myq-garage.apl.internal"
Pod-korie:
host: "pod-korie.apl.internal"
Pod-livingroom:
host: "pod-livingroom.apl.internal"
Appletv-livingroom:
ip: "10.0.15.6"
host: "appletv-livingroom.apl.internal"
Samsuntv-livingroom:
ip: "10.0.15.7"
host: "samsuntv-livingroom.apl.internal"
Leviot-humid1:
host: "leviot-humid1.apl.internal"
Leviot-humid2:
host: "leviot-humid2.apl.internal"
Amzn-bedroom:
host: "amzn-bedroom.apl.internal"
Router:
Gl-basement:
ip: "10.0.16.1"
host: "gl-basement.router.internal"
Velica-main:
ip: "10.0.16.2"
host: "velica-main.router.internal"
Velica-node1:
ip: "10.0.16.3"
host: "velica-node1.router.internal"
Devices:
Fwlaptop:
host: "fwlaptop.devices.internal"
Sumomac:
host: "sumomac.devices.internal"
Steamdeck:
host: "steamdeck.devices.internal"
Vitapc:
host: "vitapc.devices.internal"
+14 -8
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
BASE_PATH=$(realpath $BASH_SOURCE | xargs dirname)
BASE_PATH=$(realpath "${BASH_SOURCE[0]}" | xargs dirname)
ROUTER=${1:-10.0.0.1}
USER=${2:-root}
@@ -21,19 +21,21 @@ function ask {
server=$USER@$ROUTER
pushd "$BASE_PATH" || exit 1
echo "using 🤖 $server"
ask "continue update"
pushd $BASE_PATH
echo "Updating conf..."
./gen-mappings.py
cat output/summary.yaml
ask
ask "continue update"
scp -O output/etc/dnsmasq.conf $USER@$ROUTER:/tmp/dnsmasq.new.conf
ssh $USER@$ROUTER << EOF
echo "Backing up dnsmasq.conf file to /tmp/dnsmasq.old.conf"
scp -O output/etc/dnsmasq.conf "$server:/tmp/dnsmasq.new.conf"
scp -O output/etc/ethers "$server:/etc/ethers"
ssh "$server" << EOF
echo 'Backing up dnsmasq.conf file to /tmp/dnsmasq.old.conf'
cp /etc/dnsmasq.conf /tmp/dnsmasq.old.conf
echo "Updating dnsmasq.conf 🙇🏼"
echo 'Updating dnsmasq.conf 🙇🏼'
cp /tmp/dnsmasq.new.conf /etc/dnsmasq.conf
if dnsmasq --test ; then
/etc/init.d/dnsmasq restart
@@ -44,4 +46,8 @@ else
dnsmasq --test
echo "Revert successful! 👍"
fi
EOF
EOF
git add .
git commit -m "🤖 Updated Router Config at $(date)"
git push
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
BASE_PATH=$(realpath "${BASH_SOURCE[0]}" | xargs dirname)
pushd "$BASE_PATH"
mode=${1:-"main"}
host=${2:-"root@192.168.1.1"}
file_name="create-${mode}.sh"
dotenv_file_name=".env"
if [ ! -f "${file_name}" ]; then
echo "Invalid Mode ${mode}!"
echo "Please use 'main' or 'ap'"
exit 1
fi
if [ ! -f "${dotenv_file_name}" ]; then
echo "Missing dotenv file!"
echo "Please create a ${dotenv_file_name} in $BASE_PATH!"
exit 1
fi
echo "mode=${mode}"
echo "host=${host}"
read -p "Continue? [Y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Continuing..."
else
echo "Stopping!"
exit 1
fi
scp -O "$file_name" "$host:/tmp/update-script.sh"
scp -O "$dotenv_file_name" "$host:/tmp/.env"
ssh -t "$host" <<EOF
set -e
echo "chmod +x /tmp/update-script.sh"
chmod +x /tmp/update-script.sh
echo "export \$(cat /tmp/.env | xargs -0)"
export \$(cat /tmp/.env | xargs -0)
echo "/tmp/update-script.sh"
/tmp/update-script.sh
EOF
@@ -0,0 +1,9 @@
#!/bin/bash
opkg update --no-check-certificate
opkg remove wpad-basic-*
opkg install --force-overwrite \
--no-check-certificate \
wpad-openssl
uci set system.@system[0].hostname="${HOSTNAME}"
uci commit
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
HOSTNAME=${1:-$HOSTNAME}
echo "Configuring AP to $HOSTNAME"
n=5
while [ "$n" -gt 0 ]; do
echo "Starting in $n..."
sleep 1
n=$(( n - 1 ))
done
for i in firewall dnsmasq odhcpd; do
if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable
/etc/init.d/"$i" stop
fi
done
uci set network.lan.proto='dhcp'
uci delete network.wan
uci delete network.wan6
uci delete network.lan.ipaddr
uci delete network.lan.netmask
mv /etc/config/firewall /etc/config/firewall.unused
reboot
+80
View File
@@ -0,0 +1,80 @@
#!/bin/bash
# Turn an OpenWrt dumb access point into a Wi-fi mesh point
# ######################
# you may customize this
# ######################
MESH_NAME="kososvsky-mesh"
MESH_RADIO=radio0
MESH_CHANNEL=1
WIFI_NAME="kososvsky-main"
WIFI_RADIO=radio1
WIFI_CHANNEL=36
WIFI_MOBDOMAIN='3333'
if [ -z ${MESH_PWD} ]; then
echo "Missing 'MESH_PWD'"
exit 1
else
echo "MESH_NAME = ${MESH_NAME}"
echo "MESH_PWD = ${MESH_PWD}"
fi
if [ -z ${WIFI_PWD} ]; then
echo "Missing 'WIFI_PWD'"
exit 1
else
echo "WIFI_NAME = ${WIFI_NAME}"
echo "WIFI_PWD = ${WIFI_PWD}"
fi
n=5
while [ "$n" -gt 0 ]; do
echo "Starting in $n..."
sleep 1
n=$(( n - 1 ))
done
# install the wpad mesh package
opkg update
opkg install --force-overwrite wpad-mesh-openssl
# delete the "OpenWrt" radios
uci delete wireless.default_radio0
uci delete wireless.default_radio1
# create the mesh Wifi
uci set wireless.wifinet0=wifi-iface
uci set wireless.wifinet0.device="$MESH_RADIO"
uci set wireless.wifinet0.mode='mesh'
uci set wireless.wifinet0.encryption='sae'
uci set wireless.wifinet0.mesh_id="$MESH_NAME"
uci set wireless.wifinet0.mesh_fwding='1'
uci set wireless.wifinet0.mesh_rssi_threshold='0'
uci set wireless.wifinet0.key="$MESH_PWD"
uci set wireless.wifinet0.network='lan'
uci set "wireless.$MESH_RADIO.channel=$MESH_CHANNEL"
uci delete "wireless.$MESH_RADIO.disabled"
# create the AP Wifi
uci set wireless.wifinet1=wifi-iface
uci set wireless.wifinet1.device=$WIFI_RADIO
uci set wireless.wifinet1.mode='ap'
uci set wireless.wifinet1.ssid=$WIFI_NAME
uci set wireless.wifinet1.encryption='psk2'
uci set wireless.wifinet1.key=$WIFI_PWD
uci set wireless.wifinet1.ieee80211r='1'
uci set wireless.wifinet1.mobility_domain=$WIFI_MOBDOMAIN
uci set wireless.wifinet1.ft_over_ds='0'
uci set wireless.wifinet1.ft_psk_generate_local='1'
uci set wireless.wifinet1.network='lan'
uci set "wireless.$WIFI_RADIO.channel"=$WIFI_CHANNEL
uci delete "wireless.$WIFI_RADIO.disabled"
uci commit
wifi down
/etc/init.d/wpad restart
wifi up
+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
MESH_PWD=$(echo "$MESH_PWD" | tr -d '"')
WIFI_PWD=$(echo "$WIFI_PWD" | tr -d '"')
output_file=${1:-"/etc/config/wireless"}
echo "writing to $output_file"
cat << EOF >> "$output_file"
config wifi-iface 'mesh'
option device 'radio0'
option disabled '0'
option mode 'mesh'
option ifname 'mesh0'
option network 'lan'
option mesh_id 'kosovsky-mesh'
option encryption 'sae'
option key '${MESH_PWD}'
option mesh_fwding '1'
option mesh_rssi_threshold '0'
config wifi-iface 'wifi5g'
option ssid 'kosovsky-main'
option disabled '0'
option device 'radio2'
option mode 'ap'
option network 'lan'
option encryption 'psk2'
option key '${WIFI_PWD}'
option ieee80211r '1'
option mobility_domain '7da1'
option ft_over_ds '0'
config wifi-iface 'wifi2g'
option ssid 'kosovsky-main'
option disabled '0'
option device 'radio1'
option mode 'ap'
option network 'lan'
option encryption 'psk2'
option key '${WIFI_PWD}'
option ieee80211r '1'
option mobility_domain '3333'
option ft_over_ds '0'
option ft_psk_generate_local '1'
EOF