{"id":50269522,"url":"https://github.com/amake/org_social_mastodon_bridge","last_synced_at":"2026-05-27T16:04:23.578Z","repository":{"id":357375814,"uuid":"1225207400","full_name":"amake/org_social_mastodon_bridge","owner":"amake","description":"A tool for mirroring an Org Social feed to Mastodon","archived":false,"fork":false,"pushed_at":"2026-05-12T14:51:05.000Z","size":717,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-12T15:11:22.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amake.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"amake"}},"created_at":"2026-04-30T03:49:12.000Z","updated_at":"2026-05-12T13:07:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/amake/org_social_mastodon_bridge","commit_stats":null,"previous_names":["amake/org_social_mastodon_bridge"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/amake/org_social_mastodon_bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amake%2Forg_social_mastodon_bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amake%2Forg_social_mastodon_bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amake%2Forg_social_mastodon_bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amake%2Forg_social_mastodon_bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amake","download_url":"https://codeload.github.com/amake/org_social_mastodon_bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amake%2Forg_social_mastodon_bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33573271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-27T16:04:03.497Z","updated_at":"2026-05-27T16:04:23.568Z","avatar_url":"https://github.com/amake.png","language":"Dart","funding_links":["https://github.com/sponsors/amake"],"categories":[],"sub_categories":[],"readme":"# org_social_mastodon_bridge\n\nSync an [Org Social](https://org-social.org/) feed to a Mastodon account.\n\nThis project provides a CLI tool `osmb` to:\n\n- fetch and parse `social.org` feeds\n- lint and preview posts against Mastodon character limits\n- sync posts to Mastodon with idempotency and state management\n- support local authoring with local `.org` file inputs\n\nIt also supports scheduled execution via AWS Lambda.\n\n## Installation\n\n```sh\ndart pub global activate --source path .\n```\n\n(Note: Once published, you will be able to run `dart pub global activate org_social_mastodon_bridge`)\n\n## CLI Usage\n\nThe `osmb` CLI is the primary way to interact with the bridge.\n\n### `osmb init`\n\nInteractive setup to bootstrap your configuration.\n\n```sh\nosmb init\n```\n\nThis will prompt for your Mastodon instance and default feed URL, then create a configuration file at `~/.org_social_mastodon_bridge/config.json`.\n\n### `osmb auth`\n\nPerform or refresh Mastodon OAuth authorization.\n\n```sh\nosmb auth\n```\n\nThis registers an application on your instance (if needed) and guides you through the OAuth flow to obtain an access token.\n\n### `osmb lint [SOURCE]`\n\nCheck a source for errors or Mastodon limit violations. `SOURCE` can be a local file path or a URL.\n\n```sh\nosmb lint my_posts.org\n```\n\n### `osmb preview [SOURCE]`\n\nRender posts as they would be sent to Mastodon, showing character counts and publication modes.\n\n```sh\nosmb preview my_posts.org\n```\n\n### `osmb sync`\n\nPerform a synchronization pass using the configured source.\n\n```sh\nosmb sync\nosmb sync --dry-run\n```\n\n## Config\n\nBy default, `osmb` looks for configuration at `~/.org_social_mastodon_bridge/config.json`. You can override this with the `-c` or `--config` flag, or by setting the `ORG_SOCIAL_MASTODON_BRIDGE_CONFIG` environment variable.\n\nThe configuration file contains:\n\n- `source.feed_url`: URL of the Org Social feed to mirror\n- `mastodon.base_url`: Base URL of the target instance\n- `mastodon.access_token`: Posting token for the target account\n- `sync.dry_run`: Safety switch to prevent actual posting\n- `sync.include_source_link`: Whether to append a link to the original post\n- `state`: Configuration for the state store (local file or S3)\n\n### Manual Limit Overrides\n\nFor offline linting or specific instance needs, you can override Mastodon limits in `config.json`:\n\n```json\n\"mastodon\": {\n  \"max_characters\": 500,\n  \"characters_reserved_per_url\": 23,\n  \"max_media_attachments\": 4\n}\n```\n\n## Common Development Commands\n\nThese commands use `make` and typically target a local `config.json` in the repository root.\n\n- `make deps`: Install dependencies\n- `make generate`: Generate the Mastodon OpenAPI client\n- `make test`: Run tests\n- `make analyze`: Run static analysis\n- `make sync`: Run one sync pass (uses `osmb sync`)\n- `make preview`: Preview configured source (uses `osmb preview`)\n- `make provision`: Transition to Lambda: push state to S3 and config to environment variables\n- `make build`: Build the Lambda ZIP payload\n- `make deploy`: Update the Lambda function code\n\n## Logging\n\nLogs are written to stderr.\n\nSupported log levels:\n\n- `debug`\n- `info`\n- `warning`\n- `error`\n\nSet the level with `ORG_SOCIAL_MASTODON_BRIDGE_LOG_LEVEL`. If that is unset,\nthe code also falls back to `LOG_LEVEL`. The default is `info`.\n\nExamples:\n\n- `ORG_SOCIAL_MASTODON_BRIDGE_LOG_LEVEL=debug dart run bin/org_social_mastodon_bridge.dart`\n- `make run`\n- `make run run_log_level=info`\n\n## State And Idempotency\n\nEach mirrored source post is recorded by source ID in the state store together\nwith the created Mastodon status ID. The bridge also sends the source ID as the\nMastodon `Idempotency-Key` header, which reduces duplicate posts if a run fails\nmidway and is retried quickly.\n\nCurrent state files are expected to contain `content_hash`,\n`rendered_hash`, and `selected_media` for each record. State generated by the\ncurrent code will include those fields automatically; manually edited or stale\nstate files that omit them are no longer supported.\n\n## AWS Notes\n\nThe Lambda deployment target is a ZIP package for the AWS OS-only runtime\n`provided.al2023`, using a root-level `bootstrap`.\n\n`make build` compiles `bin/bootstrap.dart` to a Linux executable and zips it as\n`dist/lambda.zip`. `make deploy` updates the configured Lambda function using\nthe function name from `config.json`.\n\nRequirements for deployment tooling:\n\n- Dart SDK with cross-compilation artifacts available\n- `aws` CLI\n- `jq`\n\nThe trickiest gotcha is that if you provision the state file with `make\nprovision` it will be private, so you will need to ensure that the Lambda\nexecutor role has appropriate permissions like:\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:GetObject\",\n                \"s3:PutObject\"\n            ],\n            \"Resource\": \"arn:aws:s3:::$MY_BUCKET/path/to/state.json\"\n        }\n    ]\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famake%2Forg_social_mastodon_bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famake%2Forg_social_mastodon_bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famake%2Forg_social_mastodon_bridge/lists"}