forked from twpayne/chezmoi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secretgeneric.txt
39 lines (33 loc) · 908 Bytes
/
secretgeneric.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
[!windows] chmod 755 bin/secret
[windows] unix2dos bin/secret.cmd
chezmoi secret generic examplepassword
stdout examplepassword
chezmoi apply
cmp $HOME/.netrc golden/.netrc
-- bin/secret --
#!/bin/sh
echo "$*"
-- bin/secret.cmd --
@echo off
setlocal
set out=%*
set out=%out:\=%
echo %out%
endlocal
-- golden/.netrc --
machine example.com
login examplelogin
password examplepassword
machine example2.com
login examplelogin2
password examplepassword2
-- home/user/.config/chezmoi/chezmoi.toml --
[genericSecret]
command = "secret"
-- home/user/.local/share/chezmoi/private_dot_netrc.tmpl --
machine example.com
login examplelogin
password {{ secret "examplepassword" }}
machine example2.com
login {{ (secretJSON "{\"username\":\"examplelogin2\",\"password\":\"examplepassword2\"}").username }}
password {{ (secretJSON "{\"username\":\"examplelogin2\",\"password\":\"examplepassword2\"}").password }}