Skip to content
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

Add systemd user service for ntfy-client.service #1002

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dandersch
Copy link

We can offer ntfy-client.service as a user service along the already existing system service.

This allows the use of ~/.config/ntfy/client.yaml for configuration (for the system service, the config is hardcoded to use
/etc/ntfy/client.yaml). It also means that we can update the docs to recommend enabling the user service for "personal desktop machine" use in https://docs.ntfy.sh/subscribe/cli/?h=systemd#using-the-systemd-service and remove the part about using an override.conf (unless this has another use case for the ntfy-client that I am missing?).

Repos would need to update their packages to copy over client/user/ntfy-client.service to /usr/lib/systemd/user/ntfy-client.service.

I've been using it successfully so far. I've also added entries to scripts/postinst.sh and .goreleaser.yml, but haven't tested those.

@Migs3
Copy link

Migs3 commented Jan 15, 2024

Will this be possible to add to the docker image as well, so that it starts both server and client?

@dandersch
Copy link
Author

dandersch commented Jan 16, 2024

@Migs3 Not via this user service - the docker image doesn't (and shouldn't) use systemd. My use case was more for desktop machines that want to use only the client so that notifications can pop up with notify-send (without configuring anything in /etc like the override.conf or client.yml). If you want this functionality with a docker container, I think you would have to do what the override.conf did, i.e. include something like

    environment:
      - DISPLAY=:0
      - DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
    volumes:
      - /run/user/1000/bus:/run/user/1000/bus
    command:
      #- serve
      - subscribe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants