Skip to content

arrfour/jarvis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Jarvis - Open WebUI on Tailscale

A dual-stack (production + beta) containerized deployment of Open WebUI with Ollama support, securely accessible via Tailscale with automatically-issued valid HTTPS certificates. No port forwarding. No self-signed warnings. Pure private network security.

Current Version: v1.1.0 - Security Hardening & Stability Release

✨ Features

  • πŸ€– Open WebUI - Modern web interface for LLM chat and interactions
  • 🧠 Ollama Backend - Local LLM runtime with persistent models
  • πŸ” Tailscale Integration - End-to-end encrypted private network (no port forwarding needed)
  • βœ… Valid HTTPS Certificates - Automatic certs via Tailscale Serve (zero warnings; currently using HTTP mode while ACME rate limit recovers β€” see TROUBLESHOOTING.md)
  • πŸ”„ Dual-Stack Architecture - Production and beta environments running independently
  • 🎨 Visual Differentiation - Beta marked with red branding for quick identification
  • πŸ“¦ Docker Compose - Reproducible, version-controlled infrastructure
  • πŸ› οΈ Interactive TUI - Beautiful terminal interface with keyboard navigation
  • πŸŽ›οΈ Ansible Automation - Enterprise-grade declarative operations
  • πŸ›‘οΈ Security Hardened - 12 critical security & stability improvements in v1.1.0

πŸš€ What's New in v1.1.0

Security Hardening Release with comprehensive improvements:

πŸ”’ Security Enhancements

  • Security Headers - HTTP headers added (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection) to prevent clickjacking and injection attacks
  • Tailscale Image - Sidecars use tailscale/tailscale:unstable to access the --service VIP flag not yet in stable releases; operators should expect upstream changes on upgrade
  • Safe Configuration Parsing - Robust YAML parsing prevents injection vulnerabilities in image version detection

πŸ›‘οΈ Stability & Resource Management

  • Resource Limits - CPU (4 cores) and memory (8GB) limits enforced per container to prevent OOM crashes
  • Robust Error Handling - Error traps with line-number reporting for faster diagnostics
  • Improved Container Detection - Fixed race conditions in Tailscale readiness checks

πŸ”§ Operational Improvements

  • Consistent Networking - Production and beta stacks now use identical network modes for reliability
  • Dynamic Volume Management - Stack destruction now safely handles volumes even if project directory is renamed
  • Better TUI Feedback - Dialog now distinguishes between user cancellations and actual errors
  • Optimized Log Parsing - Robust image tag parsing prevents configuration errors from YAML format changes

⚑ Performance Optimizations

  • TUI Cleanup - Removed unnecessary temporary file operations (faster startup)
  • Consistent Tailscale Configuration - Both prod and beta use identical HTTPS/HTTP proxying syntax

πŸ—οΈ Architecture

