Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Accounts / Multi account #421

Open
KeeJef opened this issue Aug 13, 2019 · 21 comments
Open

Switch Accounts / Multi account #421

KeeJef opened this issue Aug 13, 2019 · 21 comments
Labels
Minimal Minimal priority Mobile Device Support This issue also needs support on mobile devices User Interface User interface issue

Comments

@KeeJef
Copy link
Collaborator

KeeJef commented Aug 13, 2019

Allow users to maintain multiple public key identities and switch between these identities inside Loki messenger

@KeeJef KeeJef added User Interface User interface issue Mobile Device Support This issue also needs support on mobile devices Minimal Minimal priority labels Aug 13, 2019
@KeeJef KeeJef added this to To do in Loki Messenger via automation Aug 13, 2019
@changemenemo
Copy link

we could take the same model than keybase is doing for their management of multiple accounts

@changemenemo
Copy link

  • I think the first good step would be to have a button to actually unlog from the session and be capable to log back in. The only button we have right now is delete account which is not what we want obviously.
  • The second step would be to actually be able to launch several instances of session with a command line to change home directory for the data.

@trymeouteh
Copy link

+1 for multiple accounts. Very important feature for any messaging app and is lacking in many messaging apps. Only good messaging app with multiple accounts is Jami.

@FatBirdie
Copy link

+1 also for multiple accounts, this would be an awesome feature.

@peepo5
Copy link

peepo5 commented Nov 11, 2021

+1 I would love to have this feature so social profiles can be separated for privacy reasons.

@JustaNormalGuy230
Copy link

Is this ever gonna happen? Switching Accounts usually means only one account (Session ID) is operational at a time. What is really needed is multiple, independent instances of Session. The only practical ways to do this at the moment are to run multiple instances of Session on separate devices, run multiple instances of session on the same device virtually or to emulate a device on another device. Fortunately I do have another device, but it is a slow laptop running Win10 32 bit, and since Signal doesn't support Win32, neither does Session. Virtual Machine Emulation takes too many resources. Android Emulation on a slow Win32 laptop works but is painful...

... I agree that switching would be easier to implement, but users will eventually want Social, Personal and Business Session IDs that operate simultaneously. Does this make sense? Or am I missing something?

@mdPlusPlus
Copy link

mdPlusPlus commented Sep 9, 2022

You can achieve this with firejail.

A simple firejail profile for Session derived from their Signal one (can certainly be improved):

$ cat ~/.config/firejail/session-desktop.profile

# Firejail profile for session-desktop
# Persistent local customizations
include session-desktop.local
# Persistent global definitions
include globals.local

ignore novideo

ignore noexec /tmp

noblacklist ${HOME}/.config/Session

# These lines are needed to allow Firefox to open links
noblacklist ${HOME}/.mozilla
whitelist ${HOME}/.mozilla/firefox/profiles.ini
read-only ${HOME}/.mozilla/firefox/profiles.ini

mkdir ${HOME}/.config/Session
whitelist ${HOME}/.config/Session

private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,machine-id,nsswitch.conf,pki,resolv.conf,ssl

# allow D-Bus notifications
dbus-user filter
dbus-user.talk org.freedesktop.Notifications
ignore dbus-user none

# Redirect
include electron.profile

And then:

screen -dm firejail --profile="session-desktop" --private="/path/to/folder/1" --appimage ~/session-desktop-linux-x86_64.AppImage
screen -dm firejail --profile="session-desktop" --private="/path/to/folder/2" --appimage ~/session-desktop-linux-x86_64.AppImage

You can even have them opened at the same time.

Edit: Disclaimer: I don't know how AppImage auto-updates are handled when there are multiple instances of it running.
Edit2: Apparently AppImage updates don't even work when only running a single instance of it via this specific profile. I assume it needs to get write access to ~/Downloads or whereever the path of the to-be-updated .AppImage is.

@JustaNormalGuy230
Copy link

Oh yes, forgot about Task/Program Isolation ... Well done! ... Something like SandBoxie would be the Windows Equivalent of FireJail, for those wanting to investigate this on a Windows Platform. I haven't messed much with Task Isolators, recently. There might be something better than SandBoxie.

@mdPlusPlus
Copy link

Just a little note that I personally really like the idea of recently closed #2519.

@mdPlusPlus
Copy link

For the time being you can use the .AppImage and this[0] to run multiple different instances at once:

[0] https://docs.appimage.org/user-guide/portable-mode.html

It works a lot better than firejail isolation.

@gnrlus
Copy link

gnrlus commented Feb 13, 2023

The Session backend should be able to store multiple keys/IDs that you can switch between, and we should be able to launch multiple windows/processes, each using a different ID, without having to use a custom firejail setup. These abilities are essential. Currently I have to swap out the backend data set using a script to maintain 2+ IDs. Definitely wiping data to change ID's is not ideal.

@mdPlusPlus
Copy link

mdPlusPlus commented Feb 15, 2023

Just adding these here for completeness' sake. Some Session users mentioned (in addition to the AppImage portable mode and firejail) you can try to use --profile=... and --user-data-dir=... to separate multiple identities. I haven't tried those personally yet, though.

Edit: @gnrlus, try the AppImage portable mode, it works like a charm. Updating is a bit of a hassle, though. You have to rename all the folders to include the correct name of the new executable, or at least rename the executable to have it find the directories.

@gnrlus
Copy link

gnrlus commented Feb 16, 2023

AppImage portable mode

Oh that is an appealing work-around; good idea! Is it possible the AppImage could be in one location and then different directories with soft links named differently that point to the appimage could serve as the portable-mode appimages? If that works then only one AppImage would need updating. The AppImage soft links could even reside in $HOME still, within unique subdirectories and would just be combined with the data there.

Does the development team intend to stick with delivering the app as an AppImage indefinitely? At this time I do feel like AppImage is probably the best way to package the app, because everything stays compartmentalized from the OS and doesn't try to overwrite any of your libraries, which can break things. But if they ever switched back to a .deb package then I'd have to rethink the whole approach.

And hopefully some day we can just launch new processes, each requesting which ID to use, letting you select from a list generated from whatever data is there in a single, central directory. That's ultimate comms freedom! In fact, really I think there should be an 'ID manager' page where you can just create, modify, delete, and group/ungroup IDs in a list, all day long, and that's all the page does. Perhaps code could be copied and modified from KeePassXC to achieve that and all that data could be stored in a KDBX database. Or another way would be to, like you have a 'Conversations' pane, have an 'IDs' pane, where you can search and list IDs and perform right-click actions on them, including selecting which ID is active for that process. Or you could have one process, and you just click on different IDs to view its convos in the 'Conversations' pane. That would be so powerful! Over time I think a lot of people would find this extremely useful.

@mdPlusPlus
Copy link

This unfortunately doesn't work:

$ tree -L 2
.
├── GenericSessionNameWithVersionNumber.AppImage
├── profile1
│   ├── session1.AppImage -> ../GenericSessionNameWithVersionNumber.AppImage
│   ├── session1.AppImage.config
│   └── session1.AppImage.home
└── profile2
    ├── session2.AppImage -> ../GenericSessionNameWithVersionNumber.AppImage
    ├── session2.AppImage.config
    └── session2.AppImage.home

6 directories, 3 files

AFAICT you actually need the binary on the same level as the folders, not just a link to the binary.
But honestly, if you need that many different profiles and want to rely on the portable mode of AppImages, you should use a script do download the AppImage once and copy it into every profile folder (and rename either folders or AppImages).
But apparently --user-data-dir works well, too: https://www.youtube.com/watch?v=Fq1QojG4yOk

@ElsAr4e
Copy link

ElsAr4e commented Apr 14, 2023

As mentioned #421 (comment) Jami (https://jami.net/) for example allows multiple accounts and multi-device.

https://docs.jami.net/user/all-features-by-client.html#other-features

@ghost
Copy link

ghost commented Jul 9, 2023

Any news on this? Would be an awesome feature to have

@slrslr
Copy link

slrslr commented Nov 25, 2023

users will finalmente want Social, Personal and Business Session IDs that operate simultaneously

+1. Being able to use multiple IDs at same time (without need to switch/re-login) is important, because this would allow users to maintain better privacy on the clearnet: Being able to use one ID for work, other for family, and another for personal and share such IDs accordingly without worrying to disclose wrong ID to wrong people and being able to separate clearnet identities while monitoring incoming messages on all IDs at same time.

@qdhj
Copy link

qdhj commented Nov 29, 2023

+1 to the whole thread, important af.

Note, that you ARE ABLE to do this manually on PC already:

  1. Create a shortcut for the Session app
  2. Edit the shortcut
  3. Find the path (should look somethink like "C:\Program Files\Session\Session.exe")
  4. Put whole path to quotation marks
  5. Add to the end (after the quotes): --user-data-dir=[path where second session account data will be]

For example, it could look like this (including quotes):

"C:\Program Files\Session\Session.exe" --user-data-dir=C:\Users**%username%**\SessionSecond

Where %username% is your user's name

@Luther-Harris
Copy link

It's been 3.5 years, and still hasn't happened yet.

It looks like this isn't going to happen unless we pay for its implementation via a feature bounty.

@qdhj
Copy link

qdhj commented Feb 1, 2024

It's been 3.5 years, and still hasn't happened yet.

It looks like this isn't going to happen unless we pay for its implementation via a feature bounty.

hope dies last ay. if i knew programming i'd add that myself. it is not hard at all to make, at least in windows, just making new user-data-dir, as I mentioned above, and switching between them (even by reopening the app). just need to add the ability inside the app itself

@KeeJef
Copy link
Collaborator Author

KeeJef commented Feb 1, 2024

Still something we will do, but it will come after we have completed more pressing functionality like fixing disappearing message deficiencies, overhauling closed groups and integrating Lokinet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minimal Minimal priority Mobile Device Support This issue also needs support on mobile devices User Interface User interface issue
Projects
No open projects
Loki Messenger
  
To do
Development

No branches or pull requests

13 participants