@geekbeer/minion 2.48.1 → 2.48.3

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.
@@ -306,6 +306,20 @@ do_setup() {
306
306
 
307
307
  ENV_CONTENT+="AGENT_PORT=8080\n"
308
308
  ENV_CONTENT+="MINION_USER=${TARGET_USER}\n"
309
+ ENV_CONTENT+="REFLECTION_TIME=03:00\n"
310
+
311
+ # Detect system timezone (IANA format)
312
+ local SYS_TZ=""
313
+ if command -v timedatectl &>/dev/null; then
314
+ SYS_TZ=$(timedatectl show --property=Timezone --value 2>/dev/null || true)
315
+ fi
316
+ if [ -z "$SYS_TZ" ] && [ -f /etc/timezone ]; then
317
+ SYS_TZ=$(cat /etc/timezone 2>/dev/null | tr -d '[:space:]')
318
+ fi
319
+ if [ -z "$SYS_TZ" ] && [ -L /etc/localtime ]; then
320
+ SYS_TZ=$(readlink /etc/localtime | sed 's|.*/zoneinfo/||')
321
+ fi
322
+ ENV_CONTENT+="TIMEZONE=${SYS_TZ:-Asia/Tokyo}\n"
309
323
 
310
324
  echo -e "$ENV_CONTENT" | $SUDO tee /opt/minion-agent/.env > /dev/null
311
325
  $SUDO chown "${TARGET_USER}:${TARGET_USER}" /opt/minion-agent/.env
@@ -198,9 +198,11 @@ function configRoutes(fastify, _opts, done) {
198
198
  }
199
199
 
200
200
  const envPath = resolveEnvFilePath()
201
- const value = readEnvKey(envPath, key)
201
+ const fileValue = readEnvKey(envPath, key)
202
+ // Fall back to in-memory config default when .env has no entry
203
+ const value = fileValue !== null ? fileValue : (config[key] ?? '')
202
204
 
203
- return { key, value: value || '', configured: !!value }
205
+ return { key, value, configured: fileValue !== null }
204
206
  })
205
207
 
206
208
  // Update environment variable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekbeer/minion",
3
- "version": "2.48.1",
3
+ "version": "2.48.3",
4
4
  "description": "AI Agent runtime for Minion - manages status and skill deployment on VPS",
5
5
  "main": "linux/server.js",
6
6
  "bin": {
@@ -390,9 +390,17 @@ function Invoke-Setup {
390
390
  Write-Step 4 $totalSteps "Creating config directory and .env..."
391
391
  New-Item -Path $DataDir -ItemType Directory -Force | Out-Null
392
392
  New-Item -Path $LogDir -ItemType Directory -Force | Out-Null
393
+ # Detect system timezone (IANA format)
394
+ $sysTz = 'Asia/Tokyo'
395
+ try {
396
+ $tzInfo = Get-TimeZone
397
+ if ($tzInfo.Id) { $sysTz = $tzInfo.Id }
398
+ } catch {}
393
399
  $envValues = @{
394
400
  'AGENT_PORT' = '8080'
395
401
  'MINION_USER' = $env:USERNAME
402
+ 'REFLECTION_TIME' = '03:00'
403
+ 'TIMEZONE' = $sysTz
396
404
  }
397
405
  if ($HqUrl) { $envValues['HQ_URL'] = $HqUrl }
398
406
  if ($ApiToken) { $envValues['API_TOKEN'] = $ApiToken }
@@ -188,8 +188,10 @@ function configRoutes(fastify, _opts, done) {
188
188
  return reply.code(403).send({ error: `Key '${key}' is not allowed` })
189
189
  }
190
190
  const envPath = resolveEnvPath()
191
- const value = readEnvKey(envPath, key)
192
- return { key, value: value || '', configured: !!value }
191
+ const fileValue = readEnvKey(envPath, key)
192
+ // Fall back to in-memory config default when .env has no entry
193
+ const value = fileValue !== null ? fileValue : (config[key] ?? '')
194
+ return { key, value, configured: fileValue !== null }
193
195
  })
194
196
 
195
197
  fastify.put('/api/config/env', async (request, reply) => {