Package sonia.scm.config
Class ScmConfiguration
java.lang.Object
sonia.scm.config.ScmConfiguration
- All Implemented Interfaces:
com.github.sdorra.ssp.PermissionObject,Configuration
The main configuration object for SCM-Manager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSCM Manager alerts url.static final StringDefault JavaScript date formatstatic final StringDefault url for login information (plugin and feature tips on the login page).static final StringDefault e-mail domain name that will be used whenever we have to generate an e-mail address for a user that has no mail address configured.static final Stringstatic final Stringstatic final StringDefault plugin url from version 1.0static final StringPath to the configuration filestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns the url of the alerts api.Returns the currently enabled type of anonymous mode.Returns the complete base url of the scm-manager including the context path.Returns the date format for the user interface.getId()intReturns Jwt expiration inn.intlongReturns the timeout in seconds for users which are temporary disabled, because of too many failed login attempts.Returns the mail domain, that will be used to create e-mail addresses for users without one whenever one is required.Returns the url of the plugin repository.Returns a set of glob patterns for urls which should excluded from proxy settings.intReturns the servername or ip of the proxyserver.Returns the url of the rss release feed.Returns the context path from the base url (seegetBaseUrl()) without starting or ending slashes.booleanDeprecated.booleanbooleanReturnstrueif the api keys are enabled.booleanReturnstrueif the repository file search is enabled.booleanReturnstrueif the user converter is enabled.booleanReturnstrueif the cookie xsrf protection is enabled.booleanbooleanbooleanReturnstrueif the cookie xsrf protection is enabled.booleanbooleanReturns true if failed authenticators are skipped.voidload(ScmConfiguration other) Load all properties from anotherScmConfigurationobject.voidsetAlertsUrl(String alertsUrl) Set the url for the alerts api.voidsetAnonymousAccessEnabled(boolean anonymousAccessEnabled) Deprecated.since 2.4.0 usesetAnonymousMode(AnonymousMode)insteadvoidConfigures the anonymous mode.voidsetBaseUrl(String baseUrl) voidsetDateFormat(String dateFormat) voidsetDisableGroupingGrid(boolean disableGroupingGrid) voidsetEmergencyContacts(Set<String> emergencyContacts) voidsetEnabledApiKeys(boolean enabledApiKeys) Settrueto enable api keys.voidsetEnabledFileSearch(boolean enabledFileSearch) Settrueto enable file search for repositories.voidsetEnabledJwtExpiration(boolean enabledJwtEndless) Settrueto enable endless jwt.voidsetEnabledUserConverter(boolean enabledUserConverter) Settrueto enable user converter.voidsetEnabledXsrfProtection(boolean enabledXsrfProtection) Settrueto enable xsrf cookie protection.voidsetEnableProxy(boolean enableProxy) voidsetForceBaseUrl(boolean forceBaseUrl) voidsetJwtExpirationInH(int jwtExpirationInH) Setnto configure jwt expiration time in hoursvoidsetLoginAttemptLimit(int loginAttemptLimit) Set maximum allowed login attempts.voidsetLoginAttemptLimitTimeout(long loginAttemptLimitTimeout) Sets the timeout in seconds for users which are temporary disabled, because of too many failed login attempts.voidsetLoginInfoUrl(String loginInfoUrl) voidsetMailDomainName(String mailDomainName) Sets the mail host, that will be used to create e-mail addresses for users without one whenever one is required.voidsetNamespaceStrategy(String namespaceStrategy) voidsetPluginUrl(String pluginUrl) voidsetProxyExcludes(Set<String> proxyExcludes) Set glob patterns for urls which are should be excluded from proxy settings.voidsetProxyPassword(String proxyPassword) voidsetProxyPort(int proxyPort) voidsetProxyServer(String proxyServer) voidsetProxyUser(String proxyUser) voidsetRealmDescription(String realmDescription) voidsetReleaseFeedUrl(String releaseFeedUrl) voidsetSkipFailedAuthenticators(boolean skipFailedAuthenticators) If set to true the authentication chain is not stopped, if an authenticator finds the user but fails to authenticate the user.
-
Field Details
-
DEFAULT_DATEFORMAT
Default JavaScript date format- See Also:
-
DEFAULT_PLUGIN_URL
- See Also:
-
DEFAULT_ALERTS_URL
SCM Manager alerts url.- Since:
- 2.30.0
- See Also:
-
DEFAULT_RELEASE_FEED_URL
- See Also:
-
DEFAULT_LOGIN_INFO_URL
Default url for login information (plugin and feature tips on the login page).- See Also:
-
DEFAULT_MAIL_DOMAIN_NAME
Default e-mail domain name that will be used whenever we have to generate an e-mail address for a user that has no mail address configured.- Since:
- 2.8.0
- See Also:
-
OLD_PLUGINURL
Default plugin url from version 1.0- See Also:
-
PATH
Path to the configuration file -
PERMISSION
- See Also:
-
-
Constructor Details
-
ScmConfiguration
public ScmConfiguration()
-
-
Method Details
-
fireChangeEvent
public void fireChangeEvent() -
load
Load all properties from anotherScmConfigurationobject.- Parameters:
other-ScmConfigurationto load from
-
getBaseUrl
Returns the complete base url of the scm-manager including the context path. For example http://localhost:8080/scm- Returns:
- complete base url of the scm-manager
- Since:
- 1.5
-
getServerContextPath
Returns the context path from the base url (seegetBaseUrl()) without starting or ending slashes.- Since:
- 2.42.0
-
getDateFormat
Returns the date format for the user interface. This format is a JavaScript date format, from the library moment.js.- Returns:
- moment.js date format
- See Also:
-
getLoginAttemptLimit
public int getLoginAttemptLimit() -
getLoginAttemptLimitTimeout
public long getLoginAttemptLimitTimeout()Returns the timeout in seconds for users which are temporary disabled, because of too many failed login attempts.- Returns:
- login attempt timeout in seconds
- Since:
- 1.34
-
getPluginUrl
Returns the url of the plugin repository. This url can contain placeholders. Explanation of the {placeholders}:- version = SCM-Manager Version
- os = Operation System
- arch = Architecture
- Returns:
- the complete plugin url.
-
getAlertsUrl
Returns the url of the alerts api.- Returns:
- the alerts url.
- Since:
- 2.30.0
-
getReleaseFeedUrl
Returns the url of the rss release feed.- Returns:
- the rss release feed url.
-
getMailDomainName
Returns the mail domain, that will be used to create e-mail addresses for users without one whenever one is required.- Returns:
- default mail domain
- Since:
- 2.8.0
-
getProxyExcludes
Returns a set of glob patterns for urls which should excluded from proxy settings.- Returns:
- set of glob patterns
- Since:
- 1.23
-
getProxyPassword
-
getProxyPort
public int getProxyPort() -
getProxyServer
Returns the servername or ip of the proxyserver.- Returns:
- servername or ip of the proxyserver
-
getProxyUser
-
getRealmDescription
-
getAnonymousMode
Returns the currently enabled type of anonymous mode.- Returns:
- anonymous mode
- Since:
- 2.4.0
-
getJwtExpirationInH
public int getJwtExpirationInH()Returns Jwt expiration inn.- Returns:
- Jwt expiration in
number - Since:
- 3.8.0
-
isJwtEndless
public boolean isJwtEndless()Returnstrueif the cookie xsrf protection is enabled.- Returns:
trueif the cookie xsrf protection is enabled- Since:
- 3.8.0
-
isAnonymousAccessEnabled
Deprecated.since 2.4.0 usegetAnonymousMode()insteadReturnstrueif anonymous mode is enabled.- Returns:
trueif anonymous mode is enabled
-
isDisableGroupingGrid
public boolean isDisableGroupingGrid() -
isEnabledXsrfProtection
public boolean isEnabledXsrfProtection()Returnstrueif the cookie xsrf protection is enabled.- Returns:
trueif the cookie xsrf protection is enabled- Since:
- 1.47
- See Also:
-
isEnabledUserConverter
public boolean isEnabledUserConverter()Returnstrueif the user converter is enabled.- Returns:
trueif the user converter is enabled The user converter automatically converts an internal user to external on their first login using an external system like ldap- Since:
- 2.9.0
-
isEnabledApiKeys
public boolean isEnabledApiKeys()Returnstrueif the api keys are enabled.- Returns:
trueif the api keys is enabled- Since:
- 2.16.0
-
isEnableProxy
public boolean isEnableProxy() -
isEnabledFileSearch
public boolean isEnabledFileSearch()Returnstrueif the repository file search is enabled.- Returns:
trueif the api keys is enabled- Since:
- 2.45.0
-
isForceBaseUrl
public boolean isForceBaseUrl() -
isLoginAttemptLimitEnabled
public boolean isLoginAttemptLimitEnabled() -
getNamespaceStrategy
-
getLoginInfoUrl
-
isSkipFailedAuthenticators
public boolean isSkipFailedAuthenticators()Returns true if failed authenticators are skipped.- Returns:
- true if failed authenticators are skipped
- Since:
- 1.36
-
getEmergencyContacts
-
setAnonymousAccessEnabled
Deprecated.since 2.4.0 usesetAnonymousMode(AnonymousMode)insteadEnables the anonymous access at protocol level.- Parameters:
anonymousAccessEnabled- enable or disables the anonymous access
-
setAnonymousMode
Configures the anonymous mode.- Parameters:
mode- type of anonymous mode- Since:
- 2.4.0
-
setBaseUrl
-
setDateFormat
-
setDisableGroupingGrid
public void setDisableGroupingGrid(boolean disableGroupingGrid) -
setEnableProxy
public void setEnableProxy(boolean enableProxy) -
setForceBaseUrl
public void setForceBaseUrl(boolean forceBaseUrl) -
setLoginAttemptLimit
public void setLoginAttemptLimit(int loginAttemptLimit) Set maximum allowed login attempts.- Parameters:
loginAttemptLimit- login attempt limit- Since:
- 1.34
-
setLoginAttemptLimitTimeout
public void setLoginAttemptLimitTimeout(long loginAttemptLimitTimeout) Sets the timeout in seconds for users which are temporary disabled, because of too many failed login attempts.- Parameters:
loginAttemptLimitTimeout- login attempt timeout in seconds- Since:
- 1.34
-
setPluginUrl
-
setAlertsUrl
Set the url for the alerts api.- Parameters:
alertsUrl- alerts url- Since:
- 2.30.0
-
setReleaseFeedUrl
-
setMailDomainName
Sets the mail host, that will be used to create e-mail addresses for users without one whenever one is required.- Parameters:
mailDomainName- The default mail domain to use- Since:
- 2.8.0
-
setProxyExcludes
Set glob patterns for urls which are should be excluded from proxy settings.- Parameters:
proxyExcludes- glob patterns- Since:
- 1.23
-
setProxyPassword
-
setProxyPort
public void setProxyPort(int proxyPort) -
setProxyServer
-
setProxyUser
-
setRealmDescription
-
setSkipFailedAuthenticators
public void setSkipFailedAuthenticators(boolean skipFailedAuthenticators) If set to true the authentication chain is not stopped, if an authenticator finds the user but fails to authenticate the user.- Parameters:
skipFailedAuthenticators- true to skip failed authenticators- Since:
- 1.36
-
setEnabledXsrfProtection
public void setEnabledXsrfProtection(boolean enabledXsrfProtection) Settrueto enable xsrf cookie protection.- Parameters:
enabledXsrfProtection-trueto enable xsrf protection- Since:
- 1.47
- See Also:
-
setEnabledUserConverter
public void setEnabledUserConverter(boolean enabledUserConverter) Settrueto enable user converter.- Parameters:
enabledUserConverter-trueto enable user converter- Since:
- 2.9.0
-
setEnabledApiKeys
public void setEnabledApiKeys(boolean enabledApiKeys) Settrueto enable api keys.- Parameters:
enabledApiKeys-trueto enable api keys- Since:
- 2.16.0
-
setEnabledFileSearch
public void setEnabledFileSearch(boolean enabledFileSearch) Settrueto enable file search for repositories.- Parameters:
enabledFileSearch-trueto enable file search for repositories- Since:
- 2.45.0
-
setJwtExpirationInH
public void setJwtExpirationInH(int jwtExpirationInH) Setnto configure jwt expiration time in hours- Parameters:
jwtExpirationInH-nto configure jwt expiration time in hours- Since:
- 3.8.0
-
setEnabledJwtExpiration
public void setEnabledJwtExpiration(boolean enabledJwtEndless) Settrueto enable endless jwt.- Parameters:
enabledJwtEndless-trueto enable endless jwt.- Since:
- 2.45.0
-
setNamespaceStrategy
-
setLoginInfoUrl
-
setEmergencyContacts
-
getId
- Specified by:
getIdin interfacecom.github.sdorra.ssp.PermissionObject
-
getAnonymousMode()instead