Coder Social home page Coder Social logo

lasim's Introduction

Lemmy Account Settings Instance Migrator

Project Inactive

Long overdue, but officially posting here that this project is inactive.

Lemmy 0.19 introduced the option to export / import all user settings, follows, blocks, etc. so this work-around is no longer needed.

Thank you for those of you that contributed, and I hoped the project helped some users in the early Lemmy days when there was a lot of instance hopping. It was exciting to work on something useful, even though my rust is still quite poor.

The original README content is below.


LASIM Screenshot

How it works

  1. Create an account on the server you want to migrate to.
  2. Run LASIM, enter your old account credentials, and hit "Download". Your information is saved to a local JSON file.
  3. In LASIM, hit the Upload tab, then enter your new account credentials and hit "Upload".
  4. The local file is used to update your new account's blocked users, blocked communities, followed communities, and most profile settings.
  5. That's it! Run as many times as you want to keep your accounts in-sync.

The Settings Tab

There are currently 5 settings you can toggle to alter the default LASIM experience described in How it works - they are described in detail below. Note that the state of these settings is written to a settings file in your home directory and restored when LASIM is restarted.

  • Upload Profile Settings - Whether to take the profile settings of the downloaded profile and apply it to the new profile on upload. These are things like post sort order, NSFW settings, etc.
  • Upload Community Subscriptions - Whether to add any community subscriptions/follows from the downloaded profile to the new profile on upload.
  • Upload Community Blocks - Whether to add any community blocks from the downloaded profile to the new profile on upload.
  • Upload User Subscriptions - Whether to add any user blocks from the downloaded profile to the new profile on upload.
  • Sync Removals - When enabled, for all Upload settings toggled on, also REMOVE any items found in the new profile that are not present in the old profile.
    • Put another way (assuming all Upload settings are ticked):
      • Sync Removals ON - the account being uploaded to will be altered to always EXACTLY match the downloaded account.
      • Sync Removals OFF - the account being uploaded to will always add new follows, new blocks, etc. but will never unfollow or unblock anything
    • Why is Sync Removals off by default? Because accidents are worse! Take this example:
      • You make a brand new account. You intend to add all your subscriptions to it, but by accident, you download the new account and upload to the old account. What happens?
        • Sync Removals OFF - Basically nothing. At worst, a few of your profile settings (like your default sort) are set back to the Lemmy defaults on your old account.
        • Sync Removals ON - Your entire old account is erased leaving you with two "empty" accounts.
    • So please please PLEASE take care when using Sync Removals, and always keep a backup of your account in a separate folder!

Additional Information

  • The downloaded profile file is read in when the user clicks Upload
    • Therefore do not need to download your profile every time, you can keep a copy and upload as often (or to as many accounts) as you want
  • The following profile settings are not modified by LASIM: your avatar image, your banner image, your display name, your email, your bio, your Matrix user, and your 2-Factor token
    • All other profile settings will match your old account
  • LASIM is additive by default - it cannot unfollow or unblock anything.
  • LASIM has a Sync Removals option that makes it NOT additive. Heed the warnings listed in the Settings Tab section.
  • LASIM will automatically detect if your new account already has some of the blocked users, blocked communities, and/or followed communities and will not re-issue those API calls. This means it is faster on subsequent runs.
  • LASIM respects the API rate limits set by your instance owner, so some servers may take longer than others. Be patient, it has not frozen!
  • LASIM will skip entries that fail to apply - re-run LASIM to try these entries again
  • This should go without saying, but obviously both your new and old accounts are still distinct - LASIM simply makes it easier to move from one to the other

Limitations

  • Versions of LASIM only target specific Lemmy BE versions, which are currently changing rapidly. See the Version Support table.
    • Download older versions of LASIM that are compatible with older instances as necessary.
    • You can find your Lemmy BE Version at the bottom of any page of your Lemmy instance.
  • Profile Versions refer to the format of the LASIM profile written when you click "Download".
    • As long as the "Profile Version" is the same between LASIM versions, it is possible to use different LASIM versions together to target Lemmy servers running different incompatible API versions.
    • Old versions of your LASIM profile are compatible with newer versions of LASIM, but the reverse is not true.
    • If your version is not explicitely listed, take the latest LASIM that is available!
  • Running multiple copies of LASIM simultaneously is not suggested since it can clobber the Settings in your home directory.

Version Support

If your Lemmy BE version is not explicitely listed below, use the latest LASIM available for download.

LASIM Version LASIM Profile Version Supported Lemmy BE Version(s)
0.1.* 1 0.18.1 (rc.9+), 0.18.2
0.2.* 2 0.18.3, 0.18.4

lasim's People

Contributors

aidandenlinger avatar andkit avatar cmahaff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lasim's Issues

