diff options
author | Cédric Couralet | 2018-07-30 13:47:09 +0000 |
---|---|---|
committer | Cédric Couralet | 2018-07-31 08:36:56 +0000 |
commit | 66d374b1289e6dd33008dc931e9fb642051724d0 (patch) | |
tree | 4801a08657d2a0fd04c03a3ed46440e221f0ae23 /lib/config | |
parent | 93a3ce1164f69af24381c94b941048580891e1b8 (diff) |
Add possibility to choose between version v3 or v4 for the gitlab api.
Apart from the uri versioning, one big change is the snippet visibility post data (visibility_level -> visibility)
Default gitlab api version to v4
Signed-off-by: Cédric Couralet <cedric.couralet@gmail.com>
Diffstat (limited to 'lib/config')
-rw-r--r-- | lib/config/index.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/config/index.js b/lib/config/index.js index ac03fcd4..e66c513d 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -103,6 +103,12 @@ config.isSAMLEnable = config.saml.idpSsoUrl config.isOAuth2Enable = config.oauth2.clientID && config.oauth2.clientSecret config.isPDFExportEnable = config.allowPDFExport +// Check gitlab api version +if (config.gitlab.version !== 'v4' || config.gitlab.version !== 'v3') { + logger.warn('config.js contains wrong version (' + config.gitlab.version + ') for gitlab api; it should be \'v3\' or \'v4\'. Defaulting to v3') + config.gitlab.version = 'v4' +} + // Only update i18n files in development setups config.updateI18nFiles = (env === Environment.development) |