Commit Graph

269 Commits

Author SHA1 Message Date
Valentin Maerten
89b8d04ad9 refactor(remote): rename HostHeaders to HeadersByHost
The type is a map of host to headers, not a flat header set. Name it after
that shape, and rename the fields carrying it to authHeadersByHost so the
lookup step is visible at every call site.

Claude-Session: https://claude.ai/code/session_01KNPMznEzkRpxFZMLisjdqL
2026-08-29 21:47:53 +02:00
Valentin Maerten
bff4f97d7e refactor(remote): template header values instead of expanding ${VAR}
Aligns the syntax with the rest of Task, and lets functions compose: a
Basic credential no longer needs its base64 computed by hand. The strict
expansion this replaces was already gone, so nothing is lost by the
switch.

Only functions resolve — the configuration file is read before any
Taskfile, so {{.VAR}} has nothing to read and produces an empty header.
That is documented next to the option.
2026-08-23 12:35:55 +02:00
Valentin Maerten
8fc344f6cc test(remote): drop the RemoteExists status tests 2026-08-23 12:25:36 +02:00
Valentin Maerten
a41df4a127 fix(remote): report a 401 instead of a missing Taskfile
RemoteExists treated every non-200 as an absent file, so a server
refusing the credentials ended up as "No Taskfile found", sending the
user to check the URL rather than the token. A 401 now stops the search
and reports the status code; the default names need the same credentials,
so trying them would only add rejected requests. A 403 is left alone: it
is also what a server without directory listing answers for a readable
directory.

That message being correct, the expansion no longer needs to refuse an
undefined variable: os.ExpandEnv is inlined and expandEnv is gone. The
`$$` escape goes with it, so a literal value can no longer hold a `$`
followed by a name; a secret carried in an environment variable is
unaffected, as os.Expand never rescans what it substituted.

Header names are validated with httpguts.ValidHeaderFieldName, the table
net/http itself uses, rather than a denylist that let X-Foo(bar) through.
golang.org/x/net was already in the module graph, so tidy only moves it
to the direct block.

Finally, node_http_auth.go becomes http_auth.go: the node_ prefix is for
files defining a Node type, and this one holds the auth concern of
HTTPNode plus hostMatches, which reader.go uses for trusted hosts.
2026-08-23 12:11:55 +02:00
Valentin Maerten
8d3a20ef33 chore(remote): trim the remote.auth comments 2026-08-23 12:11:08 +02:00
Valentin Maerten
8a93190060 feat(remote): add remote.auth to send HTTP headers when downloading Taskfiles
Authenticating a remote Taskfile so far meant putting the credential in the
include URL, where it leaks into error messages and the confirmation prompt.
`remote.auth` configures free-form headers per host instead, so the URL stays
safe to commit. Values may reference environment variables with ${VAR}.

