# draw.io Cloudron Package

## Description

draw.io (diagrams.net) is a free, open-source, client-side diagramming
application for creating flowcharts, process diagrams, organizational charts,
UML, entity-relationship, network diagrams, and more. It runs entirely in the
browser; diagrams are stored in browser `localStorage` or exported / synced to
cloud storage providers (Google Drive, OneDrive, GitHub, GitLab, Dropbox).

This package wraps the official `jgraph/drawio` Docker image (Tomcat serving
`draw.war`).

## Authentication

draw.io has **no built-in user model** — it is a stateless client-side tool.
This package therefore uses **Cloudron's authentication proxy**
(`httpAuth.type = proxy` in `CloudronManifest.json`). The Cloudron admin
restricts which platform users/groups may reach the app; authorized users are
challenged for their Cloudron credentials before the diagram editor loads.

This is the recommended pattern for utility apps without their own user
directory.

## Features

- **Diagram Types**: Flowcharts, BPMN, UML, ERD, network, AWS/Azure/GCP
  architecture, mind maps, org charts, floor plans, Venn, and more
- **Shape Libraries**: Hundreds of built-in stencils + custom shape import
- **Export**: PNG, JPEG, SVG, PDF, HTML, VSDX
- **Cloud Sync**: Google Drive, OneDrive, GitHub, GitLab, Dropbox, Trello
- **Offline**: Works fully offline; diagrams persist in the browser
- **Collaboration**: Real-time co-editing via Google Drive / Microsoft Teams
- **Embed**: Embed diagrams in Confluence, Jira, Notion, web pages

## Configuration

### Ports
- **8080**: Tomcat HTTP (the only exposed port)

### Environment Variables (optional)
draw.io runs out-of-the-box with no configuration. These are optional knobs:

| Variable | Purpose |
|----------|---------|
| `DRAWIO_BASE_URL` | Base URL for the deployment |
| `DRAWIO_SELF_CONTAINED` | `1` to run fully self-contained (no external CDNs) |
| `PLANTUML_URL` | URL of a PlantUML server for UML rendering |
| `EXPORT_URL` | URL of a draw.io export server (for server-side PDF/PNG) |
| `DRAWIO_CSP_URL` | Content Security Policy allowlist |

### Storage
- **None required.** draw.io is stateless. Diagrams live in the browser or in
  cloud storage. No Cloudron addons are used.

## Usage

1. Install the package on Cloudron.
2. In the Cloudron access control, grant the desired users/groups access.
3. Open the app location — you'll be prompted for Cloudron credentials.
4. Start drawing. Save diagrams to browser, export to file, or connect a cloud
   storage provider for persistence.

## Upstream

- **Repository**: https://github.com/jgraph/docker-drawio
- **Image**: `jgraph/drawio:24.7.17`
- **Website**: https://www.drawio.com
