{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lathe-live/json-schema/lathe-live-import-in-schema.json",
  "title": "ImportIn",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lathe-live-openapi.json#/components/schemas/ImportIn",
  "properties": {
    "repo": {
      "type": "string",
      "title": "Repo",
      "description": "owner/name, as GitHub spells it: a repository the Lathe app is installed on for this account (GET /github/repos lists them)."
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "The app's name on the box; the repository's name, made to fit, when empty.",
      "default": ""
    },
    "branch": {
      "type": "string",
      "title": "Branch",
      "description": "The branch whose builds deploy; the repository's default branch when empty.",
      "default": ""
    },
    "workflow": {
      "type": "string",
      "title": "Workflow",
      "description": "The workflow file that builds and pushes the image. Empty: the one the repository already has that does, or, if none does, the one Lathe adds by pull request.",
      "default": ""
    },
    "image": {
      "type": "string",
      "title": "Image",
      "description": "The reference that workflow pushes to. Empty: what the workflow file says, or ghcr.io/<owner>/<name>:<branch> for a workflow Lathe adds.",
      "default": ""
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Port",
      "description": "What the app listens on; the Dockerfile's EXPOSE, or the first free port, when empty."
    },
    "health_path": {
      "type": "string",
      "title": "Health Path",
      "description": "The path that answers 200 once ready; the Dockerfile's HEALTHCHECK path, or /, when empty.",
      "default": ""
    },
    "public": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Public",
      "description": "Served by the box's front door on a name of its own (the default) or loopback only."
    },
    "memory_mb": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Memory Mb",
      "description": "The app's share of the apps engine's budget; a modest one when empty."
    },
    "env": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Env",
      "description": "The app's environment, if any; saved before the first deploy."
    },
    "auto": {
      "type": "boolean",
      "title": "Auto",
      "description": "True: every green run of the workflow deploys the app. False: runs are tracked and shown; deploy by hand.",
      "default": true
    },
    "add_workflow": {
      "type": "boolean",
      "title": "Add Workflow",
      "description": "When no workflow in the repository builds an image: open a pull request adding one (and a Dockerfile, when the repository has none and its stack is recognised). False: the app waits and the answer carries the workflow text to add yourself. source=\"actions\" only.",
      "default": true
    },
    "source": {
      "type": "string",
      "title": "Source",
      "description": "Who builds it. \"lathe\": Lathe does, on a box of its own, from every push to the branch - from its Dockerfile, or from what its files say it is when there is none (Node, Python, Go, PHP, Ruby, Java, Rust, static sites); no workflow, no image, no registry token of yours, and the first build starts with the import. \"actions\": your own workflow builds and pushes the image. Empty: \"lathe\" wherever this deployment can build, else \"actions\".",
      "default": ""
    },
    "target": {
      "type": "string",
      "title": "Target",
      "description": "The Dockerfile stage a build of ours stops at, e.g. \"runtime\" for `FROM python:3.14-slim AS runtime`. Empty builds the last stage in the file, which is what a single-stage Dockerfile and the usual builder-then-runtime pair want; name one when the last stage is not the one that should run. source=\"lathe\" only.",
      "default": ""
    },
    "build_env": {
      "type": "boolean",
      "title": "Build Env",
      "description": "True: the app's own environment variables are given to the build as well as to the running container, which is what a front-end bundle and an install from a private package registry need. False: the build is given none of them, for an app whose variables are credentials a build has no use for - they would be written onto the build machine, and into the image config for any name the Dockerfile declares as an ARG. source=\"lathe\" only.",
      "default": true
    },
    "check_command": {
      "type": "string",
      "title": "Check Command",
      "description": "A command that must exit 0 inside the built image before it deploys - `npm test`, `pytest -q`, `tsc --noEmit`. Run in the image itself, with the app's variables, and with no access to the box it runs on. Empty: a green build deploys. A check that fails is a build that made an image and did not deploy; the build page has what it printed. source=\"lathe\" only.",
      "default": ""
    },
    "check_target": {
      "type": "string",
      "title": "Check Target",
      "description": "The Dockerfile stage the check runs in, when it is not the one that deploys: a `test` stage that adds the test tooling to the image that ships. Built with the same variables, never pushed. Empty: the check runs in the image that deploys. source=\"lathe\" only.",
      "default": ""
    },
    "check_env": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Check Env",
      "description": "Variables for the check and nothing else - not the build, not the running app: the URL of a database to run the tests against is what they are for. Names are letters, digits and underscores. source=\"lathe\" only."
    },
    "paths": {
      "type": "string",
      "title": "Paths",
      "description": "Space-separated globs a push must touch for this app to be built at all, e.g. \"apps/web/** packages/ui/**\". Empty builds every push. What a monorepo needs: a push to one app does not rebuild the other three, and a README does not redeploy anything. A commit whose files cannot be compared is built, never skipped. source=\"lathe\" only.",
      "default": ""
    },
    "untrusted": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Untrusted",
      "description": "For code its owner expects an attacker to control, such as a browser opening sites nobody vouches for: an isolated network reaching only egress (internet unless set, never an engine), no engine credentials in its environment, a /data that is emptied whenever the container is replaced, a read-only root, no capability but CAP_SYS_CHROOT (for a browser's own sandbox) and no link to sign-in. Restart the app to replace its container with a fresh one from the image. Omit for the default; the first deploy creates the app with it."
    },
    "network": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Network",
      "description": "host (the default): the app shares the box's network and reaches the box's engines and other apps. isolated: a network of its own that reaches only what egress names, and nothing of the box itself. Omit for the default; the first deploy creates the app with it."
    },
    "egress": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Egress",
      "description": "For an isolated app, everything it may open a connection to, and nothing else: internet (any public address), internet:443 (public addresses on one port), another isolated app by name or name:port (reached by that name), an engine by name (postgres, redis, couchdb, nats, seaweedfs), or a public address or range with an optional port (203.0.113.9:443, 198.51.100.0/24). Private, local and reserved ranges and the box itself are refused whatever this says. internet when the app becomes isolated; [] for nothing at all. Omit for the default; the first deploy creates the app with it."
    },
    "health": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Health",
      "description": "http (the default): the health path answers 200. tcp: the app accepts a connection on its port, for an app that speaks no HTTP, such as a proxy; such an app cannot be public. Omit for the default; the first deploy creates the app with it."
    },
    "public_allow": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Public Allow",
      "description": "For a public app, the only addresses or ranges its names answer, e.g. 203.0.113.9 or 198.51.100.0/24; a connection from anywhere else is closed before it reaches the app. A WebSocket connection is let in or refused by the same list. [] answers everyone. Omit for the default; the first deploy creates the app with it."
    },
    "max_lifetime": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Lifetime",
      "description": "Seconds after which the app's container is replaced by a fresh one from the image, 300 at least; 0 never. Omit for the default; the first deploy creates the app with it."
    },
    "runtime": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Runtime",
      "description": "sandboxed: the container runs on a kernel of its own in user space, one more wall between its code and the box. Slower to start and for some system calls. \"\" for the default. Omit for the default; the first deploy creates the app with it."
    }
  },
  "type": "object",
  "required": [
    "repo"
  ]
}