# SINCE 0.8.0\r
web.allowFlashCopyToClipboard = true\r
\r
+# Default maximum number of commits that a repository may contribute to the\r
+# activity page, regardless of the selected duration. This setting may be valuable\r
+# for an extremely busy server. This value may also be configed per-repository\r
+# in Edit Repository. 0 disables this throttle.\r
+#\r
+# SINCE 1.2.0\r
+web.maxActivityCommits = 0\r
+\r
# Default number of entries to include in RSS Syndication links\r
#\r
# SINCE 0.5.0\r
\r
#### changes\r
\r
+- Added optional global and per-repository activity page commit contribution throttle to help tame *really* active repositories (issue 173)\r
- Added support for symlinks in tree page and commit page (issue 171)\r
- All access restricted servlets (e.g. DownloadZip, RSS, etc) will try to authenticate using X509 certificates, container principals, cookies, and BASIC headers, in that order.\r
- Added *groovy* and *scala* to *web.prettyPrintExtensions*\r
} catch (Exception e) {\r
model.lastGC = new Date(0);\r
}\r
+ model.maxActivityCommits = getConfig(config, "maxActivityCommits", settings.getInteger(Keys.web.maxActivityCommits, 0));\r
model.origin = config.getString("remote", "origin", "url");\r
if (model.origin != null) {\r
model.origin = model.origin.replace('\\', '/');\r
repository.federationStrategy.name());\r
config.setBoolean(Constants.CONFIG_GITBLIT, null, "isFederated", repository.isFederated);\r
config.setString(Constants.CONFIG_GITBLIT, null, "gcThreshold", repository.gcThreshold);\r
- config.setInt(Constants.CONFIG_GITBLIT, null, "gcPeriod", repository.gcPeriod);\r
+ if (repository.gcPeriod == settings.getInteger(Keys.git.defaultGarbageCollectionPeriod, 7)) {\r
+ // use default from config\r
+ config.unset(Constants.CONFIG_GITBLIT, null, "gcPeriod");\r
+ } else {\r
+ config.setInt(Constants.CONFIG_GITBLIT, null, "gcPeriod", repository.gcPeriod);\r
+ }\r
if (repository.lastGC != null) {\r
config.setString(Constants.CONFIG_GITBLIT, null, "lastGC", new SimpleDateFormat(Constants.ISO8601).format(repository.lastGC));\r
}\r
+ if (repository.maxActivityCommits == settings.getInteger(Keys.web.maxActivityCommits, 0)) {\r
+ // use default from config\r
+ config.unset(Constants.CONFIG_GITBLIT, null, "maxActivityCommits");\r
+ } else {\r
+ config.setInt(Constants.CONFIG_GITBLIT, null, "maxActivityCommits", repository.maxActivityCommits);\r
+ }\r
\r
updateList(config, "federationSets", repository.federationSets);\r
updateList(config, "preReceiveScript", repository.preReceiveScripts);\r
private JComboBox gcPeriod;\r
\r
private JTextField gcThreshold;\r
+ \r
+ private JComboBox maxActivityCommits;\r
\r
private RegistrantPermissionsPanel usersPalette;\r
\r
isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"),\r
anRepository.isFrozen);\r
\r
+ maxActivityCommits = new JComboBox(new Integer [] { 0, 25, 50, 75, 100, 150, 250, 500 });\r
+ maxActivityCommits.setSelectedItem(anRepository.maxActivityCommits);\r
+\r
+\r
mailingListsField = new JTextField(\r
ArrayUtils.isEmpty(anRepository.mailingLists) ? ""\r
: StringUtils.flattenStrings(anRepository.mailingLists,\r
skipSizeCalculation));\r
fieldsPanel.add(newFieldPanel(Translation.get("gb.skipSummaryMetrics"),\r
skipSummaryMetrics));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.maxActivityCommits"),\r
+ maxActivityCommits));\r
fieldsPanel.add(newFieldPanel(Translation.get("gb.mailingLists"),\r
mailingListsField));\r
\r
repository.showReadme = showReadme.isSelected();\r
repository.skipSizeCalculation = skipSizeCalculation.isSelected();\r
repository.skipSummaryMetrics = skipSummaryMetrics.isSelected();\r
+ repository.maxActivityCommits = (Integer) maxActivityCommits.getSelectedItem();\r
\r
repository.isFrozen = isFrozen.isSelected();\r
repository.allowForks = allowForks.isSelected();\r
public boolean verifyCommitter;\r
public String gcThreshold;\r
public int gcPeriod;\r
+ public int maxActivityCommits;\r
\r
public transient boolean isCollectingGarbage;\r
public Date lastGC;\r
}\r
List<RevCommit> commits = JGitUtils.getRevLog(repository,\r
branch, thresholdDate);\r
- for (RevCommit commit : commits) {\r
+ if (model.maxActivityCommits > 0 && commits.size() > model.maxActivityCommits) {\r
+ // trim commits to maximum count\r
+ commits = commits.subList(0, model.maxActivityCommits);\r
+ }\r
+ for (RevCommit commit : commits) { \r
Date date = JGitUtils.getCommitDate(commit);\r
String dateStr = df.format(date);\r
if (!activity.containsKey(dateStr)) {\r
gb.clientCertificateBundleSent = Client certificate bundle for {0} sent\r
gb.enterKeystorePassword = Please enter the Gitblit keystore password\r
gb.warning = warning\r
-gb.jceWarning = Your Java Runtime Environment does not have the \"JCE Unlimited Strength Jurisdiction Policy\" files.\nThis will limit the length of passwords you may use to encrypt your keystores to 7 characters.\nThese policy files are an optional download from Oracle.\n\nWould you like to continue and generate the certificate infrastructure anyway?\n\nAnswering No will direct your browser to Oracle's download page so that you may download the policy files.
\ No newline at end of file
+gb.jceWarning = Your Java Runtime Environment does not have the \"JCE Unlimited Strength Jurisdiction Policy\" files.\nThis will limit the length of passwords you may use to encrypt your keystores to 7 characters.\nThese policy files are an optional download from Oracle.\n\nWould you like to continue and generate the certificate infrastructure anyway?\n\nAnswering No will direct your browser to Oracle's download page so that you may download the policy files.\r
+gb.maxActivityCommits = max activity commits\r
+gb.maxActivityCommitsDescription = maximum number of commits to contribute to the Activity page\r
+gb.noMaximum = no maximum
\ No newline at end of file
<tr><th><wicket:message key="gb.showReadme"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="showReadme" tabindex="10" /> <span class="help-inline"><wicket:message key="gb.showReadmeDescription"></wicket:message></span></label></td></tr>\r
<tr><th><wicket:message key="gb.skipSizeCalculation"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="skipSizeCalculation" tabindex="11" /> <span class="help-inline"><wicket:message key="gb.skipSizeCalculationDescription"></wicket:message></span></label></td></tr>\r
<tr><th><wicket:message key="gb.skipSummaryMetrics"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="skipSummaryMetrics" tabindex="12" /> <span class="help-inline"><wicket:message key="gb.skipSummaryMetricsDescription"></wicket:message></span></label></td></tr>\r
+ <tr><th><wicket:message key="gb.maxActivityCommits"></wicket:message></th><td class="edit"><select class="span2" wicket:id="maxActivityCommits" tabindex="13" /> <span class="help-inline"><wicket:message key="gb.maxActivityCommitsDescription"></wicket:message></span></td></tr>\r
<tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.mailingLists"></wicket:message></th><td class="edit"><input class="span8" type="text" wicket:id="mailingLists" size="40" tabindex="13" /></td></tr>\r
+ <tr><th><wicket:message key="gb.mailingLists"></wicket:message></th><td class="edit"><input class="span8" type="text" wicket:id="mailingLists" size="40" tabindex="14" /></td></tr>\r
</tbody>\r
</table>\r
</div>\r
<div class="tab-pane" id="permissions">\r
<table class="plain">\r
<tbody class="settings">\r
- <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select class="span2" wicket:id="owner" tabindex="14" /> <span class="help-inline"><wicket:message key="gb.ownerDescription"></wicket:message></span></td></tr>\r
+ <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select class="span2" wicket:id="owner" tabindex="15" /> <span class="help-inline"><wicket:message key="gb.ownerDescription"></wicket:message></span></td></tr>\r
<tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span4" wicket:id="accessRestriction" tabindex="15" /></td></tr>\r
+ <tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span4" wicket:id="accessRestriction" tabindex="16" /></td></tr>\r
<tr><th colspan="2"><hr/></th></tr>\r
<tr><th><wicket:message key="gb.authorizationControl"></wicket:message></th><td style="padding:2px;"><span class="authorizationControl" wicket:id="authorizationControl"></span></td></tr>\r
<tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="isFrozen" tabindex="18" /> <span class="help-inline"><wicket:message key="gb.isFrozenDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.allowForks"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="allowForks" tabindex="19" /> <span class="help-inline"><wicket:message key="gb.allowForksDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.verifyCommitter"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="verifyCommitter" tabindex="20" /> <span class="help-inline"><wicket:message key="gb.verifyCommitterDescription"></wicket:message></span><br/><span class="help-inline" style="padding-left:10px;"><wicket:message key="gb.verifyCommitterNote"></wicket:message></span></label></td></tr>\r
+ <tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="isFrozen" tabindex="17" /> <span class="help-inline"><wicket:message key="gb.isFrozenDescription"></wicket:message></span></label></td></tr>\r
+ <tr><th><wicket:message key="gb.allowForks"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="allowForks" tabindex="18" /> <span class="help-inline"><wicket:message key="gb.allowForksDescription"></wicket:message></span></label></td></tr>\r
+ <tr><th><wicket:message key="gb.verifyCommitter"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="verifyCommitter" tabindex="19" /> <span class="help-inline"><wicket:message key="gb.verifyCommitterDescription"></wicket:message></span><br/><span class="help-inline" style="padding-left:10px;"><wicket:message key="gb.verifyCommitterNote"></wicket:message></span></label></td></tr>\r
<tr><th colspan="2"><hr/></th></tr>\r
<tr><th><wicket:message key="gb.userPermissions"></wicket:message></th><td style="padding:2px;"><span wicket:id="users"></span></td></tr>\r
<tr><th colspan="2"><hr/></th></tr>\r
<div class="tab-pane" id="federation">\r
<table class="plain">\r
<tbody class="settings">\r
- <tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span4" wicket:id="federationStrategy" tabindex="21" /></td></tr>\r
+ <tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span4" wicket:id="federationStrategy" tabindex="20" /></td></tr>\r
<tr><th><wicket:message key="gb.federationSets"></wicket:message></th><td style="padding:2px;"><span wicket:id="federationSets"></span></td></tr>\r
</tbody>\r
</table>\r
form.add(new CheckBox("showReadme"));\r
form.add(new CheckBox("skipSizeCalculation"));\r
form.add(new CheckBox("skipSummaryMetrics"));\r
+ List<Integer> maxActivityCommits = Arrays.asList(0, 25, 50, 75, 100, 150, 200, 250, 500 );\r
+ form.add(new DropDownChoice<Integer>("maxActivityCommits", maxActivityCommits, new MaxActivityCommitsRenderer()));\r
+\r
mailingLists = new Model<String>(ArrayUtils.isEmpty(repositoryModel.mailingLists) ? ""\r
: StringUtils.flattenStrings(repositoryModel.mailingLists, " "));\r
form.add(new TextField<String>("mailingLists", mailingLists));\r
}\r
}\r
\r
+ private class MaxActivityCommitsRenderer implements IChoiceRenderer<Integer> {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ public MaxActivityCommitsRenderer() {\r
+ }\r
+\r
+ @Override\r
+ public String getDisplayValue(Integer value) {\r
+ if (value == 0) {\r
+ return getString("gb.noMaximum");\r
+ } else {\r
+ return value + " " + getString("gb.commits");\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public String getIdValue(Integer value, int index) {\r
+ return Integer.toString(index);\r
+ }\r
+ }\r
+ \r
}\r