Site updated at 2016-08-22 08:21:42 UTC
This commit is contained in:
parent
f9d65cbe57
commit
4acb07bf8e
559 changed files with 18878 additions and 21688 deletions
|
@ -91,74 +91,60 @@
|
|||
<hr class="divider">
|
||||
|
||||
|
||||
<p>The <code>configuration.yaml</code> file a plain-text file thus it is readable for everyone who has access to the file. The file contains passwords and API tokens which need to be redacted if you want to share your configuration. This separation can also help you to keep easier track of your passwords and API keys (as they are all stored at one place and no longer spread across the <code>configuration.yaml</code> file) if you don’t want to <a href="/topics/splitting_configuration/">split up your configuration</a>.</p>
|
||||
<p>The <code class="highlighter-rouge">configuration.yaml</code> file a plain-text file thus it is readable for everyone who has access to the file. The file contains passwords and API tokens which need to be redacted if you want to share your configuration. This separation can also help you to keep easier track of your passwords and API keys (as they are all stored at one place and no longer spread across the <code class="highlighter-rouge">configuration.yaml</code> file) if you don’t want to <a href="/topics/splitting_configuration/">split up your configuration</a>.</p>
|
||||
|
||||
<h3><a class="title-link" name="using-secretsyaml" href="#using-secretsyaml"></a> Using secrets.yaml</h3>
|
||||
|
||||
<p>The workflow for the outsourcing in the <code>secrets.yaml</code> is very similar to the <a href="/topics/splitting_configuration/">splitting of the configuration</a>. Create a <code>secrets.yaml</code> file in your Home assistant configuration directory (The location of the folder differs between operating systems: on OS X and Linux it’s <code>~/.homeassistant</code> and on Windows it’s <code>%APPDATA%/.homeassistant</code>).</p>
|
||||
<p>The workflow for the outsourcing in the <code class="highlighter-rouge">secrets.yaml</code> is very similar to the <a href="/topics/splitting_configuration/">splitting of the configuration</a>. Create a <code class="highlighter-rouge">secrets.yaml</code> file in your Home assistant configuration directory (The location of the folder differs between operating systems: on OS X and Linux it’s <code class="highlighter-rouge">~/.homeassistant</code> and on Windows it’s <code class="highlighter-rouge">%APPDATA%/.homeassistant</code>).</p>
|
||||
|
||||
<p>The entries for password and API keys in the <code>configuration.yaml</code> file usually looks like the example below.</p>
|
||||
<p>The entries for password and API keys in the <code class="highlighter-rouge">configuration.yaml</code> file usually looks like the example below.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">http</span>:
|
||||
<span class="key">api_password</span>: <span class="string"><span class="content">YOUR_PASSWORD</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
|
||||
<span class="s">api_password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>Those entries need to be replaced with <code>!secret</code> and a identifier.</p>
|
||||
<p>Those entries need to be replaced with <code class="highlighter-rouge">!secret</code> and a identifier.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">http</span>:
|
||||
<span class="key">api_password</span>: <span class="type">!secret</span> <span class="string"><span class="content">http_password</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
|
||||
<span class="s">api_password</span><span class="pi">:</span> <span class="kt">!secret</span> <span class="s">http_password</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>The <code>secrets.yaml</code> file contains the corresponding password assigned to the identifier.</p>
|
||||
<p>The <code class="highlighter-rouge">secrets.yaml</code> file contains the corresponding password assigned to the identifier.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">logger</span>: <span class="string"><span class="content">debug</span></span>
|
||||
<span class="key">http_password</span>: <span class="string"><span class="content">YOUR_PASSWORD</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">logger</span><span class="pi">:</span> <span class="s">debug</span>
|
||||
<span class="s">http_password</span><span class="pi">:</span> <span class="s">YOUR_PASSWORD</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<h3><a class="title-link" name="storing-passwords-in-a-keyring-managed-by-your-os" href="#storing-passwords-in-a-keyring-managed-by-your-os"></a> Storing passwords in a keyring managed by your OS</h3>
|
||||
|
||||
<p>Using <a href="http://pythonhosted.org/keyring/">Keyring</a> is an alternative way to <code>secrets.yaml</code>. They can be managed from the command line via the keyring script.</p>
|
||||
<p>Using <a href="http://pythonhosted.org/keyring/">Keyring</a> is an alternative way to <code class="highlighter-rouge">secrets.yaml</code>. They can be managed from the command line via the keyring script.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ hass --script keyring --help
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass --script keyring --help
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>To store a password in keyring, replace your password or API key with <code>!secret</code> and an identifier in <code>configuration.yaml</code> file.</p>
|
||||
<p>To store a password in keyring, replace your password or API key with <code class="highlighter-rouge">!secret</code> and an identifier in <code class="highlighter-rouge">configuration.yaml</code> file.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">http</span>:
|
||||
<span class="key">api_password</span>: <span class="type">!secret</span> <span class="string"><span class="content">http_password</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">http</span><span class="pi">:</span>
|
||||
<span class="s">api_password</span><span class="pi">:</span> <span class="kt">!secret</span> <span class="s">http_password</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>Create an entry in your keyring.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ hass --script keyring set http_password
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass --script keyring <span class="nb">set </span>http_password
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>If you launch home Assistant now, you will be prompted for the keyring password to unlock your keyring.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ hass
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>hass
|
||||
Config directory: /home/fab/.homeassistant
|
||||
Please enter password for encrypted keyring:
|
||||
</pre></div>
|
||||
</div>
|
||||
Please enter password <span class="k">for </span>encrypted keyring:
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p class="note warning">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue