Drop pwgen/pwqgen requirements
continuous-integration/drone/push Build is passing Details

Closes #167.
This commit is contained in:
decentral1se 2021-07-04 23:06:20 +02:00
parent 283eb21e29
commit e9fb9e56ad
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
3 changed files with 15 additions and 10 deletions

View File

@ -18,6 +18,7 @@
- Skip generation of commented out secrets and correctly fail deploy when secret generation fails ([#133](https://git.autonomic.zone/coop-cloud/abra/issues/133))
- Fix logging for chaos deploys and recipe selection logic ([#185](https://git.autonomic.zone/coop-cloud/abra/issues/185))
- Improve reliability of selectig when to download a new `apps.json` ([#170](https://git.autonomic.zone/coop-cloud/abra/issues/170))
- Remove `pwgen`/`pwqgen` as password generator requirements ([#167](https://git.autonomic.zone/coop-cloud/abra/issues/167))
# abra 9.0.0 (2021-06-10)

View File

@ -25,16 +25,14 @@ See [CHANGELOG.md](./CHANGELOG.md).
> [docs.coopcloud.tech](https://docs.coopcloud.tech)
## Install
## Requirements
Requirements:
- `pwqgen` (optional)
- `pwgen` (optional)
- `curl`
- `docker`
- `bash` >= 4
## Install
Install the latest stable release:
```sh

16
abra
View File

@ -652,6 +652,14 @@ checkout_main_or_master() {
git checkout main > /dev/null 2>&1 || git checkout master > /dev/null 2>&1
}
pwgen_native() {
tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c "$1"
}
pwqgen_native() {
shuf -n 3 /usr/share/dict/words | tr -dc 'a-zA-Z0-9' | tr -d '\n'
}
# FIXME 3wc: update or remove
if [ -z "$ABRA_ENV" ] && [ -f .env ] && type direnv > /dev/null 2>&1 && ! direnv status | grep -q 'Found RC allowed true'; then
error "direnv is blocked, run direnv allow"
@ -1706,11 +1714,9 @@ sub_app_secret_generate(){
fi
if [[ -n "$length" ]]; then
require_binary pwgen
abra__cmd_="pwgen -s $length 1"
abra__cmd_="pwgen_native $length"
else
require_binary pwqgen
abra__cmd_=pwqgen
abra__cmd_=pwqgen_native
fi
PWGEN=${abra__cmd_}
@ -1720,7 +1726,7 @@ sub_app_secret_generate(){
error "Required arguments missing"
fi
PW=$($PWGEN|tr -d "\n")
PW=$($PWGEN)
success "Password: $PW"