zitadel/build/local/keys.sh
Silvan a6e4b537fe
chore(contribute): add step by step guide (#1754)
* chore(contributing): add startup

* init

* cleanup docker file

* local

* compose works

* markdowns

* add gateway start on readme

* readme done

* finish mds

* rename/delete compose files

* correct docker compose file name

* fix links,
update contribute,
split build/readme into separate files in /guides,
add zitadel startup

* fix(docker compose): allow .keys folder to not exist

* update md's

* use docker-compose instead of docker compose as --profile gets ignored

* write a message if create key

* copy openapi statik.go

* explain how to connect in quickstart

* Apply suggestions from code review

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* sremove subscription service from env.json

* Delete caos_local.sh

moved to build/local/local.env

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2021-06-01 09:55:08 +02:00

24 lines
613 B
Bash
Executable File

#!/bin/sh
# ----------------------------------------------------------------
# generates necessary ZITADEL keys
# ----------------------------------------------------------------
set -e
KEY_PATH=$(echo "/zitadel/$(dirname ${ZITADEL_KEY_PATH})")
KEY_FILE=${KEY_PATH}/local_keys.yaml
mkdir -p ${KEY_PATH}
if [ ! -f ${KEY_FILE} ]; then
touch ${KEY_FILE}
fi
for key in $(env | grep "ZITADEL_.*_KEY" | cut -d'=' -f2); do
if [ $(grep -L ${key} ${KEY_FILE}) ]; then
echo "create key for ${key} in ${KEY_FILE}"
echo -e "${key}: $(head -c22 /dev/urandom | base64)" >> ${KEY_FILE}
fi
done