Self-hosteable Micropub and Media endpoint for blot.im and Dropbox
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config Added install check and static code analysis Aug 23, 2018
.eslintrc.json
.travis.yml Added install check and static code analysis Aug 23, 2018
LICENSE
README.md Updated README to include micropub.rocks report Aug 24, 2018
app.js
app.json Updated readme for media endpoint details Aug 21, 2018
package-lock.json
package.json

README.md

Micropub for Blot, with Dropbox

Build Status FOSSA Status

An endpoint that accepts Micropub requests, creates a simple Blot posts and saves them to a configured Dropbox folder. This enables updating a Blot blog through a Micropub client.

Currently, the endpoint supports the following.

  • Creation of posts with titles (articles) and without titles (notes)
  • Metadata creation for tags, slugs and published date
  • Support for like and reply post types. Added as metadata like-of and in-reply-to.
  • Uploading of image files as multipart data. Added as metadata photo
  • Support for syndicating posts to Mastodon
  • In-built media endpoint available at /micropub/media

Full implementation report is available on micropub.rocks

TODO

  • Add support for media endpoint
  • Implement repost, bookmark post types
  • Add support for updating and deleting the posts

Requirements

Requires at least Node.js 6.0.0.

Installation

This is a self-hosteable Micropub endpoint. Install it as a normal Node.js application. Add the required configuration values via environment variables or similar mechanism.

You can also deploy directly to Heroku.

Deploy

Note: This is an alpha release and there may be some edge cases that aren't handled. If you find one, please report an issue.

Endpoint discovery

Once you have deployed the application, your Micropub endpoint can be found at /micropub e.g. https://example.com/micropub.

To enable automatic discovery for your Micropub endpoint and token endpoint, you will need to add the following values to your Blot site's <head> - regularly in the head.html file in your theme.

<link rel="micropub" href="https://example.com/micropub">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">

Configuration

Required values

The following variables are required to enable a Micropub client to push content to your GitHub repository.

Variable Description
AUTH_TOKEN_ENDPOINT URL to verify Micropub token. Example: https://tokens.indieauth.com/token
SITE_URL URL for your site. Example: https://johndoe.example
DROPBOX_TOKEN Dropbox access token to grant access to your Dropbox folder. Example: 12345abcde67890fghij09876klmno54321pqrst
POST_PATH Dropbox path where posts are to be stored
PHOTO_PATH (Optional) Dropbox path where images are to be stored. Default to POST_PATH
PHOTO_RELATIVE_URI (Optional) Relative public URI to uploaded images (ignoring Site URL). Default to blank
MICRO_POST_PATH (Optional) Dropbox path where micro posts are to be stored. Default to POST_PATH
SET_DATE (Optional) A boolean flag which if set to true, date of the post creation is explicitly added to post metadata
TZ (Optional - only if SET_DATE set) By default, post creation date would be in UTC. This can be overridden by setting this to the preferred timezone using the TZ Database Timezone format
DEFAULT_TAG (Optional) If this property is set and no category is provided, value would be set as the tag
SYNDICATE_TO (Optional) Syndication target(s) provided as a JSON array. E.g. as defined at spec: [{"uid":"https://social.example/johndoe","name":"@johndoe on Example Social Network"}]
MASTODON_INSTANCE (Optional) Mastodon instance where posts need to be syndicated
MASTODON_TOKEN (Optional) Access Token for Mastodon
MEDIA_ENDPOINT (Optional) Media Endpoint to be used. Can also be configured to in-built endpoint available at /micropub/media

Modules used

  • micropub-express – an Express Micropub endpoint that accepts and verifies Micropub requests and calls a callback with a parsed micropubDocument.

Releases

Version Date Notes
0.5 2018-08-21 Introduced an in-built Media endpoint
0.4 2018-08-19 Added support for syndicating posts to Mastodon
0.3 2018-08-15 Added support for photo uploads multipart
0.2 2018-08-08 Added support for like/reply post types
0.1 2018-08-05 Initial release with support for notes and articles

License

FOSSA Status