Skip to content

Commit f555197

Browse files
authored
Merge branch 'main' into feat/notify_push
Signed-off-by: Jesse Hitch <jessebot@linux.com>
2 parents 2ac42ad + bf6cc4a commit f555197

17 files changed

Lines changed: 320 additions & 311 deletions

.github/pull_request_template.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Pull Request
2-
31
## Description of the change
42

53
<!-- Describe the scope of your change - i.e. what the change does. -->
@@ -23,6 +21,7 @@
2321

2422
## Checklist <!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->
2523

24+
- [ ] I have read the [CONTRIBUTING.md](https://github.com/nextcloud/helm/blob/main/CONTRIBUTING.md#pull-requests) doc.
2625
- [ ] DCO has been [signed off on the commit](https://docs.github.com/en/github/authenticating-to-github/signing-commits).
2726
- [ ] Chart version bumped in `Chart.yaml` according to [semver](http://semver.org/).
28-
- [ ] (optional) Variables are documented in the README.md
27+
- [ ] (optional) Parameters are documented in the README.md

.github/workflows/lint-test.yaml

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- 'charts/nextcloud/templates/**'
2323
2424
lint:
25-
runs-on: ubuntu-22.04
25+
runs-on: ubuntu-latest-low
2626
needs: changes
2727
if: needs.changes.outputs.src != 'false'
2828
steps:
@@ -56,10 +56,32 @@ jobs:
5656
if: steps.list-changed.outputs.changed == 'true'
5757
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
5858

59-
test-internal-database:
59+
run-tests:
6060
runs-on: ubuntu-22.04
6161
needs: [changes, lint]
62+
# only run this job if there are helm chart file changes
6263
if: needs.changes.outputs.src != 'false'
64+
strategy:
65+
# continue with all the other jobs even if one fails
66+
fail-fast: false
67+
matrix:
68+
# each item in this list is a job with an isolated test VM
69+
test_cases:
70+
# test the plain helm chart with nothing changed
71+
- name: 'Default - no custom values'
72+
73+
# test the helm chart with postgresql subchart enabled
74+
- name: PostgreSQL Enabled
75+
helm_args: '--helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing12345"'
76+
77+
# test the helm chart with nginx container enabled
78+
- name: Nginx Enabled
79+
helm_args: '--helm-extra-set-args "--set=image.flavor=fpm --set=nginx.enabled=true"'
80+
81+
# test the helm chart with horizontal pod autoscaling enabled
82+
- name: Horizontal Pod Autoscaling Enabled
83+
helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"'
84+
6385
steps:
6486
- name: Checkout
6587
uses: actions/checkout@v4
@@ -90,48 +112,15 @@ jobs:
90112
uses: helm/kind-action@v1.10.0
91113
if: steps.list-changed.outputs.changed == 'true'
92114

93-
- name: Run chart-testing (install)
115+
- name: Run chart-testing (install ${{ matrix.test_cases.name }})
94116
id: install
95117
if: steps.list-changed.outputs.changed == 'true'
96-
run: ct install --target-branch ${{ github.event.repository.default_branch }}
118+
run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }}
97119

98-
test-postgresql-database:
99-
runs-on: ubuntu-22.04
100-
needs: [changes, lint]
101-
if: needs.changes.outputs.src != 'false'
120+
summary:
121+
runs-on: ubuntu-latest-low
122+
needs: [changes, run-tests]
123+
if: always()
102124
steps:
103-
- name: Checkout
104-
uses: actions/checkout@v4
105-
with:
106-
fetch-depth: 0
107-
108-
- name: Install Helm
109-
uses: azure/setup-helm@v4
110-
with:
111-
version: v3.14.4
112-
113-
- name: Add dependency chart repos
114-
run: |
115-
helm repo add bitnami https://charts.bitnami.com/bitnami
116-
117-
- name: Set up chart-testing
118-
uses: helm/chart-testing-action@v2.6.1
119-
120-
- name: Run chart-testing (list-changed)
121-
id: list-changed
122-
run: |
123-
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
124-
if [[ -n "$changed" ]]; then
125-
echo "changed=true" >> "$GITHUB_OUTPUT"
126-
fi
127-
128-
- name: Create kind cluster
129-
uses: helm/kind-action@v1.10.0
130-
if: steps.list-changed.outputs.changed == 'true'
131-
132-
- name: Run chart-testing (install)
133-
id: install
134-
if: steps.list-changed.outputs.changed == 'true'
135-
run: |
136-
ct install --target-branch ${{ github.event.repository.default_branch }} \
137-
--helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing123456"
125+
- name: Summary
126+
run: if ${{ needs.changes.outputs.src != 'false' && needs.run-tests.result != 'success' }}; then exit 1; fi

charts/nextcloud/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: nextcloud
3-
version: 5.3.0
4-
appVersion: 29.0.3
3+
version: 5.4.0
4+
appVersion: 29.0.4
55
description: A file sharing server that puts the control and security of your own data back into your hands.
66
keywords:
77
- nextcloud

charts/nextcloud/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,24 @@ helm install my-release nextcloud/nextcloud
2222
* [Cron jobs](#cron-jobs)
2323
* [Multiple config.php file](#multiple-configphp-file)
2424
* [Using nginx](#using-nginx)
25+
* [Service discovery with nginx and ingress](#service-discovery-with-nginx-and-ingress)
2526
* [Preserving Source IP](#preserving-source-ip)
2627
* [Hugepages](#hugepages)
2728
* [HPA (Clustering)](#hpa-clustering)
29+
* [Adjusting PHP ini values](#adjusting-php-ini-values)
2830
* [Running `occ` commands](#running-occ-commands)
2931
* [Putting Nextcloud into maintanence mode](#putting-nextcloud-into-maintanence-mode)
3032
* [Downloading models for recognize](#downloading-models-for-recognize)
3133
* [Backups](#backups)
3234
* [Upgrades](#upgrades)
3335
* [Troubleshooting](#troubleshooting)
36+
* [Logging](#logging)
37+
* [Changing the logging behavior](#changing-the-logging-behavior)
38+
* [Viewing the logs](#viewing-the-logs)
39+
* [Exec into the kubernetes pod:](#exec-into-the-kubernetes-pod)
40+
* [Then look for the `nextcloud.log` file with tail or cat:](#then-look-for-the-nextcloudlog-file-with-tail-or-cat)
41+
* [Copy the log file to your local machine:](#copy-the-log-file-to-your-local-machine)
42+
* [Sharing the logs](#sharing-the-logs)
3443

3544
## Introduction
3645

@@ -194,14 +203,15 @@ The following table lists the configurable parameters of the nextcloud chart and
194203
| `startupProbe.timeoutSeconds` | When the probe times out | `5` |
195204
| `startupProbe.failureThreshold` | Minimum consecutive failures for the probe | `30` |
196205
| `startupProbe.successThreshold` | Minimum consecutive successes for the probe | `1` |
197-
| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler | `false` |
206+
| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler. If set to `true`, ignores `replicaCount`. | `false` |
198207
| `hpa.cputhreshold` | CPU threshold percent for the HorizontalPodAutoscale | `60` |
199208
| `hpa.minPods` | Min. pods for the Nextcloud HorizontalPodAutoscaler | `1` |
200209
| `hpa.maxPods` | Max. pods for the Nextcloud HorizontalPodAutoscaler | `10` |
201210
| `deploymentLabels` | Labels to be added at 'deployment' level | not set |
202211
| `deploymentAnnotations` | Annotations to be added at 'deployment' level | not set |
203212
| `podLabels` | Labels to be added at 'pod' level | not set |
204213
| `podAnnotations` | Annotations to be added at 'pod' level | not set |
214+
| `dnsConfig` | Custom dnsConfig for nextcloud containers | `{}` |
205215

206216

207217
### Database Configurations
@@ -494,6 +504,20 @@ persistence:
494504
accessMode: ReadWriteMany
495505
```
496506
507+
## Adjusting PHP ini values
508+
509+
Sometimes you may need special [`php.ini`](https://www.php.net/manual/en/ini.list.php) values. For instance, perhaps your setup requires a bit more memory. You can add additional `php.ini` files in the values.yaml by providing `nextcloud.phpConfigs.NAME_OF_FILE`. Here's an examples:
510+
511+
```yaml
512+
nextcloud:
513+
phpConfigs:
514+
zz-memory_limit.ini: |-
515+
memory_limit=512M
516+
```
517+
518+
> [!Note]
519+
> Be sure to prefix your file name with `zz` to ensure it is loaded at the end.
520+
497521
498522
## Running `occ` commands
499523
Sometimes you need to run an [occ](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) command on the Nextcloud container directly. You can do that by running commands as the user `www-data` via the `kubectl exec` command.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# line below if for Apache 2.4
2+
<ifModule mod_authz_core.c>
3+
Require all denied
4+
</ifModule>
5+
# line below if for Apache 2.2
6+
<ifModule !mod_authz_core.c>
7+
deny from all
8+
</ifModule>
9+
# section for Apache 2.2 and 2.4
10+
<ifModule mod_autoindex.c>
11+
IndexIgnore *
12+
</ifModule>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$CONFIG = array (
3+
'htaccess.RewriteBase' => '/',
4+
);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$CONFIG = array (
3+
'memcache.local' => '\OC\Memcache\APCu',
4+
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
$CONFIG = array (
3+
"apps_paths" => array (
4+
0 => array (
5+
"path" => OC::$SERVERROOT."/apps",
6+
"url" => "/apps",
7+
"writable" => false,
8+
),
9+
1 => array (
10+
"path" => OC::$SERVERROOT."/custom_apps",
11+
"url" => "/custom_apps",
12+
"writable" => true,
13+
),
14+
),
15+
);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
$autoconfig_enabled = false;
3+
if (getenv('SQLITE_DATABASE')) {
4+
$AUTOCONFIG["dbtype"] = "sqlite";
5+
$AUTOCONFIG["dbname"] = getenv('SQLITE_DATABASE');
6+
$autoconfig_enabled = true;
7+
} elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
8+
$AUTOCONFIG["dbtype"] = "mysql";
9+
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
10+
$AUTOCONFIG["dbuser"] = getenv('MYSQL_USER');
11+
$AUTOCONFIG["dbpass"] = getenv('MYSQL_PASSWORD');
12+
$AUTOCONFIG["dbhost"] = getenv('MYSQL_HOST');
13+
$autoconfig_enabled = true;
14+
} elseif (getenv('POSTGRES_DB') && getenv('POSTGRES_USER') && getenv('POSTGRES_PASSWORD') && getenv('POSTGRES_HOST')) {
15+
$AUTOCONFIG["dbtype"] = "pgsql";
16+
$AUTOCONFIG["dbname"] = getenv('POSTGRES_DB');
17+
$AUTOCONFIG["dbuser"] = getenv('POSTGRES_USER');
18+
$AUTOCONFIG["dbpass"] = getenv('POSTGRES_PASSWORD');
19+
$AUTOCONFIG["dbhost"] = getenv('POSTGRES_HOST');
20+
$autoconfig_enabled = true;
21+
}
22+
if ($autoconfig_enabled) {
23+
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
24+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
if (getenv('REDIS_HOST')) {
3+
$CONFIG = array (
4+
'memcache.distributed' => '\OC\Memcache\Redis',
5+
'memcache.locking' => '\OC\Memcache\Redis',
6+
'redis' => array(
7+
'host' => getenv('REDIS_HOST'),
8+
'port' => getenv('REDIS_HOST_PORT') ?: 6379,
9+
{{- if .Values.redis.auth.enabled }}
10+
'password' => getenv('REDIS_HOST_PASSWORD'),
11+
{{- end }}
12+
),
13+
);
14+
}

0 commit comments

Comments
 (0)