Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
)
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
AUDIT_LOGS_PERMISSION_POLICY = CDSAuditLogPermissionPolicy
Loading