Repository navigation
Conversation
Adds an optional "Private key password" field to the OpenVPN client settings for .ovpn files whose inline private key is encrypted. When provided, the passphrase is written to <name>_keypass.conf (mode 0600, created under a 0077 umask), symlinked as keypass.conf the same way login.conf is handled, and configauth.sh replaces any existing askpass directive with "askpass keypass.conf". Activating or deleting a configuration now also relinks/removes its keypass file. Arguments passed to configauth.sh are now shell-escaped. Fixes RaspAP#2109 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional Private key password field to the OpenVPN client settings, in the Certificates panel. With it,
.ovpnprofiles that contain an encrypted inline<key>can be used.Why
Without the passphrase,
openvpn-client@clientcannot decrypt the key without user input, so it exits with "can't ask for 'Enter Private Key Password'".Fixes #2109
How
SaveOpenVPNConfig()accepts an optional$keyPassword. When it is set:/tmp/ovpn/keypass(umask 0077, chmod 0600)./etc/openvpn/client/<name>_keypass.confand symlinked askeypass.conf, the same waylogin.confis handled.configauth.shtakes a 4th argument. When it is1, the script replaces any existingaskpassdirective withaskpass keypass.conf.keypass.conf, and deleting a profile removes its_keypass.conf.configauth.share now shell-escaped.How tested
php -lpasses on PHP 7.4, 8.2 and 8.5, andparallel-lintpasses. phpcs (PSR-2) reports no new findings in the touched files..ovpn, and ranconfigauth.shwithsudo/iptablesstubbed. The staleaskpassline was removed and the new one was appended.askpass, it fails the way the issue describes.Notes
askpasstogether withauth-nocache.del_ovpncfg.phpalready usedrm -f, which may not match the sudoers rule/bin/rm /etc/openvpn/client/*.conf. I kept the existing pattern rather than change it here.AI disclosure: this change was prepared with the help of Claude Code and reviewed by me.
🤖 Generated with Claude Code