migrate(photoview) migrate photoview to new common (#10086)

**Description**
clean up the gui, migrated to new common, added the cache storage option
to the gui.

⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [X] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [X] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [X] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Xstar97TheNoob 2023-07-03 16:26:49 -04:00 committed by GitHub
parent ae16b616e9
commit db4132275d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 66 additions and 38 deletions

View File

@ -3,11 +3,7 @@ appVersion: "2.3.13"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.1.2
- condition: postgresql.enabled
name: postgresql
repository: https://deps.truecharts.org/
version: 11.0.31
version: 12.14.6
description: Photoview is a simple and user-friendly photo gallery.
home: https://truecharts.org/charts/incubator/photoview
icon: https://truecharts.org/img/hotlink-ok/chart-icons/photoview.png
@ -23,7 +19,7 @@ name: photoview
sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/photoview
- https://github.com/photoview/photoview
version: 8.0.0
version: 9.0.0
annotations:
truecharts.org/catagories: |
- media

View File

@ -7,7 +7,6 @@ Under `Security and Permissions`
- Check `Show Advanced Security Settings`
- Uncheck `ReadOnly Root Filesystem`
- Uncheck `runAsNonRoot`
Under `Pod Security Context`

View File

@ -11,8 +11,6 @@ questions:
# Include{podSpec}
# Include{containerMain}
# Docker specific env
- variable: env
group: "App Configuration"
label: "Image Environment"
@ -26,6 +24,7 @@ questions:
schema:
type: string
default: ""
private: true
- variable: PHOTOVIEW_DISABLE_FACE_RECOGNITION
label: "Disable Face Recognition"
description: "Completely disable face recognition and hide the icon from the side menu."
@ -44,18 +43,21 @@ questions:
schema:
type: boolean
default: false
- variable: PHOTOVIEW_LISTEN_IP
label: PhotoView Listen IP
schema:
type: string
required: true
$ref:
- definitions/nodeIP
# Include{containerBasic}
# Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot}
- variable: main
label: "Main Service"
description: "The Primary service on which the healthcheck runs, often the webUI"
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceMain}
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
@ -75,8 +77,16 @@ questions:
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: cache
label: "App Cache Storage"
description: "Stores the Application Cache."
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
- variable: photos
label: "Photos Storage"
label: "App Photos Storage"
description: "Stores the Application Photos."
schema:
additional_attrs: true

View File

@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@ -0,0 +1,6 @@
{{/* Define the secrets */}}
{{- define "photoview.secrets" -}}
enabled: true
data:
PHOTOVIEW_POSTGRES_URL: {{ (printf "%s?client_encoding=utf8" (.Values.cnpg.main.creds.std | trimAll "\"")) | quote }}
{{- end -}}

View File

@ -1 +1,11 @@
{{ include "tc.common.loader.all" . }}
{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . }}
{{/* Render secrets for photoview */}}
{{- $secrets := include "photoview.secrets" . | fromYaml -}}
{{- if $secrets -}}
{{- $_ := set .Values.secret "secrets" $secrets -}}
{{- end -}}
{{/* Render the templates */}}
{{ include "tc.v1.common.loader.apply" . }}

View File

@ -3,25 +3,30 @@ image:
tag: 2.3.13@sha256:2df4e8e7a7f9b15e7d4af8d3b85d20c37434cb8503f04f48c50d30f1982a757b
pullPolicy: IfNotPresent
env:
PHOTOVIEW_DATABASE_DRIVER: "postgres"
PHOTOVIEW_LISTEN_PORT: "{{ .Values.service.main.ports.main.targetPort }}"
PHOTOVIEW_MEDIA_CACHE: "/cache"
MAPBOX_TOKEN: ""
PHOTOVIEW_DISABLE_FACE_RECOGNITION: false
PHOTOVIEW_DISABLE_VIDEO_ENCODING: false
PHOTOVIEW_DISABLE_RAW_PROCESSING: false
PHOTOVIEW_POSTGRES_URL:
secretKeyRef:
name: dbcreds
key: url
service:
main:
ports:
main:
port: 10159
targetPort: 10159
workload:
main:
podSpec:
containers:
main:
env:
PHOTOVIEW_LISTEN_PORT: "{{ .Values.service.main.ports.main.port }}"
PHOTOVIEW_LISTEN_IP: "127.0.0.1"
PHOTOVIEW_DATABASE_DRIVER: "postgres"
PHOTOVIEW_MEDIA_CACHE: "/cache"
MAPBOX_TOKEN: ""
PHOTOVIEW_DISABLE_FACE_RECOGNITION: false
PHOTOVIEW_DISABLE_VIDEO_ENCODING: false
PHOTOVIEW_DISABLE_RAW_PROCESSING: false
PHOTOVIEW_POSTGRES_URL:
secretKeyRef:
name: secrets
key: PHOTOVIEW_POSTGRES_URL
persistence:
# Don't use emptyDir, it stores, thumbnails and optimized media
@ -32,11 +37,12 @@ persistence:
enabled: true
mountPath: "/photos"
postgresql:
enabled: true
existingSecret: "dbcreds"
postgresqlUsername: photoview
postgresqlDatabase: photoview
cnpg:
main:
enabled: true
user: photoview
database: photoview
portal:
enabled: true
open:
enabled: true