Commit Graph
4110 Commits
Author SHA1 Message Date
Yota Hamada bf4a61cbb6 Restore the tokenless window for first-run setup
Requiring the token from the first request broke first-run setup for
anyone who opens the Web UI instead of the printed setup URL, such as a
fresh install from the Windows installer. First install has to work
without extra steps, so this goes back to the reviewed behavior.
2026-11-23 14:30:08 +09:00
Yota Hamada 7fefd02fd7 Require the setup token from the first request
A ten-minute tokenless window after start still let anyone who could
reach a fresh server create the admin, and it reopened on every
restart. Setup now needs the token as soon as the server creates it.

The setup page asks for the token when the URL carries none, since
visitors also reach it through other pages. The field is optional
because a server that cannot store a token accepts setup without one.
2026-11-23 14:22:40 +09:00
Yota Hamada 615f6db47f Merge remote-tracking branch 'origin/main' into fix/setup-token
# Conflicts:
#	api/v1/api.gen.go
2026-11-23 13:46:57 +09:00
Yota Hamada 1b395ce25d Name the setup token file and remove it once an admin exists
In quiet mode the server prints no setup URL, so after ten minutes the
setup token was only in a file that nothing named. The 401 message, the
setup page, and the API description now name auth/setup-token in the
data directory, and startup logs its path. The API description also says
that setup needs no token when the server cannot store one.

