From 58c733260faeb6b99b57926f697d20e573bb3ae5 Mon Sep 17 00:00:00 2001 From: Daniel Cosme Date: Thu, 7 May 2026 11:51:35 -0400 Subject: [PATCH] Add glance stack --- apps/hydra/glance/kustomization.yaml | 5 ++ apps/hydra/glance/namespace.yaml | 6 ++ cmd/apps/main.go | 2 + config/glance/.env | 3 + config/glance/assets/user.css | 0 config/glance/config/glance.yml | 12 ++++ config/glance/config/home.yml | 88 ++++++++++++++++++++++++++++ config/glance/docker-compose.yml | 14 +++++ pkg/glance.go | 20 +++++++ pkg/immich/immich.go | 1 - pkg/root/services.go | 10 ++++ 11 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 apps/hydra/glance/kustomization.yaml create mode 100644 apps/hydra/glance/namespace.yaml create mode 100644 config/glance/.env create mode 100644 config/glance/assets/user.css create mode 100644 config/glance/config/glance.yml create mode 100644 config/glance/config/home.yml create mode 100644 config/glance/docker-compose.yml create mode 100644 pkg/glance.go diff --git a/apps/hydra/glance/kustomization.yaml b/apps/hydra/glance/kustomization.yaml new file mode 100644 index 0000000..a9036ad --- /dev/null +++ b/apps/hydra/glance/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +metadata: {} +resources: +- namespace.yaml diff --git a/apps/hydra/glance/namespace.yaml b/apps/hydra/glance/namespace.yaml new file mode 100644 index 0000000..3f8f25c --- /dev/null +++ b/apps/hydra/glance/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: glance +spec: {} +status: {} diff --git a/cmd/apps/main.go b/cmd/apps/main.go index 6c26046..f313c76 100644 --- a/cmd/apps/main.go +++ b/cmd/apps/main.go @@ -5,6 +5,7 @@ import ( "os" "danicos.dev/daniel/go-kube/pkg/stack" + glance "danicos.dev/daniel/homelab/pkg" "danicos.dev/daniel/homelab/pkg/cnpg" "danicos.dev/daniel/homelab/pkg/flux" "danicos.dev/daniel/homelab/pkg/immich" @@ -41,6 +42,7 @@ func main() { hydra_apps := map[string]stack.Stack{ "linkding": linkding.Stack(), "immich": immich.Stack(), + "glance": glance.Stack(), } for name, s := range hydra_apps { fmt.Printf("STACK: %s\n", name) diff --git a/config/glance/.env b/config/glance/.env new file mode 100644 index 0000000..146599f --- /dev/null +++ b/config/glance/.env @@ -0,0 +1,3 @@ +# Variables defined here will be available to use anywhere in the config with the syntax ${MY_SECRET_TOKEN} +# Note: making changes to this file requires re-running docker compose up +MY_SECRET_TOKEN=123456 diff --git a/config/glance/assets/user.css b/config/glance/assets/user.css new file mode 100644 index 0000000..e69de29 diff --git a/config/glance/config/glance.yml b/config/glance/config/glance.yml new file mode 100644 index 0000000..66ff2f9 --- /dev/null +++ b/config/glance/config/glance.yml @@ -0,0 +1,12 @@ +server: + assets-path: /app/assets + +theme: + # Note: assets are cached by the browser, changes to the CSS file + # will not be reflected until the browser cache is cleared (Ctrl+F5) + custom-css-file: /assets/user.css + +pages: + # It's not necessary to create a new file for each page and include it, you can simply + # put its contents here, though multiple pages are easier to manage when separated + - $include: home.yml diff --git a/config/glance/config/home.yml b/config/glance/config/home.yml new file mode 100644 index 0000000..0cafb9d --- /dev/null +++ b/config/glance/config/home.yml @@ -0,0 +1,88 @@ +- name: Home + # Optionally, if you only have a single page you can hide the desktop navigation for a cleaner look + # hide-desktop-navigation: true + columns: + - size: small + widgets: + - type: calendar + first-day-of-week: monday + + - type: rss + limit: 10 + collapse-after: 3 + cache: 12h + feeds: + - url: https://selfh.st/rss/ + title: selfh.st + - url: https://ciechanow.ski/atom.xml + - url: https://www.joshwcomeau.com/rss.xml + title: Josh Comeau + - url: https://samwho.dev/rss.xml + - url: https://ishadeed.com/feed.xml + title: Ahmad Shadeed + + - type: twitch-channels + channels: + - theprimeagen + - j_blow + - giantwaffle + - cohhcarnage + - christitustech + - EJ_SA + + - size: full + widgets: + - type: group + widgets: + - type: hacker-news + - type: lobsters + + - type: videos + channels: + - UCXuqSBlHAE6Xw-yeJA0Tunw # Linus Tech Tips + - UCR-DXc1voovS8nhAvccRZhg # Jeff Geerling + - UCsBjURrPoezykLs9EqgamOA # Fireship + - UCBJycsmduvYEL83R_U4JriQ # Marques Brownlee + - UCHnyfMqiRRG1u-2MsSQLbXA # Veritasium + + - type: group + widgets: + - type: reddit + subreddit: technology + show-thumbnails: true + - type: reddit + subreddit: selfhosted + show-thumbnails: true + + - size: small + widgets: + - type: weather + location: London, United Kingdom + units: metric # alternatively "imperial" + hour-format: 12h # alternatively "24h" + # Optionally hide the location from being displayed in the widget + # hide-location: true + + - type: markets + markets: + - symbol: SPY + name: S&P 500 + - symbol: BTC-USD + name: Bitcoin + - symbol: NVDA + name: NVIDIA + - symbol: AAPL + name: Apple + - symbol: MSFT + name: Microsoft + + - type: releases + cache: 1d + # Without authentication the Github API allows for up to 60 requests per hour. You can create a + # read-only token from your Github account settings and use it here to increase the limit. + # token: ... + repositories: + - glanceapp/glance + - go-gitea/gitea + - immich-app/immich + - syncthing/syncthing diff --git a/config/glance/docker-compose.yml b/config/glance/docker-compose.yml new file mode 100644 index 0000000..f046791 --- /dev/null +++ b/config/glance/docker-compose.yml @@ -0,0 +1,14 @@ +services: + glance: + container_name: glance + image: glanceapp/glance + restart: unless-stopped + volumes: + - ./config:/app/config + - ./assets:/app/assets + - /etc/localtime:/etc/localtime:ro + # Optionally, also mount docker socket if you want to use the docker containers widget + # - /var/run/docker.sock:/var/run/docker.sock:ro + ports: + - 8080:8080 + env_file: .env diff --git a/pkg/glance.go b/pkg/glance.go new file mode 100644 index 0000000..c24f138 --- /dev/null +++ b/pkg/glance.go @@ -0,0 +1,20 @@ +package glance + +import ( + "danicos.dev/daniel/go-kube/pkg/kube" + "danicos.dev/daniel/go-kube/pkg/stack" + "danicos.dev/daniel/homelab/pkg/root" +) + +var meta kube.Metadata +var Namespace = kube.Namespace(root.Glance.Name) + +func Stack() stack.Stack { + kz := kube.NewKuztomizedStack( + meta, + map[string]any{ + "namespace": Namespace, + }, + ) + return kz.Stack("glance") +} diff --git a/pkg/immich/immich.go b/pkg/immich/immich.go index 43a7633..a58f779 100644 --- a/pkg/immich/immich.go +++ b/pkg/immich/immich.go @@ -83,7 +83,6 @@ func Stack() stack.Stack { func MachineLearning() apps.Deployment { envMapping := map[string]string{ - // "REDIS_PORT": fmt.Sprintf("%d", RedisPort), "IMMICH_PORT": fmt.Sprintf("%d", MachineLearningPort), } cacheVol := kube.NewVolumeFrom(kube.VolumeSourcePVC, "cache", machine_learning_pvc.Name) diff --git a/pkg/root/services.go b/pkg/root/services.go index d932814..a3d2110 100644 --- a/pkg/root/services.go +++ b/pkg/root/services.go @@ -43,6 +43,16 @@ var Immich = Service{ }, } +var Glance = Service{ + Name: "glance", + Image: "", + Port: 0, // Server Port + // Public: &Public{ + // URL: "https://photos.danicos.me", + // NodePort: 30011, + // }, +} + var ( Longhorn = "longhorn" Monitoring = "monitoring"