Synchronising/Crossposting topics across different Discourse sites

Hey Jay,

I’ve had this on my mind for a while, though it hasn’t progressed much until recently. Unfortunately the Discourse to Discourse syncing dropped in value for me(it was only a handful of topics), but what raised in value was the desire to synchronise markdown files from other platforms in general.

Our dominant use case at the company was to have readmes and wikis from Gitlab projects available within Discourse(for feedback and searching), but with the gitlab file remaining the single source of truth. My lack of ruby knowledge resulted in a python script which is definitely overkill in its implementation, but satisfactory in its functionality. The first decent version does some of what you outlined as well. Some functionality:

  • contains link to the original source(file in gitlab)
  • contains link to the specific revision(gitlab commit #)
  • handles images and image urls
    • downloads images from gitlab repo
    • uploads them to discourse
    • replaces original image url with the shorturl of the upload
  • adds a tag “synced_with_gitlab” so it’s easy to find them all

It worked more or less the same with github as well. Both have more or less the same flavour of markdown making it pretty slick.

I would love to make this open source, but I’ll need to see what legal say. Additionally, it’s still a bit of a hacky python mess. The intention is to convert this into a ruby plugin at some point, but I’ll need to see if I can find the necessary time.

3 Likes