Bỏ qua, tới nội dung
Dymini Panel
v0.16.0-main.8d0b6a9
Mục lục
Đây là tài liệu của bản thử nghiệm (v0.16.0-main.8d0b6a9).Xem bản mới nhất
Trang này chưa được dịch sang Tiếng Việt. Bạn đang xem bản gốc.

GitHub App

Trong trang này

A GitHub App lets Dymini Panel clone private repositories with short-lived tokens and receive push events, without a personal access token. Dymini Panel creates the app for you.

Connect GitHub

Git providers → Connect with GitHub.

  1. Dymini Panel sends you to GitHub with the app already described. Confirm the name and press Create GitHub App.
  2. GitHub asks which repositories the app may read. Choose them and press Install.
  3. You come back to Dymini Panel. The provider is listed as Ready with the GitHub account that installed it.

To create the app under an organization, open Create it under an organization and enter its login first. An organization that requires approval shows Waiting for approval until an owner approves; then open Manage repositories on the provider to finish.

Only admins can connect GitHub. The app is private to its owner and asks for read access to repository contents and metadata, plus the push and pull_request events. An app created before pull request previews existed does not receive pull request events until you open it on GitHub (Settings → Developer settings → GitHub Apps → the app → Permissions & events) and subscribe to Pull request.

Public address

GitHub sends you back to, and delivers push events to, the address you used to open the panel, or DYMINI_PANEL_PUBLIC_URL when it is set. Set it when the panel is behind a proxy so the address is the public one. If the address is private (localhost, a private IP, .local), GitHub cannot reach it: Dymini Panel warns you before going to GitHub and creates the app without a webhook. Builds then start by hand ("Build now") or through a per-service webhook.

Use it

Open an application → Source, choose the GitHub App provider, then pick the repository and branch from the lists (or choose Another repository… and type https://github.com/owner/name.git). A provider that is not installed yet is greyed out as needs install.

Both lists come from the installation: repositories are the ones you granted the app (private ones are marked), the branch list starts with the repository's default branch, and for a compose stack the Compose file path list shows the compose files found on the branch (compose.yaml, docker-compose.prod.yml, …). Picking a repository fills in its default branch. When the source is saved the panel asks GitHub whether the app can read the repository and the branch, so a typo or a repository outside the installation is refused with a clear message (repo_not_accessible, branch_not_found) instead of failing at the first deploy. If GitHub cannot be reached when saving, the source is saved anyway and the first build reports the problem; sources with another kind of provider are not checked.

A push to a branch starts a build of every application whose source uses this provider, the same repository (owner/name, case-insensitive, HTTPS or SSH URL), and that branch. The Git source card still shows a per-service webhook secret; it is not needed for apps. A compose stack with the same provider, repository and branch is deployed too, but only when Deploy when I push to the branch is on in its source settings (see stacks).

Pull request previews

On an application's Git source, or a Git stack's source settings, turn on Preview pull requests. When a pull request is opened, updated, or reopened against that branch in the same repository, Dymini Panel creates a copy of the service, builds the pull request's branch, and gives it a preview address. Closing the pull request removes the copy. Pull requests from a fork are ignored. The copy uses the same environment variables as the service it came from.

Manage

  • Manage repositories opens GitHub's installation page to add or remove repositories.
  • Finish installing appears on an app that was created but not installed, for example if you closed the tab on GitHub.
  • Deleting the provider removes it from Dymini Panel only. Delete the app on GitHub too (Settings → Developer settings → GitHub Apps).

Settings

Variable Default Meaning
DYMINI_PANEL_PUBLIC_URL none Public address of the panel, used for GitHub's redirects and webhook
DYMINI_PANEL_GITHUB_API_URL https://api.github.com GitHub API base, for app creation, installation checks, and installation tokens

GitHub Enterprise Server is not supported.

API

Method and path Notes
POST /api/v1/github-app/manifest Admin, write. {"organization"?, "name"?} → {action_url, manifest, webhook}; POST manifest as a form field to action_url
POST /api/v1/github-app/complete Admin, write. {code, state} from GitHub's redirect → {provider, install_url}
POST /api/v1/github-app/installed Admin, write. {installation_id, state?} from GitHub's redirect → provider. Without state the pending app that GitHub confirms owns the installation is used
POST /api/v1/git-providers/{id}/install-link Admin, write. A fresh install_url for an existing app
GET /api/v1/git-providers/{id}/repositories Repositories the installation can read (up to 500): [{full_name, url, private, default_branch}]
GET /api/v1/git-providers/{id}/branches?repo= {default_branch, branches}, default first; repo is a URL or owner/name
GET /api/v1/git-providers/{id}/compose-files?repo=&branch= {files}: compose files in the branch, shallowest first
POST /api/v1/git-providers/{id}/webhook GitHub only. Verified with the app's webhook secret; starts matching builds

GET /api/v1/git-providers reports status (ready or pending_install), app_slug, and account, never secrets. The design is in decision 0019.

Sửa trang này trên GitHub