{
  "version": 5,
  "script": {
    "version": "0.1.0",
    "changeLog": "Auto-generated draft from TrueNAS papra 1.1.19"
  },
  "requirements": {
    "locations": ["ApplicationsPerformance"],
    "specifications": ["2CORE"],
    "permissions": ["READ_WRITE_LOCATIONS"],
    "ports": [30312]
  },
  "ensure_directories_exists": [
    {"path": "$LOCATION(ApplicationsPerformance)"},
    {"path": "$LOCATION(ApplicationsPerformance)/papra"},
    {
      "path": "$LOCATION(ApplicationsPerformance)/papra/data",
      "owner": {"user": "apps"},
      "snapshot": {"id": "data"}
    },
    {
      "path": "$LOCATION(ApplicationsPerformance)/papra/ingestion",
      "owner": {"user": "apps"},
      "snapshot": {"id": "ingestion"}
    }
  ],
  "app_values": {
    "papra": {
      "base_url": "http://$SERVER_LAN_IP:30312",
      "auth_secret": "$RANDOM_STRING(32)"
    },
    "storage": {
      "data": "$HOST_PATH($LOCATION(ApplicationsPerformance)/papra/data)",
      "ingestion": "$HOST_PATH($LOCATION(ApplicationsPerformance)/papra/ingestion)"
    },
    "network": {
      "web_port": {"bind_mode": "published", "port_number": 30312}
    },
    "resources": {"limits": {"cpus": 2, "memory": "$MEMORY(10%, 4096)"}}
  }
}
