|
@ -31,8 +31,20 @@ function _create() { |
|
|
admin_password=$(load_yaml_from_expanded services[\""$domain"\"][\""$subdomain"\"].data.admin.password) |
|
|
admin_password=$(load_yaml_from_expanded services[\""$domain"\"][\""$subdomain"\"].data.admin.password) |
|
|
redis_password=$(load_yaml_from_expanded credential.redis) |
|
|
redis_password=$(load_yaml_from_expanded credential.redis) |
|
|
|
|
|
|
|
|
|
|
|
redis_host=$(lxc list ct1 -c4 -f csv | cut -d' ' -f1) |
|
|
|
|
|
|
|
|
|
|
|
echo -n "count redis databases..." |
|
|
|
|
|
redis_database=$(lxc exec ct1 -- bash -c "redis-cli -h $redis_host -a $redis_password INFO keyspace | tail -n1 | grep db | cut -d: -f1") |
|
|
|
|
|
redis_database=${redis_database#db} |
|
|
|
|
|
if [[ "$redis_database" =~ ^[0-9]+$ ]]; then |
|
|
|
|
|
redis_database=$((redis_database + 1)) |
|
|
|
|
|
else |
|
|
|
|
|
redis_database=0 |
|
|
|
|
|
fi |
|
|
|
|
|
PREFIX='' echo $redis_database |
|
|
|
|
|
|
|
|
mkdir -p "$MIAOU_CONFIGDIR/apps/discourse" |
|
|
mkdir -p "$MIAOU_CONFIGDIR/apps/discourse" |
|
|
APP_REDIS_PASSWORD=$redis_password APP_DOMAIN=$domain APP_SUBDOMAIN=$subdomain APP_FQDN=$fqdn APP_PORT=$port APP_NAME=$longname tera -e --env-key env -t "$MIAOU_BASEDIR/templates/apps/discourse/forum.yml.j2" -o "$MIAOU_CONFIGDIR/apps/discourse/$longname.yml" "$MIAOU_CONFIGDIR/miaou.expanded.yaml" >/dev/null |
|
|
|
|
|
|
|
|
APP_REDIS_DB=$redis_database APP_REDIS_PASSWORD=$redis_password APP_DOMAIN=$domain APP_SUBDOMAIN=$subdomain APP_FQDN=$fqdn APP_PORT=$port APP_NAME=$longname tera -e --env-key env -t "$MIAOU_BASEDIR/templates/apps/discourse/forum.yml.j2" -o "$MIAOU_CONFIGDIR/apps/discourse/$longname.yml" "$MIAOU_CONFIGDIR/miaou.expanded.yaml" >/dev/null |
|
|
echo "creating templates ... OK" |
|
|
echo "creating templates ... OK" |
|
|
|
|
|
|
|
|
echo "copying files to container <$container> ... " |
|
|
echo "copying files to container <$container> ... " |
|
|