Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngrewe/stadtgestalten-mastodon-bridge
https://github.com/ngrewe/stadtgestalten-mastodon-bridge
cloudflare-workers grouprise mastodon mastodon-bot stadtgestalten
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ngrewe/stadtgestalten-mastodon-bridge
- Owner: ngrewe
- License: mit
- Created: 2023-06-28T08:23:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-07T22:06:02.000Z (9 months ago)
- Last Synced: 2024-04-07T23:20:58.604Z (9 months ago)
- Topics: cloudflare-workers, grouprise, mastodon, mastodon-bot, stadtgestalten
- Language: TypeScript
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stadtgestalten/Grouprise Events to Mastodon Bridge
This bridge takes events published by a group from a [Grouprise](https://grouprise.org/) instance
and publishes them to a Mastodon feed. It runs on a cron schedule in Cloudflare workers. A free
Cloudflare account is sufficient to run this.## Configuration
| Variable | Required | Used For |
|--------------------|----------|----------|
|`STADTGESTALTEN_URL`| |URL where to reach the Grouprise instance (default: `https://stadtgestalten.org`) |
| `STADTGESTALTEN_GROUP_SLUG` | ✅ | The slug of the group you want to publish events for |
| `MASTODON_URL` | ✅ | URL of your Mastodon instance |
| `MASTODON_ACCOUNT` | ✅ | Name of your Mastodon account |
| `MASTODON_TOKEN` | ✅ | Access token with (at least) the following scopes: `read:accounts`, `read:statuses`, `write:statuses` |
| `MASTODON_HASHTAGS` | | A comma separated list of hashtags to attach to toots. Can be left empty.## Deployment
* Login to your Cloudflare account
```sh
npx wrangler login
```* Deploy the worker
```sh
npx wrangler deploy
```* Configure secrets if you have not done so already.
```sh
npx wrangler secret put STADTGESTALTEN_URL
npx wrangler secret put STADTGESTALTEN_GROUP_SLUG
npx wrangler secret put MASTODON_URL
npx wrangler secret put MASTODON_TOKEN
npx wrangler secret put MASTODON_ACCOUNT
npx wrangler secret put MASTODON_HASHTAGS
```## Local Development
Start the dev server:
```sh
npx wrangler dev --test-scheduled
```
And visit `http://127.0.0.1:8787/__scheduled?cron=*+*+*+*+*` in the browser.## Known Limitations
The worker currently scans all toots in the target account to find out which
events it has already published. This is not scalable for accounts with a
large amount of toots.