Le Tue, Apr 27, 2021 at 10:25:30AM +0200, Landry Breuil a écrit :
> Hi,
> 
> here's a wip for the serverside part of the nextcloud notify push
> (https://github.com/nextcloud/notify_push) service described at
> https://nextcloud.com/blog/nextcloud-faster-than-ever-introducing-files-high-performance-back-end/
> 
> it's a rust service providing a websocket pushing notifications to
> clients instead of clients continually hammering the server, there
> should be support for it in recent nextcloudclient versions, cf
> https://github.com/nextcloud/desktop/issues/2802
> 
> i havent tested it yet on openbsd, but i'm using it on nc 21 production
> instances on linux. support for it is not yet present in all client
> apps, but it works fine for notifications in the web interface.
> 
> potential improvements:
> - default to a unix socket to put in the www chroot ?
> - test with the chroot ?
> - improve the README and rc script ?
> - decide whether i should name the thing notify_push or
>   nextcloud_notify_push ?
> 
> this needs uid/gid 866 for _notify_push user/group in user.list:
> +866 _notify_push       _notify_push    www/nextcloud_notify_push
> 
> proofreading the README, testing and feedback welcome, ofc this requires
> nextcloud 21, and a recent commit from semarie on cargo.port.mk

now that i've tested it and it works, here's a new version, looking for
okays and testing. Feedback on the naming and the README welcome too.

changes:
- _notify_push user needs to be in www/67 group to be able to read
  nextcloud/config/config.php, so adapt the @newuser line and drop the
@newgroup line:
@newuser _notify_push:866:67:daemon:Nextcloud Notify Push 
daemon:/nonexistent:/sbin/nologin
- one cant easily use a unix socket in /var/www/run, because only root
  can write there. I dunno how to better handle that, besides creating a
subdir owned by _notify_push in the chroot. so default to binding to
127.0.0.1 is the way to go, unless someone has a better solution.
- this has a working rc.d script, also using daemon_logger to send
  stdout/stderr to syslog.

with nextcloudclient, i'm down from one PROPFIND request per synchronized
dir every 30s, to a single PROPFIND every minute. Less useless polling
:)

nextcloudclient debug log says:
2021-05-02 09:24:37:246 [ info nextcloud.gui.folder.manager ]:  Folders to 
sync: 3
2021-05-02 09:24:37:246 [ info nextcloud.gui.folder.manager ]:  Number of 
folders that don't use push notifications: 0

Landry

Attachment: nextcloud_notify_push_2.tgz
Description: application/tar-gz

Reply via email to