feat: homepage

This commit is contained in:
auricom
2024-05-13 21:31:02 +02:00
parent f78a0fe9e1
commit d3d6cb4b24
12 changed files with 389 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
- Communitcate:
- Discord:
- icon: discord.png
href: 'https://discord.com/app'
- Mail:
- icon: gmail.png
href: 'https://www.fastmail.com/mail/inbox'
- GoogleCalendar:
- icon: google-calendar.png
href: 'https://www.fastmail.com/calendar'
- Outlook:
- icon: 'https://raw.githubusercontent.com/LilDrunkenSmurf/k3s-home-cluster/main/icons/outlook.png'
href: 'https://outlook.com'
- Media:
- YouTube:
- icon: youtube.png
href: 'https://youtube.com/feed/subscriptions'
- Spotify:
- icon: spotify.png
href: 'http://open.spotify.com'
- Git:
- kubesearch:
- icon: kubernetes-dashboard.png
href: 'https://kubesearch.dev/'
- k3s-home-cluster:
- icon: github.png
href: 'https://github.com/haraldkoch/kochhaus-home'

View File

@@ -0,0 +1 @@
---

View File

@@ -0,0 +1,2 @@
---
mode: cluster

View File

@@ -0,0 +1,51 @@
---
- Home:
- HomeAssistant:
href: https://hass.${SECRET_EXTERNAL_DOMAIN}
icon: home-assistant.png
description: Home Assistant
widget:
type: homeassistant
url: https://hass.${SECRET_EXTERNAL_DOMAIN}
key: "{{HOMEPAGE_VAR_HASS_TOKEN}}"
- Media:
- Sonarr:
href: https://sonarr.${SECRET_EXTERNAL_DOMAIN}
siteMonitor: https://sonarr.${SECRET_EXTERNAL_DOMAIN}
icon: sonarr.png
description: TV Shows
widget:
type: sonarr
url: http://sonarr.default.svc.cluster.local.:8080
key: {{HOMEPAGE_VAR_SONARR_TOKEN}}
- Radarr:
href: https://radarr.${SECRET_EXTERNAL_DOMAIN}
siteMonitor: https://radarr.${SECRET_EXTERNAL_DOMAIN}
icon: radarr.png
description: Movies
widget:
type: radarr
url: http://radarr.default.svc.cluster.local.:8080
key: {{HOMEPAGE_VAR_RADARR_TOKEN}}
- Lidarr:
href: https://lidarr.${SECRET_EXTERNAL_DOMAIN}
siteMonitor: https://lidarr.${SECRET_EXTERNAL_DOMAIN}
icon: lidarr.png
description: Music
widget:
type: lidarr
url: http://lidarr.default.svc.cluster.local.:8080
key: {{HOMEPAGE_VAR_LIDARR_TOKEN}}
- Calendar:
- Agenda:
widget:
type: calendar
view: agenda # optional - possible values monthly, agenda
maxEvents: 5 # optional - defaults to 10
integrations: # optional
- type: sonarr # active widget type that is currently enabled on homepage - possible values: radarr, sonarr>
service_group: Media # group name where widget exists
service_name: Sonarr # service name for that widget
- type: radarr # active widget type that is currently enabled on homepage - possible values: radarr, sonarr>
service_group: Media # group name where widget exists
service_name: Radarr # service name for that widget

View File

@@ -0,0 +1,31 @@
---
title: Dashboard
favicon: https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/homepage.png
theme: dark
color: slate
headerStyle: clean
layout:
Calendar:
style: column
icon: mdi-calendar
Media:
style: column
icon: mdi-play-circle
Infrastructure:
style: row
columns: 3
icon: mdi-server
Storage:
style: row
columns: 2
icon: mdi-desktop-tower
Home:
style: column
icon: mdi-home-analytics
Observability:
style: column
icon: mdi-chart-line
Downloads:
style: row
columns: 3
icon: mdi-download-circle

View File

@@ -0,0 +1,35 @@
---
#- logo:
# icon: https://raw.githubusercontent.com/LilDrunkenSmurf/k3s-home-cluster/main/icons/lds-transparent.png
- search:
provider: [duckduckgo, google]
focus: false
target: _blank
- greeting:
text_size: xl
text: "Greetings, Citizen."
- kubernetes:
cluster:
cpu: true
label: cluster
memory: true
show: true
showLabel: true
nodes:
cpu: true
memory: true
show: false
showLabel: true
- openmeteo:
label: Home
latitude: ${LATITUDE}
longitude: ${LONGITUDE}
timezone: America/Toronto
units: metric
cache: 5
- datetime:
text_size: l
format:
dateStyle: long
timeStyle: short
hourCycle: h23

