]> source.dussan.org Git - gitblit.git/commitdiff
Change default access restriction to PUSH
authorJames Moger <james.moger@gitblit.com>
Fri, 27 Sep 2013 18:27:15 +0000 (14:27 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 28 Sep 2013 01:33:26 +0000 (21:33 -0400)
Change-Id: I74b3f9fedd77294c53648f8eaa730d4a84917555

releases.moxie
src/main/distrib/data/gitblit.properties
src/main/java/com/gitblit/GitBlit.java
src/main/java/com/gitblit/GitFilter.java
src/main/java/com/gitblit/client/GitblitClient.java
src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java

index 3418a051a9299713a73259867f2c751a11212723..8b8cfe8d97c4fc38f484551db50d2cc690a8697b 100644 (file)
@@ -5,7 +5,7 @@ r20: {
     title: ${project.name} ${project.version} released
     id: ${project.version}
     date: ${project.buildDate}
-    note: ~
+    note: "The default access restriction has been elevated from NONE to PUSH and anonymous push access has been disabled."
     html: ~
     text: ~
     security: ~
@@ -27,7 +27,8 @@ r20: {
     dependencyChanges: ~
     settings:
     - { 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.showBranchGraph', defaultValue: 'true' }
     contributors:
index 9a02e2313cea57bd46bd543a9f24480f4dc07a98..7c62c5ad9606e88bfa96888f39bb277709b1bcd1 100644 (file)
@@ -155,7 +155,7 @@ git.allowCreateOnPush = true
 # information.\r
 #\r
 # SINCE 1.4.0\r
-git.allowAnonymousPushes = true\r
+git.allowAnonymousPushes = false\r
 \r
 # The default access restriction for new repositories.\r
 # Valid values are NONE, PUSH, CLONE, VIEW\r
@@ -165,7 +165,7 @@ git.allowAnonymousPushes = true
 #  VIEW = authenticated view, clone, & push\r
 #\r
 # SINCE 1.0.0\r
-git.defaultAccessRestriction = NONE\r
+git.defaultAccessRestriction = PUSH\r
 \r
 # The default authorization control for new repositories.\r
 # Valid values are AUTHENTICATED and NAMED\r
index c31a0e97df2a8313bfb9246a2e4d768f31715683..c5304b4f29f2f77cbb4ebde9a2d3916273873e13 100644 (file)
@@ -2008,7 +2008,7 @@ public class GitBlit implements ServletContextListener {
                        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)));
+                                       "accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, "PUSH")));
                        model.authorizationControl = AuthorizationControl.fromName(getConfig(config,
                                        "authorizationControl", settings.getString(Keys.git.defaultAuthorizationControl, null)));
                        model.verifyCommitter = getConfig(config, "verifyCommitter", false);
index 8c6dd80d7d4709d6720e2daf1dc2471d8ede7d34..baa7ff0f4ae8781704ba1d8b953b8fe466d9dfaa 100644 (file)
@@ -224,7 +224,7 @@ public class GitFilter extends AccessRestrictionFilter {
                                } else {\r
                                        // common repository, user default server settings\r
                                        model.authorizationControl = AuthorizationControl.fromName(GitBlit.getString(Keys.git.defaultAuthorizationControl, ""));\r
-                                       model.accessRestriction = AccessRestrictionType.fromName(GitBlit.getString(Keys.git.defaultAccessRestriction, ""));\r
+                                       model.accessRestriction = AccessRestrictionType.fromName(GitBlit.getString(Keys.git.defaultAccessRestriction, "PUSH"));\r
                                }\r
 \r
                                // create the repository\r
index cc7d58a6720b1a6e0638f38e298fd5c9eebae472..427f45ba6e6aa5ed20854e5b211349f366a119b1 100644 (file)
@@ -193,7 +193,7 @@ public class GitblitClient implements Serializable {
        }\r
        \r
        public AccessRestrictionType getDefaultAccessRestriction() {\r
-               String restriction = null;\r
+               String restriction = "PUSH";\r
                if (settings.hasKey(Keys.git.defaultAccessRestriction)) {\r
                        restriction = settings.get(Keys.git.defaultAccessRestriction).currentValue;\r
                }\r
index feb33e92638b037ea1dd858be348c0aa505ab718..b2862f037e7d8d2a812cabb9c7a3ba962b6102f3 100644 (file)
@@ -81,7 +81,7 @@ public class GitblitReceivePackFactory<X> implements ReceivePackFactory<X> {
                        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)) {
                        // prohibit anonymous pushes
                        throw new ServiceNotEnabledException();
index 568c3123a41c96573d69379e879e12386e407452..f2c47f2e9c1e1c9c2a1321f91564d88d40bc9b18 100644 (file)
@@ -86,7 +86,7 @@ public class EditRepositoryPage extends RootSubPage {
                super();\r
                isCreate = true;\r
                RepositoryModel model = new RepositoryModel();\r
-               String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, null);\r
+               String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, "PUSH");\r
                model.accessRestriction = AccessRestrictionType.fromName(restriction);\r
                String authorization = GitBlit.getString(Keys.git.defaultAuthorizationControl, null);\r
                model.authorizationControl = AuthorizationControl.fromName(authorization);\r
@@ -418,7 +418,7 @@ public class EditRepositoryPage extends RootSubPage {
                form.add(ownersPalette);\r
                form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true)));\r
                DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction",\r
-                               AccessRestrictionType.choices(GitBlit.getBoolean(Keys.git.allowAnonymousPushes, true)), new AccessRestrictionRenderer());\r
+                               AccessRestrictionType.choices(GitBlit.getBoolean(Keys.git.allowAnonymousPushes, false)), new AccessRestrictionRenderer());\r
                form.add(accessRestriction);\r
                form.add(new CheckBox("isFrozen"));\r
                // TODO enable origin definition\r