The primary use case for the keymap editor supports an integration with GitHub to fetch, modify, and commit keymaps to any enabled repositories.
All configuration is provided to the app via environment variables. (See The Twelve-Factor App)
If you wish to create a local dev environment or your own hosted instance of the
editor, create a GitHub app, copy .env.template
to .env
, and fill in the
following config values:
GITHUB_APP_ID
: the app id generated by GitHubGITHUB_APP_NAME
: the name you chose for the appGITHUB_CLIENT_ID
: client id generated by GitHubGITHUB_CLIENT_SECRET
: client secret generated by GitHubGITHUB_OAUTH_CALLBACK_URL
: the public URL that GitHub will use to complete
the OAuth flow. This will be somthing like
https://<api public url>/github/authorize>
GITHUB_APP_PRIVATE_KEY
: (optional) this is the RSA private key associated
with your GitHub app. You may either pass this in as an environment variable
or store it in private-key.pem
in this repository’s root.APP_BASE_URL
: this is the public hosted URL for the keymap editor static
application (e.g. https://<username>.github.io/keymap-editor
if using
GitHub pages). Note that this app should have been built with
ENABLE_GITHUB=true
.Warning committing any of these values to a git repository is strongly
discouraged. For local development you may create .env
and private-key.pem
and these files will be ignored by default. When deploying the application your
cloud provider (e.g. Heroku) should provide a way to securely define the needed
environment variables.
When first authenticating a user to GitHub the following browser flows occur:
https://$api/github/authorize
https://$api/github/authorize
with an
authentication token.null
if the GitHub App is not installed.