View File

@@ -0,0 +1,40 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: homepage
namespace: default
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: homepage-secret
template:
engineVersion: v2
data:
# Generics
HOMEPAGE_VAR_LATITUDE: "{{ .HASS_LATITUDE }}"
HOMEPAGE_VAR_LONGITUDE: "{{ .HASS_LONGITUDE }}"
## HASS
HOMEPAGE_VAR_HASS_TOKEN: "{{ .PROMETHEUS_TOKEN }}"
## Media
HOMEPAGE_VAR_LIDARR_TOKEN: "{{ .LIDARR__API_KEY }}"
HOMEPAGE_VAR_RADARR_TOKEN: "{{ .RADARR__API_KEY }}"
HOMEPAGE_VAR_SONARR_TOKEN: "{{ .SONARR__API_KEY }}"
dataFrom:
- extract:
key: cloudnative-pg
- extract:
key: homepage
- extract:
key: home-assistant
- extract:
key: lidarr
- extract:
key: radarr
- extract:
key: sonarr

View File

@@ -0,0 +1,94 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: &app homepage
namespace: default
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.1.0
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
uninstall:
keepHistory: false
values:
controllers:
homepage:
replicas: 2
strategy: RollingUpdate
annotations:
reloader.stakater.com/auto: "true"
containers:
app:
image:
repository: ghcr.io/gethomepage/homepage
tag: v0.8.13
env:
TZ: ${TIMEZONE}
envFrom:
- secretRef:
name: homepage-secret
probes:
liveness:
enabled: true
readiness:
enabled: true
resources:
requests:
cpu: 15m
memory: 200M
limits:
memory: 2G
service:
app:
controller: *app
ports:
http:
port: 3000
ingress:
app:
enabled: true
className: nginx
hosts:
- host: &host "{{ .Release.Name }}.${SECRET_CLUSTER_DOMAIN}"
paths:
- path: /
service:
identifier: app
port: http
tls:
- hosts:
- *host
persistence:
config:
type: configMap
name: homepage-config
globalMounts:
- subPath: bookmarks.yaml
path: /app/config/bookmarks.yaml
- subPath: docker.yaml
path: /app/config/docker.yaml
- subPath: kubernetes.yaml
path: /app/config/kubernetes.yaml
- subPath: services.yaml
path: /app/config/services.yaml
- subPath: settings.yaml
path: /app/config/settings.yaml
- subPath: widgets.yaml
path: /app/config/widgets.yaml

View File

@@ -0,0 +1,20 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml
- ../../../../templates/gatus/guarded
configMapGenerator:
- name: homepage-config
files:
- bookmarks.yaml=./config/bookmarks.yaml
- docker.yaml=./config/docker.yaml
- kubernetes.yaml=./config/kubernetes.yaml
- services.yaml=./config/services.yaml
- settings.yaml=./config/settings.yaml
- widgets.yaml=./config/widgets.yaml
generatorOptions:
disableNameSuffixHash: true

View File

@@ -0,0 +1,63 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: &app homepage
labels:
app.kubernetes.io/instance: *app
app.kubernetes.io/name: *app
rules:
- apiGroups:
- ""
resources:
- namespaces
- pods
- nodes
verbs:
- get
- list
- apiGroups:
- extensions
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- apiGroups:
- traefik.containo.us
resources:
- ingressroutes
verbs:
- get
- list
- apiGroups:
- metrics.k8s.io
resources:
- nodes
- pods
verbs:
- get
- list
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: &app homepage
labels:
app.kubernetes.io/instance: *app
app.kubernetes.io/name: *app
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: *app
subjects:
- kind: ServiceAccount
name: *app
namespace: self-hosted # keep

View File

@@ -0,0 +1,24 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app homepage
namespace: flux-system
spec:
targetNamespace: default
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/default/homepage/app
prune: true
sourceRef:
kind: GitRepository
name: home-ops-kubernetes
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
postBuild:
substitute:
APP: *app

View File

@@ -20,6 +20,7 @@ resources:
- ./home-assistant/ks.yaml
- ./homebox/ks.yaml
- ./homelab/ks.yaml
- ./homepage/ks.yaml
- ./invidious/ks.yaml
- ./jellyfin/ks.yaml
- ./joplin/ks.yaml