Error with Upload to lemmy.ml

Describe the Bug
Logging this officially from https://lemmy.world/comment/965788

Download profile from lemmy.world (works great) but go to upload to lemmy.ml and get

Logging in as smoysauce
ERROR: Failed Login - HTTP status client error (403 Forbidden) for url (https://lemmy.ml/api/v3/user/login)

MFA is disabled for lemmy.ml. Tried using username as well as email. Password is copied and pasted from password manager which works when auto-filling to login to actual lemmy.ml site.

Let me know if you need anything else from me, or need to me test anything, thanks!

Information
LASIM Version: 0.1.0
LASIM Profile Version: v1 (? sorry not sure where this is)
Lemmy Source Instance URL: lemmy.world
Lemmy Source Instance Version: BE: 0.18.1
Lemmy Target Instance URL: lemmy.ml
Lemmy Target Instance Version: BE: 0.18.1

Output of LASIM
IMPORTANT: Make sure you do not post your authentication tokens here by accident!

Logging in as smoysauce
ERROR: Failed Login - HTTP status client error (403 Forbidden) for url (https://lemmy.ml/api/v3/user/login)

it does not worked on Lemmy 0.19

Describe the Bug
I suppose Since lemmy will move to 0.19 and I think this app is broken

Information
LASIM Version: 0.2.2
LASIM Profile Version:2
Lemmy Source Instance URL: https://lemmy.sdf.org/
Lemmy Source Instance Version: 0.19.0-rc.4
Lemmy Target Instance URL: https://lemmy.today/
Lemmy Target Instance Version: 0.18.4

Output of LASIM
IMPORTANT: Make sure you do not post your authentication tokens here by accident!

image

LASIM outputs errors every upload for communities/users of defederated instances

Describe the Bug
If your target instance has de-federated from an instance with communities you want to subscribe/block or users you want to block, you will get 400 errors every upload that it cannot find these communities/users, which logically makes sense, but might be confusing.

The existing profile might have the federation list (or we could fetch it), and then filter our communities that are de-federated (with a message to the user of course).

Information
LASIM Version: 0.2.1
LASIM Profile Version: 2
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM
N/A

Validate login target is a Lemmy instance before sending credentials

Describe the Bug
This tip was posted here: https://lemmy.world/post/1441882
While this is hardly fool-proof, it's probably wise to do at least this basic check before we send a users credentials out over the internet in case they fat-fingered it.

Information
LASIM Version: 0.1.2
LASIM Profile Version: 1
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM
N/A

Download comments?

Hi,

I was wondering if it would be possible to add the ability to download comments made by a user? For example, if I log in and want to download my subscribed communities and preferences etc, would it also be possible to download my comments?

Cheers.

Crash on .unwrap for instances under heavy load

Describe the Bug
Lemmy has a behavior, IMO a bug, where when under heavy load the /api/v3/site will start returning data as if the user is logged out, even if they are logged in. This causes LASIM to crash since it expects that user data to be present, and that data is required to do anything useful.

Change LASIM to report an error in this condition instead.

Information
LASIM Version: 0.2.1
LASIM Profile Version: 2
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM
N/A

Allow user to bypass Lemmy Rate Limits

Lemmy API Rate Limits are expressed as a number of messages over a period of time.

I.E. Something like 100 messages over 10 minutes.

LASIM currently just calculates the rate it can send messages to not exceed this limit. In the above example, that's 1 message every 6 seconds (which is tremendously slow for the record).

But if you were willing to not use your account for 10 minutes, there is nothing stopping you (theoretically) from making 100 calls in 30 seconds, and then letting your account site for 9.5 minutes to "cool down". If you need to make less than 100 calls totally anyway, this would be very beneficial to the user.

Put another way, there could be an option to enable "burstiness" - if the call count is below the message limit, we could "safely" do all the work much faster, with the caveat that the user might need to let their account cool down a bit afterwards.

Synchronize Removals Option

This should not be the default because it is dangerous, and the option to turn it on should be in red / have a pop-up if that's easy to do.

This option would make LASIM not additive - aka anything not present in the file would be removed from the account during upload.

Suggest UI wise a new tab for what to download/upload with check boxes.

Crashes trying to download from lemmy.world

Describe the Bug
After entering login details, app crashes trying to load user. Unexpected Error Occurred: "called Option::unwrap() on a None value"

Information
LASIM Version: 0.1.2 lasim_ubuntu.zip
LASIM Profile Version:
Lemmy Source Instance URL: https://lemmy.world
Lemmy Source Instance Version:
Lemmy Target Instance URL:
Lemmy Target Instance Version:

Output of LASIM
Unexpected Error Occurred: "called Option::unwrap() on a None value"

400 Bad Request

Describe the Bug
Got a 400 Bad Request error when trying to use lasim to download from feddit.de

Information
LASIM Version: 0.1.1
LASIM Profile Version: ?
Lemmy Source Instance URL: feddit.de
Lemmy Source Instance Version: ?
Lemmy Target Instance URL: n/a
Lemmy Target Instance Version: n/a

Output of LASIM

Logging in as [email protected]
ERROR: Failed Login - HTTP status client error (400 Bad Request) for url (https://feddit.de/api/v3/user/login)

How do I run it?

Is it something like this?

git clone https://github.com/CMahaff/lasim.git
cd lasim
make
./lasim

Runtime libs in ChromeOS Linux terminal (Debian 11.7)

Describe the Bug
Trying to run the Ubuntu release in the Linux terminal in ChromeOS. The binary fails to load due to "missing" libssl.so.3. This is the first time I've tried to run LASIM, so there is no prior saved state or profile or anything.

Information
LASIM Version: v0.2.0
LASIM Profile Version: Have never run it before, no local state
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM

$ ./lasim
./lasim: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
$ find /lib* /usr/lib* -name libssl*
/usr/lib/x86_64-linux-gnu/libssl3.so
/usr/lib/x86_64-linux-gnu/libssl.so.1.1
$ ldd lasim
./lasim: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./lasim)
./lasim: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./lasim)
./lasim: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./lasim)
        linux-vdso.so.1 (0x00007ffeb5bfb000)
        libssl.so.3 => not found
        libcrypto.so.3 => not found
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007df06cac5000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007df06c981000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007df06c7ad000)
        /lib64/ld-linux-x86-64.so.2 (0x00007df06d56f000)
