Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ntfy Notifier - authorization #58085

Open
@jirikmik

Description

@jirikmik

Symfony version(s) affected

7.1.3

Description

With self-hosted Ntfy (v 2.11.0):

  1. sending notification with Ntfy Notifier with username and password in DSN results in unauthorized error.
  2. Also I don't know way how to set DSN to use token (Bearer auth) without reading transport source.
  3. README uses keyword URL but this is not used in example DSN (instead there is "default")

How to reproduce

Set DSN by README.md (including username and password) with authorized topic and try to send notification.

Possible Solution

Problem no.1 is in bad formatted Basic authentication header. It is created in NtfyTransport.php, line 90
$headers['Authorization'] = 'Basic '.rtrim(base64_encode($this->user.':'.$this->password), '=');
should be:
$headers['Authorization'] = 'Basic '.base64_encode($this->user.':'.$this->password);
Problem is in removing= from string.

Problem no.2:
In NtfyTransport.php on line 91 is condition for use token:
} elseif (null !== $this->password) {
which in fact is satisfied when$this->user is null. Solution is to add second DSN example to README for use token:
NTFY_DSN=ntfy://[:TOKEN]@default[:PORT]/TOPIC?[secureHttp=[on]]

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp