![]() |
Possible to keep auto logging in from clients after full server reinstall? - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Support (https://forum.jellyfin.org/f-support) +--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions) +--- Thread: Possible to keep auto logging in from clients after full server reinstall? (/t-possible-to-keep-auto-logging-in-from-clients-after-full-server-reinstall) Pages:
1
2
|
Possible to keep auto logging in from clients after full server reinstall? - raulo1985 - 2024-07-21 Hi: Is there any way to config clients to keep auto connecting to a server after reinstalling it from scratch? I have a Linux Mint headless server, and from time to time I reinstall everything from scratch (not too often though). I have three clients auto connecting to it, both locally and remotely (LG Smart TV official app connecting locally and a notebook using JMP and an Iphone using the official app connecting remotely). When I reinstall my server from scratch (obviously including Jellyfin), all the clients try to connect to the same ip address (I’m using ddns), but they don’t automatically log in and show an error message when selecting the new server (I suppose the new server has different credentials or something like that, so you have to manually log in at every client). Since two of my clients are being used by relatives that know nothing about tech (my parents), when this happens I have to remote desktop or guide them by phone for them to be able to log in to the new server. Since the new server has the same configured user names and passwords, and since I’m using ddns (so the clients do find the new server automatically, it’s just that they won’t auto login), is there any way to set the server up (or the clients) to keep the clients automatically logging in without the need of doing something on the client’s side? If there’s something that can be done on the server’s side that would be fine (since I can do it). But it’s a bit complicated having to call my parents every time I setup the server from scratch just to guide them to login again (and not only that, I have to guide them to set up all the client’s settings since they return to defaults after logging in to the new server). So bottom line, since the clients are always able to reach the new server (because of ddns), and since I set it up with the same usernames and passwords, is there any way to configure things so they don’t have to manually log in and set up the client’s settings every time I set up the server from scratch? That would allow me to reinstall the server without them having to do anything to auto log in to it, which would be nice. Don’t know if it’s possible, though, but I don’t see why it wouldn’t be possible to accomplish (server always reachable, same usernames and passwords). Thanks in advance. RE: Possible to keep auto logging in from clients after full server reinstall? - TheDreadPirate - 2024-07-21 The problem is that the Jellyfin server generates a unique ID. When you reinstall from scratch it generates another unique ID and the clients don't like that. You should be backing up /var/lib/jellyfin and /etc/jellyfin and restoring those directories and resetting the file permissions. This will preserve the unique ID. RE: Possible to keep auto logging in from clients after full server reinstall? - raulo1985 - 2024-07-21 Thanks for the quick reply, I imagined it had something to do with that. A couple of questions, though: - When I reinstall my server I like to set up everything from scratch, to avoid possible conflicts (using a backup that’s not compatible with a new Jellyfin server version for example). Is there any way to just backup the server’s ID and restoring it at the new server, without restoring anything else? Is there a specific file that stores it, and if so, can you back up and restore only that particular file without issues? I don’t mind having to set up everything again (libraries and all of that), but being able to just keep the same server ID would be nice. - This would be a solution, but I suppose sooner or later a backup won’t be useful after several Jellyfin server releases (because of all the changes made). In that situation there’s no way around this but to manually log in to the new server from the clients? Thanks again RE: Possible to keep auto logging in from clients after full server reinstall? - TheDreadPirate - 2024-07-21 As long as the previous install is not super ancient compared to the new version, when you restore the previous install it will upgrade the old data the next time jellyfin starts. But I believe /var/lib/jellyfin/data/device.txt contains the server unique ID. You also have to consider that even if you preserve just the ID, the token that your clients had will no longer be valid and they will have to log in again. And I believe that tokens are in the database. RE: Possible to keep auto logging in from clients after full server reinstall? - raulo1985 - 2024-07-21 I didn’t consider the token, you’re right. So in order for reinstalling the server from scratch and having all the clients logging in automatically without having to do anything at client side, the bare minimum is to backup and restore the device.txt file and the database file (and resetting the permissions of both files)? So if I only do that, all the clients should be able to log in automatically without having to touch them (including preserving their settings, which return to default when logging in manually to a new server)? After all, my goal is that my relatives don’t have to do anything every time I reinstall the server from scratch. RE: Possible to keep auto logging in from clients after full server reinstall? - TheDreadPirate - 2024-07-21 Really you should be restoring everything. Because then you have to consider all the images that are stored on the server. If you only restored the ID and database, your clients would log in but all of the posters would be blank. You'd have to rescan, the "Search for missing metadata" type, to pull those down again. RE: Possible to keep auto logging in from clients after full server reinstall? - raulo1985 - 2024-07-26 Hi. I experimented a little bit, started from scratch and only restored the data folder (located in /var/lib/jellyfin), which contains both the database and the device.txt file. It didn’t work, but there was a difference. Before (starting from scratch without restoring anything, so the server had a new ID), the clients showed that there was a server available but couldn’t connect to it (you had to do it manually). Now it shows a couple of items of the GUI, but it keeps loading forever (and again, if you manually log in, everything works). That tells me that you need more than just the device.txt file and the database (for the tokens) for the clients to keep logging in automatically after a full server reinstall (because both are located in the data folder, which I restored). Then I tried again and restored all the contents of the /var/lib/jellyfin folder and the /etc/jellyfin folder (a full backup and restore), and to my surprise, the same thing happened again (the clients remain stuck on loading, and you can’t use them unless you log in manually). I wasn’t expecting that since it was a full backup and restore, but then I realized that I backed up and restore everything from both folders, except the contents of the /var/lib/jellyfin/.aspnet/DataProtection-Keys. They weren’t backed up because of permissions (stupid thing from my part, I didn’t realize I didn’t back up those files). Bottom line is, after a full backup/restore from both /var/lib/jellyfin and /etc/jellyfin, clients are still unable to log in automatically after a server reinstall. Could those files (the ones inside the DataProtection-Keys) be the missing part of this puzzle? What are those files for? They are the only files missing from the full backup/restore, and I understand that after a full restore all the clients should log in automatically since the server ID and tokens are preserved. Are those files related to user log in info? If not, I don’t have a clue why my clients aren’t logging in after the server reinstall (and FYI, permissions are set correctly after the restore, so that shouldn’t be the issue). Any thoughts? Thanks in advance. RE: Possible to keep auto logging in from clients after full server reinstall? - TheDreadPirate - 2024-07-26 I don't think that DataProtection-Keys is actually used in Jellyfin. I think it's something that .Net generates when Jellyfin is installed, but Jellyfin itself doesn't use it for anything. I will do some testing this weekend and get back to you. RE: Possible to keep auto logging in from clients after full server reinstall? - raulo1985 - 2024-07-26 Thanks. If those files don’t have anything to do with preserving the server ID and tokens so the clients can log in automatically after a full server reinstall, then I’m running out of ideas. The fact is that I did a full backup/restore of both /var/lib/jellyfin and /etc/jellyfin folders (except the files mentioned), give correct permissions to those folders, and still the clients didn’t automatically log in after that (as if the new server had a different ID than the previous one). And it happens with all the clients, regardless of the system (I tested with JMP and the IOS app, same result). FYI, I stopped jellyfin before backing those folders up, like suggested by the documentation. RE: Possible to keep auto logging in from clients after full server reinstall? - TheDreadPirate - 2024-07-28 Here is what I did to backup and restore my Jellyfin completely. Code: mkdir -p /path/to/backup/drive/jellyfin NOT putting a slash at the end of the SOURCE path is important. Without the slash rsync will pull the entire directory, including hidden files and folders. If you put a /* at the end of the source path it would not grab hidden folders and files. To simulate a fresh OS install Code: sudo apt purge jellyfin* To reinstall Code: curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash To restore Code: sudo systemctl stop jellyfin None of my clients had to re-login. |