Files
story/scripts/local-phone-account/main.go
T
Codex Local bf1233d5df
ci / verify (push) Canceled after 0s
feat: expand companion platform, device controls, and memoir workflows
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
2026-10-08 10:06:44 +08:00

31 lines
957 B
Go

// Local fixture setup only. Run explicitly after the local seed and migration 61.
package main
import (
"context"
"data-terminal-cloud/internal/onboarding"
"fmt"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/redis/go-redis/v9"
"os"
)
func main() {
ctx := context.Background()
pool, err := pgxpool.New(ctx, "postgres://voice:voice_dev_only@127.0.0.1:55432/voice_platform?sslmode=disable")
check(err)
defer pool.Close()
r := redis.NewClient(&redis.Options{Addr: "127.0.0.1:56379"})
defer r.Close()
s, err := onboarding.NewService(pool, r, onboarding.Options{MasterKey: os.Getenv("ONBOARDING_MASTER_KEY"), EntryURL: "http://localhost:3100/onboarding/entry", AllowLocalHTTP: true})
check(err)
check(s.ProvisionLocalDemoPhone(ctx, os.Getenv("LOCAL_DEMO_PASSWORD")))
fmt.Println("Local demo phone account provisioned; existing credentials preserved.")
}
func check(err error) {
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}