jarvis/
β”œβ”€β”€ πŸ“‹ Core Management
β”‚   β”œβ”€β”€ docker-compose.yaml          ← Root unified orchestration
β”‚   β”œβ”€β”€ docker-compose.nvidia.yaml   ← GPU override (NVIDIA)
β”‚   β”œβ”€β”€ docker-compose.amd.yaml      ← GPU override (AMD)
β”‚   β”œβ”€β”€ tui.sh                       ← Interactive TUI (recommended)
β”‚   β”œβ”€β”€ manage.sh                    ← CLI tool + TUI launcher
β”‚   └── .gitignore                   ← Secrets protection
β”‚
β”œβ”€β”€ 🐳 Docker Stack Configurations
β”‚   β”œβ”€β”€ production/                  ← Production stack (pinned versions)
β”‚   β”‚   β”œβ”€β”€ docker-compose.yaml      ← Prod-specific overrides
β”‚   β”‚   β”œβ”€β”€ nginx.conf               ← Reverse proxy config
β”‚   β”‚   β”œβ”€β”€ README.md                ← Prod documentation
β”‚   β”‚   └── .env.example             ← Template for auth keys
β”‚   β”‚
β”‚   └── beta/                        ← Beta stack (latest features)
β”‚       β”œβ”€β”€ docker-compose.yaml      ← Beta-specific overrides
β”‚       β”œβ”€β”€ nginx.conf               ← Reverse proxy config
β”‚       β”œβ”€β”€ tailscale-entrypoint.sh  ← Custom Tailscale startup
β”‚       β”œβ”€β”€ assets/                  ← Red branding (favicon + logo)
β”‚       β”œβ”€β”€ README.md                ← Beta documentation
β”‚       └── .env.example             ← Template for auth keys
β”‚
β”œβ”€β”€ πŸ€– Ansible Automation (Optional)
β”‚   β”œβ”€β”€ README.md                    ← Ansible setup guide
β”‚   β”œβ”€β”€ IMPLEMENTATION.md            ← Technical details
β”‚   β”œβ”€β”€ Makefile                     ← Easy command interface
β”‚   β”œβ”€β”€ quickstart.sh                ← One-command deployment
β”‚   β”œβ”€β”€ ansible.cfg                  ← Ansible configuration
β”‚   β”œβ”€β”€ playbooks/                   ← Start/stop/status/restart
β”‚   └── roles/                       ← Setup, environment, stack
β”‚
└── πŸ“š Documentation
    β”œβ”€β”€ README.md                    ← Main overview (you are here!)
    β”œβ”€β”€ USER_GUIDE.md                ← User-facing guide for chat access
    β”œβ”€β”€ CLAUDE.md                    ← Project instructions for Claude Code
    β”œβ”€β”€ DEPLOYMENT.md                ← Server deployment guide
    β”œβ”€β”€ DEVELOPMENT.md               ← Dev workflow & git practices
    β”œβ”€β”€ TROUBLESHOOTING.md           ← Common issues and fixes
    β”œβ”€β”€ STACK_MANAGEMENT.md          ← Manual Docker operations
    β”œβ”€β”€ BETA_QUICKSTART.md           ← Beta testing checklist
    └── ANSIBLE_MIGRATION.md         ← Ansible workflow guide

πŸš€ Quick Start

Prerequisites

Initial Setup (5 minutes)

1. Clone/extract the repository

cd /path/to/jarvis

2. Add your Tailscale auth keys

cp production/.env.example production/.env
cp beta/.env.example beta/.env

# Edit both files with your auth keys
nano production/.env      # Add TS_AUTHKEY=tskey-auth-xxxxx
nano beta/.env            # Add TS_AUTHKEY_BETA=tskey-auth-yyyyy

3. Start everything

./manage.sh start

4. Access your stacks

  • Production: https://jarvis.YOUR_TAILNET.ts.net
  • Beta: https://jarvis-beta.YOUR_TAILNET.ts.net (red branding)
  • Local HTTP: http://localhost:8080 (prod), http://localhost:8081 (beta)

Done! Both stacks are now running.

πŸ“‹ Stack Management

You have three options for managing stacks:

Option 1: Interactive TUI (Recommended)

Beautiful keyboard-driven interface with status dashboard:

# Install dialog (one-time)
sudo apt install dialog     # Debian/Ubuntu
sudo dnf install dialog     # Fedora

# Launch TUI
./manage.sh                 # Auto-launches when no args
./tui.sh                    # Direct TUI launch

Features:

  • 🎹 Keyboard navigation (arrow keys + Enter)
  • πŸ“Š Real-time status dashboard with health icons
  • πŸ“‹ Live log streaming
  • ⚠️ Confirmation dialogs for destructive operations

Option 2: CLI Commands (Quick & Simple)

Direct command execution without TUI:

./manage.sh start          # Start both stacks
./manage.sh restart-beta   # Restart beta only
./manage.sh logs-prod      # View production logs
./manage.sh help           # Show all commands

Option 3: Ansible (Infrastructure as Code)

For idempotent, declarative operations:

cd ansible
make install               # One-time setup
make start                 # Start both stacks
make restart-beta          # Restart beta only
make status                # Check status

