Hello,
I'm currently trying to test borgwarehouse.com to make sure it can get installed and ran properly on FreeBSD. It's very early stage software but sounds promising. Anyway, the software relies on a handful of bash shell scripts that could be ported to FreeBSD in no time.
One of those shell scripts tries to validate an SSH key handled by the user, relevant code is:
and full script is available at https://github.com/Ravinou/borgwarehouse/blob/main/helpers/shells/createRepo.sh
Problem: that code block will work OK on most machines I've tested it on
I don't have access to Linux with bash 5.1.16 in order to validate it's a Bash problem and not a FreeBSD problem.
Any help appreciated
I'm currently trying to test borgwarehouse.com to make sure it can get installed and ran properly on FreeBSD. It's very early stage software but sounds promising. Anyway, the software relies on a handful of bash shell scripts that could be ported to FreeBSD in no time.
One of those shell scripts tries to validate an SSH key handled by the user, relevant code is:
Bash:
# Check if the SSH public key is a valid format
# This pattern validates SSH public keys for : rsa, ed25519, ed25519-sk
pattern='(ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?'
if [[ ! "$2" =~ $pattern ]]
then
echo "Invalid public SSH KEY format. Provide a key in OpenSSH format (rsa, ed25519, ed25519-sk)"
exit 2
fi
and full script is available at https://github.com/Ravinou/borgwarehouse/blob/main/helpers/shells/createRepo.sh
Problem: that code block will work OK on most machines I've tested it on
- macOS bash 3.x
- Linux bash 4.x, 5.0.x, 5.1.4
- FreeBSD 12 bash 5.0.x
- FreeBSD 13 bash 5.1.16
- FreeBSD 13 bash 5.2.12
I don't have access to Linux with bash 5.1.16 in order to validate it's a Bash problem and not a FreeBSD problem.
Any help appreciated
