For administrators
Code and repositories
How the platform reaches GitHub, and GitLab when a school uses it: to let a colleague pick their own repository, and to create one in the group you name.
What this is
Where the code of an app is kept and how cyantula reaches it. Here you set up GitHub (a GitHub App, or a personal access token) and GitLab, say where a brand-new app's repository is created, and choose the default provider for new repositories.
Both providers are optional and independent. Without either, colleagues can still publish a public repository, a zip or a single page. With them, colleagues connect their own account, pick their own repositories, and cyantula can create repositories and open changes as pull requests or merge requests.
Where to find it
- Open Admin, then the card Apps & integrations.
- Click Code and repositories.
What you see
When both providers are set up, the top of the page shows Default provider for new repositories with the choices GitHub and GitLab. It says where a new repository or an uploaded zip goes when a colleague does not choose. With only one provider set up, that one is used and the question is not shown.
A table with the columns Provider, Status and New repositories go to, and a Configure button per row:
- GitHub (GitHub App) and GitLab (OAuth + bot token).
- Status is Connected or Not set up. GitHub counts as set up with an App ID and private key, or with a personal access token. GitLab counts as set up once it has an address.
- New repositories go to shows the organisation or group, or Nowhere: existing repositories only.
Under it: Colleagues can connect each provider that is set up with their own account.
Configure, or a click on the row, opens a side panel with the tabs Connection, Destination and, for GitHub, Advanced. The panel has its own Save and Close. Saving there saves every change on the page.
GitHub, tab Connection
- A prompt with Copy prompt: paste it into an AI that can use the GitHub CLI and a browser. It creates this cyantula's GitHub App and hands back the values below.
- Test the GitHub App: asks GitHub whether the key, the App ID, the permissions and the installation fit together. It is disabled until you save (Save first: the test uses the saved values.).
- GitHub App ID: the App's numeric ID. The help under it gives the callback URL to register on the App.
- GitHub App private key (PEM): the whole
.pemfile the App generated, including the BEGIN and END lines. Choose the file, drop it on the box, or paste it. - GitHub App client ID and GitHub App client secret: from the App's page. They let each colleague connect and see only their own repositories.
- GitHub App slug: the App's URL name, so the portal can offer the link to install it on your organisation.
GitHub, tab Destination
- GitHub organisation for new repositories: the organisation login, for example
acme-apps. Empty means existing repositories can still be published, but none can be created.
GitHub, tab Advanced
- GitHub App private key (base64): the same key, base64-encoded. When set, it wins over the PEM.
- GitHub personal access token: used when there is no GitHub App, to create repositories, upload versions and clone. A fine-grained token needs Administration (write) to create, Contents (read and write) and Pull requests (read and write).
- Repository poll interval (seconds): how often a deployed branch is checked for new commits, for repositories where no webhook could be installed.
- Changes poll interval (seconds): how often GitHub is asked which pull requests are waiting for an owner. It repairs a webhook delivery that never arrived. 0 means webhooks only.
Both poll intervals are live after the next restart of the gateway, as the note under them says.
GitLab, tab Connection
- GitLab address: one GitLab for the installation, for example
https://gitlab.comor your school's own. Required before GitLab connect is offered. Empty keeps GitHub only. - GitLab OAuth client ID and GitLab OAuth client secret: from an application registered on that same GitLab. Each colleague connects their own account with it. The help gives the callback URL and the scopes to register:
read_user,read_api,read_repository,write_repository. - GitLab bot token: creates projects, adds the owner as a Developer, installs the push webhook, and pushes zip uploads and agent commits.
- GitLab CA certificate (PEM): optional, for a private certificate authority. Paste it with its BEGIN and END lines. There is no switch to skip certificate checks.
GitLab, tab Destination
- GitLab group: the id or the full path of the group where a brand-new project is created, for example
school/apps. Empty means existing projects can still be published, but none can be created. Subgroups are included when colleagues pick a project.
How to set up GitHub with a GitHub App
- Pick the GitHub organisation that will own the App and hold new repositories.
- Create the App there. The quickest way is the prompt on this page: click Configure on GitHub and then Copy prompt, and paste it into an AI that can use the GitHub CLI and a browser. It creates the App and hands back the values. By hand, use Developer settings, GitHub Apps, New GitHub App, with the callback URL shown under GitHub App ID, and generate a client secret and a private key.
- Install the App on the organisation, on all repositories or on the ones cyantula should manage.
- On Connection, fill in GitHub App ID, GitHub App private key (PEM), GitHub App client ID, GitHub App client secret and GitHub App slug.
- On Destination, fill in GitHub organisation for new repositories.
- Click Save. You see Saved.
- On Connection, click Test the GitHub App.
You know it worked when the test says The GitHub App works: cyantula can create repositories and act on them. and the status shows Connected. The test lists its steps, each ok, check, fails or not tested: the App ID, whether the private key can be read, the client ID and secret, GitHub accepts the key for this App ID, The App asks for the permissions cyantula needs, Installed on the organisation for new repositories and An installation token can be issued. A failing step explains itself, and offers Fix on GitHub where GitHub is the place to fix it.
How to set up GitHub with a token
Use this when you cannot create an App.
- On GitHub, create a fine-grained personal access token with the permissions listed under GitHub personal access token. It must be allowed to create repositories in your organisation.
- In the portal, click Configure on GitHub, tab Advanced.
- Paste the token into GitHub personal access token.
- On Destination, fill in GitHub organisation for new repositories.
- Click Save. The status shows Connected.
Actions on GitHub are then done as the token's owner.
How to set up GitLab
- On your GitLab, register an application for cyantula, with the callback URL and the scopes shown under GitLab OAuth client ID. Copy the application ID and the secret.
- Optional, but you want it: make a bot token. On GitLab Premium or Ultimate, make a group access token on the group, role Maintainer, scopes
apiandwrite_repository. On the Free tier group access tokens do not exist: use a personal access token of a dedicated GitLab user who is Owner or Maintainer of the group, with the same scopes. - In the portal, click Configure on GitLab. Fill in GitLab address, GitLab OAuth client ID, GitLab OAuth client secret and, if you made one, GitLab bot token.
- If your GitLab uses a private certificate authority, paste it into GitLab CA certificate (PEM).
- On Destination, fill in GitLab group.
- Click Save.
The status shows Connected. Colleagues can then connect their own GitLab account. Without the bot token and the group, they can publish projects that already exist, but cyantula cannot create new ones.
How to choose the default provider
- Set up both providers. The question only appears then.
- Under Default provider for new repositories, choose GitHub or GitLab.
- Click Save.
When something looks wrong
- Some values were refused — see the fields below. Each refused field says why. Fix it and save again.
- Save first: the test uses the saved values. Click Save, then run the test again.
- The GitHub App does not work yet. The first failing step below says why. Fix that step first. If GitHub refuses the signature, the key belongs to another App, the App ID is wrong, or the key was deleted: generate a new private key on the App's page and paste it. If the App is not installed on the organisation, an owner of the organisation installs it and grants all repositories.
- Status Not set up on GitLab: the GitLab address is empty.
- A colleague cannot create a new repository: check that GitHub organisation for new repositories or GitLab group is filled in. The table shows Nowhere: existing repositories only in that case.
Good to know
- Only admins can change these settings. A saved value is in force on the next request.
- Without the GitHub App, GitHub does not announce a push at once, so cyantula notices a new version a few minutes later.
- A secret field never shows its value. It shows stored. Leave it empty to keep it. Saving an emptied secret removes it.
- Apps whose code lives on this server, rather than on GitHub, are moved under Repositories.