Commit Graph
9 Commits
Author SHA1 Message Date
andwati 028d478b05 Trim credentials before use; fix redact on awkward tokens
A GITEA_TOKEN secret stored with a trailing newline makes curl emit
`Authorization: token <value>\n`. The bare LF terminates the header
block early, so Content-Type and everything after it is parsed as
request body and Gitea rejects the call with 422 "Empty Content-Type".
GETs were unaffected because nothing they need follows the auth header,
which is why this presented as a proxy stripping the header.

- trim CR/LF and surrounding whitespace off GITHUB_TOKEN, GITEA_TOKEN,
  GITEA_URL and GITEA_OWNER, warning when a value needed it
- rebuild redact() on bash substitution; the previous sed s/// blew up
  with "unterminated `s' command" on a token containing a newline
- add AGENTS.md / CLAUDE.md documenting the run flow and these traps
2026-08-19 08:44:58 +03:00
andwati 3a07c298f6 Harden Gitea write requests against dropped Content-Type
Runs from the GitHub runner were failing every migrate with 422
"[]: Empty Content-Type" while the same script worked from a local
network, so the header is being dropped in front of Gitea on the
public path rather than the payload being wrong.

- route POST/PATCH through one gitea_write helper: body via
  --data-binary @file (also keeps the PAT out of the process list),
  Expect: disabled, explicit charset, retry over HTTP/1.1 when the
  response still reports an empty Content-Type
- add DEBUG_HTTP=1 to dump request/response headers, tokens redacted
- move temp files into a mktemp -d cleaned by trap
- add a workflow preflight that POSTs JSON over HTTP/2 and HTTP/1.1 to
  show whether the header survives the trip
- drop the redundant chmod; the script is committed mode 100755
2026-08-19 08:39:43 +03:00
andwati 9bb5037336 fix actions node warning 2026-08-19 08:29:33 +03:00
andwati 5c3b3414ee fix sync bugs 2026-08-19 08:25:30 +03:00
andwati a752daff3d Refactor mirror script to streamline repo processing and improve payload construction 2026-08-18 16:30:44 +03:00
andwati 1bdc15b258 Add .gitignore and enhance Gitea mirror script for repo visibility updates 2026-08-18 16:07:12 +03:00
andwatiandGitHub 2e3ef4e132 Create LICENSE 2026-08-18 16:01:01 +03:00
andwatiandGitHub 7fcfab98dc Create README.md 2026-08-18 16:00:41 +03:00
andwati 6ba5b43dda initial commit 2026-08-18 15:59:40 +03:00