Use machine hostname as identifier for retrieving key from bw.
This commit is contained in:
4
Brewfile
4
Brewfile
@ -19,8 +19,8 @@ brew "git-absorb"
|
|||||||
brew "git-lfs"
|
brew "git-lfs"
|
||||||
brew "glab"
|
brew "glab"
|
||||||
brew "pcre2"
|
brew "pcre2"
|
||||||
brew "go"
|
brew "go", link: false
|
||||||
brew "go@1.23"
|
brew "go@1.23", link: true
|
||||||
brew "golangci-lint"
|
brew "golangci-lint"
|
||||||
brew "goreman"
|
brew "goreman"
|
||||||
brew "govulncheck"
|
brew "govulncheck"
|
||||||
|
|||||||
@ -18,7 +18,7 @@ Before diving into the technical details, below is a brief summary of how I get
|
|||||||
|
|
||||||
** Code editing
|
** Code editing
|
||||||
|
|
||||||
For an editor I primarily rely on [[https://www.gnu.org/software/emacs/][emacs]], specifically [[https://github.com/doomemacs/doomemacs][doom emacs]].
|
For an editor I primarily rely on [[https://www.gnu.org/software/emacs/][emacs]], specifically [[https://github.com/doomemacs/doomemacs][doom emacs]], running within a terminal.
|
||||||
|
|
||||||
The main feature that I rely on in emacs is [[https://orgmode.org/][org-mode]]. This allows me to do literate programming, writing my documentation with embedded code blocks that are actually executable or exportable via [[https://orgmode.org/worg/org-contrib/babel/intro.html][babel]].
|
The main feature that I rely on in emacs is [[https://orgmode.org/][org-mode]]. This allows me to do literate programming, writing my documentation with embedded code blocks that are actually executable or exportable via [[https://orgmode.org/worg/org-contrib/babel/intro.html][babel]].
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ bw login mail@jamesblair.net
|
|||||||
|
|
||||||
I make extensive use of ~.dotfiles~ to further customise my environment. The script below restores my versions of key dotfiles automatically.
|
I make extensive use of ~.dotfiles~ to further customise my environment. The script below restores my versions of key dotfiles automatically.
|
||||||
|
|
||||||
*** Obtain ssh key from bitwarden
|
** Obtain ssh key from bitwarden
|
||||||
|
|
||||||
In order to be able to clone the repository in the next step we need to obtain our ssh keys from bitwarden. Given we have installed the bitwarden cli we can mostly automte this process minus the initial login to bitwarden.
|
In order to be able to clone the repository in the next step we need to obtain our ssh keys from bitwarden. Given we have installed the bitwarden cli we can mostly automte this process minus the initial login to bitwarden.
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ ssh-keygen -t rsa -f ~/.ssh/james -q -P ""
|
|||||||
export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)
|
export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)
|
||||||
|
|
||||||
# Export both keys
|
# Export both keys
|
||||||
export key=$(bw get item desktop --pretty | grep notes)
|
export key=$(bw get item "$(hostname)" --pretty | grep notes)
|
||||||
|
|
||||||
# Extract private key
|
# Extract private key
|
||||||
export private=${key:12}
|
export private=${key:12}
|
||||||
@ -71,7 +71,7 @@ export public=${key/*ssh-rsa/ssh-rsa} && echo ${public::-2} | awk '{gsub(/\\n/,"
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
*** Clone and restore dotfiles
|
** Clone and restore dotfiles
|
||||||
|
|
||||||
Once our keys are available to us we can clone down our dotfiles and get back to our comfortable normal terminal environment.
|
Once our keys are available to us we can clone down our dotfiles and get back to our comfortable normal terminal environment.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user