[GH-ISSUE #1613] Help users generate unguessable topics in docs #1129

Open
opened 2026-05-05 04:28:21 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @m-dressler on GitHub (Feb 17, 2026).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1613

💡 Idea
The publish docs explain "Because there is no sign-up, the topic is essentially a password, so pick something that's not easily guessable." I feel it would be neat to add a small script like such:

<script>
  // Generate a random UUID and remove hyphens
  const hex = crypto.randomUUID().replaceAll("-", "");
  // Convert hex string to bytes
  const bytes = new Uint8Array(hex.match(/.{2}/g).map((b) => parseInt(b, 16)));
  // Convert bytes to Base64
  let b64 = btoa(String.fromCharCode(...bytes));
  // Convert Base64 to Base64URL
  const b64url = b64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
  document.currentScript.replaceWith(
    "Here's a randomly generated topic just for you: " + b64url,
  );
</script>
Originally created by @m-dressler on GitHub (Feb 17, 2026). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1613 :bulb: **Idea** The [publish docs](https://docs.ntfy.sh/publish/) explain "Because there is no sign-up, the topic is essentially a password, so pick something that's not easily guessable." I feel it would be neat to add a small script like such: ```html <script> // Generate a random UUID and remove hyphens const hex = crypto.randomUUID().replaceAll("-", ""); // Convert hex string to bytes const bytes = new Uint8Array(hex.match(/.{2}/g).map((b) => parseInt(b, 16))); // Convert bytes to Base64 let b64 = btoa(String.fromCharCode(...bytes)); // Convert Base64 to Base64URL const b64url = b64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); document.currentScript.replaceWith( "Here's a randomly generated topic just for you: " + b64url, ); </script> ```
gitea-mirror added the
enhancement
label 2026-05-05 04:28:21 -06: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: github-starred/ntfy#1129
No description provided.