@@ -423,7 +423,6 @@ optional_params_server=(
423
423
" code_context"
424
424
" nexus_url"
425
425
" cr_event_type"
426
- " encryption_key"
427
426
)
428
427
429
428
bee_params=(
@@ -576,8 +575,6 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
576
575
nexus_url=$( echo " ${props[$param]} " | sed ' s/^[ \t]*//;s/[ \t]*$//' )
577
576
elif [ " $param " == " cr_event_type" ]; then
578
577
validate_cr_event_type " ${props[$param]} "
579
- elif [ " $param " == " encryption_key" ]; then
580
- encryption_key_value=${props[$param]}
581
578
else
582
579
docker_cmd+=" --$param =${props[$param]} "
583
580
fi
@@ -594,6 +591,7 @@ encrypt_git_secret() {
594
591
local plaintext=$2
595
592
596
593
# Convert key to hex
594
+ local key=$( openssl rand -base64 32)
597
595
local hex_key=$( echo -n " $key " | xxd -p -c 256)
598
596
599
597
# Generate IV (Initialization Vector)
@@ -614,22 +612,15 @@ encrypt_git_secret() {
614
612
615
613
param_bito_access_key=" bito_cli.bito.access_key"
616
614
param_git_access_token=" git.access_token"
617
- param_encryption_key= " encryption_key "
615
+
618
616
docker_enc_params=
619
617
if [ " $mode " == " server" ]; then
620
618
if [ -n " ${props[$param_bito_access_key]} " ] && [ -n " ${props[$param_git_access_token]} " ]; then
621
619
git_secret=" ${props[$param_bito_access_key]} @#~^${props[$param_git_access_token]} "
622
-
623
- if [ -n " ${props[$param_encryption_key]} " ]; then
624
- encryption_key=" ${props[$param_encryption_key]} "
625
- if [[ ${# encryption_key} -eq 44 ]] && [[ $encryption_key =~ ^[A-Za-z0-9+/]{43}= $ ]]; then
626
- git_secret=$( encrypt_git_secret " $encryption_key " " $git_secret " )
627
- docker_enc_params=" --git.secret=$git_secret --encryption_key=$encryption_key "
628
- else
629
- echo " Error: Encryption key must be a 44-character base64 string generated by openssl rand -base64 32."
630
- exit 1
631
- fi
632
- fi
620
+ encryption_key=$( openssl rand -base64 32)
621
+ git_secret=$( encrypt_git_secret " $encryption_key " " $git_secret " )
622
+ docker_enc_params=" --git.secret=$git_secret --encryption_key=$encryption_key "
623
+
633
624
634
625
echo " Use below as Gitlab and Github Webhook secret:"
635
626
echo " $git_secret "
0 commit comments