Skip to content

Commit 359fff9

Browse files
committed
initial commit
1 parent 9d6b690 commit 359fff9

File tree

23 files changed

+110
-101
lines changed

23 files changed

+110
-101
lines changed

.github/workflows/BuildImage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on: [push, pull_request_target, workflow_dispatch]
55
env:
66
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
77
ENDPOINT: "linuxserver/mods" #don't modify
8-
BASEIMAGE: "replace_baseimage" #replace
9-
MODNAME: "replace_modname" #replace
8+
BASEIMAGE: "nextcloud" #replace
9+
MODNAME: "notify-push" #replace
1010
MULTI_ARCH: "true" #set to false if not needed
1111

1212
jobs:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM scratch
44

5-
LABEL maintainer="username"
5+
LABEL maintainer="melonarc"
66

77
# copy local files
88
COPY root/ /

Dockerfile.complex

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,89 @@
1-
# Rsync - Docker mod for openssh-server
1+
# nextcloud-notify-push - Docker mod for Nextcloud
22

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.
44

5-
In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync`
5+
## Requirements
66

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
88

9-
# Mod creation instructions
9+
## Setup
1010

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.
1912

13+
2. Add ``DOCKER_MODS=linuxserver/mods:nextcloud-notify-push`` to your env.
2014

21-
## Tips and tricks
15+
3. notify_push should be running and ``**** Starting notify-push ****`` appear in the log. Also check for errors.
2216

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+
```

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/run

Lines changed: 0 additions & 30 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-add-package/up

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/run

Lines changed: 0 additions & 8 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/type

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-mod-imagename-modname-install/up

Lines changed: 0 additions & 1 deletion
This file was deleted.

root/etc/s6-overlay/s6-rc.d/svc-mod-imagename-modname/dependencies.d/init-services renamed to root/etc/s6-overlay/s6-rc.d/init-mod-nextcloud-notify-push/dependencies.d/init-services

File renamed without changes.

0 commit comments

Comments
 (0)