From dd65a193b06f6200b392b83a628d197dae76e8df Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Sun, 17 Sep 2023 04:21:23 +0200 Subject: [PATCH 01/11] Add Documentation for Restoring Admin Privileges --- .../general/administration/troubleshooting.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index 29c6f0dd2..b2e3c9779 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -130,3 +130,43 @@ After opening the database, navigate to the Execute SQL Tab and execute the foll UPDATE Users SET InvalidLoginAttemptCount = 0 WHERE Username = 'LockedUserName'; UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Users WHERE Username = 'LockedUserName'); ``` +## Fix Admin User Permissions +If the Permissions for your Admin Account break, you can Restore them using simple SQL Queries. + +:::caution +Manual changes to the database can destroy your Instance beyond repair. to prevent this create a copy of your database before executing: +`cp /PATH/TO/JELLYFIN/DB/jellyfin.db /PATH/TO/JELLYFIN/DB/jellyfin.db.bck` +::: + +Before continuing, make sure that you have sqlite3 installed. +When sqlite3 is not installed, you can install it under Debian based systems with `apt install sqlite3`. +After that do the following commands/SQL query: +```bash +sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db +``` + +### Get an Overview +To see all your current permissions for all users, you can run the following Query: + +```sql +select Permissions.Value,Permissions.Kind,Users.Username from Permissions Inner Join Users on Permissions.UserID = Users.Id; +``` +To just check Permissions on your Admin Account, run the following Query: +```sql +select Value,Kind from Permissions WHERE UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); +``` +
+ +The first row with an value of 1 or 0 shows if the permission is assigned or not. The second row displays the Kind of permission. To get a summary for every permission you can look [here](https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Data/Enums/PermissionKind.cs) + + +### Repair Permissions + +:::note +Not all permissions are needed, you can remove the unnecessary ones later in the Web UI. +::: +```sql +UPDATE Permissions SET Value = 1 WHERE (Kind = 0 or Kind = 3 or Kind = 4 or Kind = 5 or Kind = 6 or Kind = 7 or Kind = 8 or Kind = 9 or Kind = 10 or Kind = 11 or Kind = 12 or Kind = 13 or Kind = 14 or Kind = 15 or Kind = 16 or Kind = 17 or Kind = 18 or Kind = 19 or Kind = 20 or Kind = 21) AND UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); + +.exit +``` From 3530e1127c1c3b762fa16f82484e4c1ed3197d89 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:25:10 +0200 Subject: [PATCH 02/11] lint: Add Documentation for Restoring Admin Privileges --- docs/general/administration/troubleshooting.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index b2e3c9779..b01725b0d 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -130,7 +130,10 @@ After opening the database, navigate to the Execute SQL Tab and execute the foll UPDATE Users SET InvalidLoginAttemptCount = 0 WHERE Username = 'LockedUserName'; UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Users WHERE Username = 'LockedUserName'); ``` + + ## Fix Admin User Permissions + If the Permissions for your Admin Account break, you can Restore them using simple SQL Queries. :::caution @@ -141,30 +144,34 @@ Manual changes to the database can destroy your Instance beyond repair. to preve Before continuing, make sure that you have sqlite3 installed. When sqlite3 is not installed, you can install it under Debian based systems with `apt install sqlite3`. After that do the following commands/SQL query: + ```bash sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db ``` ### Get an Overview + To see all your current permissions for all users, you can run the following Query: ```sql select Permissions.Value,Permissions.Kind,Users.Username from Permissions Inner Join Users on Permissions.UserID = Users.Id; ``` + To just check Permissions on your Admin Account, run the following Query: + ```sql select Value,Kind from Permissions WHERE UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); ``` -
+
The first row with an value of 1 or 0 shows if the permission is assigned or not. The second row displays the Kind of permission. To get a summary for every permission you can look [here](https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Data/Enums/PermissionKind.cs) - ### Repair Permissions :::note Not all permissions are needed, you can remove the unnecessary ones later in the Web UI. ::: + ```sql UPDATE Permissions SET Value = 1 WHERE (Kind = 0 or Kind = 3 or Kind = 4 or Kind = 5 or Kind = 6 or Kind = 7 or Kind = 8 or Kind = 9 or Kind = 10 or Kind = 11 or Kind = 12 or Kind = 13 or Kind = 14 or Kind = 15 or Kind = 16 or Kind = 17 or Kind = 18 or Kind = 19 or Kind = 20 or Kind = 21) AND UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); From a41b33dc5ecbb98fb39108d64f194cc5dccff683 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:48:15 +0200 Subject: [PATCH 03/11] Update troubleshooting.md --- docs/general/administration/troubleshooting.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index b01725b0d..3cb8bd346 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -131,7 +131,6 @@ UPDATE Users SET InvalidLoginAttemptCount = 0 WHERE Username = 'LockedUserName'; UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Users WHERE Username = 'LockedUserName'); ``` - ## Fix Admin User Permissions If the Permissions for your Admin Account break, you can Restore them using simple SQL Queries. From 73987ea67f59361aedda64e26dc8aeef833abbf3 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Wed, 20 Sep 2023 23:46:51 +0200 Subject: [PATCH 04/11] Update troubleshooting.md --- docs/general/administration/troubleshooting.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index 3cb8bd346..655df06c5 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -142,7 +142,8 @@ Manual changes to the database can destroy your Instance beyond repair. to preve Before continuing, make sure that you have sqlite3 installed. When sqlite3 is not installed, you can install it under Debian based systems with `apt install sqlite3`. -After that do the following commands/SQL query: +After that do the following commands/SQL query: +*You can find a list of default Paths [here](https://jellyfin.org/docs/general/administration/configuration#configuration-directory)* ```bash sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db @@ -153,13 +154,14 @@ sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db To see all your current permissions for all users, you can run the following Query: ```sql -select Permissions.Value,Permissions.Kind,Users.Username from Permissions Inner Join Users on Permissions.UserID = Users.Id; +SELECT Permissions.Value,Permissions.Kind,Users.Username FROM Permissions Inner Join Users on Permissions.UserID = Users.Id; ``` -To just check Permissions on your Admin Account, run the following Query: +To just check Permissions on your Admin Account, run the following Query: +*Please change the AdminUsername to the username of your Admin account* ```sql -select Value,Kind from Permissions WHERE UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); +SELECT Value,Kind FROM Permissions WHERE UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); ```
@@ -172,7 +174,7 @@ Not all permissions are needed, you can remove the unnecessary ones later in the ::: ```sql -UPDATE Permissions SET Value = 1 WHERE (Kind = 0 or Kind = 3 or Kind = 4 or Kind = 5 or Kind = 6 or Kind = 7 or Kind = 8 or Kind = 9 or Kind = 10 or Kind = 11 or Kind = 12 or Kind = 13 or Kind = 14 or Kind = 15 or Kind = 16 or Kind = 17 or Kind = 18 or Kind = 19 or Kind = 20 or Kind = 21) AND UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); +UPDATE Permissions SET Value = 1 WHERE (Kind = 0 OR Kind = 3 OR Kind = 4 OR Kind = 5 OR Kind = 6 OR Kind = 7 OR Kind = 8 OR Kind = 9 OR Kind = 10 OR Kind = 11 OR Kind = 12 OR Kind = 13 OR Kind = 14 OR Kind = 15 OR Kind = 16 OR Kind = 17 OR Kind = 18 OR Kind = 19 OR Kind = 20 OR Kind = 21) AND UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); .exit ``` From 23ff6acef02fabcd38ebf0c313690c0565d40931 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Wed, 20 Sep 2023 23:48:09 +0200 Subject: [PATCH 05/11] fix case of sql --- docs/general/administration/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index 655df06c5..c68d23dc2 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -154,7 +154,7 @@ sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db To see all your current permissions for all users, you can run the following Query: ```sql -SELECT Permissions.Value,Permissions.Kind,Users.Username FROM Permissions Inner Join Users on Permissions.UserID = Users.Id; +SELECT Permissions.Value,Permissions.Kind,Users.Username FROM Permissions INNER JOIN Users ON Permissions.UserID = Users.Id; ``` To just check Permissions on your Admin Account, run the following Query: From c17be8d2cf130dd7f57aa44cf6abf02db8f32df3 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Thu, 21 Sep 2023 09:14:39 +0200 Subject: [PATCH 06/11] Update docs/general/administration/troubleshooting.md Co-authored-by: Tim Eisele --- docs/general/administration/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index c68d23dc2..8aff6e395 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -133,7 +133,7 @@ UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Us ## Fix Admin User Permissions -If the Permissions for your Admin Account break, you can Restore them using simple SQL Queries. +If the permissions for your admin account break, you can restore them using simple SQL queries. :::caution Manual changes to the database can destroy your Instance beyond repair. to prevent this create a copy of your database before executing: From 521536de774f0cdfe6106d3c8e8346e2bd7e10ba Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Thu, 21 Sep 2023 09:14:46 +0200 Subject: [PATCH 07/11] Update docs/general/administration/troubleshooting.md Co-authored-by: Tim Eisele --- docs/general/administration/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index 8aff6e395..4547f2f57 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -136,7 +136,7 @@ UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Us If the permissions for your admin account break, you can restore them using simple SQL queries. :::caution -Manual changes to the database can destroy your Instance beyond repair. to prevent this create a copy of your database before executing: +Manual changes to the database can destroy your instance beyond repair. to prevent this create a copy of your database before executing: `cp /PATH/TO/JELLYFIN/DB/jellyfin.db /PATH/TO/JELLYFIN/DB/jellyfin.db.bck` ::: From 1c7eb39e5086f6df956f7a1700c3d630dcedf250 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Thu, 21 Sep 2023 09:15:38 +0200 Subject: [PATCH 08/11] Update docs/general/administration/troubleshooting.md Co-authored-by: Tim Eisele --- docs/general/administration/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index 4547f2f57..40a304ae1 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -151,7 +151,7 @@ sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db ### Get an Overview -To see all your current permissions for all users, you can run the following Query: +To see the current permissions for all users, you can run the following query: ```sql SELECT Permissions.Value,Permissions.Kind,Users.Username FROM Permissions INNER JOIN Users ON Permissions.UserID = Users.Id; From d6ab95410965c84cf3652590a46e28c51e6d3d1c Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Thu, 21 Sep 2023 09:15:48 +0200 Subject: [PATCH 09/11] Update docs/general/administration/troubleshooting.md Co-authored-by: Tim Eisele --- docs/general/administration/troubleshooting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index 40a304ae1..f6fd7a6b8 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -157,8 +157,8 @@ To see the current permissions for all users, you can run the following query: SELECT Permissions.Value,Permissions.Kind,Users.Username FROM Permissions INNER JOIN Users ON Permissions.UserID = Users.Id; ``` -To just check Permissions on your Admin Account, run the following Query: -*Please change the AdminUsername to the username of your Admin account* +To just check permissions on your admin account, run the following query: +*Please change `AdminUsername` to the username of your admin account* ```sql SELECT Value,Kind FROM Permissions WHERE UserId IN (SELECT Id FROM Users WHERE Username = 'AdminUsername'); From 1c2f6296485c1d781227861b8292373498aa0123 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Thu, 21 Sep 2023 09:16:25 +0200 Subject: [PATCH 10/11] Update docs/general/administration/troubleshooting.md Co-authored-by: Tim Eisele --- docs/general/administration/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index f6fd7a6b8..fc3e5e4e9 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -165,7 +165,7 @@ SELECT Value,Kind FROM Permissions WHERE UserId IN (SELECT Id FROM Users WHERE U ```
-The first row with an value of 1 or 0 shows if the permission is assigned or not. The second row displays the Kind of permission. To get a summary for every permission you can look [here](https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Data/Enums/PermissionKind.cs) +The first row with an value of 1 or 0 shows if the permission is assigned or not. The second row displays the kind of permission. To get a summary for every permission you can look [here](https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Data/Enums/PermissionKind.cs) ### Repair Permissions From b65cf504ae5cc62a291e0132cef2332693876df2 Mon Sep 17 00:00:00 2001 From: hofq <54744977+hofq@users.noreply.github.com> Date: Thu, 21 Sep 2023 09:19:38 +0200 Subject: [PATCH 11/11] Change to relative path --- docs/general/administration/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting.md index fc3e5e4e9..9574e352b 100644 --- a/docs/general/administration/troubleshooting.md +++ b/docs/general/administration/troubleshooting.md @@ -143,7 +143,7 @@ Manual changes to the database can destroy your instance beyond repair. to preve Before continuing, make sure that you have sqlite3 installed. When sqlite3 is not installed, you can install it under Debian based systems with `apt install sqlite3`. After that do the following commands/SQL query: -*You can find a list of default Paths [here](https://jellyfin.org/docs/general/administration/configuration#configuration-directory)* +*You can find a list of default Paths [here](../configuration#configuration-directory)* ```bash sqlite3 /PATH/TO/JELLYFIN/DB/jellyfin.db