From 1e4a737175beb504b8fcb1271955d31b670a6563 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sat, 31 Oct 2026 19:36:34 +0900 Subject: ntfy: allow anonymous read on status topic (publish still requires token) Co-Authored-By: Claude Opus 5.5 --- ntfy/install.sh | 5 ++++- ntfy/server.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'ntfy') diff --git a/ntfy/install.sh b/ntfy/install.sh index f65f867..548fb5d 100755 --- a/ntfy/install.sh +++ b/ntfy/install.sh @@ -17,6 +17,9 @@ else docker exec -it ntfy ntfy user add --role=admin "$USER_NAME" fi +# status ページは公開なので、通知トピックも誰でも購読(読み取り)できるようにする。送信はトークン必須 +docker exec ntfy ntfy access "*" "$TOPIC" read-only + if grep -q '^NTFY_TOKEN=' "$STATUS_ENV" 2>/dev/null; then echo "NTFY_TOKEN already set in $STATUS_ENV" else @@ -31,4 +34,4 @@ else fi echo "" -echo "購読: ntfy アプリで サーバー https://ntfy.yyamashita.com / トピック $TOPIC / ユーザー $USER_NAME でログイン" +echo "購読: ntfy アプリで サーバー https://ntfy.yyamashita.com / トピック $TOPIC(ログイン不要)" diff --git a/ntfy/server.yml b/ntfy/server.yml index 29a6a83..8cb7936 100644 --- a/ntfy/server.yml +++ b/ntfy/server.yml @@ -7,7 +7,7 @@ cache-file: "/var/cache/ntfy/cache.db" cache-duration: "72h" attachment-cache-dir: "/var/cache/ntfy/attachments" -# 認証必須。ユーザー・トークンは install.sh で作成する +# 既定は全拒否。ユーザー・トークンと、status トピックの匿名読み取り許可は install.sh で設定する auth-file: "/var/lib/ntfy/user.db" auth-default-access: "deny-all" -- cgit v1.3