$ cat /etc/debian_version 
11.7

Ability to save account credentials so they don't have to be entered all the time

This would be tricky since you need to figure out some kind of encrypted storage to hold the credentials offline. Or live with just storing the unencrypted jwt token?

UI wise you need to have some kind of drop-down to select this on download/upload. There also needs to be a way to save the credentials in the first place. There probably needs to be a way to manage/delete the credentials as well.

This would be a decent amount of work, but it would make downloading/uploading to multiple accounts a lot easier.

LASIM doesn't handle Rate Limiting Being Disabled

Describe the Bug
It looks like admins can set their rate limiting to zero which is shorthand for "unlimited", but LASIM will treat it as the number of messages per second, and things go wrong fast with divisions by zero, etc.

Verify this in the docs before fixing, but I saw it discussed on Lemmy.

Information
LASIM Version: 0.1.2
LASIM Profile Version: N/A
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM
N/A

LASIM fails to open

Describe the Bug

LASIM fails to open with the following error log, running on Windows:

Unexpected Error Occurred: panicked at 'called glCreateShader but it was not loaded.', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\glow-0.12.3\src\gl46.rs:4571:5

Also cloned the repo, installed Rust and tried to run it to no avail, not familiar with Rust to have a closer look.

Information
LASIM Version: 0.2.2
LASIM Profile Version: N/A
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Issue During Download - 'infinite_scroll_enabled'

Describe the Bug
I'm trying to download my settings and subscribed communities from instance to import in another instance. I'm guessing it might be a Lemmy instance version problem (0.18.2 vs 0.18.3), but wanted to double check. Error happens after logging in and the Download process starts.

Information
LASIM Version: 0.2.1
LASIM Profile Version:
Lemmy Source Instance URL: https://lemmy.blahaj.zone
Lemmy Source Instance Version: 0.18.2-rc.2-50-g08455003c-kt.2
Lemmy Target Instance URL: <didn't get to this>
Lemmy Target Instance Version: <didn't get to this>

Output of LASIM
Logging in as
Login Successful.
ERROR: Failed to fetch Profile - error decoding response body: missing field infinite_scroll_enabled at line 1 column 6419

Subscribing to communities that are unknown to an instance requires running LASIM upload twice

Describe the Bug
This issue is basically the same thing that actual users run into on a fresh instance when they are the first person to lookup a specific community for the first time.

At first, it isn't known by the server, but once you search it, the server learns about it.

In LASIM this manifests initially as a failure, but re-running LASIM upload after giving the server a minute or two allows it to succeed. See redacted log output below.

Information
LASIM Version: 0.1.2
LASIM Profile Version: 1
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: 0.18.2

Output of LASIM
First Run Output

Logging in as <redacted>
Login Successful.
Existing Settings Downloaded. Calculating delta...
All profile settings from the original profile will be applied.
1 new users will be blocked
7 new communities will be blocked
80 new communities will be followed
Cannot find community <redacted>, got exception HTTP status client error (400 Bad Request)
Cannot find community <redacted>, got exception HTTP status client error (400 Bad Request)
Cannot find community <redacted>, got exception HTTP status client error (400 Bad Request)

