diff --git a/invenio.cfg b/invenio.cfg index db5c9e4e..47994fe6 100644 --- a/invenio.cfg +++ b/invenio.cfg @@ -256,17 +256,35 @@ DATACITE_DATACENTER_SYMBOL = "" # =========== # Actual values set via env vars. + +GITHUB_APP_CREDENTIALS = { + "consumer_key": "CHANGEME", + "consumer_secret": "CHANGEME", +} + GITLAB_APP_CREDENTIALS = { "consumer_key": "CHANGEME", "consumer_secret": "CHANGEME", } +vcs_github = GitHubProviderFactory( + id="github", + name="GitHub", + base_url="https://github.com", + # These options can be customised with the `VCS_PROVIDER_CONFIG_DICT` option, e.g. by passing it + # as an env var on OpenShift. + webhook_receiver_url="https://CHANGEME.cern.ch/api/hooks/receivers/github/events/?access_token={token}", + config={"insecure_ssl": False, "shared_secret": "CHANGEME"}, +) + +vcs_github_oauth_remote_config = vcs_github.oauth_remote_config +# Allow connecting GitHub accounts but not logging in with them +vcs_github_oauth_remote_config["link_only"] = True + vcs_gitlab = GitLabProviderFactory( id="gitlab", name="GitLab", base_url="https://gitlab.cern.ch", - # These options can be customised with the `VCS_PROVIDER_CONFIG_DICT` option, e.g. by passing it - # as an env var on OpenShift. webhook_receiver_url="https://CHANGEME.cern.ch/api/hooks/receivers/gitlab/events/?access_token={token}", config={"shared_validation_token": "CHANGEME"}, ) @@ -282,9 +300,10 @@ vcs_gitlab_oauth_remote_config["signup_handler"]["info_serializer"] = ( # Allow connecting GitLab accounts but not logging in with them vcs_gitlab_oauth_remote_config["link_only"] = True -VCS_PROVIDERS = [vcs_gitlab] +VCS_PROVIDERS = [vcs_gitlab, vcs_github] VCS_PROVIDER_CONFIG_DICT = { vcs_gitlab.id: {}, + vcs_github.id: {}, } # Override the template so we can customise the explanatory test to be more CDS specific VCS_TEMPLATE_INDEX = "cds_rdm/vcs/index.html" @@ -298,10 +317,12 @@ OAUTHCLIENT_REMOTE_APPS = { cern_remote_app_name: cern_keycloak.remote_app, # The OAuth app must have the same ID as the VCS provider vcs_gitlab.id: vcs_gitlab_oauth_remote_config, + vcs_github.id: vcs_github_oauth_remote_config, } OAUTHCLIENT_REST_REMOTE_APPS = { vcs_gitlab.id: vcs_gitlab_oauth_remote_config, + vcs_github.id: vcs_github_oauth_remote_config, } # Invenio-Accounts @@ -752,4 +773,4 @@ APP_RDM_DETAIL_SIDE_BAR_TEMPLATES = [ AUDIT_LOGS_ENABLED = True RDM_ALLOW_OWNERS_REMOVE_COMMUNITY_FROM_RECORD = False -AUDIT_LOGS_PERMISSION_POLICY = CDSAuditLogPermissionPolicy \ No newline at end of file +AUDIT_LOGS_PERMISSION_POLICY = CDSAuditLogPermissionPolicy