| | |
| | | model.addOwners(ArrayUtils.fromString(getConfig(config, "owner", "")));
|
| | | model.useTickets = getConfig(config, "useTickets", false);
|
| | | model.useDocs = getConfig(config, "useDocs", false);
|
| | | model.useIncrementalPushTags = getConfig(config, "useIncrementalPushTags", false);
|
| | | model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null);
|
| | | model.allowForks = getConfig(config, "allowForks", true);
|
| | | model.accessRestriction = AccessRestrictionType.fromName(getConfig(config,
|
| | | "accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, null)));
|
| | |
| | | config.setString(Constants.CONFIG_GITBLIT, null, "owner", ArrayUtils.toString(repository.owners));
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "useTickets", repository.useTickets);
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "useDocs", repository.useDocs);
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "useIncrementalPushTags", repository.useIncrementalPushTags);
|
| | | if (StringUtils.isEmpty(repository.incrementalPushTagPrefix) ||
|
| | | repository.incrementalPushTagPrefix.equals(settings.getString(Keys.git.defaultIncrementalPushTagPrefix, "r"))) {
|
| | | config.unset(Constants.CONFIG_GITBLIT, null, "incrementalPushTagPrefix");
|
| | | } else {
|
| | | config.setString(Constants.CONFIG_GITBLIT, null, "incrementalPushTagPrefix", repository.incrementalPushTagPrefix);
|
| | | }
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "allowForks", repository.allowForks);
|
| | | config.setString(Constants.CONFIG_GITBLIT, null, "accessRestriction", repository.accessRestriction.name());
|
| | | config.setString(Constants.CONFIG_GITBLIT, null, "authorizationControl", repository.authorizationControl.name());
|
| | |
| | | * Parse the properties file and aggregate all the comments by the setting
|
| | | * key. A setting model tracks the current value, the default value, the
|
| | | * description of the setting and and directives about the setting.
|
| | | * @param referencePropertiesInputStream
|
| | | *
|
| | | * @return Map<String, SettingModel>
|
| | | */
|
| | | private ServerSettings loadSettingModels(InputStream referencePropertiesInputStream) {
|
| | | private ServerSettings loadSettingModels() {
|
| | | ServerSettings settingsModel = new ServerSettings();
|
| | | settingsModel.supportsCredentialChanges = userService.supportsCredentialChanges();
|
| | | settingsModel.supportsDisplayNameChanges = userService.supportsDisplayNameChanges();
|
| | |
| | | // Read bundled Gitblit properties to extract setting descriptions.
|
| | | // This copy is pristine and only used for populating the setting
|
| | | // models map.
|
| | | InputStream is = referencePropertiesInputStream;
|
| | | InputStream is = getClass().getResourceAsStream("/reference.properties");
|
| | | BufferedReader propertiesReader = new BufferedReader(new InputStreamReader(is));
|
| | | StringBuilder description = new StringBuilder();
|
| | | SettingModel setting = new SettingModel();
|
| | |
| | | */
|
| | | @Override
|
| | | public void contextInitialized(ServletContextEvent contextEvent) {
|
| | | contextInitialized(contextEvent, contextEvent.getServletContext().getResourceAsStream("/WEB-INF/reference.properties"));
|
| | | }
|
| | |
|
| | | public void contextInitialized(ServletContextEvent contextEvent, InputStream referencePropertiesInputStream) {
|
| | | servletContext = contextEvent.getServletContext();
|
| | | if (settings == null) {
|
| | | // Gitblit is running in a servlet container
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | settingsModel = loadSettingModels(referencePropertiesInputStream);
|
| | | settingsModel = loadSettingModels();
|
| | | serverStatus.servletContainer = servletContext.getServerInfo();
|
| | | }
|
| | |
|