mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-04 10:14:47 +08:00
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:
+2
-3
@@ -3,14 +3,13 @@
|
||||
# NanoClaw — scripted end-to-end install.
|
||||
#
|
||||
# Runs `bash setup.sh` (bootstrap: Node check, pnpm install, native module
|
||||
# verify), then `pnpm run setup:auto` (environment → timezone → container →
|
||||
# onecli → auth → mounts → service → verify).
|
||||
# verify), then `pnpm run setup:auto` (environment → container → onecli →
|
||||
# auth → mounts → service → cli-agent → verify).
|
||||
#
|
||||
# Everything that can be scripted runs unattended; the one interactive pause
|
||||
# is the auth step (browser sign-in or paste token/API key).
|
||||
#
|
||||
# Config via env — passed through unchanged:
|
||||
# NANOCLAW_TZ IANA zone override
|
||||
# NANOCLAW_SKIP comma-separated setup:auto step names to skip
|
||||
# SECRET_NAME OneCLI secret name (default: Anthropic)
|
||||
# HOST_PATTERN OneCLI host pattern (default: api.anthropic.com)
|
||||
|
||||
+5
-14
@@ -7,13 +7,16 @@
|
||||
* module check). This driver picks up from there.
|
||||
*
|
||||
* Config via env:
|
||||
* NANOCLAW_TZ IANA zone override (skip autodetect)
|
||||
* NANOCLAW_DISPLAY_NAME operator name for the CLI agent (default: $USER)
|
||||
* NANOCLAW_AGENT_NAME agent persona name (default: display name)
|
||||
* NANOCLAW_SKIP comma-separated step names to skip
|
||||
* (environment|timezone|container|onecli|auth|
|
||||
* (environment|container|onecli|auth|
|
||||
* 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
|
||||
* (the only step that truly requires human input — browser sign-in or a
|
||||
* pasted token/key). Channel auth and `/manage-channels` remain separate
|
||||
@@ -132,24 +135,12 @@ async function main(): Promise<void> {
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean),
|
||||
);
|
||||
const tz = process.env.NANOCLAW_TZ;
|
||||
|
||||
if (!skip.has('environment')) {
|
||||
const env = await runStep('environment');
|
||||
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')) {
|
||||
const res = await runStep('container');
|
||||
if (!res.ok) {
|
||||
|
||||
Reference in New Issue
Block a user