# Obsidian - Web-based Note Taking

## 📋 Overview

Obsidian is a powerful knowledge management and note-taking application. This deployment provides web-based access to Obsidian through a containerized environment, allowing remote access to your notes and knowledge base.

## 🔧 Service Details

| Property | Value |
|----------|-------|
| **Container Name** | `obsidian` |
| **Image** | `lscr.io/linuxserver/obsidian:latest` |
| **Web Port** | 127.0.0.1:3000 |
| **Secondary Port** | 127.0.0.1:3001 |
| **Domain** | `obs.vish.gg` |
| **User** | `admin` |
| **Timezone** | `America/Los_Angeles` |

## 🌐 Network Access

- **Public URL**: `https://obs.vish.gg`
- **Local Access**: `http://127.0.0.1:3000`
- **Secondary Port**: `http://127.0.0.1:3001`
- **Reverse Proxy**: Nginx configuration in `/etc/nginx/sites-enabled/obsidian`

## 📁 Directory Structure

```
/opt/obsidian/
├── docker-compose.yml    # Service configuration
└── config/              # Application configuration
    ├── data/            # Obsidian vaults and notes
    ├── Desktop/         # Desktop environment files
    └── .config/         # Application settings
```

## 🚀 Management Commands

### Docker Operations
```bash
# Navigate to service directory
cd /opt/obsidian/

# Start service
docker-compose up -d

# Stop service
docker-compose down

# Restart service
docker-compose restart

# View logs
docker-compose logs -f

# Update service
docker-compose pull
docker-compose up -d
```

### Container Management
```bash
# Check container status
docker ps | grep obsidian

# Execute commands in container
docker exec -it obsidian bash

# View container logs
docker logs obsidian -f

# Check resource usage
docker stats obsidian
```

## ⚙️ Configuration

### Environment Variables
- **PUID/PGID**: 1000 (user permissions)
- **Timezone**: America/Los_Angeles
- **Custom User**: admin
- **Password**: REDACTED_PASSWORD (change in production!)

### Security Options
- **seccomp**: unconfined (required for GUI applications)
- **Shared Memory**: 1GB (for browser rendering)

### Volume Mounts
- **Config**: `/opt/obsidian/config` → `/config`

## 🔒 Security Considerations

- **Local Binding**: Only accessible via localhost (127.0.0.1)
- **Nginx Proxy**: SSL termination and authentication
- **Default Credentials**: Change default password immediately
- **Container Isolation**: Runs in isolated Docker environment
- **File Permissions**: Proper user/group mapping

## 💻 Usage

### Web Interface
1. Access via `https://obs.vish.gg`
2. Log in with configured credentials
3. Use Obsidian's full interface through the browser
4. Create and manage vaults
5. Install community plugins and themes

### Features Available
- **Full Obsidian Interface**: Complete desktop experience in browser
- **Vault Management**: Create and switch between vaults
- **Plugin Support**: Install community plugins
- **Theme Support**: Customize appearance
- **File Management**: Upload and organize files
- **Graph View**: Visualize note connections

## 🔧 Maintenance

### Backup
```bash
# Backup entire configuration
tar -czf obsidian-backup-$(date +%Y%m%d).tar.gz /opt/obsidian/config/

# Backup specific vault
tar -czf vault-backup-$(date +%Y%m%d).tar.gz /opt/obsidian/config/data/YourVaultName/
```

### Updates
```bash
cd /opt/obsidian/
docker-compose pull
docker-compose up -d
```

### Performance Tuning
```bash
# Increase shared memory if needed
# Edit docker-compose.yml and increase shm_size

# Monitor resource usage
docker stats obsidian
```

## 🐛 Troubleshooting

### Common Issues
```bash
# Container won't start
docker-compose logs obsidian

# GUI not loading
# Check shared memory allocation
# Verify seccomp:unconfined is set

# Permission issues
sudo chown -R 1000:1000 /opt/obsidian/config/

# Performance issues
# Increase shm_size in docker-compose.yml
# Check available system resources
```

### Connection Issues
```bash
# Test local endpoint
curl -I http://127.0.0.1:3000

# Test public endpoint
curl -I https://obs.vish.gg

# Check nginx configuration
sudo nginx -t
sudo systemctl reload nginx
```

### File Access Issues
```bash
# Check file permissions
ls -la /opt/obsidian/config/

# Fix ownership
sudo chown -R 1000:1000 /opt/obsidian/config/

# Check disk space
df -h /opt/obsidian/
```

## 🔗 Related Services

- **Nginx**: Reverse proxy with SSL termination
- **Let's Encrypt**: SSL certificate management
- **Docker**: Container runtime

## 📚 External Resources

- [Obsidian Official Site](https://obsidian.md/)
- [LinuxServer.io Documentation](https://docs.linuxserver.io/images/docker-obsidian)
- [Docker Hub](https://hub.docker.com/r/linuxserver/obsidian)
- [Obsidian Community](https://obsidian.md/community)
- [Plugin Directory](https://obsidian.md/plugins)