Self-host all icons and wallpaper, remove CDN dependency
Download 69 selfh.st icon files (34 PNG, 34 light SVG, unraid.svg) into assets/icons/ and add wallpaper to assets/. Update sidebar.js to serve icons from /custom/assets/icons/ instead of cdn.jsdelivr.net. Update style.css wallpaper path to /custom/assets/wallpaper.jpg. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
35
CLAUDE.md
35
CLAUDE.md
@@ -11,13 +11,24 @@ Custom CSS + JS theme for Unraid 7.2.3 WebGUI. B&W mountain wallpaper with frost
|
||||
| File | Purpose | Deploy path (persistent) | Deploy path (live) |
|
||||
|------|---------|--------------------------|---------------------|
|
||||
| `style.css` | Main CSS theme | `/boot/config/plugins/custom.css/style.css` | `/usr/local/emhttp/plugins/custom.css/style.css` |
|
||||
| `sidebar.js` | Sidebar toggle + search overlay | `/boot/config/plugins/custom.css/assets/sidebar.js` | `/usr/local/emhttp/plugins/custom.css/assets/sidebar.js` |
|
||||
| `update-icons.sh` | Replace Docker/VM icons with selfh.st CDN icons | `/boot/config/plugins/custom.css/assets/update-icons.sh` | `/usr/local/emhttp/plugins/custom.css/assets/update-icons.sh` |
|
||||
| `sidebar.js` | Sidebar toggle + search overlay + icon replacement | `/boot/config/plugins/custom.css/assets/sidebar.js` | `/usr/local/emhttp/plugins/custom.css/assets/sidebar.js` |
|
||||
| `update-icons.sh` | Replace Docker/VM cached icons with selfh.st icons | `/boot/config/plugins/custom.css/assets/update-icons.sh` | `/usr/local/emhttp/plugins/custom.css/assets/update-icons.sh` |
|
||||
| `vm-icons.conf` | VM name → icon name mapping | `/boot/config/plugins/custom.css/assets/vm-icons.conf` | — |
|
||||
| `assets/icons/` | Self-hosted selfh.st icons (34 PNG + 34 light SVG + unraid.svg) | `/boot/config/plugins/custom.css/assets/icons/` | `/usr/local/emhttp/custom/assets/icons/` |
|
||||
| `assets/wallpaper.jpg` | Mountain wallpaper background | `/boot/config/plugins/custom.css/assets/wallpaper.jpg` | `/usr/local/emhttp/custom/assets/wallpaper.jpg` |
|
||||
|
||||
## Web-Accessible Paths
|
||||
|
||||
Unraid nginx serves `/usr/local/emhttp/` as document root. Key mapping:
|
||||
- `/custom/` → `/usr/local/emhttp/custom/` (NOT `plugins/custom.css/`!)
|
||||
- `/plugins/custom.css/` → `/usr/local/emhttp/plugins/custom.css/`
|
||||
|
||||
Static assets (icons, wallpaper) that need HTTP access go to `/usr/local/emhttp/custom/assets/`.
|
||||
JS/CSS loaded via plugin pages go to `/usr/local/emhttp/plugins/custom.css/`.
|
||||
|
||||
## Deployment
|
||||
|
||||
Both files must be deployed to TWO paths — persistent (survives reboot) and live (active now):
|
||||
Code files deploy to TWO paths — persistent (survives reboot) and live (active now):
|
||||
```bash
|
||||
scp -i ~/.ssh/id_ed25519_unraid -P 422 style.css root@192.168.10.20:/boot/config/plugins/custom.css/style.css
|
||||
scp -i ~/.ssh/id_ed25519_unraid -P 422 style.css root@192.168.10.20:/usr/local/emhttp/plugins/custom.css/style.css
|
||||
@@ -28,6 +39,18 @@ scp -i ~/.ssh/id_ed25519_unraid -P 422 update-icons.sh root@192.168.10.20:/usr/l
|
||||
scp -i ~/.ssh/id_ed25519_unraid -P 422 vm-icons.conf root@192.168.10.20:/boot/config/plugins/custom.css/assets/vm-icons.conf
|
||||
```
|
||||
|
||||
Static assets deploy to persistent + web-accessible paths:
|
||||
```bash
|
||||
# Icons
|
||||
scp -i ~/.ssh/id_ed25519_unraid -P 422 -r assets/icons/ root@192.168.10.20:/boot/config/plugins/custom.css/assets/icons/
|
||||
ssh -i ~/.ssh/id_ed25519_unraid root@192.168.10.20 -p 422 'mkdir -p /usr/local/emhttp/custom/assets && cp -r /boot/config/plugins/custom.css/assets/icons /usr/local/emhttp/custom/assets/'
|
||||
# Wallpaper
|
||||
scp -i ~/.ssh/id_ed25519_unraid -P 422 assets/wallpaper.jpg root@192.168.10.20:/boot/config/plugins/custom.css/assets/wallpaper.jpg
|
||||
ssh -i ~/.ssh/id_ed25519_unraid root@192.168.10.20 -p 422 'cp /boot/config/plugins/custom.css/assets/wallpaper.jpg /usr/local/emhttp/custom/assets/'
|
||||
```
|
||||
|
||||
Boot persistence is handled by `/boot/config/go` which copies icons/wallpaper to `/usr/local/emhttp/custom/assets/` on startup.
|
||||
|
||||
JS injection is handled by `CustomJS_Loader.page` on the server (persisted via `/boot/config/go`).
|
||||
|
||||
## Unraid Sidebar DOM Structure
|
||||
@@ -113,7 +136,7 @@ The `dynamix.gui.search` plugin uses hover-trigger in sidebar theme. We replace
|
||||
|
||||
## Custom Docker/VM Icons
|
||||
|
||||
Icons are sourced from [selfh.st/icons](https://selfh.st/icons/) via jsDelivr CDN.
|
||||
Icons are sourced from [selfh.st/icons](https://selfh.st/icons/) and self-hosted locally in `assets/icons/` (no CDN dependency).
|
||||
|
||||
### How it works
|
||||
`update-icons.sh` reads a `glass.icon` Docker label from each container, downloads the matching PNG from `https://cdn.jsdelivr.net/gh/selfhst/icons@main/png/{name}.png`, and replaces Unraid's cached icon files. This works on Docker page, VM page, and Dashboard — no client-side JS needed.
|
||||
@@ -144,4 +167,6 @@ ssh -i ~/.ssh/id_ed25519_unraid root@192.168.10.20 -p 422 'bash /boot/config/plu
|
||||
|
||||
## Wallpaper
|
||||
|
||||
Place wallpaper at `/boot/config/plugins/custom.css/assets/wallpaper.jpg` — accessible at `/custom/wallpaper.jpg`.
|
||||
Source: Unsplash NuBvAE6VfSM (B&W mountains). Tracked in repo as `assets/wallpaper.jpg`.
|
||||
- Persistent: `/boot/config/plugins/custom.css/assets/wallpaper.jpg`
|
||||
- Web-accessible: `/usr/local/emhttp/custom/assets/wallpaper.jpg` → `/custom/assets/wallpaper.jpg`
|
||||
|
||||
Reference in New Issue
Block a user