https://github.com/yusukebe/minidon
Minimal implementation of ActivityPub using Cloudflare Workers and D1
https://github.com/yusukebe/minidon
Last synced: about 1 year ago
JSON representation
Minimal implementation of ActivityPub using Cloudflare Workers and D1
- Host: GitHub
- URL: https://github.com/yusukebe/minidon
- Owner: yusukebe
- Created: 2023-02-05T13:17:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T13:42:30.000Z (over 3 years ago)
- Last Synced: 2025-03-29T06:43:04.582Z (about 1 year ago)
- Language: TypeScript
- Size: 130 KB
- Stars: 61
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minidon
Minimal implementation of ActivityPub with Cloudflare Workers and D1.
## What can we do?
* Having only one actor
* The actor is discovered via webfinger (so you can find the account from other instances)
* Notifying followers of new posts (so new posts show up in their timeline)
* Web interface to post messages
## Screencast

## Requirements
* Node.js
* Cloudflare Account
## Installation
```
yarn install
```
## Configuration
```
cp wrangler.sample.toml wrangler.toml
```
Fill the values:
* `preferredUsername` - Your account name. eg. `yusukebe`
* `name` - Your long name. eg. `Yusuke Wada`
* `BASIC_USERNAME` - Basic auth username for login to Web UI
* `BASIC_PASSWORD` - Basic auth password
Pick up the value of `PRIVATE_KEY` from the files generated by `ssh-keygen`:
```
ssh-keygen -b 4096 -m PKCS8 -t rsa -N '' -f id_rsa
```
You can also use the value as "Secret variables" in Cloudflare Workers.
## Setup D1
```
wrangler d1 create minidon
```
`database_id` will be shown on your console. Copy it and paste into the value of `database_id` and `preview_database_id` in wrangler.toml.
Create tables:
```
wrangler d1 execute minidon --file minidon.sql
```
## Development
```
yarn dev
```
## Deploy
```
yarn deploy
```
## Usage
`@{name}@{minion.username.workers.dev}` will be your account id.
Paste it on such a Mastodon URL input, the account will be shown.
To post the message, access `https://minion.username.workers.dev/ui`.
## Author
Yusuke Wada
## License
MIT
And using a lot of code in Matchbox and inspired by Express ActivityPub Server.
Matchbox
https://gitlab.com/acefed/matchbox
Copyright (c) 2022 Acefed MIT License
Express ActivityPub Server
https://github.com/dariusk/express-activitypub
Copyright (c) 2018 Darius Kazemi. Licensed under the MIT license.