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 String
SCM Manager alerts url.static final String
Default JavaScript date formatstatic final String
Default url for login information (plugin and feature tips on the login page).static final String
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.static final String
Default url for plugin center authentication.static final String
static final String
static final String
Default plugin url from version 1.0static final String
Path to the configuration filestatic final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns 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()
int
long
Returns 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 which is used for plugin center authentication.Returns the url of the plugin repository.Returns a set of glob patterns for urls which should excluded from proxy settings.int
Returns 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.boolean
Deprecated.boolean
Returnstrue
if the default plugin auth url is used.boolean
boolean
Returnstrue
if the api keys are enabled.boolean
Returnstrue
if the repository file search is enabled.boolean
Returnstrue
if the user converter is enabled.boolean
Returnstrue
if the cookie xsrf protection is enabled.boolean
boolean
boolean
boolean
Returns true if failed authenticators are skipped.void
load
(ScmConfiguration other) Load all properties from anotherScmConfiguration
object.void
setAlertsUrl
(String alertsUrl) Set the url for the alerts api.void
setAnonymousAccessEnabled
(boolean anonymousAccessEnabled) Deprecated.since 2.4.0 usesetAnonymousMode(AnonymousMode)
insteadvoid
Configures the anonymous mode.void
setBaseUrl
(String baseUrl) void
setDateFormat
(String dateFormat) void
setDisableGroupingGrid
(boolean disableGroupingGrid) void
setEmergencyContacts
(Set<String> emergencyContacts) void
setEnabledApiKeys
(boolean enabledApiKeys) Settrue
to enable api keys.void
setEnabledFileSearch
(boolean enabledFileSearch) Settrue
to enable file search for repositories.void
setEnabledUserConverter
(boolean enabledUserConverter) Settrue
to enable user converter.void
setEnabledXsrfProtection
(boolean enabledXsrfProtection) Settrue
to enable xsrf cookie protection.void
setEnableProxy
(boolean enableProxy) void
setForceBaseUrl
(boolean forceBaseUrl) void
setLoginAttemptLimit
(int loginAttemptLimit) Set maximum allowed login attempts.void
setLoginAttemptLimitTimeout
(long loginAttemptLimitTimeout) Sets the timeout in seconds for users which are temporary disabled, because of too many failed login attempts.void
setLoginInfoUrl
(String loginInfoUrl) void
setMailDomainName
(String mailDomainName) Sets the mail host, that will be used to create e-mail addresses for users without one whenever one is required.void
setNamespaceStrategy
(String namespaceStrategy) void
setPluginAuthUrl
(String pluginAuthUrl) Set the url for plugin center authentication.void
setPluginUrl
(String pluginUrl) void
setProxyExcludes
(Set<String> proxyExcludes) Set glob patterns for urls which are should be excluded from proxy settings.void
setProxyPassword
(String proxyPassword) void
setProxyPort
(int proxyPort) void
setProxyServer
(String proxyServer) void
setProxyUser
(String proxyUser) void
setRealmDescription
(String realmDescription) void
setReleaseFeedUrl
(String releaseFeedUrl) 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.
-
Field Details
-
DEFAULT_DATEFORMAT
Default JavaScript date format- See Also:
-
DEFAULT_PLUGIN_URL
- See Also:
-
DEFAULT_PLUGIN_AUTH_URL
Default url for plugin center authentication.- Since:
- 2.28.0
- 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 anotherScmConfiguration
object.- Parameters:
other
-ScmConfiguration
to 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.
-
getPluginAuthUrl
Returns the url which is used for plugin center authentication.- Returns:
- authentication url
- Since:
- 2.28.0
-
isDefaultPluginAuthUrl
public boolean isDefaultPluginAuthUrl()Returnstrue
if the default plugin auth url is used.- Returns:
true
if the default plugin auth url is used- Since:
- 2.28.0
-
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
-
isAnonymousAccessEnabled
Deprecated.since 2.4.0 usegetAnonymousMode()
insteadReturnstrue
if anonymous mode is enabled.- Returns:
true
if anonymous mode is enabled
-
isDisableGroupingGrid
public boolean isDisableGroupingGrid() -
isEnabledXsrfProtection
public boolean isEnabledXsrfProtection()Returnstrue
if the cookie xsrf protection is enabled.- Returns:
true
if the cookie xsrf protection is enabled- Since:
- 1.47
- See Also:
-
isEnabledUserConverter
public boolean isEnabledUserConverter()Returnstrue
if the user converter is enabled.- Returns:
true
if 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()Returnstrue
if the api keys are enabled.- Returns:
true
if the api keys is enabled- Since:
- 2.16.0
-
isEnableProxy
public boolean isEnableProxy() -
isEnabledFileSearch
public boolean isEnabledFileSearch()Returnstrue
if the repository file search is enabled.- Returns:
true
if 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
-
setPluginAuthUrl
Set the url for plugin center authentication.- Parameters:
pluginAuthUrl
- authentication url- Since:
- 2.28.0
-
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) Settrue
to enable xsrf cookie protection.- Parameters:
enabledXsrfProtection
-true
to enable xsrf protection- Since:
- 1.47
- See Also:
-
setEnabledUserConverter
public void setEnabledUserConverter(boolean enabledUserConverter) Settrue
to enable user converter.- Parameters:
enabledUserConverter
-true
to enable user converter- Since:
- 2.9.0
-
setEnabledApiKeys
public void setEnabledApiKeys(boolean enabledApiKeys) Settrue
to enable api keys.- Parameters:
enabledApiKeys
-true
to enable api keys- Since:
- 2.16.0
-
setEnabledFileSearch
public void setEnabledFileSearch(boolean enabledFileSearch) Settrue
to enable file search for repositories.- Parameters:
enabledFileSearch
-true
to enable file search for repositories- Since:
- 2.45.0
-
setNamespaceStrategy
-
setLoginInfoUrl
-
setEmergencyContacts
-
getId
- Specified by:
getId
in interfacecom.github.sdorra.ssp.PermissionObject
-
getAnonymousMode()
instead