mirror of
https://github.com/truenas/charts.git
synced 2026-04-13 12:39:49 +08:00
NAS-123737 / 24.04 / add firefly-iii to community train (#1485)
* add `firefly-iii` to `community` train * initial templates * fix path * llint * remove app_env * more work * add service * typo * redis service * restart never cron * add cap * more cap * more caps * fix port * fix few things * more fixes * fix cron * another var * typo * update meta * add importer port gui * add missing keys from values * conditionally render the importer config * fix config
This commit is contained in:
6
library/ix-dev/community/firefly-iii/Chart.lock
Normal file
6
library/ix-dev/community/firefly-iii/Chart.lock
Normal file
@@ -0,0 +1,6 @@
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: file://../../../common
|
||||
version: 1.1.0
|
||||
digest: sha256:752ce76025f5b61094bd2b18ca11693eb9d26d0dde4eb2e63cd2330cbffe9e73
|
||||
generated: "2023-08-28T18:32:28.064951481+03:00"
|
||||
25
library/ix-dev/community/firefly-iii/Chart.yaml
Normal file
25
library/ix-dev/community/firefly-iii/Chart.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
name: firefly-iii
|
||||
description: Firefly III is a personal finances manager
|
||||
annotations:
|
||||
title: Firefly III
|
||||
type: application
|
||||
version: 1.0.0
|
||||
apiVersion: v2
|
||||
appVersion: '6.0.20'
|
||||
kubeVersion: '>=1.16.0-0'
|
||||
maintainers:
|
||||
- name: truenas
|
||||
url: https://www.truenas.com/
|
||||
email: dev@ixsystems.com
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: file://../../../common
|
||||
version: 1.1.0
|
||||
home: https://www.firefly-iii.org/
|
||||
icon: https://raw.githubusercontent.com/firefly-iii/firefly-iii/develop/.github/assets/img/logo-small.png
|
||||
sources:
|
||||
- https://hub.docker.com/r/fireflyiii/core/
|
||||
- https://github.com/truenas/charts/tree/master/community/firefly-iii
|
||||
- https://github.com/firefly-iii/firefly-iii
|
||||
keywords:
|
||||
- finance
|
||||
11
library/ix-dev/community/firefly-iii/README.md
Normal file
11
library/ix-dev/community/firefly-iii/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Firefly III
|
||||
|
||||
[Firefly III](https://www.firefly-iii.org/) is a personal finances manager
|
||||
|
||||
> When application is installed, a container will be launched with **root** privileges.
|
||||
> This is required in order to apply the correct permissions to the `postgres` directories.
|
||||
> Afterward, the `postgres` container will run as a **non**-root user (`999`).
|
||||
> On each upgrade, a container will be launched with **root** privileges in order to apply the correct
|
||||
> permissions to the `postgres` **backups** directory. Container that performs the backup will run as a **non**-root user (`999`) afterwards.
|
||||
> Keep in mind the permissions on the backup directory will be changed to `999:999` on **every** update.
|
||||
> But will only be changed once for the `postgres` data directories.
|
||||
11
library/ix-dev/community/firefly-iii/app-readme.md
Normal file
11
library/ix-dev/community/firefly-iii/app-readme.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Firefly III
|
||||
|
||||
[Firefly III](https://www.firefly-iii.org/) is a personal finances manager
|
||||
|
||||
> When application is installed, a container will be launched with **root** privileges.
|
||||
> This is required in order to apply the correct permissions to the `postgres` directories.
|
||||
> Afterward, the `postgres` container will run as a **non**-root user (`999`).
|
||||
> On each upgrade, a container will be launched with **root** privileges in order to apply the correct
|
||||
> permissions to the `postgres` **backups** directory. Container that performs the backup will run as a **non**-root user (`999`) afterwards.
|
||||
> Keep in mind the permissions on the backup directory will be changed to `999:999` on **every** update.
|
||||
> But will only be changed once for the `postgres` data directories.
|
||||
BIN
library/ix-dev/community/firefly-iii/charts/common-1.1.0.tgz
Normal file
BIN
library/ix-dev/community/firefly-iii/charts/common-1.1.0.tgz
Normal file
Binary file not shown.
14
library/ix-dev/community/firefly-iii/ci/basic-values.yaml
Normal file
14
library/ix-dev/community/firefly-iii/ci/basic-values.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
fireflyNetwork:
|
||||
appUrl: http://localhost:31000
|
||||
webPort: 31000
|
||||
|
||||
fireflyStorage:
|
||||
uploads:
|
||||
type: hostPath
|
||||
hostPath: /mnt/{{ .Release.Name }}/uploads
|
||||
pgData:
|
||||
type: hostPath
|
||||
hostPath: /mnt/{{ .Release.Name }}/pgData
|
||||
pgBackup:
|
||||
type: hostPath
|
||||
hostPath: /mnt/{{ .Release.Name }}/pgBackup
|
||||
18
library/ix-dev/community/firefly-iii/ci/importer-values.yaml
Normal file
18
library/ix-dev/community/firefly-iii/ci/importer-values.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
fireflyConfig:
|
||||
appUrl: http://localhost:31000
|
||||
enableImporter: true
|
||||
|
||||
fireflyNetwork:
|
||||
webPort: 31000
|
||||
importerPort: 31001
|
||||
|
||||
fireflyStorage:
|
||||
uploads:
|
||||
type: hostPath
|
||||
hostPath: /mnt/{{ .Release.Name }}/uploads
|
||||
pgData:
|
||||
type: hostPath
|
||||
hostPath: /mnt/{{ .Release.Name }}/pgData
|
||||
pgBackup:
|
||||
type: hostPath
|
||||
hostPath: /mnt/{{ .Release.Name }}/pgBackup
|
||||
10
library/ix-dev/community/firefly-iii/item.yaml
Normal file
10
library/ix-dev/community/firefly-iii/item.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
icon_url: https://raw.githubusercontent.com/firefly-iii/firefly-iii/develop/.github/assets/img/logo-small.png
|
||||
categories:
|
||||
- productivity
|
||||
screenshots:
|
||||
- https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/images/index.png
|
||||
- https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/images/account.png
|
||||
- https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/images/budgets.png
|
||||
- https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/images/tiny/report.png
|
||||
tags:
|
||||
- finance
|
||||
31
library/ix-dev/community/firefly-iii/metadata.yaml
Normal file
31
library/ix-dev/community/firefly-iii/metadata.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
runAsContext:
|
||||
- userName: root
|
||||
groupName: root
|
||||
gid: 0
|
||||
uid: 0
|
||||
description: Firefly III runs as root user
|
||||
- userName: root
|
||||
groupName: root
|
||||
gid: 0
|
||||
uid: 0
|
||||
description: Firefly III Data Importer runs as root user
|
||||
- userName: postgres
|
||||
groupName: postgres
|
||||
gid: 999
|
||||
uid: 999
|
||||
description: Postgres runs as a non-root user.
|
||||
- userName: redis
|
||||
groupName: redis
|
||||
gid: 1001
|
||||
uid: 0
|
||||
description: Redis runs as a non-root user and root group.
|
||||
capabilities:
|
||||
- name: CHOWN
|
||||
description: Firefly III and Firefly Data Importer is able to chown files.
|
||||
- name: FOWNER
|
||||
description: Firefly III and Firefly Data Importer is able to bypass permission checks.
|
||||
- name: SETUID
|
||||
description: Firefly III and Firefly Data Importer is able to set user ID for it's sub-processes.
|
||||
- name: SETGID
|
||||
description: Firefly III and Firefly Data Importer is able to set group ID for it's sub-processes.
|
||||
hostMounts: []
|
||||
284
library/ix-dev/community/firefly-iii/questions.yaml
Normal file
284
library/ix-dev/community/firefly-iii/questions.yaml
Normal file
@@ -0,0 +1,284 @@
|
||||
groups:
|
||||
- name: Firefly III Configuration
|
||||
description: Configure Firefly III
|
||||
- name: Network Configuration
|
||||
description: Configure Network for Firefly III
|
||||
- name: Storage Configuration
|
||||
description: Configure Storage for Firefly III
|
||||
- name: Resources Configuration
|
||||
description: Configure Resources for Firefly III
|
||||
|
||||
portals:
|
||||
web_portal:
|
||||
protocols:
|
||||
- "$kubernetes-resource_configmap_portal_protocol"
|
||||
host:
|
||||
- "$kubernetes-resource_configmap_portal_host"
|
||||
ports:
|
||||
- "$kubernetes-resource_configmap_portal_port"
|
||||
path: "$kubernetes-resource_configmap_portal_path"
|
||||
|
||||
questions:
|
||||
|
||||
- variable: fireflyConfig
|
||||
label: ""
|
||||
group: Firefly III Configuration
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: appUrl
|
||||
label: Firefly III URL
|
||||
description: |
|
||||
The base URL for Firefly III.</br>
|
||||
Examples:</br>
|
||||
https://firefly.example.com </br>
|
||||
http://192.168.1.100:30064
|
||||
schema:
|
||||
type: uri
|
||||
default: ""
|
||||
required: true
|
||||
- variable: additionalEnvs
|
||||
label: Additional Environment Variables
|
||||
description: Configure additional environment variables for Firefly III.
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: env
|
||||
label: Environment Variable
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: name
|
||||
label: Name
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
- variable: value
|
||||
label: Value
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
- variable: enableImporter
|
||||
label: Enable Firefly III Data Importer
|
||||
description: Enable Firefly III Data Importer.
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
- variable: additionalImporterEnvs
|
||||
label: Additional Data Importer Environment Variables
|
||||
description: Configure additional environment variables for Firefly III Data Importer.
|
||||
schema:
|
||||
type: list
|
||||
show_if: [["enableImporter", "=", true]]
|
||||
default: []
|
||||
items:
|
||||
- variable: env
|
||||
label: Environment Variable
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: name
|
||||
label: Name
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
- variable: value
|
||||
label: Value
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
- variable: fireflyNetwork
|
||||
label: ""
|
||||
group: Network Configuration
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: webPort
|
||||
label: Web Port
|
||||
description: The port for the Firefly III WebUI.
|
||||
schema:
|
||||
type: int
|
||||
default: 30064
|
||||
min: 9000
|
||||
max: 65535
|
||||
required: true
|
||||
- variable: importerPort
|
||||
label: Data Importer Port
|
||||
description: The port for the Firefly III Data Importer WebUI.
|
||||
schema:
|
||||
type: int
|
||||
default: 30065
|
||||
min: 9000
|
||||
max: 65535
|
||||
required: true
|
||||
- variable: hostNetwork
|
||||
label: Host Network
|
||||
description: |
|
||||
Bind to the host network. It's recommended to keep this disabled.
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
- variable: fireflyStorage
|
||||
label: ""
|
||||
group: Storage Configuration
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: uploads
|
||||
label: Firefly III Uploads Storage
|
||||
description: The path to store Firefly III uploads.
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: type
|
||||
label: Type
|
||||
description: |
|
||||
ixVolume: Is dataset created automatically by the system.</br>
|
||||
Host Path: Is a path that already exists on the system.
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ixVolume
|
||||
enum:
|
||||
- value: hostPath
|
||||
description: Host Path (Path that already exists on the system)
|
||||
- value: ixVolume
|
||||
description: ixVolume (Dataset created automatically by the system)
|
||||
- variable: datasetName
|
||||
label: Dataset Name
|
||||
schema:
|
||||
type: string
|
||||
show_if: [["type", "=", "ixVolume"]]
|
||||
required: true
|
||||
hidden: true
|
||||
immutable: true
|
||||
default: uploads
|
||||
$ref:
|
||||
- "normalize/ixVolume"
|
||||
- variable: hostPath
|
||||
label: Host Path
|
||||
schema:
|
||||
type: hostpath
|
||||
show_if: [["type", "=", "hostPath"]]
|
||||
immutable: true
|
||||
required: true
|
||||
- variable: pgData
|
||||
label: Firefly III Postgres Data Storage
|
||||
description: The path to store Firefly III Postgres Data.
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: type
|
||||
label: Type
|
||||
description: |
|
||||
ixVolume: Is dataset created automatically by the system.</br>
|
||||
Host Path: Is a path that already exists on the system.
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ixVolume
|
||||
enum:
|
||||
- value: hostPath
|
||||
description: Host Path (Path that already exists on the system)
|
||||
- value: ixVolume
|
||||
description: ixVolume (Dataset created automatically by the system)
|
||||
- variable: datasetName
|
||||
label: Dataset Name
|
||||
schema:
|
||||
type: string
|
||||
show_if: [["type", "=", "ixVolume"]]
|
||||
required: true
|
||||
hidden: true
|
||||
immutable: true
|
||||
default: pgData
|
||||
$ref:
|
||||
- "normalize/ixVolume"
|
||||
- variable: hostPath
|
||||
label: Host Path
|
||||
schema:
|
||||
type: hostpath
|
||||
show_if: [["type", "=", "hostPath"]]
|
||||
immutable: true
|
||||
required: true
|
||||
- variable: pgBackup
|
||||
label: Firefly III Postgres Backup Storage
|
||||
description: The path to store Firefly III Postgres Backup.
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: type
|
||||
label: Type
|
||||
description: |
|
||||
ixVolume: Is dataset created automatically by the system.</br>
|
||||
Host Path: Is a path that already exists on the system.
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ixVolume
|
||||
enum:
|
||||
- value: hostPath
|
||||
description: Host Path (Path that already exists on the system)
|
||||
- value: ixVolume
|
||||
description: ixVolume (Dataset created automatically by the system)
|
||||
- variable: datasetName
|
||||
label: Dataset Name
|
||||
schema:
|
||||
type: string
|
||||
show_if: [["type", "=", "ixVolume"]]
|
||||
required: true
|
||||
hidden: true
|
||||
immutable: true
|
||||
default: pgBackup
|
||||
$ref:
|
||||
- "normalize/ixVolume"
|
||||
- variable: hostPath
|
||||
label: Host Path
|
||||
schema:
|
||||
type: hostpath
|
||||
show_if: [["type", "=", "hostPath"]]
|
||||
immutable: true
|
||||
required: true
|
||||
|
||||
- variable: resources
|
||||
label: ""
|
||||
group: Resources Configuration
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: limits
|
||||
label: Limits
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: cpu
|
||||
label: CPU
|
||||
description: CPU limit for Firefly III.
|
||||
schema:
|
||||
type: string
|
||||
max_length: 6
|
||||
valid_chars: '^(0\.[1-9]|[1-9][0-9]*)(\.[0-9]|m?)$'
|
||||
valid_chars_error: |
|
||||
Valid CPU limit formats are</br>
|
||||
- Plain Integer - eg. 1</br>
|
||||
- Float - eg. 0.5</br>
|
||||
- Milicpu - eg. 500m
|
||||
default: "4000m"
|
||||
required: true
|
||||
- variable: memory
|
||||
label: Memory
|
||||
description: Memory limit for Firefly III.
|
||||
schema:
|
||||
type: string
|
||||
max_length: 12
|
||||
valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$'
|
||||
valid_chars_error: |
|
||||
Valid Memory limit formats are</br>
|
||||
- Suffixed with E/P/T/G/M/K - eg. 1G</br>
|
||||
- Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi</br>
|
||||
- Plain Integer in bytes - eg. 1024</br>
|
||||
- Exponent - eg. 134e6
|
||||
default: "8Gi"
|
||||
required: true
|
||||
1
library/ix-dev/community/firefly-iii/templates/NOTES.txt
Normal file
1
library/ix-dev/community/firefly-iii/templates/NOTES.txt
Normal file
@@ -0,0 +1 @@
|
||||
{{ include "ix.v1.common.lib.chart.notes" $ }}
|
||||
@@ -0,0 +1,78 @@
|
||||
{{- define "firefly.configuration" -}}
|
||||
|
||||
{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
|
||||
|
||||
{{- $dbHost := (printf "%s-postgres" $fullname) -}}
|
||||
{{- $dbUser := "firefly" -}}
|
||||
{{- $dbName := "firefly" -}}
|
||||
|
||||
{{- $dbPass := (randAlphaNum 32) -}}
|
||||
{{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-postgres-creds" $fullname)) -}}
|
||||
{{- $dbPass = ((index .data "POSTGRES_PASSWORD") | b64dec) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Temporary set dynamic db details on values,
|
||||
so we can print them on the notes */}}
|
||||
{{- $_ := set .Values "fireflyDbPass" $dbPass -}}
|
||||
{{- $_ := set .Values "fireflyDbHost" $dbHost -}}
|
||||
|
||||
{{- $redisHost := (printf "%s-redis" $fullname) -}}
|
||||
|
||||
{{- $redisPass := randAlphaNum 32 -}}
|
||||
{{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-redis-creds" $fullname)) -}}
|
||||
{{- $redisPass = ((index .data "REDIS_PASSWORD") | b64dec) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $appKey := (randAlphaNum 32) -}}
|
||||
{{- $cronToken := (randAlphaNum 32) -}}
|
||||
{{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-firefly-config" $fullname)) -}}
|
||||
{{- $appKey = ((index .data "APP_KEY") | b64dec) -}}
|
||||
{{- $cronToken = ((index .data "STATIC_CRON_TOKEN") | b64dec) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) }}
|
||||
secret:
|
||||
postgres-creds:
|
||||
enabled: true
|
||||
data:
|
||||
POSTGRES_USER: {{ $dbUser }}
|
||||
POSTGRES_DB: {{ $dbName }}
|
||||
POSTGRES_PASSWORD: {{ $dbPass }}
|
||||
POSTGRES_HOST: {{ $dbHost }}
|
||||
POSTGRES_URL: {{ $dbURL }}
|
||||
|
||||
redis-creds:
|
||||
enabled: true
|
||||
data:
|
||||
ALLOW_EMPTY_PASSWORD: "no"
|
||||
REDIS_PASSWORD: {{ $redisPass }}
|
||||
REDIS_HOST: {{ $redisHost }}
|
||||
|
||||
firefly-config:
|
||||
enabled: true
|
||||
data:
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: {{ $dbHost }}
|
||||
DB_PORT: "5432"
|
||||
DB_DATABASE: {{ $dbName }}
|
||||
DB_USERNAME: {{ $dbUser }}
|
||||
DB_PASSWORD: {{ $dbPass }}
|
||||
CACHE_DRIVER: redis
|
||||
SESSION_DRIVER: redis
|
||||
REDIS_HOST: {{ $redisHost }}
|
||||
REDIS_PORT: "6379"
|
||||
REDIS_USERNAME: default
|
||||
REDIS_PASSWORD: {{ $redisPass }}
|
||||
REDIS_DB: "0"
|
||||
REDIS_CACHE_DB: "1"
|
||||
APP_URL: {{ .Values.fireflyConfig.appUrl | trimSuffix "/" }}
|
||||
APP_KEY: {{ $appKey }}
|
||||
STATIC_CRON_TOKEN: {{ $cronToken }}
|
||||
|
||||
importer-config:
|
||||
enabled: {{ .Values.fireflyConfig.enableImporter }}
|
||||
data:
|
||||
FIREFLY_III_URL: http://{{ $fullname }}:{{ .Values.fireflyNetwork.webPort }}
|
||||
EXPECT_SECURE_URL: "false"
|
||||
VANITY_URL: {{ .Values.fireflyConfig.appUrl | trimSuffix "/" }}
|
||||
{{- end -}}
|
||||
56
library/ix-dev/community/firefly-iii/templates/_firefly.tpl
Normal file
56
library/ix-dev/community/firefly-iii/templates/_firefly.tpl
Normal file
@@ -0,0 +1,56 @@
|
||||
{{- define "firefly.workload" -}}
|
||||
workload:
|
||||
firefly:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec:
|
||||
hostNetwork: {{ .Values.fireflyNetwork.hostNetwork }}
|
||||
containers:
|
||||
firefly:
|
||||
enabled: true
|
||||
primary: true
|
||||
imageSelector: image
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
runAsNonRoot: false
|
||||
readOnlyRootFilesystem: false
|
||||
capabilities:
|
||||
add:
|
||||
- CHOWN
|
||||
- FOWNER
|
||||
- SETUID
|
||||
- SETGID
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: firefly-config
|
||||
{{ with .Values.fireflyConfig.additionalEnvs }}
|
||||
envList:
|
||||
{{ range $env := . }}
|
||||
- name: {{ $env.name }}
|
||||
value: {{ $env.value }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
probes:
|
||||
liveness:
|
||||
enabled: true
|
||||
type: http
|
||||
path: /health
|
||||
port: 8080
|
||||
readiness:
|
||||
enabled: true
|
||||
type: http
|
||||
path: /health
|
||||
port: 8080
|
||||
startup:
|
||||
enabled: true
|
||||
type: http
|
||||
path: /health
|
||||
port: 8080
|
||||
initContainers:
|
||||
{{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait"
|
||||
"secretName" "postgres-creds") | nindent 8 }}
|
||||
{{- include "ix.v1.common.app.redisWait" (dict "name" "redis-wait"
|
||||
"secretName" "redis-creds") | nindent 8 }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,46 @@
|
||||
{{- define "firefly.cron" -}}
|
||||
{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) }}
|
||||
workload:
|
||||
firefly-cron:
|
||||
enabled: true
|
||||
type: CronJob
|
||||
schedule: "0 3 * * *"
|
||||
podSpec:
|
||||
restartPolicy: Never
|
||||
backoffLimit: 2
|
||||
containers:
|
||||
firefly-cron:
|
||||
enabled: true
|
||||
primary: true
|
||||
imageSelector: bashImage
|
||||
env:
|
||||
CRON_TOKEN:
|
||||
secretKeyRef:
|
||||
name: firefly-config
|
||||
key: STATIC_CRON_TOKEN
|
||||
probes:
|
||||
startup:
|
||||
enabled: false
|
||||
readiness:
|
||||
enabled: false
|
||||
liveness:
|
||||
enabled: false
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
until wget --spider --quiet --timeout=3 --tries=1 \
|
||||
{{ $fullname }}:{{ .Values.fireflyNetwork.webPort }}/health; do
|
||||
echo "Waiting for Firefly to start..."
|
||||
sleep 2
|
||||
done
|
||||
if wget --spider --quiet --timeout=3 --tries=1 \
|
||||
{{ $fullname }}:{{ .Values.fireflyNetwork.webPort }}/api/v1/cron/$(CRON_TOKEN);
|
||||
then
|
||||
echo "Cron job successfully executed"
|
||||
else
|
||||
echo "Cron job failed"
|
||||
exit 1
|
||||
fi
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,67 @@
|
||||
{{- define "firefly.importer" -}}
|
||||
{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) }}
|
||||
workload:
|
||||
firefly-importer:
|
||||
enabled: true
|
||||
type: Deployment
|
||||
podSpec:
|
||||
containers:
|
||||
firefly-importer:
|
||||
enabled: true
|
||||
primary: true
|
||||
imageSelector: importerImage
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
runAsNonRoot: false
|
||||
readOnlyRootFilesystem: false
|
||||
capabilities:
|
||||
add:
|
||||
- CHOWN
|
||||
- FOWNER
|
||||
- SETUID
|
||||
- SETGID
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: importer-config
|
||||
{{ with .Values.fireflyConfig.additionalImporterEnvs }}
|
||||
envList:
|
||||
{{ range $env := . }}
|
||||
- name: {{ $env.name }}
|
||||
value: {{ $env.value }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
probes:
|
||||
liveness:
|
||||
enabled: true
|
||||
type: http
|
||||
path: /health
|
||||
port: 8080
|
||||
readiness:
|
||||
enabled: true
|
||||
type: http
|
||||
path: /health
|
||||
port: 8080
|
||||
startup:
|
||||
enabled: true
|
||||
type: http
|
||||
path: /health
|
||||
port: 8080
|
||||
initContainers:
|
||||
firefly-wait:
|
||||
enabled: true
|
||||
type: init
|
||||
imageSelector: bashImage
|
||||
command:
|
||||
- bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
until wget --spider --quiet --timeout=3 --tries=1 \
|
||||
http://{{ $fullname }}:{{ .Values.fireflyNetwork.webPort }}/health;
|
||||
do
|
||||
echo "Waiting for Firefly III to be ready..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,52 @@
|
||||
{{- define "firefly.persistence" -}}
|
||||
persistence:
|
||||
uploads:
|
||||
enabled: true
|
||||
type: {{ .Values.fireflyStorage.uploads.type }}
|
||||
datasetName: {{ .Values.fireflyStorage.uploads.datasetName | default "" }}
|
||||
hostPath: {{ .Values.fireflyStorage.uploads.hostPath | default "" }}
|
||||
targetSelector:
|
||||
firefly:
|
||||
firefly:
|
||||
mountPath: /var/www/html/storage/upload
|
||||
tmp:
|
||||
enabled: true
|
||||
type: emptyDir
|
||||
targetSelector:
|
||||
firefly:
|
||||
firefly:
|
||||
mountPath: /tmp
|
||||
firefly-importer:
|
||||
firefly-importer:
|
||||
mountPath: /tmp
|
||||
|
||||
# Postgres
|
||||
postgresdata:
|
||||
enabled: true
|
||||
type: {{ .Values.fireflyStorage.pgData.type }}
|
||||
datasetName: {{ .Values.fireflyStorage.pgData.datasetName | default "" }}
|
||||
hostPath: {{ .Values.fireflyStorage.pgData.hostPath | default "" }}
|
||||
targetSelector:
|
||||
# Postgres pod
|
||||
postgres:
|
||||
# Postgres container
|
||||
postgres:
|
||||
mountPath: /var/lib/postgresql/data
|
||||
# Permissions container
|
||||
permissions:
|
||||
mountPath: /mnt/directories/postgres_data
|
||||
postgresbackup:
|
||||
enabled: true
|
||||
type: {{ .Values.fireflyStorage.pgBackup.type }}
|
||||
datasetName: {{ .Values.fireflyStorage.pgBackup.datasetName | default "" }}
|
||||
hostPath: {{ .Values.fireflyStorage.pgBackup.hostPath | default "" }}
|
||||
targetSelector:
|
||||
# Postgres backup pod
|
||||
postgresbackup:
|
||||
# Postgres backup container
|
||||
postgresbackup:
|
||||
mountPath: /postgres_backup
|
||||
# Permissions container
|
||||
permissions:
|
||||
mountPath: /mnt/directories/postgres_backup
|
||||
{{- end -}}
|
||||
25
library/ix-dev/community/firefly-iii/templates/_portal.tpl
Normal file
25
library/ix-dev/community/firefly-iii/templates/_portal.tpl
Normal file
@@ -0,0 +1,25 @@
|
||||
{{- define "firefly.portal" -}}
|
||||
{{ $prot := "http" }}
|
||||
{{ if hasPrefix "https://" .Values.fireflyConfig.appUrl }}
|
||||
{{ $prot = "https" }}
|
||||
{{ end }}
|
||||
{{ $host := "$node_ip" }}
|
||||
{{ $port := .Values.fireflyNetwork.webPort }}
|
||||
{{ with .Values.fireflyConfig.appUrl }}
|
||||
{{ $host = . | trimPrefix "http://" | trimPrefix "https://" | trimSuffix "/" }}
|
||||
{{ if contains ":" $host }}
|
||||
{{ $port = (split ":" $host)._1 }}
|
||||
{{ $host = (split ":" $host)._0 }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: portal
|
||||
data:
|
||||
port: {{ $port | quote }}
|
||||
path: "/"
|
||||
protocol: {{ $prot }}
|
||||
host: {{ $host }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- define "postgres.workload" -}}
|
||||
workload:
|
||||
{{- include "ix.v1.common.app.postgres" (dict "secretName" "postgres-creds"
|
||||
"resources" .Values.resources
|
||||
"ixChartContext" .Values.ixChartContext) | nindent 2 }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- define "redis.workload" -}}
|
||||
workload:
|
||||
{{- include "ix.v1.common.app.redis" (dict "secretName" "redis-creds"
|
||||
"resources" .Values.resources) | nindent 2 }}
|
||||
|
||||
{{- end -}}
|
||||
50
library/ix-dev/community/firefly-iii/templates/_service.tpl
Normal file
50
library/ix-dev/community/firefly-iii/templates/_service.tpl
Normal file
@@ -0,0 +1,50 @@
|
||||
{{- define "firefly.service" -}}
|
||||
service:
|
||||
firefly:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: NodePort
|
||||
targetSelector: firefly
|
||||
ports:
|
||||
webui:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: {{ .Values.fireflyNetwork.webPort }}
|
||||
nodePort: {{ .Values.fireflyNetwork.webPort }}
|
||||
targetPort: 8080
|
||||
targetSelector: firefly
|
||||
firefly-importer:
|
||||
enabled: {{ .Values.fireflyConfig.enableImporter }}
|
||||
type: NodePort
|
||||
targetSelector: firefly-importer
|
||||
ports:
|
||||
webui:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: {{ .Values.fireflyNetwork.importerPort }}
|
||||
nodePort: {{ .Values.fireflyNetwork.importerPort }}
|
||||
targetPort: 8080
|
||||
targetSelector: firefly-importer
|
||||
redis:
|
||||
enabled: true
|
||||
type: ClusterIP
|
||||
targetSelector: redis
|
||||
ports:
|
||||
redis:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 6379
|
||||
targetPort: 6379
|
||||
targetSelector: redis
|
||||
# Postgres
|
||||
postgres:
|
||||
enabled: true
|
||||
type: ClusterIP
|
||||
targetSelector: postgres
|
||||
ports:
|
||||
postgres:
|
||||
enabled: true
|
||||
primary: true
|
||||
port: 5432
|
||||
targetSelector: postgres
|
||||
{{- end -}}
|
||||
18
library/ix-dev/community/firefly-iii/templates/common.yaml
Normal file
18
library/ix-dev/community/firefly-iii/templates/common.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- include "ix.v1.common.loader.init" . -}}
|
||||
|
||||
{{/* Merge the templates with Values */}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "firefly.configuration" $ | fromYaml) -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "firefly.service" $ | fromYaml) -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "firefly.persistence" $ | fromYaml) -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "firefly.workload" $ | fromYaml) -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "firefly.cron" $ | fromYaml) -}}
|
||||
{{- if .Values.fireflyConfig.enableImporter -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "firefly.importer" $ | fromYaml) -}}
|
||||
{{- end -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "postgres.workload" $ | fromYaml) -}}
|
||||
{{- $_ := mustMergeOverwrite .Values (include "redis.workload" $ | fromYaml) -}}
|
||||
|
||||
{{/* Create the configmap for portal manually*/}}
|
||||
{{- include "firefly.portal" $ -}}
|
||||
|
||||
{{- include "ix.v1.common.loader.apply" . -}}
|
||||
1
library/ix-dev/community/firefly-iii/upgrade_info.json
Normal file
1
library/ix-dev/community/firefly-iii/upgrade_info.json
Normal file
@@ -0,0 +1 @@
|
||||
{"filename": "values.yaml", "keys": ["image", "importerImage"]}
|
||||
38
library/ix-dev/community/firefly-iii/upgrade_strategy
Executable file
38
library/ix-dev/community/firefly-iii/upgrade_strategy
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/python3
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
||||
from catalog_update.upgrade_strategy import semantic_versioning
|
||||
|
||||
|
||||
RE_STABLE_VERSION = re.compile(r'version-[0-9]+\.[0-9]+\.[0-9]+')
|
||||
|
||||
|
||||
def newer_mapping(image_tags):
|
||||
output = {
|
||||
"tags": {},
|
||||
"app_version": ""
|
||||
}
|
||||
|
||||
for key in image_tags.keys():
|
||||
tags = {t.strip('version-'): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
|
||||
version = semantic_versioning(list(tags))
|
||||
if not version:
|
||||
continue
|
||||
|
||||
if key == 'image':
|
||||
output['app_version'] = version
|
||||
|
||||
output['tags'][key] = tags[version]
|
||||
|
||||
return output
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
versions_json = json.loads(sys.stdin.read())
|
||||
except ValueError:
|
||||
raise ValueError('Invalid json specified')
|
||||
|
||||
print(json.dumps(newer_mapping(versions_json)))
|
||||
61
library/ix-dev/community/firefly-iii/values.yaml
Normal file
61
library/ix-dev/community/firefly-iii/values.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
image:
|
||||
repository: fireflyiii/core
|
||||
pullPolicy: IfNotPresent
|
||||
tag: 'version-6.0.20'
|
||||
|
||||
importerImage:
|
||||
repository: fireflyiii/data-importer
|
||||
pullPolicy: IfNotPresent
|
||||
tag: 'version-1.3.5'
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu: 4000m
|
||||
memory: 8Gi
|
||||
|
||||
fireflyConfig:
|
||||
appUrl: http://localhost:30064
|
||||
additionalEnvs: []
|
||||
enableImporter: false
|
||||
additionalImporterEnvs: []
|
||||
|
||||
fireflyNetwork:
|
||||
webPort: 30064
|
||||
importerPort: 30065
|
||||
hostNetwork: false
|
||||
|
||||
fireflyStorage:
|
||||
uploads:
|
||||
type: ixVolume
|
||||
datasetName: uploads
|
||||
pgData:
|
||||
type: ixVolume
|
||||
hostPath: pgData
|
||||
pgBackup:
|
||||
type: ixVolume
|
||||
hostPath: pgBackup
|
||||
|
||||
|
||||
notes:
|
||||
custom: |
|
||||
{{- if .Values.fireflyConfig.enableImporter }}
|
||||
## Data Importer
|
||||
|
||||
You can reach data importer at http://<ip>:{{ .Values.fireflyNetwork.importerPort }}
|
||||
{{- end }}
|
||||
|
||||
## Database
|
||||
You can connect to the database using the pgAdmin App from the catalog
|
||||
|
||||
<details>
|
||||
<summary>Database Details</summary>
|
||||
|
||||
- Database: `firefly`
|
||||
- Username: `firefly`
|
||||
- Password: `{{ .Values.fireflyDbPass }}`
|
||||
- Host: `{{ .Values.fireflyDbHost }}.{{ .Release.Namespace }}.svc.cluster.local`
|
||||
- Port: `5432`
|
||||
|
||||
</details>
|
||||
{{- $_ := unset .Values "fireflyDbPass" }}
|
||||
{{- $_ := unset .Values "fireflyDbHost" }}
|
||||
Reference in New Issue
Block a user