refactor(setup): drop timezone step from setup:auto chain

The timezone step blocked the scripted flow on headless servers where
the resolved TZ was UTC (interactive /setup confirms, setup:auto had
to bail). Drop it from the chain — host TZ defaults to whatever the
OS reports. Users who need an explicit override run the step on
demand: `pnpm exec tsx setup/index.ts --step timezone -- --tz <zone>`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-04-21 22:18:08 +03:00
parent be6cec59ad
commit 1c748f1f2b
2 changed files with 7 additions and 17 deletions

View File

@@ -3,14 +3,13 @@
# NanoClaw — scripted end-to-end install. # NanoClaw — scripted end-to-end install.
# #
# Runs `bash setup.sh` (bootstrap: Node check, pnpm install, native module # Runs `bash setup.sh` (bootstrap: Node check, pnpm install, native module
# verify), then `pnpm run setup:auto` (environment → timezone → container # verify), then `pnpm run setup:auto` (environment → container → onecli
# onecli → auth → mounts → service → verify). # auth → mounts → service → cli-agent → verify).
# #
# Everything that can be scripted runs unattended; the one interactive pause # Everything that can be scripted runs unattended; the one interactive pause
# is the auth step (browser sign-in or paste token/API key). # is the auth step (browser sign-in or paste token/API key).
# #
# Config via env — passed through unchanged: # Config via env — passed through unchanged:
# NANOCLAW_TZ IANA zone override
# NANOCLAW_SKIP comma-separated setup:auto step names to skip # NANOCLAW_SKIP comma-separated setup:auto step names to skip
# SECRET_NAME OneCLI secret name (default: Anthropic) # SECRET_NAME OneCLI secret name (default: Anthropic)
# HOST_PATTERN OneCLI host pattern (default: api.anthropic.com) # HOST_PATTERN OneCLI host pattern (default: api.anthropic.com)

View File

@@ -7,13 +7,16 @@
* module check). This driver picks up from there. * module check). This driver picks up from there.
* *
* Config via env: * Config via env:
* NANOCLAW_TZ IANA zone override (skip autodetect)
* NANOCLAW_DISPLAY_NAME operator name for the CLI agent (default: $USER) * NANOCLAW_DISPLAY_NAME operator name for the CLI agent (default: $USER)
* NANOCLAW_AGENT_NAME agent persona name (default: display name) * NANOCLAW_AGENT_NAME agent persona name (default: display name)
* NANOCLAW_SKIP comma-separated step names to skip * NANOCLAW_SKIP comma-separated step names to skip
* (environment|timezone|container|onecli|auth| * (environment|container|onecli|auth|
* mounts|service|cli-agent|verify) * mounts|service|cli-agent|verify)
* *
* Timezone is not configured here — it defaults to the host system's TZ.
* Run `pnpm exec tsx setup/index.ts --step timezone -- --tz <zone>` later
* if autodetect is wrong (e.g. headless server with TZ=UTC).
*
* Anthropic credential registration runs via setup/register-claude-token.sh * Anthropic credential registration runs via setup/register-claude-token.sh
* (the only step that truly requires human input — browser sign-in or a * (the only step that truly requires human input — browser sign-in or a
* pasted token/key). Channel auth and `/manage-channels` remain separate * pasted token/key). Channel auth and `/manage-channels` remain separate
@@ -132,24 +135,12 @@ async function main(): Promise<void> {
.map((s) => s.trim()) .map((s) => s.trim())
.filter(Boolean), .filter(Boolean),
); );
const tz = process.env.NANOCLAW_TZ;
if (!skip.has('environment')) { if (!skip.has('environment')) {
const env = await runStep('environment'); const env = await runStep('environment');
if (!env.ok) fail('environment check failed'); if (!env.ok) fail('environment check failed');
} }
if (!skip.has('timezone')) {
const res = await runStep('timezone', tz ? ['--tz', tz] : []);
if (res.fields.NEEDS_USER_INPUT === 'true') {
fail(
'Timezone could not be autodetected.',
'Set NANOCLAW_TZ to an IANA zone (e.g. NANOCLAW_TZ=America/New_York).',
);
}
if (!res.ok) fail('timezone step failed');
}
if (!skip.has('container')) { if (!skip.has('container')) {
const res = await runStep('container'); const res = await runStep('container');
if (!res.ok) { if (!res.ok) {