Site updated at 2016-08-13 19:22:59 UTC
This commit is contained in:
parent
b043f25a3b
commit
f5b903f5ec
347 changed files with 6259 additions and 2708 deletions
|
@ -124,17 +124,17 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<h3><a class="title-link" name="python-keyring" href="#python-keyring"></a> Python Keyring</h3>
|
||||
<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> but requires that <code>keyring</code> is installed (incl. its command-line tools). This can be done with:</p>
|
||||
<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>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ pip3 install keyring
|
||||
<div class="code"><pre>$ hass --script keyring --help
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>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>!secret</code> and an identifier in <code>configuration.yaml</code> file.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">http</span>:
|
||||
|
@ -143,28 +143,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>Create an entry in your keyring. The service (SERVICE) is <code>homeassistant</code> and the identifier is the USERNAME in the keyring context.</p>
|
||||
<p>Create an entry in your keyring.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ keyring set homeassistant http_password
|
||||
Password for 'http_password' in 'homeassistant':
|
||||
Please set a password for your new keyring:
|
||||
Please confirm the password:
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>If the command-line tool <code>keyring</code> is not available, launch <code>python3</code> and do the process manually.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>>>> <span class="keyword">import</span> <span class="include">keyring</span>
|
||||
>>> keyring.set_password(<span class="string"><span class="delimiter">"</span><span class="content">homeassistant</span><span class="delimiter">"</span></span>, <span class="string"><span class="delimiter">"</span><span class="content">http_password</span><span class="delimiter">"</span></span>, <span class="string"><span class="delimiter">"</span><span class="content">12345</span><span class="delimiter">"</span></span>)
|
||||
Please <span class="predefined">set</span> a password <span class="keyword">for</span> your new keyring:
|
||||
Please confirm the password:
|
||||
>>> keyring.get_password(<span class="string"><span class="delimiter">"</span><span class="content">homeassistant</span><span class="delimiter">"</span></span>, <span class="string"><span class="delimiter">"</span><span class="content">http_password</span><span class="delimiter">"</span></span>)
|
||||
<span class="string"><span class="delimiter">'</span><span class="content">12345</span><span class="delimiter">'</span></span>
|
||||
>>> keyring.get_keyring()
|
||||
<EncryptedKeyring at /home/your_user/.local/share/python_keyring/crypted_pass.cfg>
|
||||
<div class="code"><pre>$ hass --script keyring set http_password
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -174,7 +156,7 @@ Please confirm the password:
|
|||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ hass
|
||||
Config directory: /home/fab/.homeassistant
|
||||
Please enter password for encrypted keyring:
|
||||
Please enter password for encrypted keyring:
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -184,7 +166,6 @@ Please enter password for encrypted keyring:
|
|||
</p>
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue