Change-Id: I74b3f9fedd77294c53648f8eaa730d4a84917555tags/v1.4.0
title: ${project.name} ${project.version} released | title: ${project.name} ${project.version} released | ||||
id: ${project.version} | id: ${project.version} | ||||
date: ${project.buildDate} | date: ${project.buildDate} | ||||
note: ~ | |||||
note: "The default access restriction has been elevated from NONE to PUSH and anonymous push access has been disabled." | |||||
html: ~ | html: ~ | ||||
text: ~ | text: ~ | ||||
security: ~ | security: ~ | ||||
dependencyChanges: ~ | dependencyChanges: ~ | ||||
settings: | settings: | ||||
- { name: 'git.createRepositoriesShared', defaultValue: 'false' } | - { name: 'git.createRepositoriesShared', defaultValue: 'false' } | ||||
- { name: 'git.allowAnonymousPushes', defaultValue: 'true' } | |||||
- { name: 'git.allowAnonymousPushes', defaultValue: 'false' } | |||||
- { name: 'git.defaultAccessRestriction', defaultValue: 'PUSH' } | |||||
- { name: 'web.commitMessageRenderer', defaultValue: 'plain' } | - { name: 'web.commitMessageRenderer', defaultValue: 'plain' } | ||||
- { name: 'web.showBranchGraph', defaultValue: 'true' } | - { name: 'web.showBranchGraph', defaultValue: 'true' } | ||||
contributors: | contributors: |
# information. | # information. | ||||
# | # | ||||
# SINCE 1.4.0 | # SINCE 1.4.0 | ||||
git.allowAnonymousPushes = true | |||||
git.allowAnonymousPushes = false | |||||
# The default access restriction for new repositories. | # The default access restriction for new repositories. | ||||
# Valid values are NONE, PUSH, CLONE, VIEW | # Valid values are NONE, PUSH, CLONE, VIEW | ||||
# VIEW = authenticated view, clone, & push | # VIEW = authenticated view, clone, & push | ||||
# | # | ||||
# SINCE 1.0.0 | # SINCE 1.0.0 | ||||
git.defaultAccessRestriction = NONE | |||||
git.defaultAccessRestriction = PUSH | |||||
# The default authorization control for new repositories. | # The default authorization control for new repositories. | ||||
# Valid values are AUTHENTICATED and NAMED | # Valid values are AUTHENTICATED and NAMED |
model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null); | model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null); | ||||
model.allowForks = getConfig(config, "allowForks", true); | model.allowForks = getConfig(config, "allowForks", true); | ||||
model.accessRestriction = AccessRestrictionType.fromName(getConfig(config, | model.accessRestriction = AccessRestrictionType.fromName(getConfig(config, | ||||
"accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, null))); | |||||
"accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, "PUSH"))); | |||||
model.authorizationControl = AuthorizationControl.fromName(getConfig(config, | model.authorizationControl = AuthorizationControl.fromName(getConfig(config, | ||||
"authorizationControl", settings.getString(Keys.git.defaultAuthorizationControl, null))); | "authorizationControl", settings.getString(Keys.git.defaultAuthorizationControl, null))); | ||||
model.verifyCommitter = getConfig(config, "verifyCommitter", false); | model.verifyCommitter = getConfig(config, "verifyCommitter", false); |
} else { | } else { | ||||
// common repository, user default server settings | // common repository, user default server settings | ||||
model.authorizationControl = AuthorizationControl.fromName(GitBlit.getString(Keys.git.defaultAuthorizationControl, "")); | model.authorizationControl = AuthorizationControl.fromName(GitBlit.getString(Keys.git.defaultAuthorizationControl, "")); | ||||
model.accessRestriction = AccessRestrictionType.fromName(GitBlit.getString(Keys.git.defaultAccessRestriction, "")); | |||||
model.accessRestriction = AccessRestrictionType.fromName(GitBlit.getString(Keys.git.defaultAccessRestriction, "PUSH")); | |||||
} | } | ||||
// create the repository | // create the repository |
} | } | ||||
public AccessRestrictionType getDefaultAccessRestriction() { | public AccessRestrictionType getDefaultAccessRestriction() { | ||||
String restriction = null; | |||||
String restriction = "PUSH"; | |||||
if (settings.hasKey(Keys.git.defaultAccessRestriction)) { | if (settings.hasKey(Keys.git.defaultAccessRestriction)) { | ||||
restriction = settings.get(Keys.git.defaultAccessRestriction).currentValue; | restriction = settings.get(Keys.git.defaultAccessRestriction).currentValue; | ||||
} | } |
timeout = client.getDaemon().getTimeout(); | timeout = client.getDaemon().getTimeout(); | ||||
} | } | ||||
boolean allowAnonymousPushes = GitBlit.getBoolean(Keys.git.allowAnonymousPushes, true); | |||||
boolean allowAnonymousPushes = GitBlit.getBoolean(Keys.git.allowAnonymousPushes, false); | |||||
if (!allowAnonymousPushes && UserModel.ANONYMOUS.equals(user)) { | if (!allowAnonymousPushes && UserModel.ANONYMOUS.equals(user)) { | ||||
// prohibit anonymous pushes | // prohibit anonymous pushes | ||||
throw new ServiceNotEnabledException(); | throw new ServiceNotEnabledException(); |
super(); | super(); | ||||
isCreate = true; | isCreate = true; | ||||
RepositoryModel model = new RepositoryModel(); | RepositoryModel model = new RepositoryModel(); | ||||
String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, null); | |||||
String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, "PUSH"); | |||||
model.accessRestriction = AccessRestrictionType.fromName(restriction); | model.accessRestriction = AccessRestrictionType.fromName(restriction); | ||||
String authorization = GitBlit.getString(Keys.git.defaultAuthorizationControl, null); | String authorization = GitBlit.getString(Keys.git.defaultAuthorizationControl, null); | ||||
model.authorizationControl = AuthorizationControl.fromName(authorization); | model.authorizationControl = AuthorizationControl.fromName(authorization); | ||||
form.add(ownersPalette); | form.add(ownersPalette); | ||||
form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true))); | form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true))); | ||||
DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction", | DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction", | ||||
AccessRestrictionType.choices(GitBlit.getBoolean(Keys.git.allowAnonymousPushes, true)), new AccessRestrictionRenderer()); | |||||
AccessRestrictionType.choices(GitBlit.getBoolean(Keys.git.allowAnonymousPushes, false)), new AccessRestrictionRenderer()); | |||||
form.add(accessRestriction); | form.add(accessRestriction); | ||||
form.add(new CheckBox("isFrozen")); | form.add(new CheckBox("isFrozen")); | ||||
// TODO enable origin definition | // TODO enable origin definition |