Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"permissions": {
"allow": [
"WebFetch(domain:github.com)",
"mcp__ide__getDiagnostics"
],
"deny": [
"Read(config/**)"
]
}
}
135 changes: 135 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Repository Overview

This repository contains Infrastructure as Code (IaC) configuration for a home infrastructure setup. The main goals are:
- Creating a local, self-hosted environment for various services minimizing reliance on cloud providers
- Learning and organizing knowledge, best practices, and tool documentation

## Key Commands

### Development and Building

```bash
# List all available tasks
task --list-all

# Run all linting and build tasks
task build

# Run linting tools (via pre-commit)
task lint

# Open TaskUI (terminal UI for executing tasks)
task ui

# Update pre-commit hooks
task pre-commit-update

# Run renovatebot locally
task renovate

# Clear generated content and cache data
task clean
```

### Docker Management

```bash
# Deploy locally configured containers
task docker:apply

# Update and restart containers
task docker:update

# Pull container images
task docker:pull

# Pull, update, restart containers, then show restarts
task docker:pull-update

# Stop configured containers
task docker:stop

# Remove unused and dangling images
task docker:prune

# Show docker disk usage
task docker:du
```

### Ansible Commands

```bash
# Run Ansible for homelab setup
ansible/apply-homelab.sh

# Run Ansible for cloud setup
ansible/apply-cloud.sh

# Run Ansible for Mac workstation setup
ansible/apply-mac-workstation.sh
```

## Architecture Overview

The infrastructure is designed around the following components:

1. **Core Infrastructure**:
- Proxmox Virtual Environment as a Type 1 hypervisor
- Ubuntu Server as the host OS for Docker containers
- Ansible for configuration management
- Docker Compose for container definitions

2. **Key Services**:
- **Security**: Traefik (reverse proxy), Authelia (authentication), Cloudflared (tunnel)
- **Monitoring**: Grafana, Prometheus, Node-exporter, Uptime-kuma
- **Media**: Jellyfin, Metube, Navidrome, Calibre
- **Storage**: MinIO, Syncthing, FileSharing
- **AI Tools**: Ollama, Open-WebUI, LiteLLM, AutogenStudio
- **Tools**: Guacamole, Homepage (dashboard), Vaultwarden

3. **Configuration Structure**:
- `ansible/`: Contains playbooks and roles for infrastructure setup
- `docker/`: Contains Docker Compose definitions for all services
- `docs/`: Documentation and usage instructions
- `terraform/`: IaC for cloud provisioning
- `proxmox/`: Scripts for VM creation and management
- `scripts/`: Utility scripts for various tasks
- `config/`: Host-specific configuration (not in repository)
- `config-example/`: Example configuration files

## Development Workflow

This project uses:
- **Task** (taskfile.dev) as a task runner/build tool
- **Pre-commit** for code quality and security checks
- **Docker** and Docker Compose for containerized services
- **GitHub Actions** for CI/CD workflows:
- Pre-commit checks
- Building devcontainer
- Building and deploying documentation site
- **Renovate** for automated dependency updates

## File Structure

Key directories and their purposes:

```
/
├── ansible/ # Ansible configuration for server setup
│ ├── playbooks/ # Main playbooks for different environments
│ └── roles/ # Individual roles for specific configurations
├── docker/ # Docker Compose files for services
│ ├── security/ # Auth and security services
│ ├── media/ # Media services
│ ├── storage/ # Storage services
│ └── monitoring/ # Monitoring services
├── docs/ # Documentation
├── terraform/ # Terraform configurations
└── scripts/ # Utility scripts
```

When contributing to this repository, follow the pre-commit rules defined in `.pre-commit-config.yaml` which includes linting for shell scripts, Dockerfiles, YAML files, Ansible playbooks, and Terraform configurations.