Finished!

Second Run Output

Logging in as <redacted>
Login Successful.
Existing Settings Downloaded. Calculating delta...
All profile settings from the original profile will be applied.
0 new users will be blocked
0 new communities will be blocked
3 new communities will be followed
Finished!

Feature request: At least some limited backward compatibility both ways

Describe the Bug
Currently according to the docs, the newest version of LASIM can't read or write to instances which are even a single Lemmy BackEnd version out of date, I would need to use an older version of LASIM for that which can't read or write to the newest B.E. version, However, the newest LASIM uses a new profile version that the older LASIM can't read...
So - There is no way for me to synchronize my subscriptions from an instance which has updated, to a second instance that hasn't updated to the absolute latest version of Lemmy.

Please support at least a couple older Backend versions in each version of the app, I'm not asking for supporting the entire version history of Lemmy, just 2-3 versions back to allow LASIM to work in the times when instances update on different schedules. For example, at the moment supporting 0.18.2 and 0.18.1 when 0.18.3 is the latest.

Information

LASIM Version LASIM Profile Version Supported Lemmy BE Version(s)
0.1.* 1 0.18.1 (rc.9+), 0.18.2
0.2.* 2 0.18.3

Lemmy Source Instance URL: lemmynsfw.com
Lemmy Source Instance Version: 0.18.3
Lemmy Target Instance URL: pornlemmy.com
Lemmy Target Instance Version: 0.18.2

Output of LASIM
I haven't even downloaded it yet, because I can see that it won't synchronize both directions, and I want it to work both directions.

Ability to transfer profile pictures

I think it would be a good idea to be able to transfer the old profile pictures and banner images from the old account with this tool like you can with other tools. Doesn't need to perform uploads, it can just use the URL from the original but it needs to save it when exporting settings so it can use it on the new server.

More Gracefully Handle Thread Panics

Describe the Bug
Right now if a thread panics (upload or download, usually by a surprise unwrap being None) the UI just freezes. It would be better for the application to crash (and ideally write a file with error information) when this happens so users don't think it is still doing work.

This was seen when lemmy.world was unexpectedly returning an empty "my_user" for site requests (it kept logging people out).

Information
LASIM Version: 0.1.1
LASIM Profile Version: 1
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM
N/A

Community Backup

Is it possible to backup all the posts in a community that I mod?

Lasim.exe process sometimes doesn't exit

Describe the Bug
Lasim.exe process sometimes doesn't exit. Unfortunately, I can't find a common path that is completely reproducible, but would you keep an eye on it?

I have looked at the logs both when the process exits, and when it doesn't exit. I originally thought it only occurred when there was an error (on uploads), because it seemed to happen more, but later observations show that even when there is no error, sometimes the process doesn't exit.

The steps that sometimes produce it is:

  1. Upload
  2. Click the X button on the upper right of the windows.
  3. Observe that the windows disappears, but the process doesn't exit.

I have resorted to running a separate watcher process to close lasim.exe when it doesn't exit.

Information
LASIM Version: 0.2.2
LASIM Profile Version: 2
Lemmy Source Instance URL: https://lemm.ee/
Lemmy Source Instance Version: 0.18.4
Lemmy Target Instance URL: https://monyet.cc/
Lemmy Target Instance Version: 0.18.4
OS: Windows 11 Pro

I have 4 blocked users, 5 blocked communities, and 274 subscribed communities.

Output of LASIM

V0.2.2 not opening on mac

Describe the Bug
v0.2.2 does not open on mac. v0.2.1 does work
Information
LASIM Version: v0.2.2
LASIM Profile Version: I could not view
Lemmy Source Instance URL: n/a
Lemmy Source Instance Version: n/a
Lemmy Target Instance URL: n/a
Lemmy Target Instance Version: n/a

Output of LASIM
/Users/username/Downloads/GNUSparseFile.0/lasim ; exit;
username@my-Mac-mini-2 ~ % /Users/username/Downloads/GNUSparseFile.0/lasim ; exit;
zsh: exec format error: /Users/username/Downloads/GNUSparseFile.0/lasim

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Wrong permissions on executable for Ubuntu / Linux and maybe OS X

Describe the Bug
LASIM binaries are downloaded without 755 permissions, so when you try to run them Ubuntu doesn't understand what to do with it until it is changed. The same thing might be happening in OS X as well.

Information
LASIM Version: 0.1.1
LASIM Profile Version: 1
Lemmy Source Instance URL: N/A
Lemmy Source Instance Version: N/A
Lemmy Target Instance URL: N/A
Lemmy Target Instance Version: N/A

Output of LASIM
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.