mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
6 lines
6.3 KiB
JavaScript
6 lines
6.3 KiB
JavaScript
import{_ as i,c as t,o as a,ag as e}from"./chunks/framework.DPDPlp3K.js";const g=JSON.parse('{"title":"ntfy Notification Setup","description":"","frontmatter":{},"headers":[],"relativePath":"notifications/Ntfy.md","filePath":"notifications/Ntfy.md","lastUpdated":1745963518000}'),n={name:"notifications/Ntfy.md"};function l(h,s,o,p,k,r){return a(),t("div",null,s[0]||(s[0]=[e(`<h1 id="ntfy-notification-setup" tabindex="-1">ntfy Notification Setup <a class="header-anchor" href="#ntfy-notification-setup" aria-label="Permalink to "ntfy Notification Setup""></a></h1><p>To enable ntfy notifications, you need the following:</p><ul><li><p><strong>ntfy URL</strong><br> The base URL of your ntfy server including the topic (e.g., <code>https://ntfy.example.com/alerts</code>)</p></li><li><p><strong>ntfy Token</strong><br> An access token for authentication, generated per user</p></li></ul><h2 id="how-to-get-the-ntfy-url-and-token" tabindex="-1">How to get the ntfy URL and Token <a class="header-anchor" href="#how-to-get-the-ntfy-url-and-token" aria-label="Permalink to "How to get the ntfy URL and Token""></a></h2><ol><li><p><strong>Install and set up your ntfy server</strong> (self-hosted or use <code>https://ntfy.sh</code>)</p></li><li><p><strong>Choose a topic name</strong> (e.g. <code>alerts</code>) and include it in the URL:<br><code>https://<your-ntfy-server>/<your-topic></code></p></li><li><p><strong>Create a user (if not already created)</strong></p></li><li><p><strong>Generate a token for the user</strong> using the following command:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --expires=30d</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --label=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"notifications"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">usernam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span></code></pre></div></li><li><p><strong>List existing tokens</strong> to get the full token string:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">usernam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span></span></code></pre></div></li><li><p><strong>Use the token</strong> as a bearer token when sending messages, either in the Authorization header or in your tool's configuration.</p></li></ol><h2 id="example-token-management-commands" tabindex="-1">Example Token Management Commands <a class="header-anchor" href="#example-token-management-commands" aria-label="Permalink to "Example Token Management Commands""></a></h2><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Show all tokens</span></span>
|
||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> alice</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Show tokens for user 'alice'</span></span>
|
||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> alice</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Create token for user 'alice' (never expires)</span></span>
|
||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --expires=2d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bob</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Create token for 'bob', expires in 2 days</span></span>
|
||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ntfy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> token</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> alice</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tk_...</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Delete a token</span></span></code></pre></div><p>More information at <a href="https://docs.ntfy.sh/config/#access-tokens" target="_blank" rel="noreferrer">the ntfy docs</a></p>`,8)]))}const c=i(n,[["render",l]]);export{g as __pageData,c as default};
|