The headers are injected by a RoundTripper rather than set on the request:
that covers the HEAD probe RemoteExists issues before the GET, and keeps a
cross-host redirect from carrying the credentials. They are resolved when the
request is about to be made, so a cached or offline run does not require a
token it will never send.
2026-08-23 12:11:08 +02:00
Valentin Maerten
dd4463ec60 chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920) 2026-08-20 12:24:04 +02:00
Valentin Maerten
1868ad2969 fix(remote): verify the pinned checksum on remote cache hits (#2980) 2026-08-14 19:46:08 +02:00
Pete Davison
87076b165f feat: enable remote taskfiles (#2906) 2026-08-13 14:38:10 +01:00
Valentin Maerten
37898d9102 feat: command timeouts (#2898) 2026-08-11 22:09:25 +02:00
星尘
2888867c94 feat: support excluding task namespaces (#2959) 2026-08-10 16:23:51 +02:00
cui fliter
d2b02e3c69 fix: preserve stdin taskfile bytes (#2950)
Signed-off-by: cuishuang <imcusg@gmail.com>
2026-08-09 18:55:17 +00:00
Valentin Maerten
26baea3dcd Merge commit from fork 2026-07-14 22:06:38 +02:00
Maxime Boucher
ed24adbc99 perf: avoid eager fingerprint variable evaluation (#2883) 2026-07-13 17:58:27 -03:00
qingyingliu
b5861b1e27 fix: reject include without taskfile or dir (#2892)
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
2026-07-01 19:48:47 +00:00
Pete Davison
a6cedbe732 fix: remote taskfiles from ADO git path (#2904) 2026-07-01 14:38:38 +02:00
otjdiepluong
d601746d4b fix: handle nil Vars in ToCacheMap (#2842) 2026-06-30 22:32:07 +02:00
Valentin Maerten
9910c33557 fix(remote): define special variables behavior (#2847) 2026-06-29 19:25:25 +01:00
Valentin Maerten
616433df75 feat: add use_gitignore option to exclude ignored files from sources/generates (#2773) 2026-06-29 15:39:33 +02:00
Valentin Maerten
6abbbcb265 feat: do not log secret variables (#2514) 2026-06-29 14:50:08 +02:00
Amit Mishra
1a0f146888 fix: don't mutate shared matrix AST when resolving ref: rows (#2894)
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
2026-06-28 20:03:11 +00:00
Ludovic Fernandez
ecffcc720f chore(golangci-lint): improve and clean configuration (#2808) 2026-04-23 21:13:15 -03:00
Andrey Nering
219bf3e5a5 chore: add nolint annotations for gosec linter
Add //nolint:gosec annotations for intentional code patterns
that are safe in context (path traversal in release tool,
uintptr conversion for terminals, weak rand in tests,
TLS skip verify for user-configured insecure mode).

Assisted-by: Kimi-K2.5 via Crush <crush@charm.land>
2026-04-13 10:46:19 -03:00
Valentin Maerten
8b6aca5722 feat(requires): support variable references in enum constraints (#2678) 2026-03-21 11:32:02 +01:00
Andrey Nering
fc5f6fa3aa fix: pin yaml package to v3 for now (#2693) 2026-02-17 15:29:51 -03:00
Timothy Rule
f63a63fa6c fix: improve error message when searching for Taskfile. (#2682) 2026-02-15 14:56:35 +01:00
Valentin Maerten
8b063d6b92 fix(git): check cache before context timeout in getOrCloneRepo (#2669) 2026-02-15 14:46:55 +01:00
Timothy Rule
df7810ab63 fix: copy watch when merging tasks during import (#2686) 2026-02-15 14:42:59 +01:00
Trim21
cf54be3266 fix(node_git): always use unix path style (#2656) 2026-01-31 18:49:22 +01:00
Valentin Maerten
026c899d90 feat: support self-signed certificates for remote taskfiles (#2537) 2026-01-25 18:51:30 +01:00
Timothy Rule
f6720760b4 fix(includes): propagate silent mode from included Taskfiles to tasks (#2640) 2026-01-25 16:33:52 +01:00
Valentin Maerten
9bc1efbc47 feat: add conditional execution for tasks and commands (#2564) 2026-01-21 23:05:40 +01:00
Valentin Maerten
618cd8956f feat: wildcard match aliases (#2234) 2026-01-18 19:05:29 +01:00
Valentin Maerten
ba38344ca6 fix: remote git taskfile cloning and directory includes (#2602) 2026-01-14 19:43:39 +01:00
Valentin Maerten
cb183349b7 refactor: migrate from go-git to go-getter (#2512) 2025-12-18 12:21:30 +01:00
Timothy Rule
ea933bcc55 fix: support error_ignore for a task call (#2552) 2025-12-12 22:28:20 +01:00
Valentin Maerten
5889ff6b65 fix: globals vars are available in vars at root level (#2403) 2025-12-12 21:20:27 +01:00
Andrey Nering
745633dc0e fix: a couple of fixes and improvements on task --init (#2433)
* Fixed check for an existing Taskfile: look for all possibilities, and
  not only `Taskfile.yml` specifically.
* Added a description (`desc`) to the `default` task. Important to at
  least `task --list` work by default (a core feature).
* Changed top comment to YAML language server comment.
2025-12-07 20:29:51 +00:00
Andrey Nering
9b99866224 feat: add --failfast and failtest: true to control dependencies (#2525) 2025-12-07 17:23:08 -03:00
Maciej Lech
72a349b0e9 feat: add --trusted-hosts CLI and remote.trusted-hosts config for remote tasks (#2491)
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
2025-12-07 12:17:54 +01:00
Valentin Maerten
b93638b97a fix: allow application/octet-stream for a Remote taskfile (#2536) 2025-12-02 20:36:35 +01:00
Andrey Nering
c7b4f26900 chore: run modernize 2025-11-22 17:30:30 -03:00
Timothy Rule
386dcbc1a0 fix: adjust run: when_changed to work correctly with imported tasks (#2511) 2025-11-22 17:17:13 -03:00
Andrey Nering
ee99849b1d refactor: migrate to the official yaml package (#2434)
The old package is long archived, but the YAML org forked it and will
officially maintain it from now on.

* Old: https://github.com/go-yaml/yaml
* New: https://github.com/yaml/go-yaml
2025-11-11 19:49:37 +00:00
Valentin Maerten
17757c0c15 fix: better error when a Taskfile does not exist in include (#2494) 2025-11-11 20:37:24 +01:00
Skip Baney
348158a5f6 fix: properly resolve remote entrypoints (#2438) 2025-10-12 13:29:57 +02:00
Andrey Nering
68b1d2783d lint: fix lint by passing context 2025-09-21 16:09:51 -03:00
Timothy Rule
b8bf298c84 fix: panic for empty hash var ({}) (#2417) 2025-09-12 15:29:40 -03:00
Valentin Maerten
48039be12c feat: improve fingerprint, run and output with wildcard (#1808) 2025-09-11 19:33:53 +02:00
Pete Davison
f89c12ddf0 feat: XDG taskrc config (#2380)
Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
2025-08-18 22:43:36 +02:00