Documentation menu

Documentation › Run Galley

Settings, secrets and the Galley home

What Galley keeps in its home folder, how API keys are stored and which one wins, and where the environment variables are listed.

This page is for developers and operators. Galley keeps no database. Per-computer state lives in one folder, the Galley home; per-site configuration lives in the site, in galley.config.json.

Link to this section: The Galley home

GALLEY_HOME, default ~/.galley. The CLI, the desktop app and a hosted server all use it the same way, so they see the same sites and settings when they share a home.

PathWhatWritten
settings.jsonmodel, effort, image and video choices, your name and email for publishes, theme, preview limitsfrom App settings
secrets.jsonshared keys saved from App settings — readable by you only (0600)from App settings
usage.jsonlone line per assistant or image request: model, token counts, estimated costafter each request
sites.jsonthe sites list: id, name, folder, group, pin, note, last openedwhen a site is added, filed or opened
state/<site id>/per site: assistant conversations (threads/), form submissions (submissions/), deployments, the redirects record, large brand material (brand/), the last import, and the site's own keys and author (secrets.json, 0600)as you work
sites/<repository name>/sites cloned or created here, unless GALLEY_SITES_DIR points elsewhereclone, create
plugins/plugins added with galley plugin addgalley plugin
tmp/candidates/generated images not saved to a site yetimage generation
session.keythe key session cookies are signed with — 0600first start

Removing a site from the list (DELETE /api/sites/<id>) forgets its entry, its own keys and author; its folder stays on disk.

Link to this section: Secrets

The keys Galley uses: Anthropic for the assistant; OpenAI or Google for images; Cloudflare or Vercel for putting sites online; OpenRouter (through its plugin) for images and videos. For every key the order is:

  1. the site's own key (Site settings › Connections), so a client's site bills the client;
  2. the environment the app was started from;
  3. the shared key saved in App settings.
SecretEnvironmentShape checked when saved
AssistantANTHROPIC_API_KEYstarts with sk-ant-
OpenAI imagesOPENAI_API_KEYstarts with sk- (and isn't an Anthropic key)
Google imagesGEMINI_API_KEY, then GOOGLE_API_KEYone word, 20 characters or more
CloudflareCLOUDFLARE_API_TOKENchecked with Cloudflare before it is saved
VercelVERCEL_TOKENchecked with Vercel before it is saved

Secrets never cross the HTTP boundary: Settings receives whether each key is configured, where it came from, and its last four characters. Every value the process has handled is scrubbed from error messages and logs, along with anything shaped like a key. Keys are kept in owner-only files, not yet in the operating system's keychain — the desktop app included (Desktop app).

Link to this section: Environment variables

Every variable the server, the engine, the CLI, the plugins and the site kit read is in Environment variables, checked against the source on every build of this site. Command-line options beat variables; variables beat defaults.

For development inside the repository, pnpm dev runs the server from source and opens the site in GALLEY_SITE (or the current folder), with state in ./.galley-home unless GALLEY_HOME is set.

Link to this section: Next