unoverse 0.1.96 → 0.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -377,6 +377,25 @@ _ensure_ground_config() {
377
377
  info "${DIM}(Auth0 or any OIDC provider; the issuer looks like https://your-tenant.auth0.com)${NC}"
378
378
  fi
379
379
  fi
380
+ # AWS ONLY. Cognito needs a first administrator, and nothing else in the CLI collects an
381
+ # email — so this was left FILL_ME and the deploy gave up. It is one question.
382
+ if [ "$cloud" = "aws" ] && grep -q '^admin_email[[:space:]]*=[[:space:]]*"FILL_ME"' "$tfv" 2>/dev/null; then
383
+ local admin_email=""
384
+ echo ""
385
+ echo -e " ${CYAN}${BOLD}Who is the first administrator?${NC}"
386
+ echo -e " ${DIM}They get a Cognito account with every role, and an invitation by email.${NC}"
387
+ echo ""
388
+ while [ -z "$admin_email" ]; do
389
+ read -r -p " Email: " admin_email
390
+ case "$admin_email" in
391
+ *@*.*) : ;;
392
+ *) [ -n "$admin_email" ] && warn "That does not look like an email address"; admin_email="" ;;
393
+ esac
394
+ done
395
+ _tf_put admin_email "$admin_email"
396
+ ok "First administrator: ${BOLD}$admin_email${NC}"
397
+ fi
398
+
380
399
  _tf_fill auth_issuer AUTH_ISSUER "AUTH_ISSUER"
381
400
  _tf_fill auth_client_id AUTH_CLIENT_ID "AUTH_CLIENT_ID"
382
401
 
@@ -384,9 +403,16 @@ _ensure_ground_config() {
384
403
  # it declared a complete file blank.
385
404
  if grep -qE '=[[:space:]]*"FILL_ME"' "$tfv" 2>/dev/null; then
386
405
  echo ""
387
- warn "Some values are still blank in ${BOLD}infra/$cloud/terraform.tfvars${NC} fill them, then:"
388
- info " cd infra/$cloud && terraform init && terraform apply"
389
- info " cd ../.. && unoverse deploy"
406
+ # NAME THE VALUES, AND NEVER HAND BACK TERRAFORM. This said "fill them, then cd
407
+ # infra/<cloud> && terraform init && terraform apply" — the homework this CLI exists to
408
+ # remove and then named `unoverse deploy` without the ground, which on a universe with
409
+ # two grounds is a command that refuses. Say which values, say where, say the command
410
+ # that resumes.
411
+ warn "These still need a value in ${BOLD}infra/$cloud/terraform.tfvars${NC}:"
412
+ echo ""
413
+ grep -nE '=[[:space:]]*"FILL_ME"' "$tfv" | sed -E 's/^([0-9]+):([a-z_]+).*/ line \1 \2/' | while read -r l; do echo -e " ${DIM}$l${NC}"; done
414
+ echo ""
415
+ info "Fill them in, then: ${BOLD}unoverse deploy $cloud${NC}"
390
416
  echo ""
391
417
  exit 1
392
418
  fi
@@ -541,13 +567,30 @@ cmd_deploy() {
541
567
  # ── ONE FLOW ────────────────────────────────────────────────────────────────
542
568
  # Which ground, is it configured, plan it, apply it, ship it. In that order, every
543
569
  # time, whether this is the first deploy or the fiftieth.
544
- # A named ground wins; one configured ground is implied; two without a name is refused
545
- # (see _pick_ground). Nothing configured at all falls through to creating one below,
546
- # which is the first-run path and the only case where an empty answer is not a mistake.
547
- local cloud="" rc have=0
548
- [ -f "$ROOT/infra/digitalocean/terraform.tfvars" ] || [ -f "$ROOT/infra/aws/terraform.tfvars" ] && have=1
549
- if [ "$have" = "1" ]; then
550
- cloud=$(SELF_CMD="unoverse deploy" _pick_ground "${GROUND_ARG:-}") || exit 1
570
+ # NAMING A GROUND THAT DOES NOT EXIST YET MEANS BUILD IT THERE. `unoverse deploy aws` on a
571
+ # universe with only a DigitalOcean ground used to answer "No aws ground here. Run
572
+ # unoverse deploy aws to create one" the command just typed, refusing itself. Those
573
+ # words already say where this should go, so the only thing left to do is set it up.
574
+ #
575
+ # A named ground with no tfvars falls through to the create flow below and skips the
576
+ # "which cloud?" question, because it has been answered. An UNNAMED deploy still goes
577
+ # through _pick_ground, which refuses to guess between two configured grounds.
578
+ local cloud="" rc
579
+ case "${GROUND_ARG:-}" in
580
+ do|digitalocean) cloud="digitalocean" ;;
581
+ aws|amazon) cloud="aws" ;;
582
+ esac
583
+
584
+ if [ -n "$cloud" ]; then
585
+ # Named. Configured already? Then use it; otherwise create it below.
586
+ [ -f "$ROOT/infra/$cloud/terraform.tfvars" ] || { cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" || {
587
+ echo ""
588
+ info "Once that is sorted, run ${BOLD}unoverse deploy $cloud${NC} again. It picks up right here."
589
+ echo ""
590
+ exit 1
591
+ }; }
592
+ elif [ -f "$ROOT/infra/digitalocean/terraform.tfvars" ] || [ -f "$ROOT/infra/aws/terraform.tfvars" ]; then
593
+ cloud=$(SELF_CMD="unoverse deploy" _pick_ground "") || exit 1
551
594
  fi
552
595
 
553
596
  if [ -z "$cloud" ]; then
@@ -291,8 +291,9 @@ openai_api_key = "FILL_ME"
291
291
  # hyperbrowser_api_key = "" # optional — page intelligence
292
292
 
293
293
  oauth_callback_urls = [
294
- $( if [ -n "$zone_domain" ]; then echo " \"https://$zone_domain\","; else echo " \"https://FILL_ME\","; fi )
294
+ $( if [ -n "$zone_domain" ]; then echo " \"https://canvas.$zone_domain\","; fi )
295
295
  "http://localhost:5173", # local Studio/Canvas dev against this universe
296
+ # Add your Canvas URL here once a domain is set (https://canvas.<domain>).
296
297
  ]
297
298
 
298
299
  # RBAC roles (noun:verb). Each becomes a Cognito group; put a user in the group
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.96",
3
+ "version": "0.1.98",
4
4
  "description": "The Unoverse front door — create a Studio project, a universe, or a client app, and launch Studio.",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "type": "module",