feat(piwigo) configure piwigo mariadb and admin credentials (#10444)

**Description**
Configure admin credentials and mariadb sidecar
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [X] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ 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-15 13:29:18 -04:00
committed by GitHub
parent e7855acf60
commit b51fbb0f0c
3 changed files with 67 additions and 2 deletions

View File

@@ -4,6 +4,10 @@ dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 12.14.6
- condition: mariadb.enabled
name: mariadb
repository: https://deps.truecharts.org/
version: 7.0.62
description: A photo gallery software for the web.
home: https://truecharts.org/charts/incubator/piwigo
icon: https://truecharts.org/img/hotlink-ok/chart-icons/piwigo.png
@@ -23,7 +27,7 @@ sources:
- http://piwigo.org/
- https://github.com/linuxserver/docker-piwigo
type: application
version: 6.0.0
version: 6.1.0
annotations:
truecharts.org/catagories: |
- media

View File

@@ -14,6 +14,42 @@ questions:
# Include{containerBasic}
# Include{containerAdvanced}
- variable: piwigo
group: App Configuration
label: Piwigo Configuration
schema:
additional_attrs: true
type: dict
attrs:
- variable: language
label: Language
description: Set the initial Language
schema:
type: string
default: "en_US"
- variable: admin_user
label: Admin user
description: Set the initial admin user
schema:
type: string
required: true
default: ""
- variable: admin_pass
label: Admin Password
description: Set the initial admin password
schema:
type: string
required: true
private: true
default: ""
- variable: admin_email
label: Admin Email
description: Set the initial admin email
schema:
type: string
required: true
default: ""
# Include{containerConfig}
# Include{serviceRoot}
- variable: main

View File

@@ -17,12 +17,32 @@ service:
targetPort: 80
port: 10027
piwigo:
language: en_US
admin_user: admin
admin_pass: admin123
admin_email: admin@email.com
workload:
main:
podSpec:
containers:
main:
env: {}
lifecycle:
postStart:
type: exec
command:
- /bin/sh
- -c
- |
if [ -f "/config/POSTSETUP" ]; then
echo "POSTSETUP exists, no further action is needed."
else
while ! curl -s -o -v /dev/null http://localhost/install.php; do sleep 1; done && \
curl -v -X POST -d "language={{ .Values.piwigo.language }}&dbhost={{ .Values.mariadb.creds.plainhost | trimAll "\"" }}:3306&dbuser={{ .Values.mariadb.mariadbUsername }}&dbpasswd={{ .Values.mariadb.creds.mariadbPassword | trimAll "\"" }}&dbname={{ .Values.mariadb.mariadbDatabase }}&prefix=piwigo_&admin_name={{ .Values.piwigo.admin_user }}&admin_pass1={{ .Values.piwigo.admin_pass }}&admin_pass2={{ .Values.piwigo.admin_pass }}&admin_mail={{ .Values.piwigo.admin_email }}&install=Start+installation" http://localhost/install.php && \
( touch "/config/POSTSETUP" && echo "Created POSTSETUP!") || \
( echo "Failed to create POSTSETUP file..." && exit 1 )
fi
persistence:
config:
@@ -36,6 +56,11 @@ persistence:
varrun:
enabled: true
mariadb:
enabled: true
mariadbUsername: piwigo
mariadbDatabase: piwigo
portal:
open:
enabled: true