Initial commit: Socktop WebTerm with k3s deployment

- Multi-architecture Docker image (ARM64 + AMD64)
- Kubernetes manifests for 3-replica deployment
- Traefik ingress configuration
- NGINX Proxy Manager integration
- ConfigMap-based configuration
- Automated build and deployment scripts
- Session monitoring tools
This commit is contained in:
2025-11-28 01:31:33 -08:00
parent 627073ef2d
commit 6e48c095ab
68 changed files with 12391 additions and 1007 deletions
+242
View File
@@ -0,0 +1,242 @@
# Configuration Files Directory
This directory contains configuration files that will be mounted into the Docker container at runtime.
## Required Files
Place your actual configuration files in this directory before building/running the container:
### 1. Alacritty Configuration
**`alacritty.toml`**
- Terminal emulator configuration
- Copy from: `alacritty.toml.example`
- Customize font, opacity, colors, key bindings
**`catppuccin-frappe.toml`**
- Catppuccin Frappe color theme for Alacritty
- Copy from: `catppuccin-frappe.toml.example`
- Matches the web interface theme
### 2. socktop Configuration
**`profiles.json`**
- socktop profile definitions for your remote systems
- Copy from: `profiles.json.example`
- Update with your actual host IPs and connection details
### 3. SSH Keys
**`rpi-master.pem`**
- SSH private key for master node
- **IMPORTANT**: Set permissions to 600
**`rpi-worker-1.pem`**
- SSH private key for worker node 1
- **IMPORTANT**: Set permissions to 600
**`rpi-worker-2.pem`**
- SSH private key for worker node 2
- **IMPORTANT**: Set permissions to 600
**`rpi-worker-3.pem`**
- SSH private key for worker node 3
- **IMPORTANT**: Set permissions to 600
## Quick Setup
```bash
# Copy example files
cp alacritty.toml.example alacritty.toml
cp catppuccin-frappe.toml.example catppuccin-frappe.toml
cp profiles.json.example profiles.json
# Copy your SSH keys (from wherever you have them)
cp /path/to/your/rpi-master.pem .
cp /path/to/your/rpi-worker-1.pem .
cp /path/to/your/rpi-worker-2.pem .
cp /path/to/your/rpi-worker-3.pem .
# Set correct permissions on SSH keys
chmod 600 *.pem
```
## Security Notes
### SSH Keys
**DO NOT commit private keys to version control!**
The `.gitignore` file should already exclude `*.pem` files, but verify:
```bash
# Check that keys are ignored
git status
# If keys appear, add to .gitignore
echo "files/*.pem" >> ../.gitignore
```
### File Permissions
SSH keys must have restrictive permissions:
```bash
# Set correct permissions (required)
chmod 600 *.pem
# Verify
ls -la *.pem
# Should show: -rw------- (600)
```
### Read-Only Mounting
Files are mounted read-only into the container for security:
```yaml
volumes:
- ./files:/files:ro # :ro = read-only
```
This prevents the container from modifying your configuration files.
## Customization
### Alacritty Configuration
Edit `alacritty.toml` to customize:
```toml
[window]
opacity = 0.95 # Transparency (0.0 - 1.0)
[font]
size = 11.0 # Font size
[colors]
# Theme is imported from catppuccin-frappe.toml
```
### socktop Profiles
Edit `profiles.json` to add/modify systems:
```json
{
"profiles": {
"my-server": {
"name": "My Server",
"host": "192.168.1.100",
"port": 3000,
"auth": {
"type": "ssh_key",
"username": "user",
"key_path": "~/.config/socktop/my-server.pem"
},
"tags": ["production"],
"color": "#a6d189"
}
}
}
```
## Troubleshooting
### Files Not Loading
If configuration files aren't being loaded in the container:
1. **Check files exist:**
```bash
ls -la files/
```
2. **Check container can see them:**
```bash
docker exec socktop-webterm ls -la /files
```
3. **Check they were copied to config directories:**
```bash
docker exec socktop-webterm ls -la /home/socktop/.config/alacritty
docker exec socktop-webterm ls -la /home/socktop/.config/socktop
```
4. **Check entrypoint logs:**
```bash
docker logs socktop-webterm 2>&1 | head -50
```
### SSH Key Issues
If SSH authentication fails:
1. **Verify permissions:**
```bash
ls -la *.pem
# Should show: -rw------- (600)
```
2. **Check key format:**
```bash
head -1 rpi-master.pem
# Should show: -----BEGIN ... PRIVATE KEY-----
```
3. **Test key manually:**
```bash
ssh -i rpi-master.pem user@host
```
### Font Not Rendering
If FiraCode Nerd Font doesn't work:
1. **Verify font name in config:**
```toml
[font]
normal = { family = "FiraCode Nerd Font Mono", style = "Regular" }
```
2. **Check font is installed in container:**
```bash
docker exec socktop-webterm fc-list | grep -i firacode
```
## Directory Structure
```
files/
├── README.md # This file
├── alacritty.toml.example # Example Alacritty config
├── alacritty.toml # Your Alacritty config (create this)
├── catppuccin-frappe.toml.example # Example theme
├── catppuccin-frappe.toml # Your theme (create this)
├── profiles.json.example # Example profiles
├── profiles.json # Your profiles (create this)
├── rpi-master.pem # Your SSH keys (add these)
├── rpi-worker-1.pem
├── rpi-worker-2.pem
└── rpi-worker-3.pem
```
## Validation Checklist
Before running the container, verify:
- [ ] `alacritty.toml` exists and is valid TOML
- [ ] `catppuccin-frappe.toml` exists and is valid TOML
- [ ] `profiles.json` exists and is valid JSON
- [ ] All `.pem` files exist
- [ ] All `.pem` files have 600 permissions
- [ ] No `.pem` files are committed to git
- [ ] Host IPs in `profiles.json` are correct
- [ ] SSH keys match the systems in `profiles.json`
## References
- **Alacritty Config**: https://github.com/alacritty/alacritty/blob/master/alacritty.yml
- **Catppuccin Theme**: https://github.com/catppuccin/alacritty
- **socktop Docs**: https://jasonwitty.github.io/socktop/
- **Docker Docs**: See `../DOCKER_DEPLOYMENT.md`
+101
View File
@@ -0,0 +1,101 @@
# Alacritty Configuration for socktop webterm
# This is an example configuration - copy to alacritty.toml and customize
[window]
# Window opacity (0.0 - 1.0)
opacity = 0.95
# Window padding
padding = { x = 5, y = 5 }
# Window decorations
decorations = "full"
# Startup mode
startup_mode = "Windowed"
[font]
# Font configuration
normal = { family = "FiraCode Nerd Font Mono", style = "Regular" }
bold = { family = "FiraCode Nerd Font Mono", style = "Bold" }
italic = { family = "FiraCode Nerd Font Mono", style = "Italic" }
bold_italic = { family = "FiraCode Nerd Font Mono", style = "Bold Italic" }
# Font size
size = 11.0
# Better font rendering
builtin_box_drawing = true
[colors]
# Import Catppuccin Frappe theme
# Make sure catppuccin-frappe.toml is in the same directory
import = ["~/.config/alacritty/catppuccin-frappe.toml"]
# Draw bold text with bright colors
draw_bold_text_with_bright_colors = true
[cursor]
# Cursor style
style = { shape = "Block", blinking = "On" }
# Cursor blink interval (milliseconds)
blink_interval = 750
# Cursor thickness
thickness = 0.15
[scrolling]
# Maximum number of lines in the scrollback buffer
history = 10000
# Number of lines scrolled for every input scroll increment
multiplier = 3
[mouse]
# Hide mouse cursor when typing
hide_when_typing = true
[keyboard]
# Key bindings
bindings = [
# Copy/Paste
{ key = "C", mods = "Control|Shift", action = "Copy" },
{ key = "V", mods = "Control|Shift", action = "Paste" },
# Search
{ key = "F", mods = "Control|Shift", action = "SearchForward" },
# Font size adjustment
{ key = "Plus", mods = "Control", action = "IncreaseFontSize" },
{ key = "Minus", mods = "Control", action = "DecreaseFontSize" },
{ key = "Key0", mods = "Control", action = "ResetFontSize" },
# Scrolling
{ key = "PageUp", mods = "Shift", action = "ScrollPageUp" },
{ key = "PageDown", mods = "Shift", action = "ScrollPageDown" },
{ key = "Home", mods = "Shift", action = "ScrollToTop" },
{ key = "End", mods = "Shift", action = "ScrollToBottom" },
]
[bell]
# Visual bell animation
animation = "EaseOutExpo"
duration = 0
color = "#ffffff"
[selection]
# Characters that are used as separators for "semantic words" in Alacritty
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
# When set to true, selected text will be copied to the primary clipboard
save_to_clipboard = true
[terminal]
# Set the TERM environment variable
# This should match what's expected by the application
osc52 = "CopyPaste"
[env]
# Environment variables
TERM = "xterm-256color"
+78
View File
@@ -0,0 +1,78 @@
# Catppuccin Frappe Theme for Alacritty
# https://github.com/catppuccin/alacritty
[colors.primary]
background = "#303446"
foreground = "#c6d0f5"
dim_foreground = "#c6d0f5"
bright_foreground = "#c6d0f5"
[colors.cursor]
text = "#303446"
cursor = "#f2d5cf"
[colors.vi_mode_cursor]
text = "#303446"
cursor = "#babbf1"
[colors.search.matches]
foreground = "#303446"
background = "#a5adce"
[colors.search.focused_match]
foreground = "#303446"
background = "#a6d189"
[colors.footer_bar]
foreground = "#303446"
background = "#a5adce"
[colors.hints.start]
foreground = "#303446"
background = "#e5c890"
[colors.hints.end]
foreground = "#303446"
background = "#a5adce"
[colors.selection]
text = "#303446"
background = "#f2d5cf"
[colors.normal]
black = "#51576d"
red = "#e78284"
green = "#a6d189"
yellow = "#e5c890"
blue = "#8caaee"
magenta = "#f4b8e4"
cyan = "#81c8be"
white = "#b5bfe2"
[colors.bright]
black = "#626880"
red = "#e78284"
green = "#a6d189"
yellow = "#e5c890"
blue = "#8caaee"
magenta = "#f4b8e4"
cyan = "#81c8be"
white = "#a5adce"
[colors.dim]
black = "#51576d"
red = "#e78284"
green = "#a6d189"
yellow = "#e5c890"
blue = "#8caaee"
magenta = "#f4b8e4"
cyan = "#81c8be"
white = "#b5bfe2"
[[colors.indexed_colors]]
index = 16
color = "#ef9f76"
[[colors.indexed_colors]]
index = 17
color = "#f2d5cf"
+69
View File
@@ -0,0 +1,69 @@
{
"profiles": {
"rpi-master": {
"name": "Raspberry Pi Master",
"host": "192.168.1.100",
"port": 3000,
"auth": {
"type": "ssh_key",
"username": "pi",
"key_path": "~/.config/socktop/rpi-master.pem"
},
"tags": ["production", "master", "rpi"],
"color": "#a6d189"
},
"rpi-worker-1": {
"name": "Raspberry Pi Worker 1",
"host": "192.168.1.101",
"port": 3000,
"auth": {
"type": "ssh_key",
"username": "pi",
"key_path": "~/.config/socktop/rpi-worker-1.pem"
},
"tags": ["production", "worker", "rpi"],
"color": "#8caaee"
},
"rpi-worker-2": {
"name": "Raspberry Pi Worker 2",
"host": "192.168.1.102",
"port": 3000,
"auth": {
"type": "ssh_key",
"username": "pi",
"key_path": "~/.config/socktop/rpi-worker-2.pem"
},
"tags": ["production", "worker", "rpi"],
"color": "#ca9ee6"
},
"rpi-worker-3": {
"name": "Raspberry Pi Worker 3",
"host": "192.168.1.103",
"port": 3000,
"auth": {
"type": "ssh_key",
"username": "pi",
"key_path": "~/.config/socktop/rpi-worker-3.pem"
},
"tags": ["production", "worker", "rpi"],
"color": "#ef9f76"
},
"local": {
"name": "Local Agent",
"host": "localhost",
"port": 3001,
"auth": {
"type": "none"
},
"tags": ["local", "dev"],
"color": "#e5c890"
}
},
"default_profile": "local",
"settings": {
"refresh_interval": 1000,
"theme": "catppuccin-frappe",
"show_graphs": true,
"compact_mode": false
}
}