-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nextcloud): add notify_push support #581
base: main
Are you sure you want to change the base?
Conversation
4c3cee5
to
46eb0e9
Compare
f5f716e
to
6ed673a
Compare
Can we ensure that the notify_push-plugin is installed? Maybe something like this? lifecycle:
postStart:
exec:
command: ["occ", "app:install notify_push"] And we have to active that plugin by running
|
I think it makes sense to give this option so the installation and setup is completely automatic, but I'd rather put it behind a second config flag: notify_push:
enabled: true
automatic_setup: true Maybe some people don't want to have this done automatically, so it's nice to give them the option. |
Therefore we has that hook of the container script (see #525), i write a ConfigMap for it. PS: the same way, then in #480 (@provokateurin you wanted to take a look there ...) PSS: Does somebody test this/my code? |
andre@server:~/k8s/nextcloud$ helm upgrade -n nextcloud akops-nextcloud -f values.yml ./helm/charts/nextcloud/
Error: UPGRADE FAILED: template: nextcloud/templates/notify_push/deployment.yaml:41:31: executing "nextcloud/templates/notify_push/deployment.yaml" at <$.Values.global.image.registry>: nil pointer evaluating interface {}.image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I remove the global-references, then I got this error:
andre@server:~/k8s/nextcloud$ helm upgrade -n nextcloud akops-nextcloud -f values.yml ./helm/charts/nextcloud/
Error: UPGRADE FAILED: YAML parse error on nextcloud/templates/notify_push/deployment.yaml: error converting YAML to JSON: yaml: line 41: did not find expected key
Oh sorry, that was a copy-paste error. |
I was able to try an install. The result was this: Configuring Redis as session handler
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
==> Running the script (cwd: /var/www/html): "/docker-entrypoint-hooks.d/before-starting/notify_push.sh"
notify_push already installed
✓ redis is configured
🗴 push server is not receiving redis messages (received 272721789, got 0)
==> Failed at executing "/docker-entrypoint-hooks.d/before-starting/notify_push.sh". Exit code: 1 EditI have a password for redis and it was not set. Can add this like this? - name: REDIS_URL
value: "redis://:<PASSWORD>@{{ template "nextcloud.redis.fullname" . }}-master:{{ .Values.redis.master.service.ports.redis }}" When I did this locally, then we have the chicken-egg-problem ... Maybe there is a better hook after nextcloud has started? |
With the fixed port, I still unable to run it. Logs from notify_push pod:
|
@wrenix I'm updated your push file to be |
d69d481
to
4e06db2
Compare
43ba133
to
fc97749
Compare
b73428e
to
fa34027
Compare
fa34027
to
4f953e2
Compare
I move the env handling back to the helper (and split it). So it should be review ready (and merge ready). I create an CHANGELOG.md for the Breaking Changes. |
3e0e0ca
to
a6d5be4
Compare
d5360ea
to
da98433
Compare
a6d5be4
to
bdd5610
Compare
Signed-off-by: Jesse Hitch <[email protected]> Signed-off-by: WrenIX <[email protected]>
Signed-off-by: WrenIX <[email protected]>
bdd5610
to
9f3e65a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks mostly good to me, but I have some reservations.
You should also add some documentation to the readme and update the values tables.
@jessebot can you also take a look?
@@ -0,0 +1,4 @@ | |||
#!/bin/sh | |||
/var/www/html/occ app:install notify_push | |||
/var/www/html/occ config:app:set notify_push base_endpoint --value="https://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded to https? This seems wrong to me.
Also accessing it through the external host shouldn't be necessary and wouldn't work if the port is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or alternatively the hostname in the container should be bent to localhost similar to https://github.com/NixOS/nixpkgs/blob/a23b0bdc68f56700d03aec9598eeeae6975f0ade/nixos/modules/services/web-apps/nextcloud-notify_push.nix#L138-L141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, but is this url not used by the nextcloud client? so a bent to localhost looks strange for me.
(i use the ingress.tls parameter to check if it is set ...)
charts/nextcloud/values.yaml
Outdated
# -- image of notify_push (there is no official image yet: https://github.com/nextcloud/notify_push/issues/106) | ||
repository: miles170/notify_push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel good to me, anything that is not at least semi-official (like the nextcloud docker image) is a risky dependency to add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand you, and i would prefer to change that.
For the current state:
- Tagged docker images & Docker Hub repo notify_push#106 on project it-self
i find that current solution okay (not all images are from nextcloud company, e.g. nextcloud-exporter for prometheus).
Maybe somebody from nextcloud could internal request for a official container ala nextcloud/notify_push#106
Or you could try the aio container: https://hub.docker.com/r/nextcloud/aio-notify-push/tags (which use a other container then notify-push itself )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try the AIO container? I'd be more comfortable with that, but if it doesn't work we can use this image for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this image has an strange behavour:
https://github.com/nextcloud/all-in-one/blob/main/Containers/notify-push/Dockerfile + https://github.com/nextcloud/all-in-one/blob/main/Containers/notify-push/start.sh
It runs on /nextcloud
data from another container with path:
/nextcloud/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push
It does not contain the notify_push binary (just shell scripts) ...
and a own / independent environment variable management.
Co-authored-by: Kate <[email protected]> Signed-off-by: WrenIX <[email protected]>
b4fcb1c
to
57b3806
Compare
@@ -0,0 +1,4 @@ | |||
#!/bin/sh | |||
/var/www/html/occ app:install notify_push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/var/www/html/occ app:install notify_push | |
/var/www/html/occ app:enable notify_push |
This will both install and enable the app. I'd expect that the app is automatically enabled, if it was disabled but installed previously.
/var/www/html/occ config:app:set notify_push base_endpoint --value="http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" | ||
# /var/www/html/occ notify_push:setup "http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
Does the command not work due to startup order creating a circular dependency?
Either way I don't think a commented out command is helpful, so please remove one of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is a startup circular dependency.
Should I write a comment instatt of removing it?
(So that other person would not change that could to use notify_push:setup
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please
ports: | ||
- name: metrics | ||
port: 9205 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the port changed? This could be an unintended and unnecessary breaking change for some setups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?:
The service port is independent of the pod port. I make it equal to the new notify_push port.
I choose 9100 to be equal with the node-exporter the most famous exporter. So more or less the default port of exporters ...
Breaking Change:
I do not know if it is really one. Prometheus access it on name and technical aspect like networkpolicy just look for pod-ports ... But yes, if any unknown service outside of that helm-chart use that service it is one.
For me, it does not matter which port I use here, so two option in announce Changelog or roll it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok fine, just add it to the changelog to avoid surprises.
{{- with .Values.notifyPush.redisURLEnv }} | ||
- name: "REDIS_URL" | ||
{{- toYaml . | nindent 14 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit ugly, a generic option like we already have for the server deployment would be nicer:
helm/charts/nextcloud/values.yaml
Lines 259 to 264 in 70403bc
extraEnv: | |
# - name: SOME_SECRET_ENV | |
# valueFrom: | |
# secretKeyRef: | |
# name: nextcloud | |
# key: secret_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm okay, I need to change the logic and would drop the fail check if something is set for redis.
# test the helm chart with notify push enabled | ||
- name: Notify Push Enabled | ||
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/notify_push.yaml"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we only test that the deployment succeeds, could we use the notify_push self-test check (or whatever it is called) to ensure it works correctly?
Or would that already be covered automatically because the deployments won't succeed otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I make some thoughts therefore.
(No there is no self-test at this moment)
Pull Request
Description of the change
Not yet tested
Benefits
Possible drawbacks
Applicable issues
Additional information
Checklist
Chart.yaml
according to semver.TODO