fix(projectsend): init db (#2248)
This commit is contained in:
parent
0438cc2993
commit
1461dc41de
|
@ -1,7 +1,7 @@
|
|||
apiVersion: v2
|
||||
kubeVersion: ">=1.16.0-0"
|
||||
name: projectsend
|
||||
version: 1.0.4
|
||||
version: 1.0.5
|
||||
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.
|
||||
type: application
|
||||
|
@ -15,7 +15,10 @@ dependencies:
|
|||
- name: common
|
||||
repository: https://truecharts.org
|
||||
version: 9.1.8
|
||||
# condition:
|
||||
- condition: mariadb.enabled
|
||||
name: mariadb
|
||||
repository: https://truecharts.org/
|
||||
version: 2.0.7
|
||||
maintainers:
|
||||
- email: info@truecharts.org
|
||||
name: TrueCharts
|
||||
|
|
|
@ -90,6 +90,20 @@ questions:
|
|||
type: int
|
||||
required: true
|
||||
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}
|
||||
|
||||
- variable: service
|
||||
|
|
|
@ -13,6 +13,8 @@ podSecurityContext:
|
|||
|
||||
env:
|
||||
MAX_UPLOAD: 5000
|
||||
PHP_MEMORY_LIMIT: "512M"
|
||||
PHP_MAX_FILE_UPLOAD: 200
|
||||
|
||||
service:
|
||||
main:
|
||||
|
@ -25,5 +27,65 @@ persistence:
|
|||
config:
|
||||
enabled: true
|
||||
mountPath: "/config"
|
||||
data:
|
||||
enabled: true
|
||||
mountPath: "/data"
|
||||
varrun:
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue