try again

This commit is contained in:
Micke Nordin 2025-01-24 18:05:48 +01:00
parent 790480f443
commit 368a6021fe
5 changed files with 97 additions and 67 deletions

View file

@ -26,36 +26,40 @@ data:
), ),
), ),
'appstoreenabled' => false, 'appstoreenabled' => false,
'config_is_read_only' => false, 'config_is_read_only' => true,
'csrf.disabled' => true, 'csrf.disabled' => true,
'datadirectory' => '/var/www/html/data', 'datadirectory' => '/var/www/html/data',
'dbhost' => getenv('MYSQL_HOST_PORT'), 'dbhost' => '{{MYSQL_HOST}}:{{MYSQL_PORT}}',
'dbname' => getenv('MYSQL_DATABASE'), 'dbname' => '{{MYSQL_DATABASE}}',
'dbpassword' => getenv('MYSQL_PASSWORD'), 'dbpassword' => '{{MYSQL_PASSWORD}}',
'dbport' => getenv('MYSQL_PORT'), 'dbport' => '{{MYSQL_PORT}}',
'dbtableprefix' => 'oc_', 'dbtableprefix' => 'oc_',
'dbtype' => 'mysql', 'dbtype' => 'mysql',
'dbuser' => getenv('MYSQL_USER'), 'dbuser' => '{{MYSQL_USER}}',
'default_phone_region' => 'SE', 'default_phone_region' => 'SE',
'forcessl' => true, 'forcessl' => true,
'gs.enabled' => 'true', 'gs.enabled' => 'true',
'gs.federation' => 'global', 'gs.federation' => 'global',
'gs.trustedHosts' => ['*.sunet.se'], 'gs.trustedHosts' => ['*.sunet.se'],
'gss.jwt.key' => '{{GSS_JWT_KEY}}',
'gss.master.url' => '{{GSS_MASTER_URL}}',
'gss.mode' => 'slave',
'gss.user.discovery.module' => '\\OCA\\GlobalSiteSelector\\UserDiscoveryModules\\ManualUserMapping',
'installed' => true, 'installed' => true,
'instanceid' => getenv('NEXTCLOUD_INSTANCEID'), 'instanceid' => '{{NEXTCLOUD_INSTANCEID}}',
'integrity.check.disabled' => true, 'integrity.check.disabled' => true,
'log_type' => 'file', 'log_type' => 'file',
'loglevel' => 0, 'loglevel' => 0,
'lookup_server' => getenv('LOOKUP_SERVER'), 'lookup_server' => '{{LOOKUP_SERVER}}',
'mail_domain' => getenv('MAIL_DOMAIN'), 'mail_domain' => '{{MAIL_DOMAIN}}',
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 'mail_from_address' => '{{MAIL_FROM_ADDRESS}}',
'mail_sendmailmode' => 'smtp', 'mail_sendmailmode' => 'smtp',
'mail_smtpauth' => 1, 'mail_smtpauth' => 1,
'mail_smtpauthtype' => 'LOGIN', 'mail_smtpauthtype' => 'LOGIN',
'mail_smtphost' => getenv('MAIL_SMTPHOST'), 'mail_smtphost' => '{{MAIL_SMTPHOST}}',
'mail_smtpmode' => 'smtp', 'mail_smtpmode' => 'smtp',
'mail_smtpname' => getenv('MAIL_SMTPNAME'), 'mail_smtpname' => '{{MAIL_SMTPNAME}}',
'mail_smtppassword' => getenv('MAIL_SMTPPASSWORD'), 'mail_smtppassword' => '{{MAIL_SMTPPASSWORD}}',
'mail_smtpport' => '587', 'mail_smtpport' => '587',
'mail_smtpsecure' => 'tls', 'mail_smtpsecure' => 'tls',
'mail_template_class' => 'OCA\DriveEmailTemplate\EMailTemplate', 'mail_template_class' => 'OCA\DriveEmailTemplate\EMailTemplate',
@ -69,33 +73,33 @@ data:
'arguments' => 'arguments' =>
array ( array (
'autocreate' => false, 'autocreate' => false,
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 'bucket' => '{{OBJECTSTORE_S3_BUCKET}}',
'hostname' => getenv('OBJECTSTORE_S3_HOST'), 'hostname' => '{{OBJECTSTORE_S3_HOST}}',
'key' => getenv('OBJECTSTORE_S3_KEY'), 'key' => '{{OBJECTSTORE_S3_KEY}}',
'legacy_auth' => false, 'legacy_auth' => false,
'objectPrefix' => 'urn:oid:', 'objectPrefix' => 'urn:oid:',
'port' => '', 'port' => '',
'region' => getenv('OBJECTSTORE_S3_REGION'), 'region' => '{{OBJECTSTORE_S3_REGION}}',
'secret' => getenv('OBJECTSTORE_S3_SECRET'), 'secret' => '{{OBJECTSTORE_S3_SECRET}}',
'use_path_style' => true, 'use_path_style' => true,
'use_ssl' => true, 'use_ssl' => true,
), ),
), ),
'overwrite.cli.url' => 'https://' . getenv('SITE_NAME'), 'overwrite.cli.url' => 'https://{{SITE_NAME}}',
'overwritehost' => getenv('SITE_NAME'), 'overwritehost' => '{{SITE_NAME}}',
'overwriteprotocol' => 'https', 'overwriteprotocol' => 'https',
'passwordsalt' => getenv('NEXTCLOUD_PASSWORDSALT'), 'passwordsalt' => '{{NEXTCLOUD_PASSWORDSALT}}',
'secret' => getenv('NEXTCLOUD_SECRET'), 'secret' => '{{NEXTCLOUD_SECRET}}',
'redis' => 'redis' =>
array ( array (
'host' => getenv('REDIS_HOST'), 'host' => '{{REDIS_HOST}}',
'port' => 6379, 'port' => 6379,
), ),
'skeletondirectory' => '', 'skeletondirectory' => '',
'templatedirectory' => '', 'templatedirectory' => '',
'trusted_domains' => 'trusted_domains' =>
array ( array (
0 => getenv('NEXTCLOUD_TRUSTED_DOMAINS') 0 => '{{NEXTCLOUD_TRUSTED_DOMAINS}}'
), ),
'trusted_proxies' => 'trusted_proxies' =>
array ( array (
@ -107,5 +111,5 @@ data:
0 => 'admin', 0 => 'admin',
), ),
'updatechecker' => false, 'updatechecker' => false,
'version' => getenv('NEXTCLOUD_VERSION_STRING'), 'version' => '{{NEXTCLOUD_VERSION_STRING}}',
); );

View file

@ -11,6 +11,16 @@ spec:
app: customer-node app: customer-node
updateStrategy: updateStrategy:
type: RollingUpdate type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: nextcloud-data
spec:
storageClassName: csi-sc-cinderplugin
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
template: template:
metadata: metadata:
labels: labels:
@ -22,9 +32,9 @@ spec:
- name: customer - name: customer
image: docker.sunet.se/drive/nextcloud-custom:30.0.5.2-1 image: docker.sunet.se/drive/nextcloud-custom:30.0.5.2-1
volumeMounts: volumeMounts:
- name: nextcloud-config - name: nextcloud-data
mountPath: /config.php mountPath: /var/www/html/config/
subPath: config.php subPath: config
- name: apache-config - name: apache-config
mountPath: /etc/apache2/sites-enabled/000-default.conf mountPath: /etc/apache2/sites-enabled/000-default.conf
subPath: 000-default.conf subPath: 000-default.conf
@ -40,6 +50,42 @@ spec:
- name: cli-php-config - name: cli-php-config
mountPath: /etc/php/8.0/cli/php.ini mountPath: /etc/php/8.0/cli/php.ini
subPath: php.ini subPath: php.ini
resources:
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 1000m
memory: 512Mi
readinessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 10
periodSeconds: 60
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 20
periodSeconds: 180
ports:
- containerPort: 80
name: nextcloud-http
command: ["/bin/bash"]
args: ["-c", "apachectl -D FOREGROUND"]
lifecycle:
postStart:
exec:
command: ["/bin/bash", "-c", "/usr/local/bin/nc-upgrade"]
initContainers:
- image: docker.sunet.se/sunet/docker-jinja:latest
name: init-config
volumeMounts:
- name: nextcloud-config
mountPath: /tmp/config.php.template
subPath: config.php
- name: nextcloud-data
mountPath: /var/www/html/config
subPath: config
env: env:
- name: GSS_MASTER_URL - name: GSS_MASTER_URL
value: "https://drive.test.sunet.se" value: "https://drive.test.sunet.se"
@ -69,8 +115,6 @@ spec:
value: "nextcloud_customer" value: "nextcloud_customer"
- name: MYSQL_HOST - name: MYSQL_HOST
value: "proxysqlcluster.proxysql" value: "proxysqlcluster.proxysql"
- name: MYSQL_HOST_PORT
value: "proxysqlcluster.proxysql:6033"
- name: MYSQL_PASSWORD - name: MYSQL_PASSWORD
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
@ -130,32 +174,7 @@ spec:
value: "redis" value: "redis"
- name: SITE_NAME - name: SITE_NAME
value: "customer.drive.test.sunet.se" value: "customer.drive.test.sunet.se"
resources: command: ["/bin/bash", "-c", "/usr/bin/j2 -f env -o /var/www/html/config/config.php /tmp/config.php.template"]
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 1000m
memory: 512Mi
readinessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 10
periodSeconds: 60
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 20
periodSeconds: 180
ports:
- containerPort: 80
name: nextcloud-http
command: ["/bin/bash"]
args: ["-c", "apachectl -D FOREGROUND"]
lifecycle:
postStart:
exec:
command: ["/bin/bash", "-c", "/usr/local/bin/nc-upgrade"]
volumes: volumes:
- name: script-config - name: script-config
configMap: configMap:

