cross-posted from: https://slrpnk.net/post/10823519

So I wrote a little web app that allows a user to move their user data, like settings and subscribed/banned communities, from one account/instance to another.

It runs completely client-side, but is hosted on GitHub for the moment. Maybe it’ll be of some use!

Features:

  • Export user data from any Lemmy instance (>=v0.19)
  • Download user data as a text file
  • Modify user data in the browser, e.g. to add or remove followed instances
  • Transfer user data to the target account on the target instance
  • warmaster@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    5 months ago

    Could this work offline as a PWA? By offline I mean not hosted on your server, but locally.

    • Emotet@slrpnk.netOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      Sure, the code is completely client-side, simply clone it. If you’re running into CORS problems due to the file:// scheme Origin of opening a local file, simply host it as a local temporary server with something like python -m http.server .

      This is due to the two ways most instances validate Cross-Origin requests:


      • Sending Access-Control-Allow-Origin: * (allow all hosts)
      • Dynamically putting your Origin into the Origin header of the response to your requests by the backend

      file:// URLs will result in a null or file:// Origin which can’t be authorized via the second option, therefore the need to sometimes host the application via (local) webserver.