patlas/ docs

GitHub storage and commit signing

Atlas stores a project as files under .project/. A project owner can connect
that folder to a GitHub repository. Members then edit in Atlas while the server
commits and pushes on their behalf.

Git identity and GPG keys are personal settings. They apply to every project and
live in patlas.db on the Atlas server, not in .project/ and not in Git history
as a settings file.

Owner setup

Only the project owner can configure storage.

  1. Create a fine-grained GitHub PAT for the repository.
  2. Grant Contents: read and write.
  3. Open project Settings, Repository.
  4. Enter owner/repo, an optional branch, and the PAT.
  5. Save.

Adding a repository is a non-destructive remote setup. Atlas validates access,
stores the repository and PAT, and points origin at the repository. It does not
check out another branch, pull or push.

Use Pull to fast-forward from the remote. Use Push to send queued local
commits. The 60 second timer also pushes when commits are queued. A new branch is
created on the remote by the first push.

Disconnect removes origin and the stored remote settings. The local clone,
.project files, branches and Git history stay on the server. The GitHub
repository is not changed.

No GitHub App, OAuth callback, deploy key or webhook is required. Members do not
need access to the repository.

The PAT is stored only in patlas.db. It is never returned by the API and never
written to .git/config.

Member setup

Every member configures their own Git identity and signing key.

1. Set a commit email

Open My settings from the project topbar, or go to /settings. Set the commit
name and email under My git config.

The email must be verified on the member's GitHub account. GitHub compares the
commit's committer email with the GPG key identities and the account's verified
emails.

2. Generate a dedicated GPG key

gpg --quick-generate-key "Your Name <you@users.noreply.github.com>" ed25519 sign 0

Use a dedicated key for Atlas. Export the private key:

gpg --armor --export-secret-keys <fingerprint>

Paste the armored private key into My settings, My git config. Add the passphrase
if the key has one. The server keeps the key and passphrase in patlas.db so it
can sign while the member is offline.

3. Add the public key to GitHub

After saving, Atlas shows the public key and fingerprint. Copy the public key and
add it to GitHub:

  1. GitHub, Settings, SSH and GPG keys.
  2. New GPG key.
  3. Paste the public key.

Future commits by that member show Verified when the key is valid and the
commit email matches the key and the GitHub account.

How attribution works

Git stores two identities on every commit:

Atlas sets both to the editing member and signs with that member's key. The
project PAT pushes the commit, but the pusher is not part of the commit.

GitHub checks the committer email against the GPG key and the member's verified
GitHub email. The author can differ, but Atlas keeps both the same so a commit is
not marked Partially verified.

flowchart LR
  Member[Member edits in Atlas] --> Commit[Commit: author and committer = member]
  Key[Member GPG key] --> Sign[Sign commit]
  Commit --> Sign
  Sign --> Push[Server pushes with project PAT]
  Push --> GitHub[GitHub verifies committer email and key]

Trust model

The member gives the server a private signing key. The server can sign any commit
as that member. This is the same authority the member has locally.

Use a dedicated key. Revoke it on GitHub and remove it in Atlas if the member
stops trusting the server or leaves the project.

The key and passphrase are stored in patlas.db. The database is 0600 and the
data directory is 0711. The directory allows traversal but not listing, so
nginx can read project artifacts as www-data while every file keeps its own
mode. Database backups contain the key, so protect backups the same way, keep
them 0600 inside that directory.

The server imports each key once into an isolated keyring and reuses it for later
commits. The keyring lives in memory-backed storage when available. patlas.db
remains the source of truth.

Signed commits on the server

For each commit the server:

  1. Creates a temporary GPG home outside the repository.
  2. Imports the member's private key.
  3. Signs the commit with that key.
  4. Kills the temporary gpg-agent.
  5. Removes the temporary directory.

The key never enters .project/ or the clone directory.

Initialization and migration commits use a service identity and are not signed.
They are system actions, not member edits.

Sync behavior

Atlas never rebases signed commits. Rebasing would rewrite commits, change the
committer and drop signatures.

The timer stops when the project runtime is evicted after 30 minutes idle.

Require signed commits

A project owner can enable Require signed commits in Repository settings.

When enabled:

The setting is off by default. Initialization and migrations are still allowed.

Identity fallback

The database stores overrides. Empty values inherit:

SettingOverrideFallback
Commit nameuser_git_config.commit_nameproject member display name, then nickname
Commit emailuser_git_config.commit_emaillegacy person email, then <name>@patlas.local
Signing keyuser_git_configno signature

A member without a GPG key can still commit. The commit is unsigned and uses the
project member name. It will not show as Verified on GitHub.

Test pipeline

Copy .env.test.example to .env.test and fill in the test repository and PAT.
The file is ignored by Git.

bun run test:e2e:github

The script:

Use unique branches. Do not point the pipeline at a production repository.

The GitHub Actions workflow in .github/workflows/github-e2e.yml runs the same
script on demand and on a weekly schedule. It needs these repository settings:

NameKindValue
PATLAS_TEST_REPOvariableowner/repo
PATLAS_TEST_TOKENsecretPAT with Contents read and write
PATLAS_TEST_COMMIT_EMAILvariableverified email for Alice
PATLAS_TEST_GPG_PRIVATE_KEYsecretoptional pre-registered key
PATLAS_TEST_GPG_PASSPHRASEsecretoptional key passphrase
PATLAS_TEST_EXPECT_VERIFIEDvariable1 to assert GitHub Verified

Without a pre-registered key the pipeline still verifies signatures locally with
git verify-commit. The GitHub Verified assertion needs the public key on the
test GitHub account.

Troubleshooting

GitHub does not show Verified

Check the commit email, the key UID and the GitHub account. All three must match:

git log -1 --format='%an <%ae> | %cn <%ce>'
gpg --list-keys <fingerprint>

The email must be in the key UID and verified on GitHub. The public key must be
added as a signing key.

The key cannot sign

The passphrase may be wrong. The key may be expired or revoked. Atlas rejects
expired and revoked keys when they are saved.

gpg is missing

Atlas needs GnuPG installed on the server. The test pipeline also needs gpg,
git and Bun.

The PAT stops working

Rotate it in project Settings, Repository. Leave the token field blank to keep
the current token. A new token replaces it.