example(miniflux): add custom recipe example: miniflux

This commit is contained in:
Masaki Yatsu
2025-09-07 22:02:20 +09:00
parent 6e1ae8b79b
commit 3fe286c8ff
4 changed files with 82 additions and 0 deletions

View File

@@ -4,4 +4,5 @@ set fallback := true
default:
@just --list --unsorted --list-submodules
mod miniflux 'miniflux/justfile'
mod reddit-rss 'reddit-rss/justfile'

1
custom-example/miniflux/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
miniflux-values.yaml

View File

@@ -0,0 +1,60 @@
set fallback := true
export MINIFLUX_NAMESPACE := env("MINIFLUX_NAMESPACE", "miniflux")
export MINIFLUX_CHART_VERSION := env("MINIFLUX_CHART_VERSION", "0.9.2")
export MINIFLUX_DB_USERNAME := env("MINIFLUX_DB_USERNAME", "miniflux")
export MINIFLUX_DB_PASSWORD := env("MINIFLUX_DB_PASSWORD", "")
export MINIFLUX_DB_NAME := env("MINIFLUX_DB_NAME", "miniflux")
[private]
default:
@just --list --unsorted --list-submodules
# Add Helm repository
add-helm-repo:
helm repo add gabe565 https://charts.gabe565.com
helm repo update
# Remove Helm repository
remove-helm-repo:
helm repo remove gabe565
# Install Miniflux
install:
#!/bin/bash
set -euo pipefail
export MINIFLUX_HOST=${MINIFLUX_HOST:-}
while [ -z "${MINIFLUX_HOST}" ]; do
MINIFLUX_HOST=$(
gum input --prompt="Miniflux host (FQDN): " --width=100 \
--placeholder="e.g., miniflux.example.com"
)
done
if [ -z "${MINIFLUX_DB_PASSWORD}" ]; then
MINIFLUX_DB_PASSWORD=$(
gum input --prompt="Database password (empty to auto-generate): " \
--width=100 --password
)
if [ -z "${MINIFLUX_DB_PASSWORD}" ]; then
MINIFLUX_DB_PASSWORD=$(just utils::random-password)
echo "Generated random password: ${MINIFLUX_DB_PASSWORD}"
fi
fi
just postgres::create-user-and-db \
${MINIFLUX_DB_USERNAME} ${MINIFLUX_DB_NAME} ${MINIFLUX_DB_PASSWORD}
just vault::put miniflux/db username=${MINIFLUX_DB_USERNAME} \
password=${MINIFLUX_DB_PASSWORD} database=${MINIFLUX_DB_NAME}
# https://github.com/gabe565/charts/tree/main/charts/miniflux
MINIFLUX_NAMESPACE=${MINIFLUX_NAMESPACE} \
gomplate -f miniflux-values.gomplate.yaml -o miniflux-values.yaml
helm upgrade --install miniflux gabe565/miniflux \
--version ${MINIFLUX_CHART_VERSION} -n ${MINIFLUX_NAMESPACE} --create-namespace --wait \
-f miniflux-values.yaml
# Uninstall Miniflux
uninstall:
helm uninstall miniflux -n ${MINIFLUX_NAMESPACE} --wait --ignore-not-found
kubectl delete namespace ${MINIFLUX_NAMESPACE} --ignore-not-found

View File

@@ -0,0 +1,20 @@
ingress:
main:
enabled: true
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.entrypoints: websecure
ingressClassName: traefik
hosts:
- host: {{ .Env.MINIFLUX_HOST }}
paths:
- path: /
tls:
- hosts:
- {{ .Env.MINIFLUX_HOST }}
env:
DATABASE_URL: "postgresql://{{ .Env.MINIFLUX_DB_USERNAME }}:{{ .Env.MINIFLUX_DB_PASSWORD }}@postgres-cluster-rw.postgres:5432/{{ .Env.MINIFLUX_DB_NAME }}"
postgresql:
enabled: false