Chapter 3. Preparing your external services
Red Hat Developer Hub relies on external services. Prepare the following required external services:
- PostgreSQL database
- Developer Hub stores data in a PostgreSQL database. Use an external database for resiliency and include it in your disaster recovery plan.
- Redis cache
- For efficiency, Developer Hub caches plugin and Techdocs assets when your provide a Redis cache server.
- GitHub API access
- Provide credentials to a GitHub app to enable access to the GitHub API for repository discovery.
- Connection to your identity provider
- Provide credentials to your identity provider to enable user provisioning and authentication.
Procedure
Get your external PostgreSQL database connection strings and certificates.
- postgres-host
- Your PostgreSQL instance Domain Name System (DNS) or IP address.
- postgres-port
- Your PostgreSQL instance port number, such as 5432.
- postres-username
- The user name to connect to your PostgreSQL instance.
- postgres-password
- The password to connect to your PostgreSQL instance.
- postgres-ca.pem, postgres-key.key, postgres-crt.pem
For security, use TLS certificates to secure the connection to the database.
-
Get your Redis cache server connection string, such as
rediss://user:pass@cache.example.com:6379. For security, consider using aredisssecure server connection. Create a GitHub App to allow Developer Hub to access the GitHub API for repository. Opt for a GitHub App instead of an OAuth app to use fine-grained permissions, gain more control over which repositories the application can access, and use short-lived tokens.
Register a GitHub App with the following configuration:
- GitHub App name
-
Enter a unique name identifying your GitHub App, such as
integrating-with-rhdh-<GUID>. - Homepage URL
-
Enter your Developer Hub URL:
https://<my_developer_hub_domain>. - Authorization callback URL
-
Enter your Developer Hub authentication backend URL:
https://<my_developer_hub_domain>/api/auth/github/handler/frame. - Webhook
- Clear "Active", as this is not needed for authentication and catalog providers.
- App permissions
- Select permissions to define the level of access for the app. Adapt permissions to your needs:
-
Get your Redis cache server connection string, such as
- Reading software components
- Contents
-
Read-only - Commit statuses
-
Read-only
- Reading organization data
- Members
-
Read-only
- Publishing software templates
Set permissions if you intend to use the same GitHub App for software templates.
- Administration
-
Read & write(for creating repositories) - Contents
-
Read & write - Metadata
-
Read-only - Pull requests
-
Read & write - Issues
-
Read & write - Workflows
-
Read & write(if templates include GitHub workflows) - Variables
-
Read & write(if templates include GitHub Action Repository Variables) - Secrets
-
Read & write(if templates include GitHub Action Repository Secrets) - Environments
Read & write(if templates include GitHub Environments)- Organization permissions
- Members
Read-only- Where can this GitHub App be installed?
Select
Only on this account.-
In the General
Clients secrets section, click Generate a new client secret. -
In the General
Private keys section, click Generate a private key. - In the Install App tab, choose an account to install your GitHub App on.
- Save the following values for the next step:
-
In the General
- App ID
- Client ID
- Client secret
- Private key