mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Deployed 5134e15 with MkDocs version: 1.4.2
This commit is contained in:
parent
383f9ef9cb
commit
58582e07be
39 changed files with 1766 additions and 596 deletions
|
|
@ -11,7 +11,7 @@
|
|||
<link rel="canonical" href="https://containrrr.dev/watchtower/notifications/">
|
||||
|
||||
<link rel="icon" href="../images/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.2.3, mkdocs-material-8.1.11">
|
||||
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-8.5.8">
|
||||
|
||||
|
||||
|
||||
|
|
@ -19,36 +19,42 @@
|
|||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/main.50e68009.min.css">
|
||||
<link rel="stylesheet" href="../assets/stylesheets/main.20d9efc8.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/palette.e6a45f82.min.css">
|
||||
<link rel="stylesheet" href="../assets/stylesheets/palette.815d1a91.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
|
||||
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../stylesheets/theme.css">
|
||||
|
||||
<script>__md_scope=new URL("..",location),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -56,6 +62,8 @@
|
|||
|
||||
|
||||
|
||||
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
|
||||
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" for="__drawer"></label>
|
||||
|
|
@ -82,7 +90,7 @@
|
|||
|
||||
</a>
|
||||
<label class="md-header__button md-icon" for="__drawer">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
|
||||
</label>
|
||||
<div class="md-header__title" data-md-component="header-title">
|
||||
<div class="md-header__ellipsis">
|
||||
|
|
@ -101,10 +109,32 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<form class="md-header__option" data-md-component="palette">
|
||||
|
||||
|
||||
|
||||
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="containrrr" data-md-color-primary="" data-md-color-accent="" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
|
||||
|
||||
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3 3.19.09m3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95 2.06.05m-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31Z"/></svg>
|
||||
</label>
|
||||
|
||||
|
||||
|
||||
|
||||
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="containrrr-dark" data-md-color-primary="" data-md-color-accent="" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
|
||||
|
||||
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5c-.84 0-1.65.15-2.39.42L12 2M3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29L3.34 7m.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14L3.36 17M20.65 7l-1.77 3.79a7.023 7.023 0 0 0-2.38-4.15l4.15.36m-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29L20.64 17M12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44L12 22Z"/></svg>
|
||||
</label>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<label class="md-header__button md-icon" for="__search">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
||||
</label>
|
||||
<div class="md-search" data-md-component="search" role="dialog">
|
||||
<label class="md-search__overlay" for="__search"></label>
|
||||
|
|
@ -112,13 +142,13 @@
|
|||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
||||
<label class="md-search__icon md-icon" for="__search">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
||||
</label>
|
||||
<nav class="md-search__options" aria-label="Search">
|
||||
|
||||
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
|
||||
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
|
|
@ -141,7 +171,7 @@
|
|||
<a href="https://github.com/containrrr/watchtower/" title="Go to repository" class="md-source" data-md-component="source">
|
||||
<div class="md-source__icon md-icon">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||
</div>
|
||||
<div class="md-source__repository">
|
||||
GitHub
|
||||
|
|
@ -185,7 +215,7 @@
|
|||
<a href="https://github.com/containrrr/watchtower/" title="Go to repository" class="md-source" data-md-component="source">
|
||||
<div class="md-source__icon md-icon">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||
</div>
|
||||
<div class="md-source__repository">
|
||||
GitHub
|
||||
|
|
@ -304,13 +334,41 @@
|
|||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#available_services" class="md-nav__link">
|
||||
Available services
|
||||
<a href="#shoutrrr_notifications" class="md-nav__link">
|
||||
shoutrrr notifications
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Available services">
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#simple_templates" class="md-nav__link">
|
||||
Simple templates
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#report_templates" class="md-nav__link">
|
||||
Report templates
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#legacy_notifications" class="md-nav__link">
|
||||
Legacy notifications
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Legacy notifications">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#notify-upgrade" class="md-nav__link">
|
||||
notify-upgrade
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#email" class="md-nav__link">
|
||||
Email
|
||||
|
|
@ -337,13 +395,6 @@
|
|||
Gotify
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#containrrrshoutrrr" class="md-nav__link">
|
||||
containrrr/shoutrrr
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
|
@ -528,13 +579,41 @@
|
|||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#available_services" class="md-nav__link">
|
||||
Available services
|
||||
<a href="#shoutrrr_notifications" class="md-nav__link">
|
||||
shoutrrr notifications
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Available services">
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#simple_templates" class="md-nav__link">
|
||||
Simple templates
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#report_templates" class="md-nav__link">
|
||||
Report templates
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#legacy_notifications" class="md-nav__link">
|
||||
Legacy notifications
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Legacy notifications">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#notify-upgrade" class="md-nav__link">
|
||||
notify-upgrade
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#email" class="md-nav__link">
|
||||
Email
|
||||
|
|
@ -561,13 +640,6 @@
|
|||
Gotify
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#containrrrshoutrrr" class="md-nav__link">
|
||||
containrrr/shoutrrr
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
|
@ -583,27 +655,21 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div class="md-content" data-md-component="content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
<div class="md-content" data-md-component="content">
|
||||
<article class="md-content__inner md-typeset">
|
||||
|
||||
<a href="https://github.com/containrrr/watchtower/edit/main/docs/notifications.md" title="Edit this page" class="md-content__button md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="https://github.com/containrrr/watchtower/edit/main/docs/notifications.md" title="Edit this page" class="md-content__button md-icon">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25Z"/></svg>
|
||||
</a>
|
||||
|
||||
|
||||
<h1 id="notifications">Notifications<a class="headerlink" href="#notifications" title="Permanent link">¶</a></h1>
|
||||
<p>Watchtower can send notifications when containers are updated. Notifications are sent via hooks in the logging
|
||||
system, <a href="http://github.com/sirupsen/logrus">logrus</a>. The types of notifications to send are set by passing a
|
||||
comma-separated list of values to the <code>--notifications</code> option
|
||||
(or corresponding environment variable <code>WATCHTOWER_NOTIFICATIONS</code>), which has the following valid values:</p>
|
||||
<ul>
|
||||
<li><code>email</code> to send notifications via e-mail</li>
|
||||
<li><code>slack</code> to send notifications through a Slack webhook</li>
|
||||
<li><code>msteams</code> to send notifications via MSTeams webhook</li>
|
||||
<li><code>gotify</code> to send notifications via Gotify</li>
|
||||
<li><code>shoutrrr</code> to send notifications via <a href="https://github.com/containrrr/shoutrrr">containrrr/shoutrrr</a></li>
|
||||
</ul>
|
||||
system, <a href="http://github.com/sirupsen/logrus">logrus</a>. </p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Using multiple notifications with environment variables</p>
|
||||
<p>There is currently a bug in Viper (<a class="magiclink magiclink-github magiclink-issue" href="https://github.com/spf13/viper/issues/380" title="GitHub Issue: spf13/viper #380">spf13/viper#380</a>), which prevents comma-separated slices to
|
||||
|
|
@ -619,9 +685,210 @@ quotes (<code>"</code>). This prevents unexpected errors when watchtower starts.
|
|||
<ul>
|
||||
<li><code>--notifications-level</code> (env. <code>WATCHTOWER_NOTIFICATIONS_LEVEL</code>): Controls the log level which is used for the notifications. If omitted, the default log level is <code>info</code>. Possible values are: <code>panic</code>, <code>fatal</code>, <code>error</code>, <code>warn</code>, <code>info</code>, <code>debug</code> or <code>trace</code>.</li>
|
||||
<li><code>--notifications-hostname</code> (env. <code>WATCHTOWER_NOTIFICATIONS_HOSTNAME</code>): Custom hostname specified in subject/title. Useful to override the operating system hostname.</li>
|
||||
<li><code>--notifications-delay</code> (env. <code>WATCHTOWER_NOTIFICATION_DELAY</code>): Delay before sending notifications expressed in seconds.</li>
|
||||
<li>Watchtower will post a notification every time it is started. This behavior <a href="https://containrrr.github.io/watchtower/arguments/#without_sending_a_startup_message">can be changed</a> with an argument.</li>
|
||||
<li><code>notification-title-tag</code> (env. <code>WATCHTOWER_NOTIFICATION_TITLE_TAG</code>): Prefix to include in the title. Useful when running multiple watchtowers.</li>
|
||||
<li><code>notification-skip-title</code> (env. <code>WATCHTOWER_NOTIFICATION_SKIP_TITLE</code>): Do not pass the title param to notifications. This will not pass a dynamic title override to notification services. If no title is configured for the service, it will remove the title all together.</li>
|
||||
</ul>
|
||||
<h2 id="available_services">Available services<a class="headerlink" href="#available_services" title="Permanent link">¶</a></h2>
|
||||
<h2 id="shoutrrr_notifications"><a href="https://github.com/containrrr/shoutrrr">shoutrrr</a> notifications<a class="headerlink" href="#shoutrrr_notifications" title="Permanent link">¶</a></h2>
|
||||
<p>To send notifications via shoutrrr, the following command-line options, or their corresponding environment variables, can be set:</p>
|
||||
<ul>
|
||||
<li><code>--notification-url</code> (env. <code>WATCHTOWER_NOTIFICATION_URL</code>): The shoutrrr service URL to be used. This option can also reference a file, in which case the contents of the file are used.</li>
|
||||
</ul>
|
||||
<p>Go to <a href="https://containrrr.dev/shoutrrr/v0.6/services/overview">containrrr.dev/shoutrrr/v0.6/services/overview</a> to
|
||||
learn more about the different service URLs you can use. You can define multiple services by space separating the
|
||||
URLs. (See example below)</p>
|
||||
<p>You can customize the message posted by setting a template.</p>
|
||||
<ul>
|
||||
<li><code>--notification-template</code> (env. <code>WATCHTOWER_NOTIFICATION_TEMPLATE</code>): The template used for the message.</li>
|
||||
</ul>
|
||||
<p>The template is a Go <a href="https://golang.org/pkg/text/template/">template</a> that either format a list
|
||||
of <a href="https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry">log entries</a> or a <code>notification.Data</code> struct.</p>
|
||||
<p>Simple templates are used unless the <code>notification-report</code> flag is specified:</p>
|
||||
<ul>
|
||||
<li><code>--notification-report</code> (env. <code>WATCHTOWER_NOTIFICATION_REPORT</code>): Use the session report as the notification template data.</li>
|
||||
</ul>
|
||||
<h2 id="simple_templates">Simple templates<a class="headerlink" href="#simple_templates" title="Permanent link">¶</a></h2>
|
||||
<p>The default value if not set is <code>{{range .}}{{.Message}}{{println}}{{end}}</code>. The example below uses a template that also
|
||||
outputs timestamp and log level.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Custom date format</p>
|
||||
<p>If you want to adjust the date/time format it must show how the
|
||||
<a href="https://golang.org/pkg/time/#pkg-constants">reference time</a> (<em>Mon Jan 2 15:04:05 MST 2006</em>) would be displayed in your
|
||||
custom format.<br />
|
||||
i.e., The day of the year has to be 1, the month has to be 2 (february), the hour 3 (or 15 for 24h time) etc.</p>
|
||||
</div>
|
||||
<p>Example:</p>
|
||||
<div class="highlight"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_URL</span><span class="o">=</span><span class="s2">"discord://token@channel slack://watchtower@token-a/token-b/token-c"</span> <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_TEMPLATE</span><span class="o">=</span><span class="s2">"{{range .}}{{.Time.Format \"2006-01-02 15:04:05\"}} ({{.Level}}): {{.Message}}{{println}}{{end}}"</span> <span class="se">\</span>
|
||||
containrrr/watchtower
|
||||
</code></pre></div>
|
||||
<h2 id="report_templates">Report templates<a class="headerlink" href="#report_templates" title="Permanent link">¶</a></h2>
|
||||
<p>The default template for report notifications are the following:
|
||||
<div class="highlight"><pre><span></span><code><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">.</span><span class="nx">Report</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">with</span><span class="w"> </span><span class="p">.</span><span class="nx">Report</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">or</span><span class="w"> </span><span class="p">.</span><span class="nx">Updated</span><span class="w"> </span><span class="p">.</span><span class="nx">Failed</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="p">{{</span><span class="nx">len</span><span class="w"> </span><span class="p">.</span><span class="nx">Scanned</span><span class="p">}}</span><span class="w"> </span><span class="nx">Scanned</span><span class="p">,</span><span class="w"> </span><span class="p">{{</span><span class="nx">len</span><span class="w"> </span><span class="p">.</span><span class="nx">Updated</span><span class="p">}}</span><span class="w"> </span><span class="nx">Updated</span><span class="p">,</span><span class="w"> </span><span class="p">{{</span><span class="nx">len</span><span class="w"> </span><span class="p">.</span><span class="nx">Failed</span><span class="p">}}</span><span class="w"> </span><span class="nx">Failed</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="p">.</span><span class="nx">Updated</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="o">-</span><span class="w"> </span><span class="p">{{.</span><span class="nx">Name</span><span class="p">}}</span><span class="w"> </span><span class="p">({{.</span><span class="nx">ImageName</span><span class="p">}}):</span><span class="w"> </span><span class="p">{{.</span><span class="nx">CurrentImageID</span><span class="p">.</span><span class="nx">ShortID</span><span class="p">}}</span><span class="w"> </span><span class="nx">updated</span><span class="w"> </span><span class="nx">to</span><span class="w"> </span><span class="p">{{.</span><span class="nx">LatestImageID</span><span class="p">.</span><span class="nx">ShortID</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="p">.</span><span class="nx">Fresh</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="o">-</span><span class="w"> </span><span class="p">{{.</span><span class="nx">Name</span><span class="p">}}</span><span class="w"> </span><span class="p">({{.</span><span class="nx">ImageName</span><span class="p">}}):</span><span class="w"> </span><span class="p">{{.</span><span class="nx">State</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="p">.</span><span class="nx">Skipped</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="o">-</span><span class="w"> </span><span class="p">{{.</span><span class="nx">Name</span><span class="p">}}</span><span class="w"> </span><span class="p">({{.</span><span class="nx">ImageName</span><span class="p">}}):</span><span class="w"> </span><span class="p">{{.</span><span class="nx">State</span><span class="p">}}:</span><span class="w"> </span><span class="p">{{.</span><span class="nx">Error</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="p">.</span><span class="nx">Failed</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="o">-</span><span class="w"> </span><span class="p">{{.</span><span class="nx">Name</span><span class="p">}}</span><span class="w"> </span><span class="p">({{.</span><span class="nx">ImageName</span><span class="p">}}):</span><span class="w"> </span><span class="p">{{.</span><span class="nx">State</span><span class="p">}}:</span><span class="w"> </span><span class="p">{{.</span><span class="nx">Error</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p">{{</span><span class="k">range</span><span class="w"> </span><span class="p">.</span><span class="nx">Entries</span><span class="w"> </span><span class="o">-</span><span class="p">}}{{.</span><span class="nx">Message</span><span class="p">}}{{</span><span class="s">"\n"</span><span class="p">}}{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
<span class="p">{{</span><span class="o">-</span><span class="w"> </span><span class="nx">end</span><span class="w"> </span><span class="o">-</span><span class="p">}}</span><span class="w"></span>
|
||||
</code></pre></div></p>
|
||||
<p>It will be used to send a summary of every session if there are any containers that were updated or which failed to update.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Skipping notifications</p>
|
||||
<p>Whenever the result of applying the template results in an empty string, no notifications will
|
||||
be sent. This is by default used to limit the notifications to only be sent when there something noteworthy occurred.</p>
|
||||
<p>You can replace <code>{{- if ( or .Updated .Failed ) -}}</code> with any logic you want to decide when to send the notifications.</p>
|
||||
</div>
|
||||
<p>Example using a custom report template that always sends a session report after each run:</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="1:2"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">docker run</label><label for="__tabbed_1_2">docker-compose</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="highlight"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_REPORT</span><span class="o">=</span><span class="s2">"true"</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_URL</span><span class="o">=</span><span class="s2">"discord://token@channel slack://watchtower@token-a/token-b/token-c"</span> <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_TEMPLATE</span><span class="o">=</span><span class="s2">"</span>
|
||||
<span class="s2"> {{- if .Report -}}</span>
|
||||
<span class="s2"> {{- with .Report -}}</span>
|
||||
<span class="s2"> {{len .Scanned}} Scanned, {{len .Updated}} Updated, {{len .Failed}} Failed</span>
|
||||
<span class="s2"> {{- range .Updated}}</span>
|
||||
<span class="s2"> - {{.Name}} ({{.ImageName}}): {{.CurrentImageID.ShortID}} updated to {{.LatestImageID.ShortID}}</span>
|
||||
<span class="s2"> {{- end -}}</span>
|
||||
<span class="s2"> {{- range .Fresh}}</span>
|
||||
<span class="s2"> - {{.Name}} ({{.ImageName}}): {{.State}}</span>
|
||||
<span class="s2"> {{- end -}}</span>
|
||||
<span class="s2"> {{- range .Skipped}}</span>
|
||||
<span class="s2"> - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}</span>
|
||||
<span class="s2"> {{- end -}}</span>
|
||||
<span class="s2"> {{- range .Failed}}</span>
|
||||
<span class="s2"> - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}</span>
|
||||
<span class="s2"> {{- end -}}</span>
|
||||
<span class="s2"> {{- end -}}</span>
|
||||
<span class="s2"> {{- else -}}</span>
|
||||
<span class="s2"> {{range .Entries -}}{{.Message}}{{"</span><span class="se">\n</span><span class="s2">"}}{{- end -}}</span>
|
||||
<span class="s2"> {{- end -}}</span>
|
||||
<span class="s2"> "</span> <span class="se">\</span>
|
||||
containrrr/watchtower
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">"3"</span><span class="w"></span>
|
||||
<span class="nt">services</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">watchtower</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">containrrr/watchtower</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">volumes</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/var/run/docker.sock:/var/run/docker.sock</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">env</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">WATCHTOWER_NOTIFICATION_REPORT</span><span class="p">:</span><span class="w"> </span><span class="s">"true"</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">WATCHTOWER_NOTIFICATION_URL</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">></span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">discord://token@channel</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">slack://watchtower@token-a/token-b/token-c</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">WATCHTOWER_NOTIFICATION_TEMPLATE</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">|</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- if .Report -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- with .Report -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{len .Scanned}} Scanned, {{len .Updated}} Updated, {{len .Failed}} Failed</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- range .Updated}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">- {{.Name}} ({{.ImageName}}): {{.CurrentImageID.ShortID}} updated to {{.LatestImageID.ShortID}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- end -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- range .Fresh}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">- {{.Name}} ({{.ImageName}}): {{.State}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- end -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- range .Skipped}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">- {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- end -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- range .Failed}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">- {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- end -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- end -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- else -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}}</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="no">{{- end -}}</span><span class="w"></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 id="legacy_notifications">Legacy notifications<a class="headerlink" href="#legacy_notifications" title="Permanent link">¶</a></h2>
|
||||
<p>For backwards compatibility, the notifications can also be configured using legacy notification options. These will automatically be converted to shoutrrr URLs when used.<br />
|
||||
The types of notifications to send are set by passing a comma-separated list of values to the <code>--notifications</code> option
|
||||
(or corresponding environment variable <code>WATCHTOWER_NOTIFICATIONS</code>), which has the following valid values:</p>
|
||||
<ul>
|
||||
<li><code>email</code> to send notifications via e-mail</li>
|
||||
<li><code>slack</code> to send notifications through a Slack webhook</li>
|
||||
<li><code>msteams</code> to send notifications via MSTeams webhook</li>
|
||||
<li><code>gotify</code> to send notifications via Gotify</li>
|
||||
</ul>
|
||||
<h3 id="notify-upgrade"><code>notify-upgrade</code><a class="headerlink" href="#notify-upgrade" title="Permanent link">¶</a></h3>
|
||||
<p>If watchtower is started with <code>notify-upgrade</code> as it's first argument, it will generate a .env file with your current legacy notification options converted to shoutrrr URLs.</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="2:2"><input checked="checked" id="__tabbed_2_1" name="__tabbed_2" type="radio" /><input id="__tabbed_2_2" name="__tabbed_2" type="radio" /><div class="tabbed-labels"><label for="__tabbed_2_1">docker run</label><label for="__tabbed_2_2">docker-compose.yml</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="highlight"><pre><span></span><code>$ docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>slack <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL</span><span class="o">=</span><span class="s2">"https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy"</span> <span class="se">\</span>
|
||||
containrrr/watchtower <span class="se">\</span>
|
||||
notify-upgrade
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">"3"</span><span class="w"></span>
|
||||
<span class="nt">services</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">watchtower</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">containrrr/watchtower</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">volumes</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/var/run/docker.sock:/var/run/docker.sock</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">env</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">WATCHTOWER_NOTIFICATIONS</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">slack</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">command</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">notify-upgrade</span><span class="w"></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>You can then copy this file from the container (a message with the full command to do so will be logged) and use it with your current setup:</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="3:2"><input checked="checked" id="__tabbed_3_1" name="__tabbed_3" type="radio" /><input id="__tabbed_3_2" name="__tabbed_3" type="radio" /><div class="tabbed-labels"><label for="__tabbed_3_1">docker run</label><label for="__tabbed_3_2">docker-compose.yml</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="highlight"><pre><span></span><code>$ docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
--env-file watchtower-notifications.env <span class="se">\</span>
|
||||
containrrr/watchtower
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="highlight"><pre><span></span><code><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">"3"</span><span class="w"></span>
|
||||
<span class="nt">services</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">watchtower</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">containrrr/watchtower</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">volumes</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/var/run/docker.sock:/var/run/docker.sock</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="nt">env_file</span><span class="p">:</span><span class="w"></span>
|
||||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">watchtower-notifications.env</span><span class="w"></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="email">Email<a class="headerlink" href="#email" title="Permanent link">¶</a></h3>
|
||||
<p>To receive notifications by email, the following command-line options, or their corresponding environment variables, can be set:</p>
|
||||
<ul>
|
||||
|
|
@ -633,7 +900,7 @@ quotes (<code>"</code>). This prevents unexpected errors when watchtower starts.
|
|||
<li><code>--notification-email-server-user</code> (env. <code>WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER</code>): The username to authenticate with the SMTP server with.</li>
|
||||
<li><code>--notification-email-server-password</code> (env. <code>WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD</code>): The password to authenticate with the SMTP server with. Can also reference a file, in which case the contents of the file are used.</li>
|
||||
<li><code>--notification-email-delay</code> (env. <code>WATCHTOWER_NOTIFICATION_EMAIL_DELAY</code>): Delay before sending notifications expressed in seconds.</li>
|
||||
<li><code>--notification-email-subjecttag</code> (env. <code>WATCHTOWER_NOTIFICATION_EMAIL_SUBJECTTAG</code>): Prefix to include in the subject tag. Useful when running multiple watchtowers.</li>
|
||||
<li><code>--notification-email-subjecttag</code> (env. <code>WATCHTOWER_NOTIFICATION_EMAIL_SUBJECTTAG</code>): Prefix to include in the subject tag. Useful when running multiple watchtowers. <strong>NOTE:</strong> This will affect all notification types.</li>
|
||||
</ul>
|
||||
<p>Example:</p>
|
||||
<div class="highlight"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
|
|
@ -737,54 +1004,29 @@ quotes (<code>"</code>). This prevents unexpected errors when watchtower starts.
|
|||
</code></pre></div>
|
||||
<p><code>-e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN</code> or <code>--notification-gotify-token</code> can also reference a file, in which case the contents of the file are used.</p>
|
||||
<p>If you want to disable TLS verification for the Gotify instance, you can use either <code>-e WATCHTOWER_NOTIFICATION_GOTIFY_TLS_SKIP_VERIFY=true</code> or <code>--notification-gotify-tls-skip-verify</code>.</p>
|
||||
<h3 id="containrrrshoutrrr"><a href="https://github.com/containrrr/shoutrrr">containrrr/shoutrrr</a><a class="headerlink" href="#containrrrshoutrrr" title="Permanent link">¶</a></h3>
|
||||
<p>To send notifications via shoutrrr, the following command-line options, or their corresponding environment variables, can be set:</p>
|
||||
<ul>
|
||||
<li><code>--notification-url</code> (env. <code>WATCHTOWER_NOTIFICATION_URL</code>): The shoutrrr service URL to be used.</li>
|
||||
</ul>
|
||||
<p>Go to <a href="https://containrrr.dev/shoutrrr/v0.5/services/overview">containrrr.dev/shoutrrr/v0.5/services/overview</a> to
|
||||
learn more about the different service URLs you can use. You can define multiple services by space separating the
|
||||
URLs. (See example below)</p>
|
||||
<p>You can customize the message posted by setting a template.</p>
|
||||
<ul>
|
||||
<li><code>--notification-template</code> (env. <code>WATCHTOWER_NOTIFICATION_TEMPLATE</code>): The template used for the message.</li>
|
||||
</ul>
|
||||
<p>The template is a Go <a href="https://golang.org/pkg/text/template/">template</a> and that format a list
|
||||
of <a href="https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry">log entries</a>.</p>
|
||||
<p>The default value if not set is <code>{{range .}}{{.Message}}{{println}}{{end}}</code>. The example below uses a template that also
|
||||
outputs timestamp and log level.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Custom date format</p>
|
||||
<p>If you want to adjust the date/time format it must show how the
|
||||
<a href="https://golang.org/pkg/time/#pkg-constants">reference time</a> (<em>Mon Jan 2 15:04:05 MST 2006</em>) would be displayed in your
|
||||
custom format.<br />
|
||||
i.e., The day of the year has to be 1, the month has to be 2 (february), the hour 3 (or 15 for 24h time) etc.</p>
|
||||
</div>
|
||||
<p>Example:</p>
|
||||
<div class="highlight"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>shoutrrr <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_URL</span><span class="o">=</span><span class="s2">"discord://token@channel slack://watchtower@token-a/token-b/token-c"</span> <span class="se">\</span>
|
||||
-e <span class="nv">WATCHTOWER_NOTIFICATION_TEMPLATE</span><span class="o">=</span><span class="s2">"{{range .}}{{.Time.Format \"2006-01-02 15:04:05\"}} ({{.Level}}): {{.Message}}{{println}}{{end}}"</span> <span class="se">\</span>
|
||||
containrrr/watchtower
|
||||
</code></pre></div>
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="md-footer">
|
||||
|
||||
<nav class="md-footer__inner md-grid" aria-label="Footer">
|
||||
|
||||
<nav class="md-footer__inner md-grid" aria-label="Footer" >
|
||||
|
||||
|
||||
<a href="../arguments/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Arguments" rel="prev">
|
||||
<div class="md-footer__button md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
||||
</div>
|
||||
<div class="md-footer__title">
|
||||
<div class="md-ellipsis">
|
||||
|
|
@ -808,7 +1050,7 @@ i.e., The day of the year has to be 1, the month has to be 2 (february), the hou
|
|||
</div>
|
||||
</div>
|
||||
<div class="md-footer__button md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
|
@ -834,10 +1076,11 @@ i.e., The day of the year has to be 1, the month has to be 2 (february), the hou
|
|||
<div class="md-dialog" data-md-component="dialog">
|
||||
<div class="md-dialog__inner md-typeset"></div>
|
||||
</div>
|
||||
<script id="__config" type="application/json">{"base": "..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "../assets/javascripts/workers/search.092fa1f6.min.js"}</script>
|
||||
|
||||
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.16e2a7d4.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
|
||||
|
||||
|
||||
<script src="../assets/javascripts/bundle.5a9542cf.min.js"></script>
|
||||
<script src="../assets/javascripts/bundle.d6c3db9e.min.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue