# NextWorkspace

A self-hosted productivity suite for startups. One binary + Caddy + Authelia.

## Architecture

```
app.nextwks.eu :443                    auth.nextwks.eu :443
       │                                         │
   Caddy (TLS + forward auth)          Caddy → Authelia :9091
       │                                         │
       ├── /home/       → launcher page          └── authelia-api :8080
       ├── /drive/*     → OpenCloud :9100
       ├── /office/*    → Euro Office :9200
       ├── /erp/*       → ERPNext :9300
       ├── /chat/*      → Matrix :9400
       ├── /meet/*      → Jitsi :9500
       ├── /mail/*      → Alps :9600
       ├── /ai/*        → Open WebUI :9700
       └── /admin/*     → Portainer :9800
```

- **Caddy**: Reverse proxy, TLS (auto LE), subdomain routing, forward auth to Authelia
- **Authelia**: OIDC provider, 2FA, identity store
- **Binary**: Go launcher + path-based reverse proxy to upstream apps

## Quick Start

```bash
sudo ./install.sh
```

Prompts for domain, TLS email, and admin credentials. Installs dependencies, generates configs, deploys Caddy + Authelia + launcher.

## Directory Layout

```
/opt/nextworkspace/
├── config/
│   ├── caddy/Caddyfile
│   ├── authelia/configuration.yml
│   ├── authelia/users_database.yml
│   └── nextworkspace/{config,apps}.yaml
├── data/
│   ├── caddy/ (certs + runtime data)
│   └── authelia/ (database)
├── compose/
│   ├── caddy.yaml
│   └── authelia.yaml
├── www/ (landing page)
└── nextworkspace (binary)

/opt/backup/
├── .env (secrets vault)
└── certficates/ (LE cert backup)
```

## Deployment

```bash
sudo ./deploy.sh          # Smart update (swap binary, restart)
sudo ./deploy.sh --destroy # Full rebuild (certs backed up)
```

## Version

Current: 0.1.0.0007 — see [CHANGELOG.md](CHANGELOG.md)
