fix(projectsend): init db (#2248)

This commit is contained in:
Stavros Kois 2022-03-23 07:25:55 +02:00 committed by GitHub
parent 0438cc2993
commit 1461dc41de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 81 additions and 2 deletions

View File

@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
name: projectsend name: projectsend
version: 1.0.4 version: 1.0.5
appVersion: "2021.12.10" appVersion: "2021.12.10"
description: Projectsend is a self-hosted application that lets you upload files and assign them to specific clients that you create yourself. description: Projectsend is a self-hosted application that lets you upload files and assign them to specific clients that you create yourself.
type: application type: application
@ -15,7 +15,10 @@ dependencies:
- name: common - name: common
repository: https://truecharts.org repository: https://truecharts.org
version: 9.1.8 version: 9.1.8
# condition: - condition: mariadb.enabled
name: mariadb
repository: https://truecharts.org/
version: 2.0.7
maintainers: maintainers:
- email: info@truecharts.org - email: info@truecharts.org
name: TrueCharts name: TrueCharts

View File

@ -90,6 +90,20 @@ questions:
type: int type: int
required: true required: true
default: 5000 default: 5000
- variable: PHP_MEMORY_LIMIT
label: "PHP_MEMORY_LIMIT"
description: "PHP_MEMORY_LIMIT"
schema:
type: string
required: true
default: "512M"
- variable: PHP_MAX_FILE_UPLOAD
label: "PHP_MAX_FILE_UPLOAD"
description: "PHP_MAX_FILE_UPLOAD"
schema:
type: int
required: true
default: 200
# Include{containerConfig} # Include{containerConfig}
- variable: service - variable: service

View File

@ -13,6 +13,8 @@ podSecurityContext:
env: env:
MAX_UPLOAD: 5000 MAX_UPLOAD: 5000
PHP_MEMORY_LIMIT: "512M"
PHP_MAX_FILE_UPLOAD: 200
service: service:
main: main:
@ -25,5 +27,65 @@ persistence:
config: config:
enabled: true enabled: true
mountPath: "/config" mountPath: "/config"
data:
enabled: true
mountPath: "/data"
varrun: varrun:
enabled: true enabled: true
mariadb:
enabled: true
mariadbUsername: projectsend
mariadbDatabase: projectsend
existingSecret: "mariadbcreds"
installContainers:
initconfig:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
env:
- name: DBNAME
value: "{{ .Values.mariadb.mariadbDatabase }}"
- name: DBUSER
value: "{{ .Values.mariadb.mariadbUsername }}"
- name: DBPASS
valueFrom:
secretKeyRef:
name: mariadbcreds
key: mariadb-password
- name: DBHOST
valueFrom:
secretKeyRef:
name: mariadbcreds
key: plainhost
volumeMounts:
- name: config
mountPath: "/config"
command: ["/bin/sh", "-c"]
args:
- >
export configFile="/config/projectsend/sys.config.php";
if [ ! -f $configFile ];
then
echo "Creating initial config file...";
mkdir -p /config/projectsend
touch $configFile;
echo "<?php" >> $configFile
echo "# This is generated on initial setup of this TrueCharts App" >> $configFile;
echo "# Do not change below values, or DB connection will fail." >> $configFile
echo "define('DB_DRIVER', 'mysql');" >> $configFile;
echo "define('DB_NAME', '$DBNAME');" >> $configFile;
echo "define('DB_HOST', '$DBHOST');" >> $configFile;
echo "define('DB_USER', '$DBUSER');" >> $configFile;
echo "define('DB_PASSWORD', '$DBPASS');" >> $configFile;
echo "define('TABLES_PREFIX', 'tbl_');" >> $configFile;
echo "# You can manually change below values if you like." >> $configFile
echo "define('SITE_LANG', 'en');" >> $configFile;
echo "define('MAX_FILESIZE',2048);" >> $configFile;
echo "define('EMAIL_ENCODING', 'utf-8');" >> $configFile;
echo "define('DEBUG', false);" >> $configFile;
echo "# End of generated config values." >> $configFile;
echo "Done!";
else
echo "Initial config file already exists. Skipping...";
fi;