mirror of
https://github.com/kp2pml30/dotfiles.git
synced 2026-04-14 22:31:46 +04:00
first xray
This commit is contained in:
parent
bbacfb100e
commit
c2106ca1a6
18 changed files with 482 additions and 29 deletions
43
nix/server/modify-secrets.vim
Normal file
43
nix/server/modify-secrets.vim
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
set nobackup nowritebackup noundofile noswapfile viminfo= history=0 noshelltemp secure
|
||||
|
||||
function! s:OpenSSLReadPre()
|
||||
endfunction
|
||||
|
||||
function! s:OpenSSLReadPost()
|
||||
silent! execute "0,$!openssl enc -aes-256-cbc -pbkdf2 -iter 1000000 -base64 -d -k '" . $KP2_DOTFILES_SECRET_KEY . "'"
|
||||
if v:shell_error
|
||||
silent! 0,$y
|
||||
silent! undo
|
||||
echo "Note that your version of openssl may not have the given cipher engine built-in"
|
||||
echo "even though the engine may be documented in the openssl man pages."
|
||||
echo "ERROR FROM OPENSSL:"
|
||||
echo @"
|
||||
echo "COULD NOT DECRYPT"
|
||||
return
|
||||
endif
|
||||
redraw!
|
||||
endfunction
|
||||
|
||||
function! s:OpenSSLWritePre()
|
||||
silent! execute "0,$!openssl enc -aes-256-cbc -pbkdf2 -iter 1000000 -base64 -k '" . $KP2_DOTFILES_SECRET_KEY . "'"
|
||||
if v:shell_error
|
||||
silent! 0,$y
|
||||
silent! undo
|
||||
echo "Note that your version of openssl may not have the given cipher engine built in"
|
||||
echo "even though the engine may be documented in the openssl man pages."
|
||||
echo "ERROR FROM OPENSSL:"
|
||||
echo @"
|
||||
echo "COULD NOT ENCRYPT"
|
||||
return
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:OpenSSLWritePost()
|
||||
"silent! undo
|
||||
"redraw!
|
||||
endfunction
|
||||
|
||||
autocmd BufReadPre,FileReadPre * call s:OpenSSLReadPre()
|
||||
autocmd BufReadPost,FileReadPost * call s:OpenSSLReadPost()
|
||||
autocmd BufWritePre,FileWritePre * call s:OpenSSLWritePre()
|
||||
autocmd BufWritePost,FileWritePost * call s:OpenSSLWritePost()
|
||||
Loading…
Add table
Add a link
Reference in a new issue