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.
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.
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.
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.
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.
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.
Checking a DAG while editing it reran every step, so a one-line change
to a filter at the end reopened the site and asked the model to read
it again, though nothing that step read had changed.
A run may name an earlier finished run of the same DAG to reuse, as
reuseFrom in the API or --reuse-from on dagu start. A step whose
definition, the DAG's other settings, the base config, the resolved
parameters, the runtime profile, and the steps it depends on are as
they were there, and that succeeded there or carried outputs into it,
is skipped and carries its outputs; the changed steps and the steps
after them run. When nothing changed or nothing can be reused, every
step runs. It builds on the selected-steps run, so a reused step is
recorded as it is for outputsFromRuns, and the run takes that run's
work directory.
A step that calls a missing executable passed validation in the DAG
editor and failed only at run time. Validation now returns a non-fatal
warning for such a command, with the step and the field, so the editor
marks it. The DAG stays valid, and saving and running stay allowed.
The check reads the server host, so it reports nothing when the host
cannot answer: container, SSH, and worker-dispatched steps, commands
that hold a variable or a substitution, scripts, shell built-ins,
relative paths, and bare names when the DAG or the step sets PATH or
installs tools. Only a caller that may edit DAGs gets the warning,
because it reveals which paths exist on the server.
Closes#3679
Since #3621, dagu validate warns when a command writes a model's reply
into its shell text, because a shell can run that text as code. The
reference list still offered those outputs in a command with no hint, so
an author learned of the risk only after choosing one.
The scope now flags such an output, and a field that a shell reads marks
it as not safe, with what to do instead. That covers run fields in
foreach bodies and parallel groups, where the validator warns too. Env
offers it plainly, since passing the value through env is the fix. An
output that its schema limits to an enum or a non-text type is not
flagged.
The rule follows the validator's private functions rather than exporting
them, and a test runs real YAML through both to keep them in step.
Refs #3616