# CasaOS App Icon — Base64 Data-URL Pattern

## Problem

When `x-casaos.icon` points to a URL on the container itself (e.g. `http://172.29.0.1:8099/icon.png`), CasaOS may classify the app as "Legacy" — even when deployed via compose with a valid `x-casaos` block. The icon also disappears when the container is down.

## Solution

Embed the icon directly as a base64 data-URL in the compose file. This makes the icon self-contained and always available to the dashboard.

## How to convert

```bash
# For SVG (preferred — small, scalable):
cat /path/to/icon.svg | base64 -w0

# For PNG (larger but works):
base64 -w0 /path/to/icon.png
```

Then set in compose:
```yaml
x-casaos:
  icon: data:image/svg+xml;base64,<base64-string>
```

## Example (MuslimOS → EhliSünnet)

Original (broken — Legacy App):
```yaml
x-casaos:
  hostname: 172.29.0.1
  icon: http://172.29.0.1:8099/icon.png
```

Fixed (normal v2app):
```yaml
x-casaos:
  hostname: ""
  icon: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiI+CiAgPGRlZnM+CiAgICA8bWFzayBpZD0ibW9vbiI+CiAgICAgIDxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJibGFjayIvPgogICAgICA8Y2lyY2xlIGN4PSIyNDgiIGN5PSIyNTYiIHI9IjIwMiIgZmlsbD0id2hpdGUiLz4KICAgICAgPGNpcmNsZSBjeD0iMzM2IiBjeT0iMTk4IiByPSIxNzgiIGZpbGw9ImJsYWNrIi8+CiAgICA8L21hc2s+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSIjOUI0Rjk2IiBtYXNrPSJ1cmwoI21vb24pIi8+Cjwvc3ZnPgo=
```

## Pitfalls

- The base64 string can be very long for PNGs — prefer SVG
- Must include the full MIME type prefix: `data:image/svg+xml;base64,` or `data:image/png;base64,`
- After changing the compose file, restart `zimaos-app-management` and hard-refresh the dashboard
