Skip to content

Configure HPB client push for Nextcloud snap

Marc edited this page Jun 15, 2024 · 22 revisions

HPB = High Performance Backend

The following configuration was tested on a fresh Ubuntu Server 22.04 LTS running on a x86_64 processor & on an Ubuntu Server 20.04 LTS running on an aarch64 processor. You need to adjust this steps depending on your OS.

Prepair FQDN / trusted proxy

Follow the instructions here.

Install

A. Install the Nextcloud app

Install the "Client Push" app via the App Store or via the cli:
sudo nextcloud.occ app:enable notify_push

B. Create the systemd unit

  1. Create and open a new systemd unit file via sudo nano /etc/systemd/system/notify_push.service and paste the following template in:
[Unit]
Description = Push daemon for Nextcloud clients
After = snap.nextcloud.nextcloud-fixer.service

[Service]
Environment=SOCKET_PATH=/tmp/snap-private-tmp/snap.nextcloud/tmp/sockets/notify_push.sock
Environment=DATABASE_URL=mysql://nextcloud:CHANGEME@localhost/nextcloud?socket=/tmp/snap-private-tmp/snap.nextcloud/tmp/sockets/mysql.sock
Environment=REDIS_URL=redis+unix:///tmp/snap-private-tmp/snap.nextcloud/tmp/sockets/redis.sock
ExecStartPre=/bin/bash -c 'while /bin/systemctl is-active --quiet snap.nextcloud.nextcloud-fixer.service; do sleep 10; done'
TimeoutStartSec=15m
ExecStart=/var/snap/nextcloud/current/nextcloud/extra-apps/notify_push/bin/ARCHITECTURE/notify_push /var/snap/nextcloud/current/nextcloud/config/config.php
Type=notify
User=root

[Install]
WantedBy = multi-user.target
  1. Adjust the template with some system configurations:
  • Replace ARCHITECTURE with one of the following, depending on your system. Some examples:
    • x86_64
    • aarch64
    • armv7
  • Replace CHANGEME in DATABASE_URL with the config value dbpassword.
    Get via cli with: sudo nextcloud.occ config:system:get dbpassword.

C. Start & enable the systemd unit

  1. sudo systemctl start notify_push
  2. sudo systemctl enable notify_push

D. Enable the reverse proxy

Enable the reverse proxy configuration for notify_push using the following command:
sudo snap set nextcloud http.notify-push-reverse-proxy=true

E. Setup the Nextcloud app

Setup the app via the following command:
sudo nextcloud.occ notify_push:setup https://cloud.example.com/push
Replacing cloud.example.com with your instance domain.

Uninstall

A. Stop & disable the systemd unit

  1. sudo systemctl stop notify_push
  2. sudo systemctl disable notify_push

B. Uninstall the Nextcloud app

Uninstall the "Client Push" app via the App Store or via the cli:
sudo nextcloud.occ app:remove notify_push

C. Disable the Reverse Proxy

Disable the reverse proxy configuration for notify_push using the following command:
sudo snap set nextcloud http.notify-push-reverse-proxy=false

Troubleshooting

  • Ensure you configured overwrite.cli.url if required. Otherwise you may not be able to continue the setup.
  • Ensure you added 127.0.0.1 to trusted_proxies in config.php:
'trusted_proxies' =>
array (
  0 => '127.0.0.1',
),
Clone this wiki locally