# Conflicts: # README.md
|4 months ago|
|img||4 months ago|
|masto_bridges||4 months ago|
|.gitignore||11 months ago|
|LICENSE||11 months ago|
|README.md||4 months ago|
|poetry.lock||4 months ago|
|post-commit.sample||11 months ago|
|pyproject.toml||4 months ago|
masto-bridges (formerly masto-gitsocial-bridge)
Mirrored to https://github.com/sneakers-the-rat/masto-gitsocial-bridge if for some godforsaken reason you want to raise issues or pull requests or fork it or whatever
CalDAV to Masto (and back again)
Post directly from your (CalDAV) calendar, and follow your feeds from your calendar!
See config below for how to set up for your calendar.
Compatible with mobile too!
From Calendar to Masto
Make a new calendar event with
- Event title/summary: your username
user. Calendar entries that don't match your username will not be posted (since they aren't from you!)
- Notes/Description: The content of your post!
- Time, date, duration, repetition: don't matter for now!
- The absence of a URL in the "location" field is used to make sure we don't echo posts we make from the real masto
From Masto to Calendar
MASTOBRIDGE_STREAM_MODE="home", your home feed should already be posting to your calendar!
To make it so only your posts are added to your calendar, set the stream mode to
bridge between mastodon and bcrypt's git-social
From git to masto
Post on git-social...
Bridge to mastodon
From masto to git
Post on mastodon...
Bridge to git-social
Everything in this package is a bug and not a feature.
I'm not going to uh, make this good or put it on pypi or anything.
So you should clone this and install it with poetry, (otherwise
you have to modify the below
post-commit action to activate the
venv where it is installed correctly)
git clone https://git.jon-e.net/jonny/masto-gitsocial-bridge cd masto-gitsocial-bridge poetry install
Make masto token
~ check with your instance's policies before doing something bad like this ~
From your masto instance's homepage...
- Preferences (in hamburger menu top right if page is narrow)
- Development tab
- New Application
The bot needs permissions (I'm honestly not sure you need to give all of
me() method seems to need a lot of them. idk.)
write:lists- the bot only streams your posts by making a list with just you on it
write:statuses- to xpost, dummy!
Then copy the resulting access token for use in configuration...
masto_git_bridge.config.Config for the required configuration values.
The config object uses Pydantic to load either from an
.env file or
from environment variables, for example, make an
.env file in the cloned
repository directory like
MASTOBRIDGE_LOGDIR="/wherever/you/want/to/put/logs" MASTOBRIDGE_MASTO_URL="https://social.coop" MASTOBRIDGE_MASTO_TOKEN="<mastodon bot access token>" MASTOBRIDGE_ENABLE_GIT=false MASTOBRIDGE_GIT_REPO="/path/to/your/git-social/tweets" MASTOBRIDGE_GIT_REMOTE_URL="https://git.jon-e.net/jonny/tweets" MASTOBRIDGE_ENABLE_CALDAV=true MASTOBRIDGE_CALDAV_URL="https://your.caldav.calendar/wherever" MASTOBRIDGE_CALDAV_USER="<caldav username>" MASTOBRIDGE_CALDAV_PASSWORD="<caldav password>" MASTOBRIDGE_CALDAV_CALENDAR_NAME="<name of calendar to use for feeds and posts>" # "home" (for streaming your home feed to bridges) # or "list" for streaming a list with just your account in it to bridges MASTOBRIDGE_STREAM_MODE="home"
This is assuming you don't need any sort of authentication/local password on your local git repository in order to commit or push to it.
In your git-social repository, make a
post-commit action (
that looks something like this (see the sample)
#!/bin/bash # Assuming we have installed the package using poetry from a git repository # lmao I did not say we handled virtual environments well in this package cd <path/to/masto-gitsocial-bridge> poetry run post_last_commit # otherwise activate whatever venv you have installed the package in and # call masto_git_bridge.main:post_last_commit, which is # installed as an entrypoint script by poetry
The post-commit action should run anytime you commit a post to git-social, but to post from mastodon you'll have to run the bot, which listens for your posts and reposts them to git-social (only if they are "public" or "unlisted").
poetry run masto_gitbot # or # >>> poetry shell # >>> masto_bridgebot # or however else you run python entrypoint scripts # hell you could do python -m masto_bridges.main:masto_gitbot # i think?
Warnings & Gotchas
If you ever enable this, you should promptly disable it