Skip to content

GitHub and previews ​

Connecting GitHub ​

The first time you connect GitHub, Orbit asks GitHub to create an App for this server. When you install it, GitHub asks where (your account or one of your organizations), and the App can only read the repositories you choose there.

  • Why the App is public: GitHub only installs a private App on the account that created it. Public only means it can be installed elsewhere. Anyone can see its page, but its key stays on your server, and Orbit only uses the installation that the GitHub user connecting from your console confirms.
  • Owned by an organization: Orbit can create the App under an organization ("Have an organization own the App instead") if the organization wants it in its own settings.
  • Name and logo: the App is named "Orbit <server name>", which you can change before creating it; GitHub requires a name no other App uses. GitHub only accepts a logo through the App's settings page, so Settings → Integrations offers Orbit's logo and links to that page.
  • One installation at a time: to read another account's repositories, disconnect and connect again, choosing that account.
  • Addresses: GitHub sends you back to the address you used when you created the App, so create it from https://orbit.<server-ip-with-dashes>.sslip.io rather than through an SSH tunnel. If you later reach Orbit at another address, update the App's callback URL on GitHub to <new address>/github/callback.
  • Where its key lives: the App's private key and secrets are sealed in Orbit's secret store and travel with orbit backup. Disconnecting forgets the installation but keeps the App. Deleting the App on GitHub makes Orbit create a new one the next time you connect.

Deploying on push ​

  • The App sends every push to https://orbit.<server-ip-with-dashes>.sslip.io/github/webhook, signed with a secret only your server knows.
  • A push to an application's branch deploys that commit when Deploy automatically is on in the application's settings. The same delivery twice deploys once.
  • For Apps created by older versions, turn on their Push event on GitHub (Permissions & events → Subscribe to events); Settings → Integrations says so while it is off.

Pull request previews ​

Turn previews on in a project's Previews, next to its environments, and choose the long-lived environment they copy and how many can run at once (3 by default, at most 10).

Every pull request opened from a branch of a repository that environment builds gets a preview named after it (pr-12):

  • the services built from that repository, deployed from the pull request's branch, with the source's variables and secrets;
  • empty copies of the databases those services reference, without scheduled backups, unless an administrator enables the PostgreSQL data policy below;
  • its own namespace and generated address (<service>-pr-12-<project>.<server-ip-with-dashes>.sslip.io), or pr-12.<domain> once previews have a domain of yours in Cloudflare.

Pushes to the branch redeploy the preview. Closing or merging the pull request removes it with its data, and Remove does the same by hand.

  • Forks: pull requests from forks never get a preview, so code from outside the repository never runs on your servers.
  • The limit: past it, a pull request gets its preview on its next push once another one closes. Turning previews off keeps the open ones until their pull requests close.
  • Older Apps: previews need Pull requests: read and the Pull request event. Add both on GitHub (Permissions & events), then accept the new permission on the installation; the Previews page says so while the event is missing.

Verified data in previews ​

In Previews → Data for previews, a workspace administrator can opt individual PostgreSQL databases into data copies. It is off by default. Orbit selects the latest backup that passed a restore test, verifies its checksum and prepares it in a temporary PostgreSQL instance that cannot receive or make network connections. Production is never the restore target. Only the prepared dump is transferred to the preview database.

  • Column rules replace emails, names, phone numbers and text with fictional values, or set a column to NULL. Rules preserve existing NULLs. They are not automatic discovery: identify sensitive columns in related tables, audit logs and histories too. Foreign keys, uniqueness, types and length constraints can make a rule fail; the copy then stops without publishing data.
  • Empty tables removes every row from the selected tables. Select related tables together: there is no implicit cascade. Sessions, credentials, job queues and outbound notifications often need this treatment.
  • Preparation SQL runs in isolation before the standard rules, for relationships and application-specific cleanup. This is administrator-provided code. Without any column/table rule or SQL script, copying requires explicit confirmation of unmasked values.
  • Size defaults to 2048 MB, with a maximum of 10240 MB. Both dump bytes and the restored database are bounded. A missing verified backup or an oversized initial copy leaves an empty database and a notice. A manual refresh keeps the old data in those cases. Preparation failures stop the operation; they do not fall back to an unmasked copy.

Any preview created with a data policy requires a signed-in workspace member on every routed request, including static pages, assets and APIs. The console must have a public HTTPS address. The router checks the current Orbit session and membership; signing out, session expiry or member removal revokes access. The browser receives a cookie limited to this preview, never the console's session cookie. A preview keeps this protection even if its data copy is empty or its project later disables the policy. Existing public previews are not converted: close and recreate them to use seeded data. Webhooks and anonymous API clients cannot use a protected preview.

Refresh data uses the project's saved rules and the newest verified backup, replacing edits made in the preview. Masking finishes before replacement; schema removal and restore are one transaction, so a failed restore keeps the previous database. Multiple databases refresh individually, not as a distributed transaction. Successful restores record the source backup, time, operation and requesting actor in Activity. The preview's applications restart after a successful refresh.

The temporary Job expires after 30 minutes even if Orbit stops and is removed after completion. Preparation needs extra CPU, memory and temporary disk space; the size limit is not a capacity reservation. Review copied application secrets and outbound integrations separately: masking database columns does not rewrite environment variables or stop the preview application from sending email.

Orbit by Cortex Labs