See ansible/README.md for full Ansible documentation.

πŸ“Š Common Tasks

Check stack health

./manage.sh status

View logs

./manage.sh logs          # All stacks
./manage.sh logs-prod     # Production only
./manage.sh logs-beta     # Beta only

Update a model in Ollama

docker exec -it open-webui2 ollama pull llama2
docker exec -it open-webui-beta ollama pull mistral

Stop all stacks

./manage.sh stop

🌍 Access from Outside Your Machine

Since everything runs on Tailscale, you can access it from any device on your Tailnet:

  1. From another Linux box:

    curl https://jarvis.YOUR_TAILNET.ts.net
  2. From Windows/Mac with Tailscale installed:

    • Open browser: https://jarvis.YOUR_TAILNET.ts.net
    • Works exactly like localhost but encrypted end-to-end
  3. From mobile (iOS/Android Tailscale app):

    • Install Tailscale app
    • Same FQDN works

🐳 Docker Compose Profiles

The root docker-compose.yaml uses profiles to manage multiple stacks:

docker-compose --profile all up -d    # Both prod + beta
docker-compose --profile prod up -d   # Production only
docker-compose --profile beta up -d   # Beta only

Use manage.sh to avoid remembering these flags.

πŸ“š Documentation

πŸš€ Performance Tips

  1. GPU Support: Automatically detected (NVIDIA or AMD)

    • Use ./manage.sh start --cpu to force CPU-only mode
  2. Model Management: Ollama models stored in persistent volumes

    • Production: docker volume inspect jarvis_ollama
    • Beta: docker volume inspect jarvis_ollama-beta
  3. Memory: Monitor with docker stats

πŸ” Security Notes

  • βœ… All traffic encrypted (Tailscale VPN + HTTPS)
  • βœ… No port forwarding needed
  • βœ… Valid certificates (no self-signed warnings)
  • βœ… Auth keys expire and auto-approve (90 days)
  • βœ… Hardened with security headers (XSS, clickjacking protection)

Best Practices:

  1. Regenerate auth keys periodically
  2. Keep Tailscale updated
  3. Review connected devices: https://login.tailscale.com/admin/machines
  4. Use separate keys for prod and beta

πŸ“ Version Control

This repo tracks:

  • βœ… Configuration files (docker-compose.yaml, nginx.conf)
  • βœ… Deployment scripts (manage.sh, tui.sh)
  • βœ… Documentation
  • ❌ .env files (gitignored - contains secrets)
  • ❌ Volumes/data (handled by Docker)

Current Release:

  • Version: v1.1.0 (Security Hardening & Stability Release)
  • Branch: main (production-stable)
  • Previous: v2025.12.6.003

View all releases: git tag -l | sort -V

πŸ†˜ Troubleshooting

Issue: Can't connect to jarvis.YOUR_TAILNET.ts.net

  • Verify device is approved in Tailscale admin
  • Check: ./manage.sh status
  • View logs: ./manage.sh logs

Issue: Models not persisting?

docker volume ls | grep jarvis
docker volume inspect jarvis_ollama

Issue: Slow responses?

  • Try a smaller model
  • Check GPU is being used: ./manage.sh monitor-gpu

More issues? See TROUBLESHOOTING.md

πŸŽ“ Learning Resources

πŸ“„ License

MIT License - Feel free to use, modify, and share

πŸ“ Changelog

  • v1.1.0 - Security hardening: 12 critical improvements (headers, pinned deps, resource limits, error handling, etc.)
  • v2025.12.6.003 - Code review remediations
  • v2025.12.6.002 - Fixed logging and cert rotation
  • v2025.12.6.001 - Initial release with Tailscale HTTPS certificates

Found a bug or have an improvement? Submit a pull request or open an issue on GitHub.

About

Cobbling together a stack of Open WebUI, with some Tailscale, all with a poorly chosen name

Resources

Security policy

Stars

Watchers

Forks

Contributors