View file

@ -5,10 +5,15 @@ metadata:
data: data:
nc-upgrade: | nc-upgrade: |
#!/bin/bash #!/bin/bash
cp /config.php /var/www/html/config/config.php sed "s/config_is_read_only\(.\) => true,/config_is_read_only\1 => false,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp
chown www-data:root /var/www/html/config/config.php mv /var/www/html/config/config.php.tmp /var/www/html/config/config.php
su - www-data -s /bin/bash -c "php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ upgrade" php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ app:disable globalsiteselector
su - www-data -s /bin/bash -c "php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:repair" php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ upgrade
su - www-data -s /bin/bash -c "php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ db:add-missing-primary-keys" php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ app:enable globalsiteselector
su - www-data -s /bin/bash -c "php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ db:add-missing-columns" php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:repair
su - www-data -s /bin/bash -c "php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ db:add-missing-indices" php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:mode --off
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ db:add-missing-primary-keys
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ db:add-missing-columns
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ db:add-missing-indices
sed "s/config_is_read_only\(.\) => false,/config_is_read_only\1 => true,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp
mv /var/www/html/config/config.php.tmp /var/www/html/config/config.php

View file

@ -11,8 +11,9 @@ spec:
labels: labels:
app: customer-node app: customer-node
spec: spec:
containers: initContainers:
- name: customer - image: docker.sunet.se/sunet/docker-jinja:latest
name: init-config
env: env:
- name: MYSQL_DATABASE - name: MYSQL_DATABASE
value: "nextcloud_nordunet" value: "nextcloud_nordunet"

View file

@ -10,8 +10,9 @@ spec:
labels: labels:
app: customer-node app: customer-node
spec: spec:
containers: initContainers:
- name: customer - image: docker.sunet.se/sunet/docker-jinja:latest
name: init-config
env: env:
- name: MYSQL_DATABASE - name: MYSQL_DATABASE
value: "nextcloud_vinnova" value: "nextcloud_vinnova"