Remove keychain for gpg-agent
This commit is contained in:
		
							parent
							
								
									8841520957
								
							
						
					
					
						commit
						d3a5ff8349
					
				
							
								
								
									
										12
									
								
								zlogin
								
								
								
								
							
							
						
						
									
										12
									
								
								zlogin
								
								
								
								
							|  | @ -77,16 +77,6 @@ if [ ${USER} != "root" ] && [ $(command -v startx) ]; then | |||
| 	fi | ||||
| fi | ||||
| 
 | ||||
| # ssh-agent with fix socket path {{{ | ||||
| # ssh-agent with fix socket path | ||||
| ## See load-ssh-agent function in ~/.zsh/zshrc | ||||
| load-ssh-agent | ||||
| # }}} | ||||
| 
 | ||||
| # GPG Agent {{{ | ||||
| if [ -f $HOME/.gnupg/secring.gpg ]; then | ||||
| 	# Keychain | ||||
| 	## Don't ask for gpg password, it will be asked at the first usage | ||||
| 	keychain --noask --agents gpg | ||||
| 	. $HOME/.keychain/$HOST-sh-gpg | ||||
| fi | ||||
| # }}} | ||||
|  |  | |||
							
								
								
									
										4
									
								
								zshenv
								
								
								
								
							
							
						
						
									
										4
									
								
								zshenv
								
								
								
								
							|  | @ -108,3 +108,7 @@ SSH_AGENT_ENV="${HOME}/.ssh/socks/ssh_agent_env" | |||
| ## ssh-keys path | ||||
| SSH_ED25519_KEY="${HOME}/.ssh/id_ed25519" | ||||
| SSH_RSA_KEY="${HOME}/.ssh/id_rsa" | ||||
| 
 | ||||
| # GPG | ||||
| GPG_PRIV_KEY="${HOME}/.gnupg/secring.gpg" | ||||
| GPG_TEST_FILE="${HOME}/.password-store/test" | ||||
|  |  | |||
							
								
								
									
										25
									
								
								zshrc
								
								
								
								
							
							
						
						
									
										25
									
								
								zshrc
								
								
								
								
							|  | @ -373,19 +373,24 @@ alias scpdev='scp -o UserKnownHostsFile=/dev/null' | |||
| 
 | ||||
| # }}} | ||||
| 
 | ||||
| ## Keychain for GPG {{{ | ||||
| function gpg() { | ||||
| 	## If keychain exists, run gpg from default $PATH as usual | ||||
| 	if [ -f ~/.keychain/"${HOST}"-sh-gpg ]; then | ||||
| 		command -p gpg ${*} | ||||
| 	else ## Otherwise, reload keychain and run gpg | ||||
| 		keychain --agents gpg | ||||
| 		source ~/.keychain/"${HOST}"-sh-gpg | ||||
| 		command -p gpg ${*} | ||||
| # GPG {{{ | ||||
| ######### | ||||
| 
 | ||||
| # Load gpg-agent {{{ | ||||
| ## This function can be used : | ||||
| ##   1. with aliases (git commit,…) | ||||
| function load-gpg-agent() { | ||||
| 	## If a gpg key is available | ||||
| 	if [ -f "${GPG_PRIV_KEY}" ]; then | ||||
| 		## Remove any previous test file | ||||
| 		rm --force -- "${GPG_TEST_FILE}" | ||||
| 		## Run a gpg command on the test file | ||||
| 		gpg --quiet --for-your-eyes-only --decrypt "${GPG_TEST_FILE}.gpg" > /dev/null | ||||
| 	fi | ||||
| } | ||||
| ## }}} | ||||
| # }}} | ||||
| 
 | ||||
| # }}} | ||||
| 
 | ||||
| # Taskwarrior {{{ | ||||
| ## Aliases | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue