Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/reusable-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:

steps:
- uses: actions/checkout@v6
- run: sudo apt update && sudo apt install -y pwgen
- name: Generate .env file
env:
FNM_PATH: ${{ github.workspace }}
Expand Down
5 changes: 4 additions & 1 deletion scripts/fcli_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ if [ "$PARAM1" = "show" ];then
fi
fi

docker compose -f $COMPOSE_FILE exec $SERVICE_NAME fcli $@
exec docker compose \
-f $COMPOSE_FILE \
exec -e JSON_MODE="${JSON_MODE:-off}" $SERVICE_NAME \
fcli "$@"
16 changes: 11 additions & 5 deletions scripts/init_secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@ grafana_admin_password
clickhouse_grafana_password
web_api_admin_password"

#for secret in "${SECRETS_NAMES[@]}"
for secret in $SECRETS_NAMES;do
echo "Generate and write $secret"
if [ -f "${PROJECT_DIR}/secrets/$secret" ]; then
echo "$secret secret file already exist\n"
else
password=`printf "%s" $(pwgen 16 1)`
password=""
LENGTH=16
while [ "${#password}" -lt "$LENGTH" ]; do
chunk=$(head -c 64 /dev/urandom | tr -dc 'A-Za-z0-9_-')
password="${password}${chunk}"
done
password=$(printf '%s' "$password" | cut -c "1-$LENGTH")

if [ "$secret" = "web_api_admin_password" ]; then
password=`printf "_%s" $(pwgen 15 1)`
password=$(printf '%s' "$password" | sed 's/^./_/')
fi
printf '%s' "$password" > "${PROJECT_DIR}/secrets/$secret"
printf '%s' "$password" > "${PROJECT_DIR}/secrets/$secret"
fi
done

echo "Done"
echo "Done"
Loading