{
  "version": 5,
  "script": {
    "version": "0.1.0",
    "changeLog": "Auto-generated draft from TrueNAS adventurelog 1.3.30"
  },
  "installation_questions": [
    {
      "question": "Admin username",
      "type": "text",
      "key": "admin_username",
      "required": true
    },
    {
      "question": "Admin password",
      "type": "password",
      "key": "admin_password",
      "required": true
    },
    {
      "question": "Admin email",
      "type": "text",
      "key": "admin_email",
      "required": true
    },
    {
      "question": "Backend url",
      "type": "text",
      "key": "backend_url",
      "required": true
    }
  ],
  "requirements": {
    "locations": ["Media", "ApplicationsPerformance"],
    "specifications": ["2CORE"],
    "permissions": ["READ_WRITE_LOCATIONS"],
    "ports": [30250, 30251]
  },
  "ensure_directories_exists": [
    {"path": "$LOCATION(Media)", "network_share": true},
    {"path": "$LOCATION(ApplicationsPerformance)"},
    {"path": "$LOCATION(ApplicationsPerformance)/adventurelog"},
    {
      "path": "$LOCATION(ApplicationsPerformance)/adventurelog/postgres_data",
      "owner": {"user": "netdata", "group": "docker"},
      "snapshot": {"id": "postgres_data"}
    }
  ],
  "app_values": {
    "adventurelog": {
      "db_password": "$RANDOM_STRING(16)",
      "secret_key": "$RANDOM_STRING(32)",
      "admin_username": "$QUESTION(admin_username)",
      "admin_password": "$QUESTION(admin_password)",
      "admin_email": "$QUESTION(admin_email)",
      "frontend_url": "http://$SERVER_LAN_IP:30250",
      "backend_url": "$QUESTION(backend_url)"
    },
    "storage": {
      "media": "$HOST_PATH($LOCATION(Media))",
      "postgres_data": "$HOST_PATH($LOCATION(ApplicationsPerformance)/adventurelog/postgres_data)"
    },
    "network": {
      "backend_port": {"bind_mode": "published", "port_number": 30250},
      "frontend_port": {"bind_mode": "published", "port_number": 30251}
    },
    "resources": {"limits": {"cpus": 2, "memory": "$MEMORY(10%, 4096)"}}
  }
}