A token left by an earlier start stayed after initial_admin created the
admin on the next start. It is now removed whenever an admin exists.
2026-11-23 13:42:28 +09:00
Yota Hamada b50d980385 Teach the fail-closed checker the default mock (#4052) 2026-11-23 13:34:58 +09:00
Yota Hamada 5e0c8d6c4b Disable protected backfill profiles for non-admins (#4064)
The server refuses a backfill with a protected profile to anyone but an
administrator, but the backfill dialog offered those profiles to every
user who can manage profiles. A manager who picked one saw only a 403
in the plan preview.

The dialog now marks protected profiles and disables them for a
non-administrator, as the run dialog does.
2026-11-23 13:23:44 +09:00
Yota Hamada ecd29f0f9f Apply defaults to required human task fields (#4054) 2026-11-23 13:19:47 +09:00
Yota Hamada f87ca0084d Fix the DelayedRunningStatusWriteRemainsActiveUntilTerminalStatus flake (#4061) 2026-11-23 13:01:59 +09:00
Yota Hamada 309c0b8a43 Require an administrator to backfill with a protected profile (#4062)
A single run with a protected runtime profile needs an administrator,
but a backfill checked only execute access, so an operator could run
every slot of a DAG with a protected profile.

A backfill now checks its profile as a single run does. The profile
must also exist and be enabled, which a backfill learned only when its
first slot ran. Resuming a backfill keeps the profile it was submitted
with, as a retry keeps the profile of its run.
2026-11-23 12:58:47 +09:00
Yota Hamada ab16bc115b Publish every named output from a mock (#4055) 2026-11-23 12:58:18 +09:00
Yota HamadaandSCcagg5 cd32bc0293 List the recent activity of each DAG (#4041)
Co-authored-by: SCcagg5 <sccagg5@gmail.com>
2026-11-23 12:41:31 +09:00
Yota Hamada 6ce0f598a7 Ask for the setup token on the setup page
The page sends the token from the setup URL the server prints. When the
server answers that it needs the token, the page asks for it.
2026-11-23 12:36:37 +09:00
Yota Hamada 06a68fabcf Need a setup token for first-run setup after ten minutes
Until the first admin exists, anyone who could reach the server could
create it and take over the server. Scripts create the admin through
the same endpoint as the server starts, so a token cannot be required
from the first second without breaking them.

A server that starts without an admin now keeps a one-time setup token
in <data_dir>/auth/setup-token and prints the setup URL with the token,
in the startup banner or the log. For the first ten minutes after
start, setup works as before. After that, it needs the token, and
returns 401 without it. The token file is removed once the admin
exists. Servers with an admin, or with auth.builtin.initial_admin, are
unchanged, and so is setup when the token cannot be written.
2026-11-23 12:36:37 +09:00
Yota Hamada 51e184e719 Share generated token files between peers and setup
The coordinator keeps a generated peer token in the data directory, and
first-run setup needs a token kept the same way. The file handling, a
random token created once so processes on one data directory agree,
moves to the crypto package for both.
2026-11-23 12:36:37 +09:00
Yota Hamada fff4163335 Fill secrets with placeholders when no step is real (#4053) 2026-11-23 12:20:14 +09:00
Yota Hamada 2c5c387083 Close run ID, remote proxy, env, and webhook gaps (#4031) 2026-11-23 12:13:19 +09:00
Divyam Talwar 9e306fa56c Detect Excel workbook holders on macOS (#3285) 2026-11-23 11:57:00 +09:00
Yota Hamada 66f4d560e9 Add RFC 023 to publish workflows as A2A agents
Issue #4048 proposes letting external A2A agents discover and call
Dagu workflows. The RFC records the design: publishing files under
<dags_dir>/a2a, a DAG-level outputs field for results, the DAG run as
the only record of a task, retries disabled for runs started through
A2A so terminal tasks stay terminal, and task ownership by the key's
subject so rotating a key keeps access to its tasks.
2026-11-23 11:49:02 +09:00
Yota Hamada 286c7319ad Mock sub-DAG, parallel, foreach, and node steps (#4057) 2026-11-23 11:47:51 +09:00
Yota Hamada a25133b1e4 Replace Bluesky link with the X account
The Bluesky account was deleted. Point the community link at
x.com/dagucockpit, the account the GitHub organization lists.
2026-11-23 11:44:02 +09:00
Yota Hamada 02786087a0 Share the action-name lookup with the fail-closed checker (#4056) 2026-11-23 11:16:00 +09:00
Yota Hamada 2f8bdf1c20 Test node connections and trust host keys (#4046)
Add server-side APIs to test inventory node connections and enroll
verified SSH host keys. Require explicit replacement fingerprints and
role checks so unknown hosts never receive credentials.

Share SSH connection logic with workflow execution so connection tests
use the same host-key checks, credentials, and shell behavior.
2026-11-23 11:02:45 +09:00
Yota Hamada 7a54b9b142 Match Spec 101 to the accepted RFC 020 (#4051) 2026-11-23 10:29:19 +09:00
Yota Hamada 470f440d8d Exempt real steps from the run-time limit failure
A continuous step in real keeps its real intervals, so the run-time
limit rule fails only a step that is neither mocked nor real. This
matches Spec 101.
2026-11-23 10:23:03 +09:00
Yota Hamada 33c6bc7ea7 Keep authored assertions under dagu test --update
Rewriting the whole expect block dropped the output and stream
assertions an author wrote. Update only exact facts and keep intent
checks as written. Also fix the assertions example, which repeated a
mapping key.
2026-11-23 10:12:51 +09:00
Yota Hamada caa7d649ee Accept RFC 020 with the authoring decisions
Settle the open gates in favor of the smallest test files that keep
the fail-closed guarantee. A default mock covers every unnamed step,
waits without required values are approved automatically, and secrets
need values only when a step is real, so committed tests carry no
credentials.

Add output, stream, and notification assertions, run retries without a
scheduler, run-time repeat limits decided when they resolve, paste-ready
fixes for invalid cases, a test-file JSON Schema, and the --init and
--update authoring tools.
2026-11-23 09:55:53 +09:00
Yota Hamada f48bcee6cb Close UX gaps in RFC 022
A job's machine and logs are gone once its run ends, and a review of
what a person can then do found gaps. Reports now say where the run
ran: the CI platform with a link to its run, or Kubernetes with the
pod's name. A job run shows that platform instead of "manual", which
on such a machine is rarely a person.

The sender honors proxies and custom certificates as the other Console
clients do, prints a line when a finish was counted but not listed
past the allowance, and sends its version for Console to show beside
the key. The docs cover the firewall host and grouping retries with
--run-id.
2026-11-23 09:29:25 +09:00
Yota Hamada 488a471279 Settle RFC 022's open questions
Job runs send error messages by default, at the errors level Dagu
recommends for servers: once the machine is gone, a failure alert is
the only place that says why the run failed. cloud.report: runs keeps
error output on the machine.

The run prints one neutral line when it reports and a warning when
reporting stops short, naming neither the key nor the workspace, since
CI and Kubernetes logs are often public.
2026-11-23 09:20:29 +09:00
Yota Hamada 2c5bde7feb Add RFC 022 for job run reports to Dagu Console
A DAG run in a Kubernetes Job or CI step reports nothing: only the
server process reports, and running a server per container fills the
plan with servers meant to disappear. Dagu Console now takes runs sent
with a run key (RFC 020 in dagucloud/cloud) and waits for a sender.

RFC 022 has dagu start, exec, retry, and restart report the top-level
run with DAGU_CLOUD_RUN_KEY: at the start, each minute, on a status
change, and at the finish, retried for 10 seconds, without ever
changing the run's status or exit code. It wraps the run-state store
the agent writes through, reuses the server reporter's builders, and
stays off on a licensed server, a worker, a sub-DAG, a test, or a dry
run.
2026-11-23 00:57:58 +09:00
Yota HamadaandSCcagg5 c95171d336 Quick-fix a field that accepts one value (#4042)
Co-authored-by: SCcagg5 <sccagg5@gmail.com>
2026-11-23 00:54:41 +09:00
Yota Hamada 782875408a Add the fail-closed checker for workflow tests (#4033) 2026-11-23 00:22:59 +09:00
Yota Hamada 58c353fa1b Turn off run-level side effects for workflow test runs (#4034) 2026-11-23 00:22:15 +09:00
Yota HamadaandSCcagg5 0f4c0d4911 Measure the content width of an element (#4043)
Co-authored-by: SCcagg5 <sccagg5@gmail.com>
2026-11-23 00:13:56 +09:00
Yota Hamada 5c60dba019 Fix TestSignalCleanupTimeout timing out on start (#4047) 2026-11-23 00:09:56 +09:00
Yota Hamada e379cbf67d Isolate each workflow-test case in a case directory (T8) (#4036) 2026-11-23 00:00:43 +09:00
Yota Hamada 368ae21dc4 Prevent duplicate users and make them safe to remove (#4045)
Follow-up to #4028.
2026-11-22 23:55:52 +09:00
Yota Hamada 49301ab8eb Authenticate coordinator peers with a shared token (#4037) 2026-11-22 23:36:34 +09:00
Yota Hamada 070226c4c6 Inject step mocks where the node builds its executor (#4032) 2026-11-22 23:31:19 +09:00
Yota Hamada eabc976ede Fix TestService_DeliversLifecycleEvent timing out on slow runners (#4044) 2026-11-22 23:30:51 +09:00
4 Bytes Robby 48ba97ee97 Collapse duplicate usernames in the user list (#4028)
Closes #4025
2026-11-22 23:25:34 +09:00
Yota Hamada 3fca5a2a27 Read and import inventories over the API (N12) (#3945) 2026-11-22 23:04:49 +09:00
Yota Hamada b7c6f68065 Add Spec 101 for workflow tests (#4035) 2026-11-22 22:40:55 +09:00
Yota Hamada f10be453d1 Measure a run's steps once per read (#4040)
The reporter measured every cached step again on each report to keep
the runs in progress within their 512 KiB. A read now keeps its size,
and reads are kept by the run as listed, so a run whose status changed
is read again.
2026-11-22 22:34:04 +09:00
Yota Hamada a239c77eec Bind the SSH node into its child run (N13) (#4024)
A run bound to an inventory node now reaches it over SSH, as a run
with DAG-level ssh reaches its host. Steps with no action, steps typed
command or shell, ssh.run, and sftp.* connect to the node through its
bastion; other actions run where the run runs. Before, every bound run
with a command step failed before any step started.

Each hop accepts only its node's pinned or trusted host key unless the
node sets strict_host_key: false, and a refused key fails the step
before any credential is sent. The node's secret refs resolve once per
run, only when a step connects, and join the run's masking. A step's
with overrides the node's fields. with.known_host_file,
with.strict_host_key, and with.bastion are errors, since the inventory
decides them.

${node.*} reads the bound node's name, host, port, user, description,
and labels. A run fails before any step when its node is missing or
disabled, or when a value-resolved field reads a label the node lacks
or a path the namespace does not define. Outside a bound run, a
variable named node keeps its JSON path reading.

A command step's node children now read earlier steps' outputs. Bound
runs on workers fail before any step until N27.
2026-11-22 22:27:23 +09:00
4 Bytes Robby 1060ea64c2 Match the license label to the version style (#4027)
The sidebar footer showed the license label in a different font, size,
and nesting than the version number next to it. Render the label as a
direct sibling of the version, in the same monospace 11px style.

Closes #4026
2026-11-22 22:25:45 +09:00
Yota Hamada 620fa652a0 Fix TestCommandExecutor_CleansProcessGroupWhenParentDies reading an empty PID (#4039) 2026-11-22 22:22:37 +09:00
Yota HamadaandSCcagg5 7101cc087e Read YAML booleans right in the code editor (#4023)
Co-authored-by: SCcagg5 <sccagg5@gmail.com>
2026-11-22 22:16:13 +09:00
Yota Hamada a9fc54757a Carry projects in RFC 021's audit uploads
Dagu v3 records each audit entry's project ID and name (RFC 003), and
Console filters by them. The upload sends both within the identifier
limits. project_id is generated, so it stays unmasked with the other
control fields; the project name is masked like workspace.
2026-11-22 22:12:51 +09:00
Yota HamadaandSCcagg5 07a75332ed Shorten the run IDs that the scheduler gives (#4022)
Co-authored-by: SCcagg5 <sccagg5@gmail.com>
2026-11-22 22:02:05 +09:00
Yota Hamada 9653a783f8 Serve the run history of service DAGs (#4020)
Since #4009 the scheduler keeps a long-term history of the runs of each
service DAG, but nothing read it. Three API routes now serve it: the
samples in buckets, the failed, recovered and gap events, and the
availability of four windows, each with its uptime.

A sample is written only when a run ends, so the routes add the run in
progress to the uptime at the time of the query, without counting the
time the history already recorded. A DAG that is no longer a service
DAG keeps serving its history, and its live run adds no up time. A
plain DAG with no history gets 404.

StepSamples and StepAvailability become aliases of the shared schemas,
so the step routes answer as before. A conformance suite checks the
routes against a real scheduler and server.
2026-11-22 21:34:25 +09:00