Skip to content

Add container workflow and bupd crosspost X posting - #9

Merged
bupd merged 7 commits into
mainfrom
feat/container-taskfile-workflow
Jun 15, 2026
Merged

Add container workflow and bupd crosspost X posting#9
bupd merged 7 commits into
mainfrom
feat/container-taskfile-workflow

Conversation

@bupd

@bupd bupd commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • add container-first Taskfile workflow, Docker Compose env handling, and CI lint/format checks
  • add dry-run mode, authorized Telegram users, safer Telegram log replies, and env doctor script
  • normalize crosspost env aliases, including AUTH_TOKEN -> TWITTER_AUTH_TOKEN for X
  • build crosspost from bupd/crosspost with configurable CROSSPOST_REPO/CROSSPOST_REF
  • switch the runtime image to Debian-based Bun so emusks/CycleTLS works in containers
  • keep Mastodon image upload patch for crosspost container usage

Verification

  • go test ./...
  • go vet ./...
  • docker compose config
  • docker build --no-cache --build-arg CROSSPOST_REF=feat/emusks-twitter-strategy -t registry.goharbor.io/bupd/shitpost:latest .
  • live container started with CROSSPOST_FLAGS=-bmt and AUTH_TOKEN present
  • direct X text smoke from container succeeded and was deleted
  • direct X image smoke from container succeeded and was deleted
  • missed X image post was backfilled successfully after crosspost media_id_string fix

Related

@bupd

bupd commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Added dry-run and lint workflow.\n\nContainer dry-run test command:\n\nshell\ntask up:dry-run\n\n\nDetached dry-run:\n\nshell\ntask up:dry-run:detached\ntask logs\n\n\nLocal smoke test passed with your ignored .env: the container started, authorized as @shitpost_engine_bot, and logged Dry-run mode enabled. Messages will not be posted.\n\nValidation run:\n- task validate\n- docker compose config\n- detached dry-run container startup/log check\n\nCI now checks:\n- gofmt\n- go vet\n- go build\n- go test

@bupd

bupd commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Fixed the downloads permission issue.\n\nRoot cause: with rootless Podman, the non-root bun user inside the container could not write to the host bind mount at ./downloads:/app/downloads.\n\nFixes pushed:\n- Run the runtime container as root inside the container for bind-mount compatibility. In rootless Podman this maps to the host user.\n- Ensure Taskfile starts create downloads/ before Compose starts.\n- Redact Telegram bot tokens from file download URLs in logs.\n\nValidated:\n- task validate\n- rebuilt dry-run container\n- touch /app/downloads/.write-test inside the container succeeds\n- bot starts in dry-run mode and authorizes as @shitpost_engine_bot

@bupd

bupd commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Fixed the Telegram message caption is too long issue.\n\nRoot cause: when crosspost failed, the bot tried to send the original media back with full stdout/stderr logs in the media caption. Telegram media captions are much shorter than normal messages.\n\nFix:\n- Media acknowledgement uses only the original caption.\n- Crosspost status/logs are sent as separate text messages.\n- Long logs are split into Telegram-safe chunks.\n\nCommit: be624b0 fix: avoid oversized Telegram log captions

@bupd

bupd commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

X retest result after corrected access token/secret:\n\n- X-only text post now reaches X with x-access-level: read-write, so the OAuth token/secret are accepted.\n- X still rejects the post with 402 CreditsDepleted: Your enrolled account ... does not have any credits to fulfill this request.\n\nSo the current Twitter/X blocker is no longer credentials. It is X API credits for write requests.\n\nI also pushed task doctor and env alias normalization so the bot can use canonical TWITTER_* keys or aliases like consumer_key, consumer_key_secret, access_token, and access_token_secret before invoking crosspost.\n\nCommit: ca75144 feat: normalize env aliases for crosspost

@bupd

bupd commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

Fixed Mastodon image upload in the container.\n\nRoot cause: the installed @humanwhocodes/crosspost package sends Mastodon media as a Bun Blob without a filename. Mastodon rejects that as 422 Validation failed: File can't be blank.\n\nFix: patch the installed crosspost Mastodon strategy during Docker build to append a filename to the FormData file field.\n\nValidated Mastodon-only image+caption post succeeded:\nhttps://mastodon.social/@bupd/116748523513085676\n\nThe bot has been rebuilt/restarted with the patched image.\n\nCommit: 990ed76 fix: patch Mastodon media uploads in container

@bupd bupd changed the title feat: add container-first task workflow Add container workflow and bupd crosspost X posting Jun 15, 2026
@bupd
bupd merged commit 76253c3 into main Jun 15, 2026
2 checks passed
@bupd
bupd deleted the feat/container-taskfile-workflow branch June 15, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant