[PR #1384] [MERGED] Declarative users #1585

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

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1384
Author: @binwiederhier
Created: 7/7/2025
Status: Merged
Merged: 7/31/2025
Merged by: @binwiederhier

Base: mainHead: predefined-users


📝 Commits (10+)

  • efef587 WIP: Predefined users
  • c0b5151 Predefined users
  • 51af114 Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users
  • f59df0f Works
  • 4457e9e Migration
  • f99801a Add "ntfy user hash"
  • 141ddb3 Comments
  • 52ca986 Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users
  • b495a74 Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users
  • 27b3a89 Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users

📊 Changes

30 files changed (+2058 additions, -514 deletions)

View changed files

📝 Makefile (+1 -1)
📝 cmd/access.go (+33 -23)
📝 cmd/access_test.go (+4 -4)
📝 cmd/serve.go (+128 -1)
📝 cmd/serve_test.go (+452 -0)
📝 cmd/tier.go (+16 -16)
📝 cmd/tier_test.go (+17 -17)
📝 cmd/token.go (+29 -12)
📝 cmd/token_test.go (+11 -11)
📝 cmd/user.go (+49 -13)
📝 cmd/user_test.go (+18 -18)
📝 cmd/webpush.go (+2 -2)
📝 cmd/webpush_test.go (+8 -5)
📝 docs/config.md (+183 -19)
📝 docs/releases.md (+2 -1)
📝 go.mod (+8 -8)
📝 go.sum (+16 -47)
📝 server/config.go (+3 -0)
📝 server/message_cache.go (+7 -0)
📝 server/server.go (+12 -1)

...and 10 more files

📄 Description

This implements declarative users:

auth-users:
  - "phil:$2a$10$YLiO8U21sX1uhZamTLJXHuxgVC0Z/GKISibrKCLohPgtG7yIxSk4C:admin"
  - "ben:$2a$10$NKbrNb7HPMjtQXWJ0f1pouw03LDLT/WzlO9VAv44x84bRCkh19h6m:user"
auth-access:
  - "ben:alerts-*:rw"
  - "ben:system-logs:ro"
  - "*:announcements:ro" # or: "everyone:announcements,ro"
auth-tokens:
  - "phil:tk_3gd7d2yftt4b8ixyfe9mnmro88o76"
  - "ben:tk_f099we8uzj7xi5qshzajwp6jffvkz:Ben personal token"

🔄 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/1384 **Author:** [@binwiederhier](https://github.com/binwiederhier) **Created:** 7/7/2025 **Status:** ✅ Merged **Merged:** 7/31/2025 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `predefined-users` --- ### 📝 Commits (10+) - [`efef587`](https://github.com/binwiederhier/ntfy/commit/efef5876717f82e9a2b449ff590dd65a7ae8c02c) WIP: Predefined users - [`c0b5151`](https://github.com/binwiederhier/ntfy/commit/c0b5151baeee36cfeeb0fea1c3c83519d8acb490) Predefined users - [`51af114`](https://github.com/binwiederhier/ntfy/commit/51af114b2eb69d5d07d0f238f6d9b25bfe4fc482) Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users - [`f59df0f`](https://github.com/binwiederhier/ntfy/commit/f59df0f40ada3221a1857c665c9c82e0fdf63d2e) Works - [`4457e9e`](https://github.com/binwiederhier/ntfy/commit/4457e9e26ff82d290ff82e8e8446ee5066be09db) Migration - [`f99801a`](https://github.com/binwiederhier/ntfy/commit/f99801a2e6d8c7675fd624ff8e16075dce734f4f) Add "ntfy user hash" - [`141ddb3`](https://github.com/binwiederhier/ntfy/commit/141ddb3a5187a7e3281f99e96d7e11bf09871388) Comments - [`52ca986`](https://github.com/binwiederhier/ntfy/commit/52ca98611ce4840cacfcd4ad3609f65ce3c869f6) Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users - [`b495a74`](https://github.com/binwiederhier/ntfy/commit/b495a744c923dab94ae73f9156fd0e61f23f5cce) Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users - [`27b3a89`](https://github.com/binwiederhier/ntfy/commit/27b3a89247d9cb28b9dc5fb0e5a983c8e36fe747) Merge branch 'main' of github.com:binwiederhier/ntfy into predefined-users ### 📊 Changes **30 files changed** (+2058 additions, -514 deletions) <details> <summary>View changed files</summary> 📝 `Makefile` (+1 -1) 📝 `cmd/access.go` (+33 -23) 📝 `cmd/access_test.go` (+4 -4) 📝 `cmd/serve.go` (+128 -1) 📝 `cmd/serve_test.go` (+452 -0) 📝 `cmd/tier.go` (+16 -16) 📝 `cmd/tier_test.go` (+17 -17) 📝 `cmd/token.go` (+29 -12) 📝 `cmd/token_test.go` (+11 -11) 📝 `cmd/user.go` (+49 -13) 📝 `cmd/user_test.go` (+18 -18) 📝 `cmd/webpush.go` (+2 -2) 📝 `cmd/webpush_test.go` (+8 -5) 📝 `docs/config.md` (+183 -19) 📝 `docs/releases.md` (+2 -1) 📝 `go.mod` (+8 -8) 📝 `go.sum` (+16 -47) 📝 `server/config.go` (+3 -0) 📝 `server/message_cache.go` (+7 -0) 📝 `server/server.go` (+12 -1) _...and 10 more files_ </details> ### 📄 Description This implements declarative users: ```yaml auth-users: - "phil:$2a$10$YLiO8U21sX1uhZamTLJXHuxgVC0Z/GKISibrKCLohPgtG7yIxSk4C:admin" - "ben:$2a$10$NKbrNb7HPMjtQXWJ0f1pouw03LDLT/WzlO9VAv44x84bRCkh19h6m:user" auth-access: - "ben:alerts-*:rw" - "ben:system-logs:ro" - "*:announcements:ro" # or: "everyone:announcements,ro" auth-tokens: - "phil:tk_3gd7d2yftt4b8ixyfe9mnmro88o76" - "ben:tk_f099we8uzj7xi5qshzajwp6jffvkz:Ben personal token" ``` --- <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:47 +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#1585
No description provided.