From 598b60d98a3a144d473b6e958f1857bdbaabff20 Mon Sep 17 00:00:00 2001 From: Maurice Renck Date: Tue, 25 Jun 2024 13:17:56 +0200 Subject: [PATCH] chore: updated readme --- .env.sample | 3 ++- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++--- docker-compose.yml | 19 ++++++++-------- 3 files changed, 63 insertions(+), 13 deletions(-) diff --git a/.env.sample b/.env.sample index 9ebd2e3..62461eb 100644 --- a/.env.sample +++ b/.env.sample @@ -2,4 +2,5 @@ MASTODON_INSTANCE="https://mastodon.instance" MASTODON_USER="username" BLUESKY_ENDPOINT="https://bsky.social" BLUESKY_HANDLE="USERNAME.bsky.social" -BLUESKY_PASSWORD="PASSWORD" \ No newline at end of file +BLUESKY_PASSWORD="PASSWORD" +INTERVAL_MINUTES: 5 diff --git a/README.md b/README.md index 47984b7..43304e9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,51 @@ -# mastodon-to-bluesky -A Node.js script for crossposting from mastodon to bluesky -For more details see: https://maurice-renck.de/hub/tooling/crosspost-from-mastodon-to-bluesky \ No newline at end of file +# Mastodon to Bluesky +#### Crosspost from Mastodon to Bluesky + +![GitHub release](https://img.shields.io/github/release/mauricerenck/mastodon-to-bluesky.svg?maxAge=1800) ![License](https://img.shields.io/github/license/mashape/apistatus.svg) + +--- + +This scripts listens to your Mastodon account and crossposts your toots to your Bluesky account. It uses the Mastodon API and the Bluesky API to achieve this. The script is written in Node.js and can be run on your local machine or on a server. + +--- + +## Installation + +You can run the script directly using Node.js or you can use the Docker image. + +### Node.js + +Clone this repository and install the dependencies: + +```bash +git clone https://github.com/mauricerenck/mastodon-to-bluesky.git +cd mastodon-to-bluesky +npm install +``` + +## Configuration + +Create a `.env` file in the root directory of the project and add the following variables: + +```bash +MASTODON_INSTANCE: 'https://mastodon.instance' +MASTODON_USER: 'username' +BLUESKY_ENDPOINT: 'https://bsky.social' +BLUESKY_HANDLE: 'USERNAME.bsky.social' +BLUESKY_PASSWORD: 'PASSWORD' +INTERVAL_MINUTES: 5 +``` + +You can also set the same variables as environment variables in the `docker-compose.yml` file. + +## Usage + +To run the script, execute the following command: + +```bash +node main.js +``` + +--- + +For more details see: https://maurice-renck.de/hub/tooling/crosspost-from-mastodon-to-bluesky diff --git a/docker-compose.yml b/docker-compose.yml index 3e1a2e6..fd55d19 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,17 +3,18 @@ services: app: image: host/mastodon-to-bluesky:latest container_name: mastodon-to-bluesky - environment: - MASTODON_INSTANCE: 'https://mastodon.instance' - MASTODON_USER: 'username' - BLUESKY_ENDPOINT: 'https://bsky.social' - BLUESKY_HANDLE: 'USERNAME.bsky.social' - BLUESKY_PASSWORD: 'PASSWORD' - INTERVAL_MINUTES: 5 + env_file: '.env' + # environment: + # MASTODON_INSTANCE: 'https://mastodon.instance' + # MASTODON_USER: 'username' + # BLUESKY_ENDPOINT: 'https://bsky.social' + # BLUESKY_HANDLE: 'USERNAME.bsky.social' + # BLUESKY_PASSWORD: 'PASSWORD' + # INTERVAL_MINUTES: 5 volumes: - mastodon-to-bluesky:/usr/src/app/data restart: unless-stopped volumes: - mastodon-to-bluesky: - external: true \ No newline at end of file + mastodon-to-bluesky: + external: true