|
1 | | -# Rsync - Docker mod for openssh-server |
| 1 | +# nextcloud-notify-push - Docker mod for Nextcloud |
2 | 2 |
|
3 | | -This mod adds rsync to openssh-server, to be installed/updated during container start. |
| 3 | +This mod adds a service to start the [notify-push](https://github.com/nextcloud/notify_push) binary. |
4 | 4 |
|
5 | | -In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync` |
| 5 | +## Requirements |
6 | 6 |
|
7 | | -If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2` |
| 7 | +- Redis configured in your config.php |
8 | 8 |
|
9 | | -# Mod creation instructions |
| 9 | +## Setup |
10 | 10 |
|
11 | | -* Fork the repo, create a new branch based on the branch `template`. |
12 | | -* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done. |
13 | | -* Inspect the `root` folder contents. Edit, add and remove as necessary. |
14 | | -* After all init scripts and services are created, run `find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print -exec chmod +x {} +` to fix permissions. |
15 | | -* Edit this readme with pertinent info, delete these instructions. |
16 | | -* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed. |
17 | | -* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch. |
18 | | -* Submit PR against the branch created by the team. |
| 11 | +1. Download and install the "client-push" (``notify-push``) app from the Nextcloud store. |
19 | 12 |
|
| 13 | +2. Add ``DOCKER_MODS=linuxserver/mods:nextcloud-notify-push`` to your env. |
20 | 14 |
|
21 | | -## Tips and tricks |
| 15 | +3. notify_push should be running and ``**** Starting notify-push ****`` appear in the log. Also check for errors. |
22 | 16 |
|
23 | | -* Some images have helpers built in, these images are currently: |
24 | | - * [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files) |
25 | | - * [Code-server](https://github.com/linuxserver/docker-code-server/pull/95) |
| 17 | +4. [Configure your reverse proxy for notify push.](https://github.com/nextcloud/notify_push#reverse-proxy) |
| 18 | + |
| 19 | +5. run ``occ notify_push:setup https://cloud.example.org/push`` to test and enable notify-push, replace "*cloud.example.org*" with your domain. |
| 20 | + |
| 21 | +### Traefik configuration |
| 22 | + |
| 23 | +notify-push listens on its own port, therefore we need to to forward all traffic under example.org/push/* to port 7867. |
| 24 | + |
| 25 | +We need to add an additional router and service to the container. Having more than one router requires to explicitly configure more options. Additionally a new middleware to strip the /push prefix. |
| 26 | + |
| 27 | +Replace "*cloud.example.org*" for both routers with your domain! |
| 28 | + |
| 29 | +#### Before |
| 30 | + |
| 31 | +```yaml |
| 32 | + ... |
| 33 | + labels: |
| 34 | + - "traefik.enable=true" |
| 35 | + - "traefik.http.routers.nextcloud.entryPoints=https" |
| 36 | + - "traefik.http.routers.nextcloud.rule=Host(`cloud.example.org`)" |
| 37 | + - "traefik.http.services.nextcloud.loadbalancer.server.port=443" |
| 38 | +``` |
| 39 | + |
| 40 | +#### After |
| 41 | + |
| 42 | +```yaml |
| 43 | + ... |
| 44 | + labels: |
| 45 | + # Nextcloud |
| 46 | + - "traefik.enable=true" |
| 47 | + - "traefik.http.routers.nextcloud.entryPoints=https" |
| 48 | + - "traefik.http.routers.nextcloud.rule=Host(`cloud.example.org`)" |
| 49 | + - "traefik.http.services.nextcloud.loadbalancer.server.port=443" |
| 50 | + # add service |
| 51 | + - "traefik.http.routers.nextcloud.service=nextcloud" |
| 52 | + |
| 53 | + #Notify-push |
| 54 | + # forward cloud.example.org/push/* |
| 55 | + - "traefik.http.routers.nextcloud_push.rule=Host(`cloud.example.org`) && PathPrefix(`/push`)" |
| 56 | + # entry point |
| 57 | + - "traefik.http.routers.nextcloud_push.entryPoints=https" |
| 58 | + # set protocol to http |
| 59 | + - "traefik.http.services.nextcloud_push.loadbalancer.server.scheme=http" |
| 60 | + # set port |
| 61 | + - "traefik.http.services.nextcloud_push.loadbalancer.server.port=7867" |
| 62 | + # use middleware |
| 63 | + - "traefik.http.routers.nextcloud_push.middlewares=nextcloud_strip_push" |
| 64 | + # define middleware |
| 65 | + - "traefik.http.middlewares.nextcloud_strip_push.stripprefix.prefixes=/push" |
| 66 | + # add service |
| 67 | + - "traefik.http.routers.nextcloud_push.service=nextcloud_push" |
| 68 | + |
| 69 | +``` |
| 70 | + |
| 71 | +## Validation |
| 72 | + |
| 73 | +1. Read the section about the [Test client](https://github.com/nextcloud/notify_push#test-client). Create an app password and connect to your server |
| 74 | + |
| 75 | + ```sh |
| 76 | + test_client https://cloud.example.com username password |
| 77 | + ``` |
| 78 | + |
| 79 | +2. Run ``occ notify_push:metrics``. Step 1 can be skipped if real clients are already connected. |
| 80 | + |
| 81 | + ```sh |
| 82 | + root@1d0f9bf7fff9:/# occ notify_push:metrics |
| 83 | + Active connection count: 2 |
| 84 | + Active user count: 1 |
| 85 | + Total connection count: 5 |
| 86 | + Total database query count: 1 |
| 87 | + Events received: 13 |
| 88 | + Messages sent: 3 |
| 89 | + ``` |
0 commit comments