From ee2ed84b6e79192482f1310634a2db15269ff86b Mon Sep 17 00:00:00 2001
From: Chris Cowley <christopher.cowley@ubisoft.com>
Date: Wed, 23 Oct 2024 10:31:27 +0200
Subject: [PATCH] Add notes to fix jellyfin and nextcloud admin

---
 Dockerfile                |  1 +
 docs/general-fix-notes.md | 46 +++++++++++++++++++++++++++++++++++++++
 docs/physical-network.md  | 23 +++++++++++++++-----
 3 files changed, 64 insertions(+), 6 deletions(-)
 create mode 100644 docs/general-fix-notes.md

diff --git a/Dockerfile b/Dockerfile
index 59facde..e4d6d1d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,4 +9,5 @@ RUN mkdocs build
 
 FROM nginx:alpine
 
+EXPOSE 80
 COPY --from=build /docs/site/ /usr/share/nginx/html/
diff --git a/docs/general-fix-notes.md b/docs/general-fix-notes.md
new file mode 100644
index 0000000..a0fd9b3
--- /dev/null
+++ b/docs/general-fix-notes.md
@@ -0,0 +1,46 @@
+
+# General Notes
+
+## Nextcloud
+
+Lost admin privileges
+
+connect to Nextcloud container and change to www-data (`su -s /bin/bash - www-data`)
+
+```bash
+cd /var/www/html
+php occ user:list
+```
+
+The user you need will be in the list and need the UUID
+
+```bash
+php occ group:adduser admin <uuid>
+```
+
+## Jellyfin
+
+### Fix lost admin privileges
+
+Change jellyfin pod to run bash instead of jellyfin
+
+Install SQLlite in the new temporary pod
+
+```bash
+apt update
+apt install sqlite3
+```
+
+Backup the database just in case
+
+```bash
+cp /config/data/jellyfin.db{,.bak}
+```
+
+Update the permissions:
+
+```bash
+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
+```
diff --git a/docs/physical-network.md b/docs/physical-network.md
index c071389..1af8681 100644
--- a/docs/physical-network.md
+++ b/docs/physical-network.md
@@ -1,10 +1,21 @@
 # Physical Network
 
 ``` mermaid
-graph LR
-  A[Start] --> B{Error?};
-  B -->|Yes| C[Hmm...];
-  C --> D[Debug];
-  D --> B;
-  B ---->|No| E[Yay!];
+graph TB
+  C(Opnsense) --> A;
+  D(laundry AP) --> A;
+  E(Loft AP) --> A;
+  A[Laundry Switch] <-->|Outside| B[Garage Switch];
+  B --> F(Microserver)
+  B --> G(kubemaster)
+  B --> H(agent0)
+  B --> I(agent1)
+  B --> J(agent2)
+  P[bedroom] <--> B
+  L(TV) --> K
+  M(Kodi) --> K
+  N(OrangeTV) --> K
+  O(Retropie) --> K
+  K[lounge switch] <--> B
 ```
+