[PR #1329] [MERGED] [Featute] Add optional web app flag which requires a login for every action #1567

Closed
opened 2026-05-07 01:02:42 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1329
Author: @theatischbein
Created: 5/5/2025
Status: Merged
Merged: 8/25/2025
Merged by: @binwiederhier

Base: mainHead: feat_optional_require_login


📝 Commits (1)

  • 03aeb70 feat: Add optional web app flag which requires a login for every action

📊 Changes

10 files changed (+39 additions, -13 deletions)

View changed files

📝 cmd/serve.go (+1 -0)
📝 docs/config.md (+1 -0)
📝 server/config.go (+1 -0)
📝 server/server.go (+1 -0)
📝 server/server.yml (+2 -0)
📝 server/types.go (+1 -0)
📝 web/public/static/langs/en.json (+2 -0)
📝 web/src/components/Navigation.jsx (+7 -1)
📝 web/src/components/Notifications.jsx (+7 -2)
📝 web/src/components/Preferences.jsx (+16 -10)

📄 Description

Problem

I have read #238 and was also notified about #1316 (which I disagree too because the ACL does not allow it).
I do understand that the web app is supposed to be a dump client, but I still want to manage who uses my server ressources. Since the web app has a login it feels not suitable to add an additonal login step like BASIC-AUTH.

But I see the point of #238 that the web app can be used to subscribe to other ntfy servers, which might not be wanted.

Also I find it a bit confusing in my setup that there are options in the NavigationBar to subscribe or publish notifications on my servers without a login, but the ACL does not allow it. And I do not want others (without an account) to use my instance to subscribe to external server.

Changes

So I added the flag require_login/require-login/NTFY_REQUIRE_LOGIN (Default: false).

If the flag is enabled and there is no Login:

  • NavigationBar: hides All Notifications, Settings, Publisish Notification, Subscribe to topic
  • NavigationBar: Documentation and all other possible entries are still there
  • Endpoint /settings redirects back to main page
  • Notification: Informs that a Login is needed to use this page

Screenshot from 2025-05-05 10-54-35

Missing

I only added the translation for English.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/1329 **Author:** [@theatischbein](https://github.com/theatischbein) **Created:** 5/5/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `feat_optional_require_login` --- ### 📝 Commits (1) - [`03aeb70`](https://github.com/binwiederhier/ntfy/commit/03aeb707f2a3276239765292d37311786b44e4b4) feat: Add optional web app flag which requires a login for every action ### 📊 Changes **10 files changed** (+39 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `cmd/serve.go` (+1 -0) 📝 `docs/config.md` (+1 -0) 📝 `server/config.go` (+1 -0) 📝 `server/server.go` (+1 -0) 📝 `server/server.yml` (+2 -0) 📝 `server/types.go` (+1 -0) 📝 `web/public/static/langs/en.json` (+2 -0) 📝 `web/src/components/Navigation.jsx` (+7 -1) 📝 `web/src/components/Notifications.jsx` (+7 -2) 📝 `web/src/components/Preferences.jsx` (+16 -10) </details> ### 📄 Description ## Problem I have read #238 and was also notified about #1316 (which I disagree too because the ACL does not allow it). I do understand that the web app is supposed to be a dump client, but I still want to manage who uses my server ressources. Since the web app has a login it feels not suitable to add an additonal login step like BASIC-AUTH. But I see the point of #238 that the web app can be used to subscribe to other ntfy servers, which might not be wanted. Also I find it a bit confusing in my setup that there are options in the NavigationBar to subscribe or publish notifications on my servers without a login, but the ACL does not allow it. And I do not want others (without an account) to use my instance to subscribe to external server. ## Changes So I added the flag `require_login`/`require-login`/`NTFY_REQUIRE_LOGIN` (Default: `false`). If the flag is enabled and there is no Login: - NavigationBar: hides All Notifications, Settings, Publisish Notification, Subscribe to topic - NavigationBar: Documentation and all other possible entries are still there - Endpoint `/settings` redirects back to main page - Notification: Informs that a Login is needed to use this page ![Screenshot from 2025-05-05 10-54-35](https://github.com/user-attachments/assets/e5d1ed24-47e4-4ebf-b4be-e827fd276e99) ## Missing I only added the translation for English. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:02:42 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1567
No description provided.