hrfee / jfa-go

a better way to manage your Jellyfin users, now in go

Home Page:https://jfa-go.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About Database

xenoncolt opened this issue · comments

The new database is good, but it would be even better if Jfa-go also had a copy of that database in a .json format.

I recently encountered an issue with the email feature where Jfa-go didn't display any user email addresses. I had no idea how to edit the new database, so I had to delete the /db folder and recreate Jfa-go using the old .json file, resulting in the loss of some user data.

If Jfa-go wrote both databases (/db and .json files), it would be a more robust solution to prevent data loss.

image

You were likely experiencing the same thing as #303, where emails and other contact methods were being wiped if Jellyfin wasn't running when jfa-go does its cleanup operations. Writing to a database and json files wouldn't make any difference, as the code that controls what gets added and deleted to/from them would be the same.

What version are you running? The issue is fixed in unstable if it was the same thing that happened to you.

Version:

  • Stable

Is it possible to add new user data without deleting the old data in the users.json file?

Additionally, please ensure that the user expiration time in users.json is preserved and not deleted, and only write to .json files, without applying the chmod-777 permissions like the /db folder. This way, we can have a backup in case something goes wrong, and we can re-create Jfa-go using the .json files.

If you switch to unstable, the issue should hopefully be fixed.

Is it possible to add new user data without deleting the old data in the users.json file?

Are you asking if there's a way to import new data from a json file? There isn't, but a bulk import/export sorta thing like that is a good idea.

Additionally, please ensure that the user expiration time in users.json is preserved and not deleted, and only write to .json files, without applying the chmod-777 permissions like the /db folder. This way, we can have a backup in case something goes wrong, and we can re-create Jfa-go using the .json files.

I'm not sure I understand this part, sorry, but i can say the default permissions of /db is 700, and the files within it are either 600 or 644. And regarding having a backup, that can be easily handled by other software like a simple script.

I'm not sure I understand this part, sorry, but I can say the default permissions of /db is 700, and the files within it are either 600 or 644. And regarding having a backup, that can be easily handled by other software like a simple script.

Sorry, for the confusion. I was trying to tell you about bulk import/export. It would be beneficial to have automatic backup exports, like a zip file or something, generated once every 12 hours or 6 hours.

ah okay. Coincidentally, I just replied to another issue where someone had a power cut which corrupted the database, and after mentioning the import/export to you I said I'd try and add that soon, so hopefully I'll get it done by the end of the week, including a automatic backup like you said.

Thank you so much. I know switching to a new type of database is great but it's also kind of sad that unwanted behavior corrupts the database. I've encountered database problems before. So, waiting for the new update.