{
  "version": 5,
  "script": {
    "version": "0.1.0",
    "changeLog": "Auto-generated draft from TrueNAS piwigo 1.4.11"
  },
  "installation_questions": [
    {
      "question": "Admin name",
      "type": "text",
      "key": "admin_name",
      "required": true
    },
    {
      "question": "Admin password",
      "type": "password",
      "key": "admin_password",
      "required": true
    },
    {
      "question": "Admin email",
      "type": "text",
      "key": "admin_email",
      "required": true
    }
  ],
  "requirements": {
    "locations": ["ApplicationsPerformance", "Media"],
    "specifications": ["2CORE"],
    "permissions": ["READ_WRITE_LOCATIONS"],
    "ports": [30066]
  },
  "ensure_directories_exists": [
    {"path": "$LOCATION(ApplicationsPerformance)"},
    {"path": "$LOCATION(ApplicationsPerformance)/piwigo"},
    {"path": "$LOCATION(Media)", "network_share": true},
    {
      "path": "$LOCATION(ApplicationsPerformance)/piwigo/config",
      "snapshot": {"id": "config"}
    },
    {
      "path": "$LOCATION(ApplicationsPerformance)/piwigo/gallery",
      "snapshot": {"id": "gallery"}
    },
    {
      "path": "$LOCATION(ApplicationsPerformance)/piwigo/mariadb_data",
      "owner": {"user": "netdata", "group": "docker"},
      "snapshot": {"id": "mariadb_data"}
    }
  ],
  "app_values": {
    "piwigo": {
      "db_password": "$RANDOM_STRING(16)",
      "db_root_password": "$RANDOM_STRING(16)",
      "admin_name": "$QUESTION(admin_name)",
      "admin_password": "$QUESTION(admin_password)",
      "admin_email": "$QUESTION(admin_email)"
    },
    "storage": {
      "config": "$HOST_PATH($LOCATION(ApplicationsPerformance)/piwigo/config)",
      "gallery": "$HOST_PATH($LOCATION(ApplicationsPerformance)/piwigo/gallery)",
      "mariadb_data": "$HOST_PATH($LOCATION(ApplicationsPerformance)/piwigo/mariadb_data)",
      "additional_storage": [
        "$MOUNTED_HOST_PATH($LOCATION(Media), /media)"
      ]
    },
    "network": {
      "web_port": {"bind_mode": "published", "port_number": 30066}
    },
    "resources": {"limits": {"cpus": 2, "memory": "$MEMORY(10%, 4096)"}}
  }
}
