Wire demo seed so TUI connects to Test and Website Relaunch.

Dev seed now issues write tokens and writes local taskmaster meta under TASK_MASTER_HOME, so make run-dev can sync without manual setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-27 23:05:10 +01:00
co-authored by Cursor
parent 79b0821837
commit b311a355fd
5 changed files with 201 additions and 11 deletions
+7 -3
View File
@@ -88,7 +88,7 @@ func bootstrapAdmin(db *sqlite.DB) error {
}
func runServer(listen, dbPath string, secure bool) error {
db, _, err := openDB(dbPath)
db, cfg, err := openDB(dbPath)
if err != nil {
return err
}
@@ -100,7 +100,10 @@ func runServer(listen, dbPath string, secure bool) error {
srv.Secure = secure
if strings.EqualFold(os.Getenv("TM_SEED_DEMO"), "1") ||
strings.EqualFold(os.Getenv("TM_SEED_DEMO"), "true") {
if err := srv.SeedDemo(); err != nil {
if err := srv.SeedDemo(server.SeedDemoOptions{
ClientDataDir: cfg.DataDir,
BaseURL: server.SeedBaseURL(listen),
}); err != nil {
return fmt.Errorf("seed: %w", err)
}
projects, _ := srv.Projects.List()
@@ -183,6 +186,7 @@ Env:
TASK_MASTER_HOME / TASK_MASTER_DATA_DIR same as tm
TASK_MASTER_SECRET encrypts remote tokens
TM_ADMIN_USER / TM_ADMIN_PASSWORD bootstrap first admin
TM_SEED_DEMO=1 seed local Test projects when DB empty (no YouTrack)
TM_SEED_DEMO=1 seed demo projects + wire TUI (Test, Website Relaunch)
TM_SEED_BASE_URL override base URL written into TUI meta.json
`)
}