This repository has been archived on 2022-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
dotplan-online/README.md

50 lines
2.0 KiB
Markdown
Raw Normal View History

2020-07-16 20:48:53 -05:00
# dotplan.online
## The un-social network.
- User-provided content tied to an email address.
- Text only, limited to 4kb.
- No retweets, shares, @s, likes, or boosting of any kind.
2020-07-16 23:55:59 -05:00
- Authenticity optionally verified by clients using public PGP keys.
2020-07-16 20:48:53 -05:00
- Accessed via public APIs.
2020-07-16 23:55:59 -05:00
- Open source.
- Self-hostable, discovery via domain SRV records.
- Single giant Perl script because PERL IS AWESOME!
2020-07-16 20:48:53 -05:00
## API
2020-07-16 23:55:59 -05:00
### Authentication
- `POST /users/{email}` - request new account
- request data: `{"password":"whatever"}`
- email with validation token will be sent
- `GET /users/{email}?token={token}` - validate new account
2020-07-17 21:36:12 -05:00
- `GET /token` - retrieve auth token
2020-07-16 23:55:59 -05:00
- http basic auth
2020-07-17 21:36:12 -05:00
- `?expires={minutes}` sets an explicit expiration, default is 5 minutes from creation
2020-07-16 23:55:59 -05:00
- response data: `{"token":"whatever"}`
2020-07-17 21:36:12 -05:00
- `DELETE /token` - invalidate current auth token
2020-07-16 23:55:59 -05:00
- http basic auth
- `GET /users/{email}/pwtoken` - get password change token
- email with password change token will be sent
- `PUT /users/{email}` - update password
- request data: `{"password":"whatever","pwtoken":"whatever"}`
- token expires 600 seconds from creation
### Plans
- `PUT /plan/{email}` - update a plan
- request data: `{"plan":"whatever","signature":"base64 encoded signature","auth":"token"}`
2020-07-17 21:36:12 -05:00
- omitting `plan` from the payload will delete the existing plan
2020-07-16 23:55:59 -05:00
- `GET /plan/{email}` - retrieve a plan
- `text/plain` by default - raw plan content
- `?format=html` or `Accept: text/html` - plan content with html entity encoding for special characters
- `?format=json` or `Accept: application/json` - response data: `{"plan":"whatever","signature":"base64 encoded signature"}`
2020-07-16 23:55:59 -05:00
- `404` if no plan found
2020-07-17 21:36:12 -05:00
- `301` redirect if plan is on a different provider
2020-07-16 23:55:59 -05:00
- `POST /verify/{email}` - verify PGP signature of a plan
2020-07-18 15:23:29 -05:00
- request data: `{"pubkey":"ascii public key"}`
- response data: `{"plan":"whatever","verified":1}` or `{"verified":0}`
2020-07-17 21:36:12 -05:00
- `404` if no plan found
- `308` redirect if plan is on a different provider